src/: Recommend --badname only if it is useful
(Review with -w (--ignore-all-space).) Closes: <https://github.com/shadow-maint/shadow/issues/1067> Reported-by: Anselm Schüler <mail@anselmschueler.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
This commit is contained in:
committed by
Serge Hallyn
parent
0663c91f80
commit
1f11a5ce5a
+10
-4
@@ -1523,10 +1523,16 @@ static void process_flags (int argc, char **argv)
|
||||
}
|
||||
|
||||
user_name = argv[optind];
|
||||
if (!is_valid_user_name (user_name)) {
|
||||
fprintf (stderr,
|
||||
_("%s: invalid user name '%s': use --badname to ignore\n"),
|
||||
Prog, user_name);
|
||||
if (!is_valid_user_name(user_name)) {
|
||||
if (errno == EINVAL) {
|
||||
fprintf(stderr,
|
||||
_("%s: invalid user name '%s': use --badname to ignore\n"),
|
||||
Prog, user_name);
|
||||
} else {
|
||||
fprintf(stderr,
|
||||
_("%s: invalid user name '%s'\n"),
|
||||
Prog, user_name);
|
||||
}
|
||||
#ifdef WITH_AUDIT
|
||||
audit_logger (AUDIT_ADD_USER, Prog,
|
||||
"adding user",
|
||||
|
||||
Reference in New Issue
Block a user