]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core/exec-invoke: use correct exit status
authorMike Yuan <me@yhndnzj.com>
Wed, 18 Oct 2023 13:22:19 +0000 (21:22 +0800)
committerMike Yuan <me@yhndnzj.com>
Thu, 19 Oct 2023 13:37:33 +0000 (21:37 +0800)
These calls can fail not only due to OOM.

src/core/exec-invoke.c

index b6ab421a8d89bf4022e0c085784a74c793927572..c6ef2953c8d846b8295da495e468f194ff13af0b 100644 (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");