svn commit: r241108 - head/usr.sbin/pw

Baptiste Daroussin bapt at FreeBSD.org
Mon Oct 1 17:00:33 UTC 2012


Author: bapt
Date: Mon Oct  1 17:00:33 2012
New Revision: 241108
URL: http://svn.freebsd.org/changeset/base/241108

Log:
  Do not treat empty name as an uid 0
  
  Reported by:	Robert Bonomi <bonomi at mail.r-bonomi.com>

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

Modified: head/usr.sbin/pw/pw_user.c
==============================================================================
--- head/usr.sbin/pw/pw_user.c	Mon Oct  1 16:42:07 2012	(r241107)
+++ head/usr.sbin/pw/pw_user.c	Mon Oct  1 17:00:33 2012	(r241108)
@@ -314,7 +314,8 @@ pw_user(struct userconf * cnf, int mode,
 		 * know.
 		 */
 		if (mode != M_ADD && pwd == NULL
-		    && strspn(a_name->val, "0123456789") == strlen(a_name->val)) {
+		    && strspn(a_name->val, "0123456789") == strlen(a_name->val)
+		    && *a_name->val) {
 			(a_uid = a_name)->ch = 'u';
 			a_name = NULL;
 		}


More information about the svn-src-all mailing list