Fix regression: report if a group already exists when creating it
This commit is contained in:
parent
521095bbe7
commit
4453f16adb
@ -546,6 +546,8 @@ pw_group_add(int argc, char **argv, char *arg1)
|
||||
freopen(_PATH_DEVNULL, "w", stderr);
|
||||
if (name == NULL)
|
||||
errx(EX_DATAERR, "group name required");
|
||||
if (GETGRNAM(name) != NULL)
|
||||
errx(EX_DATAERR, "group name `%s' already exists", name);
|
||||
cnf = get_userconfig(cfg);
|
||||
rc = groupadd(cnf, name, gr_gidpolicy(cnf, id), members, fd, dryrun,
|
||||
pretty, precrypted);
|
||||
|
Loading…
Reference in New Issue
Block a user