Commit c245b43a authored by Till Kamppeter's avatar Till Kamppeter

removed scheduler-create-ppd-correct-permissions.patch, included upstream.

parent 6e51c845
Description: The scheduler sets the permissions and ownerships of PPD files in /etc/cups/ppd/ differently depending on whether the IPP request to create or modify the print queue had the PPD attached or a model URI pointing to a system-supplied PPD. This leads to the PPDs in /etc/cups/ppd/ sometimes being world-readable and sometimes not. Now we assure consistent permissions and ownerships by setting them explicitly to the default for CUPS' configuration files in all cases.
Author: Michael Sweet <msweet@apple.com>
Bug-Upstream: https://www.cups.org/str.php?L4703
Last-Update: 2015-08-28
--- a/scheduler/ipp.c
+++ b/scheduler/ipp.c
@@ -70,7 +70,7 @@
cups_array_t *exclude);
static int copy_banner(cupsd_client_t *con, cupsd_job_t *job,
const char *name);
-static int copy_file(const char *from, const char *to);
+static int copy_file(const char *from, const char *to, mode_t mode);
static int copy_model(cupsd_client_t *con, const char *from,
const char *to);
static void copy_job_attrs(cupsd_client_t *con,
@@ -2615,7 +2615,7 @@
* interfaces directory and make it executable...
*/
- if (copy_file(srcfile, dstfile))
+ if (copy_file(srcfile, dstfile, ConfigFilePerm | 0110))
{
send_ipp_status(con, IPP_INTERNAL_ERROR,
_("Unable to copy interface script - %s"),
@@ -2625,7 +2625,6 @@
cupsdLogMessage(CUPSD_LOG_DEBUG,
"Copied interface script successfully");
- chmod(dstfile, 0755);
}
snprintf(dstfile, sizeof(dstfile), "%s/ppd/%s.ppd", ServerRoot,
@@ -2638,7 +2637,7 @@
* ppd directory and make it readable by all...
*/
- if (copy_file(srcfile, dstfile))
+ if (copy_file(srcfile, dstfile, ConfigFilePerm))
{
send_ipp_status(con, IPP_INTERNAL_ERROR,
_("Unable to copy PPD file - %s"),
@@ -2648,7 +2647,6 @@
cupsdLogMessage(CUPSD_LOG_DEBUG,
"Copied PPD file successfully");
- chmod(dstfile, 0644);
}
else
{
@@ -4336,7 +4334,8 @@
static int /* O - 0 = success, -1 = error */
copy_file(const char *from, /* I - Source file */
- const char *to) /* I - Destination file */
+ const char *to, /* I - Destination file */
+ mode_t mode) /* I - Permissions */
{
cups_file_t *src, /* Source file */
*dst; /* Destination file */
@@ -4353,7 +4352,7 @@
if ((src = cupsFileOpen(from, "rb")) == NULL)
return (-1);
- if ((dst = cupsFileOpen(to, "wb")) == NULL)
+ if ((dst = cupsdCreateConfFile(to, mode)) == NULL)
{
cupsFileClose(src);
return (-1);
@@ -4377,7 +4376,7 @@
cupsFileClose(src);
- return (cupsFileClose(dst));
+ return (cupsdCloseCreatedConfFile(dst, to));
}
# patches accepted and committed upstream
# patches sent upstream
scheduler-create-ppd-correct-permissions.patch
pwg-raster-attributes.patch
manpage-hyphen-minus.patch
rootbackends-worldreadable.patch
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment