summaryrefslogtreecommitdiff
path: root/debian/patches/str4500-cupsGetPPD3-Only-use-symlink-if-file-is-readable-STR.patch
blob: acf39d395ebc76a118f1739e5f6aad3cac9a39d3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
Description: cupsGetPPD* would return a symlink to the PPD in /etc/cups/ppd even if it was not readable by the user
Bug-Upstream: https://cups.org/str.php?L4500
Author: Michael Sweet <msweet@apple.com>
Last-Updated: 2014-10-20
--- a/cups/util.c
+++ b/cups/util.c
@@ -955,10 +955,10 @@
 
     snprintf(ppdname, sizeof(ppdname), "%s/ppd/%s.ppd", cg->cups_serverroot,
              name);
-    if (!stat(ppdname, &ppdinfo))
+    if (!stat(ppdname, &ppdinfo) && !access(ppdname, R_OK))
     {
      /*
-      * OK, the file exists, use it!
+      * OK, the file exists and is readable, use it!
       */
 
       if (buffer[0])