From: Till Kamppeter Date: Thu, 4 Mar 2021 16:29:53 +0000 (+0100) Subject: scheduler: Do not set extra groups for processes when in a Snap X-Git-Tag: v2.4b1~246 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1867a90df897b838c996252aec98bb0d14fd10b4;p=thirdparty%2Fcups.git scheduler: Do not set extra groups for processes when in a Snap --- diff --git a/scheduler/cups-exec.c b/scheduler/cups-exec.c index 674de0a3a7..dff5055158 100644 --- a/scheduler/cups-exec.c +++ b/scheduler/cups-exec.c @@ -129,7 +129,11 @@ main(int argc, /* I - Number of command-line args */ if (setgid(gid)) exit(errno + 100); +# ifdef SUPPORT_SNAPPED_CUPSD + if (setgroups(0, NULL)) +# else if (setgroups(1, &gid)) +# endif /* SUPPORT_SNAPPED_CUPSD */ exit(errno + 100); if (uid && setuid(uid)) diff --git a/scheduler/process.c b/scheduler/process.c index 3c1c6ba4f9..3b09efe24c 100644 --- a/scheduler/process.c +++ b/scheduler/process.c @@ -744,7 +744,11 @@ cupsdStartProcess( if (!RunUser && setgid(Group)) exit(errno + 100); +# ifdef SUPPORT_SNAPPED_CUPSD + if (!RunUser && setgroups(0, NULL)) +# else if (!RunUser && setgroups(1, &Group)) +# endif /* SUPPORT_SNAPPED_CUPSD */ exit(errno + 100); /*