b725558
diff -up cups-1.7.5/notifier/rss.c.str4461 cups-1.7.5/notifier/rss.c
b725558
--- cups-1.7.5/notifier/rss.c.str4461	2013-05-29 12:51:34.000000000 +0100
b725558
+++ cups-1.7.5/notifier/rss.c	2014-09-01 10:16:34.088149082 +0100
b725558
@@ -1,27 +1,16 @@
b725558
 /*
b725558
  * "$Id: rss.c 10996 2013-05-29 11:51:34Z msweet $"
b725558
  *
b725558
- *   RSS notifier for CUPS.
b725558
+ * RSS notifier for CUPS.
b725558
  *
b725558
- *   Copyright 2007-2012 by Apple Inc.
b725558
- *   Copyright 2007 by Easy Software Products.
b725558
+ * Copyright 2007-2014 by Apple Inc.
b725558
+ * Copyright 2007 by Easy Software Products.
b725558
  *
b725558
- *   These coded instructions, statements, and computer programs are the
b725558
- *   property of Apple Inc. and are protected by Federal copyright
b725558
- *   law.  Distribution and use rights are outlined in the file "LICENSE.txt"
b725558
- *   which should have been included with this file.  If this file is
b725558
- *   file is missing or damaged, see the license at "http://www.cups.org/".
b725558
- *
b725558
- * Contents:
b725558
- *
b725558
- *   main()           - Main entry for the test notifier.
b725558
- *   compare_rss()    - Compare two messages.
b725558
- *   delete_message() - Free all memory used by a message.
b725558
- *   load_rss()       - Load an existing RSS feed file.
b725558
- *   new_message()    - Create a new RSS message.
b725558
- *   password_cb()    - Return the cached password.
b725558
- *   save_rss()       - Save messages to a RSS file.
b725558
- *   xml_escape()     - Copy a string, escaping &, <, and > as needed.
b725558
+ * These coded instructions, statements, and computer programs are the
b725558
+ * property of Apple Inc. and are protected by Federal copyright
b725558
+ * law.  Distribution and use rights are outlined in the file "LICENSE.txt"
b725558
+ * which should have been included with this file.  If this file is
b725558
+ * file is missing or damaged, see the license at "http://www.cups.org/".
b725558
  */
b725558
 
b725558
 /*
b725558
@@ -29,6 +18,7 @@
b725558
  */
b725558
 
b725558
 #include <cups/cups.h>
b725558
+#include <sys/stat.h>
b725558
 #include <cups/language.h>
b725558
 #include <cups/string-private.h>
b725558
 #include <cups/array.h>
b725558
@@ -629,6 +619,8 @@ save_rss(cups_array_t *rss,		/* I - RSS
b725558
     return (0);
b725558
   }
b725558
 
b725558
+  fchmod(fileno(fp), 0644);
b725558
+
b725558
   fputs("\n", fp);
b725558
   fputs("<rss version=\"2.0\">\n", fp);
b725558
   fputs("  <channel>\n", fp);
d10ba26
diff -up cups-1.7.5/scheduler/client.c.str4461 cups-1.7.5/scheduler/client.c
d10ba26
--- cups-1.7.5/scheduler/client.c.str4461	2014-07-22 15:03:19.000000000 +0100
b725558
+++ cups-1.7.5/scheduler/client.c	2014-09-01 10:15:51.970947105 +0100
d10ba26
@@ -3263,6 +3263,7 @@ get_file(cupsd_client_t *con,		/* I  - C
d10ba26
   char		*ptr;			/* Pointer info filename */
d10ba26
   int		plen;			/* Remaining length after pointer */
d10ba26
   char		language[7];		/* Language subdirectory, if any */
d10ba26
+  int		perm_check = 1;		/* Do permissions check? */
ba58bf8
 
d10ba26
 
d10ba26
  /*
d10ba26
@@ -3272,17 +3273,27 @@ get_file(cupsd_client_t *con,		/* I  - C
d10ba26
   language[0] = '\0';
d10ba26
 
d10ba26
   if (!strncmp(con->uri, "/ppd/", 5) && !strchr(con->uri + 5, '/'))
d10ba26
+  {
d10ba26
     snprintf(filename, len, "%s%s", ServerRoot, con->uri);
d10ba26
+
d10ba26
+    perm_check = 0;
d10ba26
+  }
d10ba26
   else if (!strncmp(con->uri, "/icons/", 7) && !strchr(con->uri + 7, '/'))
ba58bf8
   {
d10ba26
     snprintf(filename, len, "%s/%s", CacheDir, con->uri + 7);
d10ba26
     if (access(filename, F_OK) < 0)
d10ba26
       snprintf(filename, len, "%s/images/generic.png", DocumentRoot);
ba58bf8
+
d10ba26
+    perm_check = 0;
ba58bf8
   }
d10ba26
   else if (!strncmp(con->uri, "/rss/", 5) && !strchr(con->uri + 5, '/'))
d10ba26
     snprintf(filename, len, "%s/rss/%s", CacheDir, con->uri + 5);
d10ba26
-  else if (!strncmp(con->uri, "/admin/conf/", 12))
d10ba26
-    snprintf(filename, len, "%s%s", ServerRoot, con->uri + 11);
d10ba26
+  else if (!strcmp(con->uri, "/admin/conf/cupsd.conf"))
d10ba26
+  {
d10ba26
+    strlcpy(filename, ConfigurationFile, len);
d10ba26
+
d10ba26
+    perm_check = 0;
d10ba26
+  }
d10ba26
   else if (!strncmp(con->uri, "/admin/log/", 11))
d10ba26
   {
d10ba26
     if (!strncmp(con->uri + 11, "access_log", 10) && AccessLog[0] == '/')
d10ba26
@@ -3293,6 +3304,8 @@ get_file(cupsd_client_t *con,		/* I  - C
d10ba26
       strlcpy(filename, PageLog, len);
d10ba26
     else
d10ba26
       return (NULL);
d10ba26
+
d10ba26
+    perm_check = 0;
d10ba26
   }
d10ba26
   else if (con->language)
d10ba26
   {
d10ba26
@@ -3358,7 +3371,7 @@ get_file(cupsd_client_t *con,		/* I  - C
d10ba26
   * not allow access...
d10ba26
   */
d10ba26
 
d10ba26
-  if (!status && !(filestats->st_mode & S_IROTH))
d10ba26
+  if (!status && perm_check && !(filestats->st_mode & S_IROTH))
d10ba26
   {
d10ba26
     cupsdLogMessage(CUPSD_LOG_INFO, "[Client %d] Files/directories such as \"%s\" must be world-readable.", con->http.fd, filename);
d10ba26
     return (NULL);
d10ba26
@@ -3466,7 +3479,7 @@ get_file(cupsd_client_t *con,		/* I  - C
d10ba26
     * not allow access...
d10ba26
     */
d10ba26
 
d10ba26
-    if (!status && !(filestats->st_mode & S_IROTH))
d10ba26
+    if (!status && perm_check && !(filestats->st_mode & S_IROTH))
d10ba26
     {
d10ba26
       cupsdLogMessage(CUPSD_LOG_INFO, "[Client %d] Files/directories such as \"%s\" must be world-readable.", con->http.fd, filename);
d10ba26
       return (NULL);
b725558
diff -up cups-1.7.5/scheduler/conf.c.str4461 cups-1.7.5/scheduler/conf.c
b725558
--- cups-1.7.5/scheduler/conf.c.str4461	2014-09-01 10:15:51.968947096 +0100
b725558
+++ cups-1.7.5/scheduler/conf.c	2014-09-01 10:16:52.624237974 +0100
b725558
@@ -1092,7 +1092,7 @@ cupsdReadConfiguration(void)
b725558
 
b725558
   if ((cupsdCheckPermissions(RequestRoot, NULL, 0710, RunUser,
b725558
 			     Group, 1, 1) < 0 ||
b725558
-       cupsdCheckPermissions(CacheDir, NULL, 0775, RunUser,
b725558
+       cupsdCheckPermissions(CacheDir, NULL, 0770, RunUser,
b725558
 			     Group, 1, 1) < 0 ||
b725558
        cupsdCheckPermissions(temp, NULL, 0775, RunUser,
b725558
 			     Group, 1, 1) < 0 ||
d10ba26
diff -up cups-1.7.5/scheduler/ipp.c.str4461 cups-1.7.5/scheduler/ipp.c
b725558
--- cups-1.7.5/scheduler/ipp.c.str4461	2014-09-01 10:15:51.848946520 +0100
b725558
+++ cups-1.7.5/scheduler/ipp.c	2014-09-01 10:15:51.972947115 +0100
d10ba26
@@ -2743,7 +2743,6 @@ add_printer(cupsd_client_t  *con,	/* I -
d10ba26
 
d10ba26
       cupsdLogMessage(CUPSD_LOG_DEBUG,
d10ba26
 		      "Copied PPD file successfully");
d10ba26
-      chmod(dstfile, 0644);
d10ba26
     }
d10ba26
   }
d10ba26
 
d10ba26
@@ -4650,7 +4649,7 @@ copy_model(cupsd_client_t *con,		/* I -
d10ba26
   * Open the destination file for a copy...
d10ba26
   */
d10ba26
 
d10ba26
-  if ((dst = cupsFileOpen(to, "wb")) == NULL)
d10ba26
+  if ((dst = cupsdCreateConfFile(to, ConfigFilePerm)) == NULL)
d10ba26
   {
d10ba26
     cupsFreeOptions(num_defaults, defaults);
d10ba26
     cupsFileClose(src);
d10ba26
@@ -4705,7 +4704,7 @@ copy_model(cupsd_client_t *con,		/* I -
d10ba26
 
d10ba26
   unlink(tempfile);
d10ba26
 
d10ba26
-  return (cupsFileClose(dst));
d10ba26
+  return (cupsdCloseCreatedConfFile(dst, to));
d10ba26
 }
d10ba26
 
ba58bf8
 
b725558
diff -up cups-1.7.5/scheduler/Makefile.str4461 cups-1.7.5/scheduler/Makefile
b725558
--- cups-1.7.5/scheduler/Makefile.str4461	2014-09-01 10:15:51.965947081 +0100
b725558
+++ cups-1.7.5/scheduler/Makefile	2014-09-01 10:16:52.624237974 +0100
b725558
@@ -174,7 +174,7 @@ install-data:
b725558
 	echo Creating $(REQUESTS)/tmp...
b725558
 	$(INSTALL_DIR) -m 1770 -g $(CUPS_GROUP) $(REQUESTS)/tmp
b725558
 	echo Creating $(CACHEDIR)...
b725558
-	$(INSTALL_DIR) -m 775 -g $(CUPS_GROUP) $(CACHEDIR)
b725558
+	$(INSTALL_DIR) -m 770 -g $(CUPS_GROUP) $(CACHEDIR)
b725558
 	if test "x$(INITDIR)" != x; then \
b725558
 		echo Installing init scripts...; \
b725558
 		$(INSTALL_DIR) -m 755 $(BUILDROOT)$(INITDIR)/init.d; \