summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbapt <bapt@FreeBSD.org>2015-12-02 22:35:25 +0000
committerbapt <bapt@FreeBSD.org>2015-12-02 22:35:25 +0000
commit9d1a130e5876a30b188849baecf3cf324a4e8091 (patch)
tree4fa56a2f2ee1aeb842ceb34d5b9b12459c9b0b15
parent5df8300abf919431bbeedfbabfa605cf95f01080 (diff)
downloadFreeBSD-src-9d1a130e5876a30b188849baecf3cf324a4e8091.zip
FreeBSD-src-9d1a130e5876a30b188849baecf3cf324a4e8091.tar.gz
pw_checkname since the beginning if 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 validation. Reported by: des MFC after: 1 week
-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 61c2440..30a2749 100644
--- a/usr.sbin/pw/pw_user.c
+++ b/usr.sbin/pw/pw_user.c
@@ -642,7 +642,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