Fix regression: report again if a username already exists when creating it
This commit is contained in:
parent
db533440b7
commit
a64b90fbaa
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=286198
@ -1275,6 +1275,9 @@ pw_user_add(int argc, char **argv, char *arg1)
|
||||
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 : "";
|
||||
|
Loading…
Reference in New Issue
Block a user