summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbapt <bapt@FreeBSD.org>2015-12-09 21:38:26 +0000
committerbapt <bapt@FreeBSD.org>2015-12-09 21:38:26 +0000
commitcebf0995415f15b7fa2f1428a76d033fd1d4be83 (patch)
treef83d6c58d41660bc158e51ac9dd5500ad0b72554
parent79deb7823d916cc1f7e3fbf543067d7cca00974a (diff)
downloadFreeBSD-src-cebf0995415f15b7fa2f1428a76d033fd1d4be83.zip
FreeBSD-src-cebf0995415f15b7fa2f1428a76d033fd1d4be83.tar.gz
MFC: r291658
pw_checkname since the beginning is too strict on GECOS field, relax it a bit so gecos can be used to store multibytes data. This was unseen before FreeBSD 10.2 as this validation function was motly unused since FreeBSD 10.2 the usage of this function has been generalized to improve Reported by: des
-rw-r--r--usr.sbin/pw/pw_user.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/usr.sbin/pw/pw_user.c b/usr.sbin/pw/pw_user.c
index d9602e9..5b422fe 100644
--- a/usr.sbin/pw/pw_user.c
+++ b/usr.sbin/pw/pw_user.c
@@ -640,7 +640,8 @@ pw_checkname(char *name, int gecos)
}
if (!reject) {
while (*ch) {
- if (strchr(badchars, *ch) != NULL || *ch < ' ' ||
+ if (strchr(badchars, *ch) != NULL ||
+ (!gecos && *ch < ' ') ||
*ch == 127) {
reject = 1;
break;
OpenPOWER on IntegriCloud