core: write kdbus.attach_flags_mask only on real boot

The kernel module system is not namespaced, so no container should ever
modify global options. Make sure we set the kdbus attach_flags_mask only
on a real boot as PID1.
This commit is contained in:
David Herrmann 2015-01-18 23:54:42 +01:00
parent 9c89c1cabd
commit 90b99192ad

View file

@ -708,7 +708,7 @@ static int manager_setup_kdbus(Manager *m) {
if (m->test_run || m->kdbus_fd >= 0)
return 0;
if (getpid() == 1)
if (m->running_as == SYSTEMD_SYSTEM && detect_container(NULL) <= 0)
bus_kernel_fix_attach_mask();
m->kdbus_fd = bus_kernel_create_bus(