]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
scheduler: Do not set extra groups for processes when in a Snap
authorTill Kamppeter <till.kamppeter@gmail.com>
Thu, 4 Mar 2021 16:29:53 +0000 (17:29 +0100)
committerTill Kamppeter <till.kamppeter@gmail.com>
Thu, 4 Mar 2021 16:29:53 +0000 (17:29 +0100)
scheduler/cups-exec.c
scheduler/process.c

index 674de0a3a7e4f35e3866e79f7e074cac1b1f4b9a..dff5055158037f9f51e566a1e947c080e3b55ada 100644 (file)
@@ -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))
index 3c1c6ba4f9d49fcc3ebb82dd5e446f902ad2e636..3b09efe24c2dd071855a16bfa6a7279d707db2a9 100644 (file)
@@ -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);
 
    /*