svn commit: r286198 - head/usr.sbin/pw
Baptiste Daroussin
bapt at FreeBSD.org
Sun Aug 2 12:54:16 UTC 2015
Author: bapt
Date: Sun Aug 2 12:54:15 2015
New Revision: 286198
URL: https://svnweb.freebsd.org/changeset/base/286198
Log:
Fix regression: report again if a username already exists when creating it
Modified:
head/usr.sbin/pw/pw_user.c
Modified: head/usr.sbin/pw/pw_user.c
==============================================================================
--- head/usr.sbin/pw/pw_user.c Sun Aug 2 12:48:36 2015 (r286197)
+++ head/usr.sbin/pw/pw_user.c Sun Aug 2 12:54:15 2015 (r286198)
@@ -1275,6 +1275,9 @@ pw_user_add(int argc, char **argv, char
if (name == NULL)
errx(EX_DATAERR, "login name required");
+ if (GETPWNAM(name) != NULL)
+ errx(EX_DATAERR, "login name `%s' already exists", name);
+
pwd = &fakeuser;
pwd->pw_name = name;
pwd->pw_class = cmdcnf->default_class ? cmdcnf->default_class : "";
More information about the svn-src-all
mailing list