1
0
mirror of https://github.com/systemd/systemd.git synced 2025-03-19 22:50:17 +03:00

exec-invoke: Fix unshare() error handling

Follow up for cd58b5a13537fc89b669ff9232ba2206214c9fa1

(cherry picked from commit c78b06b1d23b95e4ea5f507a719bded6a2737581)
This commit is contained in:
Daan De Meyer 2025-02-26 22:31:35 +01:00
parent cd727da491
commit 014b7f987f

View File

@ -5037,10 +5037,9 @@ int exec_invoke(
}
if (needs_sandboxing && exec_needs_cgroup_namespace(context, params)) {
r = unshare(CLONE_NEWCGROUP);
if (r < 0) {
if (unshare(CLONE_NEWCGROUP) < 0) {
*exit_status = EXIT_NAMESPACE;
return log_exec_error_errno(context, params, r, "Failed to set up cgroup namespacing: %m");
return log_exec_error_errno(context, params, errno, "Failed to set up cgroup namespacing: %m");
}
}