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