]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
src/newusers.c: Don't allow bad names in group names
authorAlejandro Colomar <alx@kernel.org>
Sun, 12 Jul 2026 15:26:41 +0000 (17:26 +0200)
committerIker Pedrosa <ikerpedrosam@gmail.com>
Fri, 17 Jul 2026 07:33:21 +0000 (09:33 +0200)
Other programs handling groups don't allow this.
I believe this was only accidentally allowed.

Fixes: a2cd3e9ef03a (2019-10-04; "chkname.c, pwck.c, useradd.c, usermod.c, newusers.c: Allow names that do not conform to standards")
Cc: ed <ed@s5h.net>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
src/newusers.c

index c66f7ee4dc1afb3ea5beff361e408eb9ecc692fb..ae4cca0a455eb2f46bc0c0f6e7d3550ec86565f5 100644 (file)
@@ -288,7 +288,7 @@ static int add_group (const char *name, const char *gid, gid_t *ngid, uid_t uid)
        }
 
        /* Check if this is a valid group name */
-       if (!is_valid_group_name(grent.gr_name, bflg)) {
+       if (!is_valid_group_name(grent.gr_name, false)) {
                fprintf (stderr,
                         _("%s: invalid group name '%s'\n"),
                         Prog, grent.gr_name);