Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 2 Dec 2015 22:35:25 +0000 (UTC)
From:      Baptiste Daroussin <bapt@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r291658 - head/usr.sbin/pw
Message-ID:  <201512022235.tB2MZPLM048433@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: bapt
Date: Wed Dec  2 22:35:25 2015
New Revision: 291658
URL: https://svnweb.freebsd.org/changeset/base/291658

Log:
  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

Modified:
  head/usr.sbin/pw/pw_user.c

Modified: head/usr.sbin/pw/pw_user.c
==============================================================================
--- head/usr.sbin/pw/pw_user.c	Wed Dec  2 22:01:37 2015	(r291657)
+++ head/usr.sbin/pw/pw_user.c	Wed Dec  2 22:35:25 2015	(r291658)
@@ -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;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201512022235.tB2MZPLM048433>