File Do-not-ignore-errors-from-initgroups.patch of Package slurm.13628

From: Tim Wickberg <tim@schedmd.com>
Date: Wed Dec 18 20:53:27 2019 -0700
Subject: Do not ignore errors from initgroups().
Patch-mainline: Not yet
Git-commit: ca21f3e66b7957044a1ec9961f9202b97cde99a7
References: bsc#1159692,CVE-2019-19728

Bug 8084.

Signed-off-by: Egbert Eich <eich@suse.de>
Signed-off-by: Egbert Eich <eich@suse.com>
---
 src/srun/libsrun/srun_job.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/srun/libsrun/srun_job.c b/src/srun/libsrun/srun_job.c
index 2fce59d..b607706 100644
--- a/src/srun/libsrun/srun_job.c
+++ b/src/srun/libsrun/srun_job.c
@@ -1598,7 +1598,9 @@ static int _become_user (void)
 		return (error ("setgid: %m"));
 	}
 
-	(void) initgroups(user, gid); /* Ignore errors */
+	if (initgroups(user, gid))
+		return (error ("initgroups: %m"));
+
 	xfree(user);
 
 	if (setuid (opt.uid) < 0)