machined: Allow user ids in open_shell for machine-dbus
Previously "machinectl shell --uid=1000 <container>" resulted in a sucessful drop into a shell in the respective target machine. After commita9e9288288this is no longer the case. This fixes the above breaking change brought in commita9e9288288
This commit is contained in:
@@ -391,7 +391,7 @@ int bus_machine_method_open_shell(sd_bus_message *message, void *userdata, sd_bu
|
||||
return r;
|
||||
user = isempty(user) ? "root" : user;
|
||||
|
||||
if (!valid_user_group_name(user, VALID_USER_RELAX))
|
||||
if (!valid_user_group_name(user, VALID_USER_RELAX | VALID_USER_ALLOW_NUMERIC))
|
||||
return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Invalid user name '%s'", user);
|
||||
|
||||
/* Ensure only root can shell into the root namespace. This is to avoid unprivileged users registering
|
||||
|
||||
Reference in New Issue
Block a user