Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 9 Dec 2015 21:38:26 +0000 (UTC)
From:      Baptiste Daroussin <bapt@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r292026 - stable/10/usr.sbin/pw
Message-ID:  <201512092138.tB9LcQOE031821@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: bapt
Date: Wed Dec  9 21:38:26 2015
New Revision: 292026
URL: https://svnweb.freebsd.org/changeset/base/292026

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

Modified:
  stable/10/usr.sbin/pw/pw_user.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/usr.sbin/pw/pw_user.c
==============================================================================
--- stable/10/usr.sbin/pw/pw_user.c	Wed Dec  9 21:34:03 2015	(r292025)
+++ stable/10/usr.sbin/pw/pw_user.c	Wed Dec  9 21:38:26 2015	(r292026)
@@ -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;



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