]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
cups/dest.c: Write data into /etc/cups/lpoptions if we're root 456/head
authorZdenek Dohnal <zdohnal@redhat.com>
Mon, 15 Aug 2022 15:38:12 +0000 (17:38 +0200)
committerZdenek Dohnal <zdohnal@redhat.com>
Mon, 15 Aug 2022 15:38:12 +0000 (17:38 +0200)
Fixes #454 , the patch is created by Yair Yarom
(https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1008053).

cups/dest.c

index f563ce22606e38ad9bb1e2d900777d4f5b2a28cb..a9273ff93a3eaefad245460b643bcc9a1979a7a1 100644 (file)
@@ -2080,7 +2080,11 @@ cupsSetDests2(http_t      *http, /* I - Connection to server or @code CUPS_HTTP_
 
   snprintf(filename, sizeof(filename), "%s/lpoptions", cg->cups_serverroot);
 
-  if (cg->home)
+  if (cg->home
+#ifndef _WIN32
+      && getuid() != 0
+#endif /* !_WIN32 */
+      )
   {
    /*
     * Create ~/.cups subdirectory...