1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-29 12:03:03 +00:00

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
This commit is contained in:
Baptiste Daroussin 2015-12-02 22:35:25 +00:00
parent c514e5a523
commit 8ab28c4e4b
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=291658

View File

@ -642,7 +642,8 @@ pw_checkname(char *name, int gecos)
} }
if (!reject) { if (!reject) {
while (*ch) { while (*ch) {
if (strchr(badchars, *ch) != NULL || *ch < ' ' || if (strchr(badchars, *ch) != NULL ||
(!gecos && *ch < ' ') ||
*ch == 127) { *ch == 127) {
reject = 1; reject = 1;
break; break;