1
0
mirror of https://github.com/systemd/systemd.git synced 2025-03-10 16:58:28 +03:00

core/exec-invoke: use correct exit status

These calls can fail not only due to OOM.
This commit is contained in:
Mike Yuan 2023-10-18 21:22:19 +08:00
parent bbe92ea5cc
commit dbc0342e61
No known key found for this signature in database
GPG Key ID: 417471C0A40F58B3

View File

@ -4524,7 +4524,7 @@ int exec_invoke(
ngids_after_pam = getgroups_alloc(&gids_after_pam);
if (ngids_after_pam < 0) {
*exit_status = EXIT_MEMORY;
*exit_status = EXIT_GROUP;
return log_exec_error_errno(context, params, ngids_after_pam, "Failed to obtain groups after setting up PAM: %m");
}
}
@ -4632,7 +4632,7 @@ int exec_invoke(
ngids_after_pam,
&gids_to_enforce);
if (ngids_to_enforce < 0) {
*exit_status = EXIT_MEMORY;
*exit_status = EXIT_GROUP;
return log_exec_error_errno(context, params,
ngids_to_enforce,
"Failed to merge group lists. Group membership might be incorrect: %m");