Compare commits

..

2 Commits

Author SHA1 Message Date
Lennart Poettering a85daa0dfb 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
2020-03-31 11:25:01 +02:00
Piero La Terza 36e4a8f22a homectl: fix a typo
stroage -> storage
2020-03-31 09:24:38 +02:00
2 changed files with 3 additions and 3 deletions

View File

@ -778,10 +778,10 @@ bool valid_user_group_name_or_id_full(const char *u, bool strict) {
if (isempty(u)) if (isempty(u))
return false; return false;
if (valid_user_group_name_full(u, strict)) if (parse_uid(u, NULL) >= 0)
return true; return true;
return parse_uid(u, NULL) >= 0; return valid_user_group_name_full(u, strict);
} }
bool valid_gecos(const char *d) { bool valid_gecos(const char *d) {

View File

@ -295,7 +295,7 @@ static int handle_generic_user_record_error(
if (sd_bus_error_has_name(error, BUS_ERROR_HOME_ABSENT)) if (sd_bus_error_has_name(error, BUS_ERROR_HOME_ABSENT))
return log_error_errno(SYNTHETIC_ERRNO(EREMOTE), return log_error_errno(SYNTHETIC_ERRNO(EREMOTE),
"Home of user %s is currently absent, please plug in the necessary stroage device or backing file system.", user_name); "Home of user %s is currently absent, please plug in the necessary storage device or backing file system.", user_name);
else if (sd_bus_error_has_name(error, BUS_ERROR_AUTHENTICATION_LIMIT_HIT)) else if (sd_bus_error_has_name(error, BUS_ERROR_AUTHENTICATION_LIMIT_HIT))
return log_error_errno(SYNTHETIC_ERRNO(ETOOMANYREFS), return log_error_errno(SYNTHETIC_ERRNO(ETOOMANYREFS),