nspawn: machine registration is now available unpriv

This commit is contained in:
Lennart Poettering 2024-05-27 13:30:11 +02:00
parent f98e821cda
commit e16be05858

View file

@ -1659,12 +1659,6 @@ static int verify_arguments(void) {
SET_FLAG(arg_mount_settings, MOUNT_PRIVILEGED, arg_privileged); SET_FLAG(arg_mount_settings, MOUNT_PRIVILEGED, arg_privileged);
if (!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) { if (!arg_private_network) {
log_notice("Automatically implying --private-network, since mounting /sys/ in an unprivileged user namespaces requires network namespacing."); log_notice("Automatically implying --private-network, since mounting /sys/ in an unprivileged user namespaces requires network namespacing.");
arg_private_network = true; arg_private_network = true;
@ -5350,7 +5344,7 @@ static int run_container(
} }
if (arg_register || !arg_keep_unit) { if (arg_register || !arg_keep_unit) {
if (arg_privileged) if (arg_privileged || arg_register)
r = sd_bus_default_system(&bus); r = sd_bus_default_system(&bus);
else else
r = sd_bus_default_user(&bus); r = sd_bus_default_user(&bus);