Skip to content

Commit

Permalink
executor: check for all permission related errnos when setting up IPC…
Browse files Browse the repository at this point in the history
… namespace

Denials from AppArmor are raised as EACCES, so EPERM is not enough. Do
the same check as PrivateNetwork above.

Fixes systemd/systemd#31037

Related to 06384eb

(cherry picked from commit cafe40e)
  • Loading branch information
bluca committed May 27, 2024
1 parent 632b493 commit e481710
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/exec-invoke.c
Original file line number Diff line number Diff line change
Expand Up @@ -4639,7 +4639,7 @@ int exec_invoke(

if (ns_type_supported(NAMESPACE_IPC)) {
r = setup_shareable_ns(runtime->shared->ipcns_storage_socket, CLONE_NEWIPC);
if (r == -EPERM)
if (ERRNO_IS_NEG_PRIVILEGE(r))
log_exec_warning_errno(context, params, r,
"PrivateIPC=yes is configured, but IPC namespace setup failed, ignoring: %m");
else if (r < 0) {
Expand Down

0 comments on commit e481710

Please sign in to comment.