]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
machined: Allow user ids in open_shell for machine-dbus
authorcidkidnix <cidkidnix@protonmail.com>
Tue, 7 Jul 2026 19:04:30 +0000 (14:04 -0500)
committerLuca Boccassi <luca.boccassi@gmail.com>
Thu, 16 Jul 2026 10:58:15 +0000 (11:58 +0100)
Previously "machinectl shell --uid=1000 <container>" resulted in a
sucessful drop into a shell in the respective target machine. After
commit a9e9288288567beae57337ae903dd3b6c774001c this is no longer the
case.

This fixes the above breaking change brought in commit a9e9288288567beae57337ae903dd3b6c774001c

src/machine/machine-dbus.c

index 09872b53bbbc0a9e8626f86c7adece4a61dfd53b..4517f596f3b3ccbc7e2e076f4b01932ac64ca74a 100644 (file)
@@ -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