user-util: switch order of checks in valid_user_group_name_or_id_full()
When we are supposed to accept numeric UIDs formatted as string, then
let's check that first, before passing things on to
valid_user_group_name_full(), since that might log about, and not the
other way round.
See: #15201
Follow-up for: 93c23c9297
This commit is contained in:
parent
36e4a8f22a
commit
a85daa0dfb
|
@ -778,10 +778,10 @@ bool valid_user_group_name_or_id_full(const char *u, bool strict) {
|
|||
if (isempty(u))
|
||||
return false;
|
||||
|
||||
if (valid_user_group_name_full(u, strict))
|
||||
if (parse_uid(u, NULL) >= 0)
|
||||
return true;
|
||||
|
||||
return parse_uid(u, NULL) >= 0;
|
||||
return valid_user_group_name_full(u, strict);
|
||||
}
|
||||
|
||||
bool valid_gecos(const char *d) {
|
||||
|
|
Loading…
Reference in New Issue