]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
nspawn: machine registration is now available unpriv
authorLennart Poettering <lennart@poettering.net>
Mon, 27 May 2024 11:30:11 +0000 (13:30 +0200)
committerLennart Poettering <lennart@poettering.net>
Fri, 21 Jun 2024 15:38:23 +0000 (17:38 +0200)
src/nspawn/nspawn.c

index ed428c6a0b07caa1dcc3a9bf9d3e82da6ecd4ccd..6eec5a27a08ea2c11d576204747ce94ce0ae8e72 100644 (file)
@@ -1659,12 +1659,6 @@ static int verify_arguments(void) {
         SET_FLAG(arg_mount_settings, MOUNT_PRIVILEGED, arg_privileged);
 
         if (!arg_privileged) {
-                /* machined is not accessible to unpriv clients */
-                if (arg_register) {
-                        log_notice("Automatically implying --register=no, since machined is not accessible to unprivileged clients.");
-                        arg_register = false;
-                }
-
                 if (!arg_private_network) {
                         log_notice("Automatically implying --private-network, since mounting /sys/ in an unprivileged user namespaces requires network namespacing.");
                         arg_private_network = true;
@@ -5350,7 +5344,7 @@ static int run_container(
         }
 
         if (arg_register || !arg_keep_unit) {
-                if (arg_privileged)
+                if (arg_privileged || arg_register)
                         r = sd_bus_default_system(&bus);
                 else
                         r = sd_bus_default_user(&bus);