diff options
author | bapt <bapt@FreeBSD.org> | 2015-08-02 12:56:25 +0000 |
---|---|---|
committer | bapt <bapt@FreeBSD.org> | 2015-08-02 12:56:25 +0000 |
commit | 4453f16adb9c5b1a4748ba717d8cb7a673496900 (patch) | |
tree | 49bab21323d39b8e5798bb9e45bc68fdc744bda6 /usr.sbin | |
parent | 521095bbe7389eb9b7b2c12af03b85a4549cfb9b (diff) | |
download | FreeBSD-src-4453f16adb9c5b1a4748ba717d8cb7a673496900.zip FreeBSD-src-4453f16adb9c5b1a4748ba717d8cb7a673496900.tar.gz |
Fix regression: report if a group already exists when creating it
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/pw/pw_group.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/usr.sbin/pw/pw_group.c b/usr.sbin/pw/pw_group.c index 5ba5e39..22e80b0 100644 --- a/usr.sbin/pw/pw_group.c +++ b/usr.sbin/pw/pw_group.c @@ -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); |