mirror of
https://github.com/systemd/systemd
synced 2024-07-22 18:55:10 +00:00
execute: fix the condition of private mounts for user namespacing
Follow-up for: 6ef721cbc7
This commit is contained in:
parent
a5ebaf7982
commit
adeff82234
|
@ -4584,7 +4584,7 @@ static bool exec_context_need_unprivileged_private_users(const ExecContext *cont
|
|||
context->network_namespace_path ||
|
||||
context->private_ipc ||
|
||||
context->ipc_namespace_path ||
|
||||
context->private_mounts ||
|
||||
context->private_mounts > 0 ||
|
||||
context->mount_apivfs ||
|
||||
context->n_bind_mounts > 0 ||
|
||||
context->n_temporary_filesystems > 0 ||
|
||||
|
|
|
@ -448,9 +448,9 @@ static void test_exec_privatedevices(Manager *m) {
|
|||
}
|
||||
|
||||
test(m, "exec-privatedevices-yes-capability-mknod.service", can_unshare || MANAGER_IS_SYSTEM(m) ? 0 : EXIT_NAMESPACE, CLD_EXITED);
|
||||
test(m, "exec-privatedevices-no-capability-mknod.service", 0, CLD_EXITED);
|
||||
test(m, "exec-privatedevices-no-capability-mknod.service", MANAGER_IS_SYSTEM(m) ? 0 : EXIT_FAILURE, CLD_EXITED);
|
||||
test(m, "exec-privatedevices-yes-capability-sys-rawio.service", MANAGER_IS_SYSTEM(m) ? 0 : EXIT_NAMESPACE, CLD_EXITED);
|
||||
test(m, "exec-privatedevices-no-capability-sys-rawio.service", 0, CLD_EXITED);
|
||||
test(m, "exec-privatedevices-no-capability-sys-rawio.service", MANAGER_IS_SYSTEM(m) ? 0 : EXIT_FAILURE, CLD_EXITED);
|
||||
}
|
||||
|
||||
static void test_exec_protecthome(Manager *m) {
|
||||
|
@ -480,7 +480,7 @@ static void test_exec_protectkernelmodules(Manager *m) {
|
|||
return;
|
||||
}
|
||||
|
||||
test(m, "exec-protectkernelmodules-no-capabilities.service", 0, CLD_EXITED);
|
||||
test(m, "exec-protectkernelmodules-no-capabilities.service", MANAGER_IS_SYSTEM(m) ? 0 : EXIT_FAILURE, CLD_EXITED);
|
||||
test(m, "exec-protectkernelmodules-yes-capabilities.service", MANAGER_IS_SYSTEM(m) ? 0 : EXIT_NAMESPACE, CLD_EXITED);
|
||||
test(m, "exec-protectkernelmodules-yes-mount-propagation.service", can_unshare ? 0 : MANAGER_IS_SYSTEM(m) ? EXIT_FAILURE : EXIT_NAMESPACE, CLD_EXITED);
|
||||
}
|
||||
|
@ -1118,12 +1118,12 @@ static void test_exec_unsetenvironment(Manager *m) {
|
|||
}
|
||||
|
||||
static void test_exec_specifier(Manager *m) {
|
||||
test(m, "exec-specifier.service", can_unshare || MANAGER_IS_SYSTEM(m) ? 0 : EXIT_FAILURE, CLD_EXITED);
|
||||
test(m, "exec-specifier.service", 0, CLD_EXITED);
|
||||
if (MANAGER_IS_SYSTEM(m))
|
||||
test(m, "exec-specifier-system.service", 0, CLD_EXITED);
|
||||
else
|
||||
test(m, "exec-specifier-user.service", 0, CLD_EXITED);
|
||||
test(m, "exec-specifier@foo-bar.service", can_unshare || MANAGER_IS_SYSTEM(m) ? 0 : EXIT_FAILURE, CLD_EXITED);
|
||||
test(m, "exec-specifier@foo-bar.service", 0, CLD_EXITED);
|
||||
test(m, "exec-specifier-interpolation.service", 0, CLD_EXITED);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue