1 --- cups-2.4.0/scheduler/cups-exec.c 2021-11-29 16:19:34.235186064 +0100
2 +++ cups-2.4.0/scheduler/cups-exec.c.new 2021-11-29 16:25:30.764049649 +0100
3 @@ -134,9 +134,14 @@ main(int argc, /* I - Number of command-line args */
5 if (setgroups(0, NULL))
7 - if (setgroups(1, &gid))
8 -# endif /* CUPS_SNAP */
10 + struct passwd * pwd = getpwuid(uid);
11 + if(initgroups(pwd->pw_name,pwd->pw_gid))
13 + fprintf(stderr, "DEBUG: initgroups failed\n");
16 +# endif /* CUPS_SNAP */
18 if (uid && setuid(uid))
20 --- cups-2.4.0/scheduler/util.c 2021-11-29 15:27:31.000000000 +0100
21 +++ cups-2.4.0/scheduler/util.c.new 2021-11-29 16:29:58.810719066 +0100
25 if (!getuid() && user)
26 - setuid(user); /* Run as restricted user */
29 + struct passwd * pwd = getpwuid(user);
30 + if(initgroups(pwd->pw_name,pwd->pw_gid))
32 + fprintf(stderr, "DEBUG: initgroups failed\n");
35 + setuid(user); /* Run as restricted user */
38 if ((fd = open("/dev/null", O_RDONLY)) > 0)