nspawn: machine registration is now available unpriv

This commit is contained in:
Lennart Poettering
2024-06-21 17:38:23 +02:00
parent f98e821cda
commit e16be05858
+1 -7
View 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);