]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
Suggest badname if name has special characters
authorIker Pedrosa <ipedrosa@redhat.com>
Tue, 26 Apr 2022 14:45:04 +0000 (16:45 +0200)
committerSerge Hallyn <serge@hallyn.com>
Fri, 6 May 2022 15:13:51 +0000 (10:13 -0500)
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2076819

Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
src/newusers.c
src/pwck.c
src/usermod.c

index 8e7c620dcbd889d798c7ddcbf8d369fdcb4cd1d3..8c882100aebc0fb713d62f9663c93b9f4a763ec1 100644 (file)
@@ -383,7 +383,7 @@ static int add_user (const char *name, uid_t uid, gid_t gid)
        /* Check if this is a valid user name */
        if (!is_valid_user_name (name)) {
                fprintf (stderr,
-                        _("%s: invalid user name '%s'\n"),
+                        _("%s: invalid user name '%s': use --badname to ignore\n"),
                         Prog, name);
                return -1;
        }
index 22b1fdcd8e680a472c6ccde0b52a89fdd9c43bbd..058a240e278e0d1a3439b4a96ea5d3c25bed7c1a 100644 (file)
@@ -470,7 +470,8 @@ static void check_pw_file (int *errors, bool *changed)
                 */
 
                if (!is_valid_user_name (pwd->pw_name)) {
-                       printf (_("invalid user name '%s'\n"), pwd->pw_name);
+                       printf (_("invalid user name '%s': use --badname to ignore\n"),
+                                       pwd->pw_name);
                        *errors += 1;
                }
 
index af2208be3cd0bd7c46dbe737e3ef5d91856f3d25..459d8acf06d4d137af230e60ba937c97d03c2145 100644 (file)
@@ -1095,7 +1095,7 @@ static void process_flags (int argc, char **argv)
                        case 'l':
                                if (!is_valid_user_name (optarg)) {
                                        fprintf (stderr,
-                                                _("%s: invalid user name '%s'\n"),
+                                                _("%s: invalid user name '%s': use --badname to ignore\n"),
                                                 Prog, optarg);
                                        exit (E_BAD_ARG);
                                }