]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Mirror fix from trunk.
authormsweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be>
Wed, 8 Jan 2014 16:00:25 +0000 (16:00 +0000)
committermsweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be>
Wed, 8 Jan 2014 16:00:25 +0000 (16:00 +0000)
git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/branches/branch-1.7@11510 a1ca3aef-8c08-0410-bb20-df032aa958be

CHANGES.txt
cups/usersys.c

index cb048a8c3a23660fedd029a43d5fc1510ed20de6..a47e895852d6ad2ace0ad173e8a3b2ecdcc456f0 100644 (file)
@@ -1,4 +1,4 @@
-CHANGES.txt - 1.7.1 - 2014-01-06
+CHANGES.txt - 1.7.1 - 2014-01-08
 --------------------------------
 
 CHANGES IN CUPS V1.7.1
@@ -13,7 +13,7 @@ CHANGES IN CUPS V1.7.1
          scheduler (<rdar://problem/15382819>)
        - The RPM spec file did not list the build requirements; this was on
          purpose, but now we are listing the Red Hat package names
-         (<rdar://problem/15375760>)
+         (<rdar://problem/15375760>, STR #4322)
        - Printing to a raw queue could result in corrupt output due to
          opportunistic compression (<rdar://problem/15008524>)
        - The GNU TLS support code triggered many compiler warnings due to the
@@ -36,6 +36,8 @@ CHANGES IN CUPS V1.7.1
        - lpq and lpstat did not list jobs in the correct order when priorities
          were specified (STR #4326)
        - The D-BUS notifier did not remove its lockfile (STR #4314)
+       - CUPS incorrectly used the USER environment variable when the name did
+         not match the user ID (STR #4327)
 
 
 CHANGES IN CUPS V1.7.0
index 867226d5b98f6006c4907e78620e0df43b9a6740..16617e900c74bbc0a670697357de2fbfac2347bc 100644 (file)
@@ -850,7 +850,25 @@ _cupsSetDefaults(void)
   cups_expiredcerts   = getenv("CUPS_EXPIREDCERTS");
 
   if ((cups_user = getenv("CUPS_USER")) == NULL)
-    cups_user = getenv("USER");
+  {
+   /*
+    * Try the USER environment variable...
+    */
+
+    if ((cups_user = getenv("USER")) != NULL)
+    {
+     /*
+      * Validate USER matches the current UID, otherwise don't allow it to
+      * override things...  This makes sure that printing after doing su or
+      * sudo records the correct username.
+      */
+
+      struct passwd    *pw;            /* Account information */
+
+      if ((pw = getpwnam(cups_user)) == NULL || pw->pw_uid != getuid())
+        cups_user = NULL;
+    }
+  }
 
  /*
   * Then, if needed, read the ~/.cups/client.conf or /etc/cups/client.conf