Merged update from upstream sources

This is an automated DistroBaker update from upstream sources.
If you do not know what this is about or would like to opt out,
contact the OSCI team.

Source: https://src.fedoraproject.org/rpms/cups.git#48e9d6b921d9ce43427439adb9a5c7d47f848be5
This commit is contained in:
DistroBaker 2020-12-15 10:57:28 +00:00
parent c556dd30d6
commit 05b50b45cd
23 changed files with 177 additions and 967 deletions

1
.gitignore vendored
View File

@ -93,3 +93,4 @@ cups-1.4.4-source.tar.bz2
/cups-2.3.0-source.tar.gz
/cups-2.3.1-source.tar.gz
/cups-2.3.3-source.tar.gz
/cups-2.3.3op1-source.tar.gz

View File

@ -1,43 +0,0 @@
diff --git a/cups/http-support.c b/cups/http-support.c
index 6317514..ea8640c 100644
--- a/cups/http-support.c
+++ b/cups/http-support.c
@@ -1,8 +1,9 @@
/*
* HTTP support routines for CUPS.
*
- * Copyright 2007-2019 by Apple Inc.
- * Copyright 1997-2007 by Easy Software Products, all rights reserved.
+ * Copyright © 2020 by Michael R Sweet
+ * Copyright © 2007-2019 by Apple Inc.
+ * Copyright © 1997-2007 by Easy Software Products, all rights reserved.
*
* Licensed under Apache License v2.0. See the file "LICENSE" for more
* information.
@@ -26,6 +27,8 @@
#elif defined(HAVE_AVAHI)
# include <avahi-client/client.h>
# include <avahi-client/lookup.h>
+// for avahi_free()
+# include <avahi-common/malloc.h>
# include <avahi-common/simple-watch.h>
#endif /* HAVE_DNSSD */
@@ -2536,6 +2539,8 @@ http_resolve_cb(
memcpy(uuid, value, valueLen);
uuid[valueLen] = '\0';
+ avahi_free(value);
+
if (_cups_strcasecmp(uuid, uribuf->uuid))
{
if (uribuf->options & _HTTP_RESOLVE_STDERR)
@@ -2620,6 +2625,8 @@ http_resolve_cb(
memcpy(resource + 1, value, valueLen);
resource[valueLen + 1] = '\0';
}
+
+ avahi_free(value);
}
else
{

View File

@ -1,43 +0,0 @@
From 5313c22785446473771e07d5adb1d2f11cbcbfe7 Mon Sep 17 00:00:00 2001
From: Zdenek Dohnal <zdohnal@redhat.com>
Date: Mon, 9 Nov 2020 07:40:20 +0100
Subject: [PATCH] backend,scheduler/ipp.c: Fix 'printer-alert' invalid free
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
The fix is created by Bernhard Übelacker from apple/cups #5826.
---
backend/ipp.c | 2 +-
scheduler/ipp.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/backend/ipp.c b/backend/ipp.c
index 35c0711c0..3e601b2ad 100644
--- a/backend/ipp.c
+++ b/backend/ipp.c
@@ -3075,7 +3075,7 @@ report_printer_state(ipp_t *ipp) /* I - IPP response */
* Report alerts and messages...
*/
- if ((pa = ippFindAttribute(ipp, "printer-alert", IPP_TAG_TEXT)) != NULL)
+ if ((pa = ippFindAttribute(ipp, "printer-alert", IPP_TAG_STRING)) != NULL)
report_attr(pa);
if ((pam = ippFindAttribute(ipp, "printer-alert-message",
diff --git a/scheduler/ipp.c b/scheduler/ipp.c
index 0c44d7d4a..68763a0f1 100644
--- a/scheduler/ipp.c
+++ b/scheduler/ipp.c
@@ -4891,7 +4891,7 @@ copy_printer_attrs(
}
if (printer->alert && (!ra || cupsArrayFind(ra, "printer-alert")))
- ippAddString(con->response, IPP_TAG_PRINTER, IPP_TAG_STRING, "printer-alert", NULL, printer->alert);
+ ippAddOctetString(con->response, IPP_TAG_PRINTER, "printer-alert", printer->alert, (int)strlen(printer->alert));
if (printer->alert_description && (!ra || cupsArrayFind(ra, "printer-alert-description")))
ippAddString(con->response, IPP_TAG_PRINTER, IPP_TAG_TEXT, "printer-alert-description", NULL, printer->alert_description);
--
2.26.2

View File

@ -1,10 +0,0 @@
diff --git a/scheduler/org.cups.cupsd.service.in b/scheduler/org.cups.cupsd.service.in
index bf308a5..add238b 100644
--- a/scheduler/org.cups.cupsd.service.in
+++ b/scheduler/org.cups.cupsd.service.in
@@ -10,4 +10,4 @@ Restart=on-failure
[Install]
Also=cups.socket cups.path
-WantedBy=printer.target
+WantedBy=printer.target multi-user.target

View File

@ -1,130 +0,0 @@
diff -up cups-2.3.0/backend/ipp.c.eggcups cups-2.3.0/backend/ipp.c
--- cups-2.3.0/backend/ipp.c.eggcups 2019-08-23 17:19:38.000000000 +0200
+++ cups-2.3.0/backend/ipp.c 2019-10-07 12:14:25.385111933 +0200
@@ -143,6 +143,70 @@ static char tmpfilename[1024] = "";
static char mandatory_attrs[1024] = "";
/* cupsMandatory value */
+#if HAVE_DBUS
+#include <dbus/dbus.h>
+
+static DBusConnection *dbus_connection = NULL;
+
+static int
+init_dbus (void)
+{
+ DBusConnection *connection;
+ DBusError error;
+
+ if (dbus_connection &&
+ !dbus_connection_get_is_connected (dbus_connection)) {
+ dbus_connection_unref (dbus_connection);
+ dbus_connection = NULL;
+ }
+
+ dbus_error_init (&error);
+ connection = dbus_bus_get (getuid () ? DBUS_BUS_SESSION : DBUS_BUS_SYSTEM, &error);
+ if (connection == NULL) {
+ dbus_error_free (&error);
+ return -1;
+ }
+
+ dbus_connection = connection;
+ return 0;
+}
+
+int
+dbus_broadcast_queued_remote (const char *printer_uri,
+ ipp_status_t status,
+ unsigned int local_job_id,
+ unsigned int remote_job_id,
+ const char *username,
+ const char *printer_name)
+{
+ DBusMessage *message;
+ DBusMessageIter iter;
+ const char *errstr;
+
+ if (!dbus_connection || !dbus_connection_get_is_connected (dbus_connection)) {
+ if (init_dbus () || !dbus_connection)
+ return -1;
+ }
+
+ errstr = ippErrorString (status);
+ message = dbus_message_new_signal ("/com/redhat/PrinterSpooler",
+ "com.redhat.PrinterSpooler",
+ "JobQueuedRemote");
+ dbus_message_iter_init_append (message, &iter);
+ dbus_message_iter_append_basic (&iter, DBUS_TYPE_STRING, &printer_uri);
+ dbus_message_iter_append_basic (&iter, DBUS_TYPE_STRING, &errstr);
+ dbus_message_iter_append_basic (&iter, DBUS_TYPE_UINT32, &local_job_id);
+ dbus_message_iter_append_basic (&iter, DBUS_TYPE_UINT32, &remote_job_id);
+ dbus_message_iter_append_basic (&iter, DBUS_TYPE_STRING, &username);
+ dbus_message_iter_append_basic (&iter, DBUS_TYPE_STRING, &printer_name);
+
+ dbus_connection_send (dbus_connection, message, NULL);
+ dbus_connection_flush (dbus_connection);
+ dbus_message_unref (message);
+
+ return 0;
+}
+#endif /* HAVE_DBUS */
/*
* Local functions...
@@ -1768,6 +1832,15 @@ main(int argc, /* I - Number of comm
fprintf(stderr, "DEBUG: Print job accepted - job ID %d.\n", job_id);
}
+#if HAVE_DBUS
+ dbus_broadcast_queued_remote (argv[0],
+ ipp_status,
+ atoi (argv[1]),
+ job_id,
+ argv[2],
+ getenv ("PRINTER"));
+#endif /* HAVE_DBUS */
+
ippDelete(response);
if (job_canceled)
diff -up cups-2.3.0/backend/Makefile.eggcups cups-2.3.0/backend/Makefile
--- cups-2.3.0/backend/Makefile.eggcups 2019-10-07 12:14:25.385111933 +0200
+++ cups-2.3.0/backend/Makefile 2019-10-07 12:16:00.457569406 +0200
@@ -257,7 +257,7 @@ dnssd: dnssd.o ../cups/$(LIBCUPS) libbac
ipp: ipp.o ../cups/$(LIBCUPS) libbackend.a
echo Linking $@...
- $(LD_CC) $(ALL_LDFLAGS) -o ipp ipp.o libbackend.a $(LINKCUPS)
+ $(LD_CC) $(LDFLAGS) -o ipp ipp.o libbackend.a $(LINKCUPS) $(SERVERLIBS)
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
$(RM) http https ipps
for file in $(IPPALIASES); do \
diff -up cups-2.3.0/scheduler/subscriptions.c.eggcups cups-2.3.0/scheduler/subscriptions.c
--- cups-2.3.0/scheduler/subscriptions.c.eggcups 2019-08-23 17:19:38.000000000 +0200
+++ cups-2.3.0/scheduler/subscriptions.c 2019-10-07 12:18:21.736478684 +0200
@@ -1257,13 +1257,13 @@ cupsd_send_dbus(cupsd_eventmask_t event,
what = "PrinterAdded";
else if (event & CUPSD_EVENT_PRINTER_DELETED)
what = "PrinterRemoved";
- else if (event & CUPSD_EVENT_PRINTER_CHANGED)
- what = "QueueChanged";
else if (event & CUPSD_EVENT_JOB_CREATED)
what = "JobQueuedLocal";
else if ((event & CUPSD_EVENT_JOB_STATE) && job &&
job->state_value == IPP_JOB_PROCESSING)
what = "JobStartedLocal";
+ else if (event & (CUPSD_EVENT_PRINTER_CHANGED|CUPSD_EVENT_JOB_STATE_CHANGED|CUPSD_EVENT_PRINTER_STATE_CHANGED))
+ what = "QueueChanged";
else
return;
@@ -1299,7 +1299,7 @@ cupsd_send_dbus(cupsd_eventmask_t event,
dbus_message_append_iter_init(message, &iter);
if (dest)
dbus_message_iter_append_string(&iter, dest->name);
- if (job)
+ if (job && strcmp (what, "QueueChanged") != 0)
{
dbus_message_iter_append_uint32(&iter, job->id);
dbus_message_iter_append_string(&iter, job->username);

View File

@ -1,25 +0,0 @@
diff --git a/cups/http-addrlist.c b/cups/http-addrlist.c
index e4ffc3d..a989055 100644
--- a/cups/http-addrlist.c
+++ b/cups/http-addrlist.c
@@ -240,7 +240,10 @@ httpAddrConnect2(
}
if (!addrlist && nfds == 0)
+ {
+ errno = EHOSTDOWN;
break;
+ }
/*
* See if we can connect to any of the addresses so far...
@@ -371,6 +374,9 @@ httpAddrConnect2(
remaining -= 250;
}
+ if (remaining <= 0)
+ errno = ETIMEDOUT;
+
while (nfds > 0)
{
nfds --;

View File

@ -1,32 +0,0 @@
diff -up cups-1.6b1/scheduler/job.c.filter-debug cups-1.6b1/scheduler/job.c
--- cups-1.6b1/scheduler/job.c.filter-debug 2012-05-25 16:06:01.000000000 +0200
+++ cups-1.6b1/scheduler/job.c 2012-05-25 16:07:46.309259511 +0200
@@ -625,10 +625,28 @@ cupsdContinueJob(cupsd_job_t *job) /* I
if (!filters)
{
+ mime_filter_t *current;
+
cupsdLogJob(job, CUPSD_LOG_ERROR,
"Unable to convert file %d to printable format.",
job->current_file);
+ cupsdLogJob(job, CUPSD_LOG_ERROR,
+ "Required: %s/%s -> %s/%s",
+ job->filetypes[job->current_file]->super,
+ job->filetypes[job->current_file]->type,
+ job->printer->filetype->super,
+ job->printer->filetype->type);
+
+ for (current = (mime_filter_t *)cupsArrayFirst(MimeDatabase->srcs);
+ current;
+ current = (mime_filter_t *)cupsArrayNext(MimeDatabase->srcs))
+ cupsdLogJob(job, CUPSD_LOG_ERROR,
+ "Available: %s/%s -> %s/%s (%s)",
+ current->src->super, current->src->type,
+ current->dst->super, current->dst->type,
+ current->filter);
+
abort_message = "Aborting job because it cannot be printed.";
abort_state = IPP_JOB_ABORTED;

View File

@ -1,21 +0,0 @@
diff -up cups-1.5b1/backend/snmp.c.hp-deviceid-oid cups-1.5b1/backend/snmp.c
--- cups-1.5b1/backend/snmp.c.hp-deviceid-oid 2011-05-20 05:49:49.000000000 +0200
+++ cups-1.5b1/backend/snmp.c 2011-05-24 17:24:48.000000000 +0200
@@ -187,6 +187,7 @@ static const int UriOID[] = { CUPS_OID_p
static const int LexmarkProductOID[] = { 1,3,6,1,4,1,641,2,1,2,1,2,1,-1 };
static const int LexmarkProductOID2[] = { 1,3,6,1,4,1,674,10898,100,2,1,2,1,2,1,-1 };
static const int LexmarkDeviceIdOID[] = { 1,3,6,1,4,1,641,2,1,2,1,3,1,-1 };
+static const int HPDeviceIdOID[] = { 1,3,6,1,4,1,11,2,3,9,1,1,7,0,-1 };
static const int XeroxProductOID[] = { 1,3,6,1,4,1,128,2,1,3,1,2,0,-1 };
static cups_array_t *DeviceURIs = NULL;
static int HostNameLookups = 0;
@@ -1006,6 +1007,9 @@ read_snmp_response(int fd) /* I - SNMP
_cupsSNMPWrite(fd, &(packet.address), CUPS_SNMP_VERSION_1,
packet.community, CUPS_ASN1_GET_REQUEST,
DEVICE_PRODUCT, XeroxProductOID);
+ _cupsSNMPWrite(fd, &(packet.address), CUPS_SNMP_VERSION_1,
+ packet.community, CUPS_ASN1_GET_REQUEST,
+ DEVICE_ID, HPDeviceIdOID);
break;
case DEVICE_DESCRIPTION :

View File

@ -1,39 +0,0 @@
diff --git a/cups/ipp-vars.c b/cups/ipp-vars.c
index 395b0eb..d863287 100644
--- a/cups/ipp-vars.c
+++ b/cups/ipp-vars.c
@@ -12,7 +12,7 @@
* Include necessary headers...
*/
-#include <cups/cups.h>
+#include "cups/cups-private.h"
#include "ipp-private.h"
#include "string-private.h"
#include "debug-internal.h"
@@ -220,10 +220,22 @@ _ippVarsSet(_ipp_vars_t *v, /* I - IPP variables */
{
if (!strcmp(name, "uri"))
{
- char uri[1024]; /* New printer URI */
- http_uri_status_t uri_status; /* URI status */
+ char uri[1024]; /* New printer URI */
+ char resolved[1024]; /* Resolved mDNS URI */
- if ((uri_status = httpSeparateURI(HTTP_URI_CODING_ALL, value, v->scheme, sizeof(v->scheme), v->username, sizeof(v->username), v->host, sizeof(v->host), &(v->port), v->resource, sizeof(v->resource))) < HTTP_URI_STATUS_OK)
+ if (strstr(value, "._tcp"))
+ {
+ /*
+ * Resolve URI...
+ */
+
+ if (!_httpResolveURI(value, resolved, sizeof(resolved), _HTTP_RESOLVE_DEFAULT, NULL, NULL))
+ return (0);
+
+ value = resolved;
+ }
+
+ if (httpSeparateURI(HTTP_URI_CODING_ALL, value, v->scheme, sizeof(v->scheme), v->username, sizeof(v->username), v->host, sizeof(v->host), &(v->port), v->resource, sizeof(v->resource)) < HTTP_URI_STATUS_OK)
return (0);
if (v->username[0])

View File

@ -1,63 +0,0 @@
diff -up cups-2.1b1/scheduler/log.c.logrotate cups-2.1b1/scheduler/log.c
--- cups-2.1b1/scheduler/log.c.logrotate 2015-06-04 20:00:31.000000000 +0200
+++ cups-2.1b1/scheduler/log.c 2015-06-29 13:25:09.623350218 +0200
@@ -26,6 +26,9 @@
# include <systemd/sd-journal.h>
#endif /* HAVE_ASL_H */
#include <syslog.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
/*
@@ -135,12 +138,10 @@ cupsdCheckLogFile(cups_file_t **lf, /* I
}
/*
- * Format the filename as needed...
+ * Format the filename...
*/
- if (!*lf ||
- (strncmp(logname, "/dev/", 5) && cupsFileTell(*lf) > MaxLogSize &&
- MaxLogSize > 0))
+ if (strncmp(logname, "/dev/", 5))
{
/*
* Handle format strings...
@@ -254,6 +255,34 @@ cupsdCheckLogFile(cups_file_t **lf, /* I
/*
* Change ownership and permissions of non-device logs...
*/
+
+ fchown(cupsFileNumber(*lf), RunUser, Group);
+ fchmod(cupsFileNumber(*lf), LogFilePerm);
+ }
+ }
+
+ /*
+ * Has someone else (i.e. logrotate) already rotated the log for us?
+ */
+ else if (strncmp(filename, "/dev/", 5))
+ {
+ struct stat st;
+ if (stat(filename, &st) || st.st_size == 0)
+ {
+ /* File is either missing or has zero size. */
+
+ cupsFileClose(*lf);
+ if ((*lf = cupsFileOpen(filename, "a")) == NULL)
+ {
+ syslog(LOG_ERR, "Unable to open log file \"%s\" - %s", filename,
+ strerror(errno));
+
+ return (0);
+ }
+
+ /*
+ * Change ownership and permissions of non-device logs...
+ */
fchown(cupsFileNumber(*lf), RunUser, Group);
fchmod(cupsFileNumber(*lf), LogFilePerm);

View File

@ -1,13 +0,0 @@
diff --git a/cups/ppd-cache.c b/cups/ppd-cache.c
index 94a125a..79aab32 100644
--- a/cups/ppd-cache.c
+++ b/cups/ppd-cache.c
@@ -3228,7 +3228,7 @@ _ppdCreateFromIPP(char *buffer, /* I - Filename buffer */
cupsFilePuts(fp, "*cupsFilter2: \"application/vnd.cups-pdf application/pdf 10 -\"\n");
}
else
- cupsFilePuts(fp, "*cupsManualCopies: true\n");
+ cupsFilePuts(fp, "*cupsManualCopies: True\n");
if (is_apple)
cupsFilePuts(fp, "*cupsFilter2: \"image/urf image/urf 100 -\"\n");
if (is_pwg)

View File

@ -1,22 +0,0 @@
diff --git a/ppdc/ppdc-import.cxx b/ppdc/ppdc-import.cxx
index 04b587d..60d8834 100644
--- a/ppdc/ppdc-import.cxx
+++ b/ppdc/ppdc-import.cxx
@@ -27,7 +27,7 @@ ppdcSource::import_ppd(const char *f) // I - Filename
char line[256], // Comment line
*ptr; // Pointer into line
int cost; // Cost for filter
- ppd_file_t *ppd; // PPD file data
+ ppd_file_t *ppd = NULL; // PPD file data
ppd_group_t *group; // PPD group
ppd_option_t *option; // PPD option
ppd_choice_t *choice; // PPD choice
@@ -323,5 +323,8 @@ ppdcSource::import_ppd(const char *f) // I - Filename
}
}
+ if (ppd)
+ ppdClose(ppd);
+
return (1);
}

View File

@ -1,16 +0,0 @@
diff --git a/cups/ppd-cache.c b/cups/ppd-cache.c
index 167e1df..6c05735 100644
--- a/cups/ppd-cache.c
+++ b/cups/ppd-cache.c
@@ -3790,6 +3790,11 @@ _ppdCreateFromIPP(char *buffer, /* I - Filename buffer */
PRINTF_COLOROPTION("RGB", _("Color"), CUPS_CSPACE_SRGB, 8)
default_color = "RGB";
+
+ // Apparently some printers only advertise color support, so make sure
+ // we also do grayscale for these printers...
+ if (!ippContainsString(attr, "sgray_8") && !ippContainsString(attr, "black_1") && !ippContainsString(attr, "black_8"))
+ PRINTF_COLOROPTION("Gray", _("GrayScale"), CUPS_CSPACE_SW, 8)
}
else if (!strcasecmp(keyword, "adobe-rgb_16") || !strcmp(keyword, "ADOBERGB48") || !strcmp(keyword, "ADOBERGB24-48"))
{

View File

@ -1,14 +0,0 @@
diff --git a/filter/rastertopwg.c b/filter/rastertopwg.c
index 1e63e4e..b3a2e87 100644
--- a/filter/rastertopwg.c
+++ b/filter/rastertopwg.c
@@ -260,7 +260,8 @@ main(int argc, /* I - Number of command-line args */
}
if (inheader.cupsPageSizeName[0] &&
- (pwg_size = _ppdCacheGetSize(cache, inheader.cupsPageSizeName)) != NULL)
+ (pwg_size = _ppdCacheGetSize(cache, inheader.cupsPageSizeName)) != NULL &&
+ pwg_size->map.pwg)
{
strlcpy(outheader.cupsPageSizeName, pwg_size->map.pwg,
sizeof(outheader.cupsPageSizeName));

View File

@ -1,21 +0,0 @@
diff -up cups-1.5b1/backend/snmp.c.ricoh-deviceid-oid cups-1.5b1/backend/snmp.c
--- cups-1.5b1/backend/snmp.c.ricoh-deviceid-oid 2011-05-24 17:29:48.000000000 +0200
+++ cups-1.5b1/backend/snmp.c 2011-05-24 17:29:48.000000000 +0200
@@ -188,6 +188,7 @@ static const int LexmarkProductOID[] = {
static const int LexmarkProductOID2[] = { 1,3,6,1,4,1,674,10898,100,2,1,2,1,2,1,-1 };
static const int LexmarkDeviceIdOID[] = { 1,3,6,1,4,1,641,2,1,2,1,3,1,-1 };
static const int HPDeviceIdOID[] = { 1,3,6,1,4,1,11,2,3,9,1,1,7,0,-1 };
+static const int RicohDeviceIdOID[] = { 1,3,6,1,4,1,367,3,2,1,1,1,11,0,-1 };
static const int XeroxProductOID[] = { 1,3,6,1,4,1,128,2,1,3,1,2,0,-1 };
static cups_array_t *DeviceURIs = NULL;
static int HostNameLookups = 0;
@@ -1005,6 +1006,9 @@ read_snmp_response(int fd) /* I - SNMP
packet.community, CUPS_ASN1_GET_REQUEST,
DEVICE_ID, LexmarkDeviceIdOID);
_cupsSNMPWrite(fd, &(packet.address), CUPS_SNMP_VERSION_1,
+ packet.community, CUPS_ASN1_GET_REQUEST,
+ DEVICE_ID, RicohDeviceIdOID);
+ _cupsSNMPWrite(fd, &(packet.address), CUPS_SNMP_VERSION_1,
packet.community, CUPS_ASN1_GET_REQUEST,
DEVICE_PRODUCT, XeroxProductOID);
_cupsSNMPWrite(fd, &(packet.address), CUPS_SNMP_VERSION_1,

View File

@ -1,48 +0,0 @@
diff -up cups-2.2.12/conf/cups-files.conf.in.synconclose cups-2.2.12/conf/cups-files.conf.in
--- cups-2.2.12/conf/cups-files.conf.in.synconclose 2019-08-16 00:35:30.000000000 +0200
+++ cups-2.2.12/conf/cups-files.conf.in 2019-08-19 09:58:14.646567949 +0200
@@ -7,7 +7,7 @@
#FatalErrors @CUPS_FATAL_ERRORS@
# Do we call fsync() after writing configuration or status files?
-#SyncOnClose No
+#SyncOnClose Yes
# Default user and group for filters/backends/helper programs; this cannot be
# any user or group that resolves to ID 0 for security reasons...
diff -up cups-2.2.12/doc/help/man-cups-files.conf.html.synconclose cups-2.2.12/doc/help/man-cups-files.conf.html
--- cups-2.2.12/doc/help/man-cups-files.conf.html.synconclose 2019-08-16 00:35:30.000000000 +0200
+++ cups-2.2.12/doc/help/man-cups-files.conf.html 2019-08-19 09:58:14.646567949 +0200
@@ -150,7 +150,7 @@ The default is "/var/run/cups" or "/etc/
<dd style="margin-left: 5.0em">Specifies whether the scheduler calls
<b>fsync</b>(2)
after writing configuration or state files.
-The default is "No".
+The default is "Yes".
<dt><a name="SystemGroup"></a><b>SystemGroup </b><i>group-name </i>[ ... <i>group-name</i> ]
<dd style="margin-left: 5.0em">Specifies the group(s) to use for <i>@SYSTEM</i> group authentication.
The default contains "admin", "lpadmin", "root", "sys", and/or "system".
diff -up cups-2.2.12/man/cups-files.conf.man.in.synconclose cups-2.2.12/man/cups-files.conf.man.in
--- cups-2.2.12/man/cups-files.conf.5.synconclose 2019-08-16 00:35:30.000000000 +0200
+++ cups-2.2.12/man/cups-files.conf.5 2019-08-19 09:58:14.646567949 +0200
@@ -214,7 +214,7 @@ The default is "/var/run/cups" or "/etc/
Specifies whether the scheduler calls
.BR fsync (2)
after writing configuration or state files.
-The default is "No".
+The default is "Yes".
.\"#SystemGroup
.TP 5
\fBSystemGroup \fIgroup-name \fR[ ... \fIgroup-name\fR ]
diff -up cups-2.2.12/scheduler/conf.c.synconclose cups-2.2.12/scheduler/conf.c
--- cups-2.2.12/scheduler/conf.c.synconclose 2019-08-19 09:58:14.647567941 +0200
+++ cups-2.2.12/scheduler/conf.c 2019-08-19 09:59:36.066927455 +0200
@@ -735,7 +735,7 @@ cupsdReadConfiguration(void)
RootCertDuration = 300;
Sandboxing = CUPSD_SANDBOXING_STRICT;
StrictConformance = FALSE;
- SyncOnClose = FALSE;
+ SyncOnClose = TRUE;
Timeout = 900;
WebInterface = CUPS_DEFAULT_WEBIF;

View File

@ -1,74 +0,0 @@
diff -up cups-2.2.12/scheduler/main.c.systemd-socket cups-2.2.12/scheduler/main.c
--- cups-2.2.12/scheduler/main.c.systemd-socket 2019-08-16 00:35:30.000000000 +0200
+++ cups-2.2.12/scheduler/main.c 2019-08-19 09:31:09.703370325 +0200
@@ -674,8 +674,16 @@ main(int argc, /* I - Number of comm
#ifdef HAVE_ONDEMAND
if (OnDemand)
+ {
cupsdAddEvent(CUPSD_EVENT_SERVER_STARTED, NULL, NULL, "Scheduler started on demand.");
- else
+# ifdef HAVE_SYSTEMD
+ sd_notifyf(0, "READY=1\n"
+ "STATUS=Scheduler is running...\n"
+ "MAINPID=%lu",
+ (unsigned long) getpid());
+# endif /* HAVE_SYSTEMD */
+ } else
+
#endif /* HAVE_ONDEMAND */
if (fg)
cupsdAddEvent(CUPSD_EVENT_SERVER_STARTED, NULL, NULL, "Scheduler started in foreground.");
diff -up cups-2.2.12/scheduler/org.cups.cupsd.path.in.systemd-socket cups-2.2.12/scheduler/org.cups.cupsd.path.in
--- cups-2.2.12/scheduler/org.cups.cupsd.path.in.systemd-socket 2019-08-16 00:35:30.000000000 +0200
+++ cups-2.2.12/scheduler/org.cups.cupsd.path.in 2019-08-19 09:31:09.703370325 +0200
@@ -1,6 +1,6 @@
[Unit]
Description=CUPS Scheduler
-PartOf=org.cups.cupsd.service
+PartOf=cups.service
[Path]
PathExists=@CUPS_CACHEDIR@/org.cups.cupsd
diff -up cups-2.2.12/scheduler/org.cups.cupsd.service.in.systemd-socket cups-2.2.12/scheduler/org.cups.cupsd.service.in
--- cups-2.2.12/scheduler/org.cups.cupsd.service.in.systemd-socket 2019-08-19 09:31:09.703370325 +0200
+++ cups-2.2.12/scheduler/org.cups.cupsd.service.in 2019-08-19 09:54:58.890036404 +0200
@@ -1,13 +1,13 @@
[Unit]
Description=CUPS Scheduler
Documentation=man:cupsd(8)
-After=sssd.service
+After=sssd.service network.target
[Service]
ExecStart=@sbindir@/cupsd -l
-Type=simple
+Type=notify
Restart=on-failure
[Install]
-Also=org.cups.cupsd.socket org.cups.cupsd.path
+Also=cups.socket cups.path
WantedBy=printer.target
diff -up cups-2.2.12/scheduler/org.cups.cupsd.socket.in.systemd-socket cups-2.2.12/scheduler/org.cups.cupsd.socket.in
--- cups-2.2.12/scheduler/org.cups.cupsd.socket.in.systemd-socket 2019-08-16 00:35:30.000000000 +0200
+++ cups-2.2.12/scheduler/org.cups.cupsd.socket.in 2019-08-19 09:31:09.703370325 +0200
@@ -1,6 +1,6 @@
[Unit]
Description=CUPS Scheduler
-PartOf=org.cups.cupsd.service
+PartOf=cups.service
[Socket]
ListenStream=@CUPS_DEFAULT_DOMAINSOCKET@
diff -up cups-2.2.12/scheduler/org.cups.cups-lpd.socket.systemd-socket cups-2.2.12/scheduler/org.cups.cups-lpd.socket
--- cups-2.2.12/scheduler/org.cups.cups-lpd.socket.systemd-socket 2019-08-16 00:35:30.000000000 +0200
+++ cups-2.2.12/scheduler/org.cups.cups-lpd.socket 2019-08-19 09:31:09.703370325 +0200
@@ -1,6 +1,6 @@
[Unit]
Description=CUPS LPD Server Socket
-PartOf=org.cups.cups-lpd.service
+PartOf=cups-lpd.service
[Socket]
ListenStream=515

View File

@ -1,13 +0,0 @@
diff --git a/cgi-bin/admin.c b/cgi-bin/admin.c
index a87e6be..4600d33 100644
--- a/cgi-bin/admin.c
+++ b/cgi-bin/admin.c
@@ -974,6 +974,8 @@ do_am_printer(http_t *http, /* I - HTTP connection */
cgiSetVariable("TEMPLATE_NAME", template);
}
+
+ cgiSetVariable("DEVICE_URI", var);
}
}

View File

@ -1,12 +0,0 @@
diff -up cups-2.2.12/scheduler/org.cups.cupsd.service.in.ypbind cups-2.2.12/scheduler/org.cups.cupsd.service.in
--- cups-2.2.12/scheduler/org.cups.cupsd.service.in.ypbind 2019-08-19 10:00:47.586326493 +0200
+++ cups-2.2.12/scheduler/org.cups.cupsd.service.in 2019-08-19 10:01:39.295890076 +0200
@@ -1,7 +1,7 @@
[Unit]
Description=CUPS Scheduler
Documentation=man:cupsd(8)
-After=sssd.service network.target
+After=sssd.service network.target ypbind.service
[Service]
ExecStart=@sbindir@/cupsd -l

View File

@ -1,5 +0,0 @@
/var/log/cups/*_log {
missingok
notifempty
sharedscripts
}

446
cups.spec
View File

@ -10,22 +10,22 @@
#%%global prever rc1
#%%global VERSION %%{version}%%{prever}
%global VERSION %{version}
# Openprinting version
%global OP_VER op1
Summary: CUPS printing system
Name: cups
Epoch: 1
Version: 2.3.3
Release: 20%{?dist}
Version: 2.3.3%{OP_VER}
Release: 1%{?dist}
License: ASL 2.0
Url: http://www.cups.org/
Source0: https://github.com/apple/cups/releases/download/v%{VERSION}/cups-%{VERSION}-source.tar.gz
# Apple stopped uploading the new versions into github, use OpenPrinting fork
Source0: https://github.com/OpenPrinting/cups/releases/download/v%{VERSION}/cups-%{VERSION}-source.tar.gz
# Pixmap for desktop file
Source1: cupsprinter.png
# Logrotate configuration
Source2: cups.logrotate
# Backend for NCP protocol
Source3: ncp.backend
Source4: macros.cups
# cups_serverbin macro definition for use during builds
Source2: macros.cups
# PAM enablement, very old patch, not even git can track when or why
# the patch was added.
@ -42,134 +42,87 @@ Patch3: cups-banners.patch
Patch4: cups-no-export-ssllibs.patch
# enables old uri usb:/dev/usb/lp0 - leave it here for users of old printers
Patch5: cups-direct-usb.patch
# fix for redhat dbus spooler - adding new dbus functions to backend/ipp.c
# -> initialize dbus connection and sending dbus broadcast about job queued
# on remote queue with QueueChanged type for PRINTER_CHANGED, JOB_STATE_CHANGED
# and PRINTER_STATE_CHANGED events
Patch6: cups-eggcups.patch
# when system workload is high, timeout for cups-driverd can be reached -
# increase the timeout
Patch7: cups-driverd-timeout.patch
# cupsd implement its own logrotate, but when MaxLogSize 0 is used, logrotated
# takes care of it
Patch8: cups-logrotate.patch
Patch6: cups-driverd-timeout.patch
# usb backend didn't get any notification about out-of-paper because of kernel
Patch9: cups-usb-paperout.patch
Patch7: cups-usb-paperout.patch
# uri compatibility with old Fedoras
Patch10: cups-uri-compat.patch
# fixing snmp oid for hp printer - upstream doesn't want to support too much
# snmp backend, because it's deprecated
Patch11: cups-hp-deviceid-oid.patch
# same as HP OID
Patch12: cups-ricoh-deviceid-oid.patch
# change to notify type, because when it fails to start, it gives a error
# message + renaming org.cups.cupsd names, because we have cups units in
# in older Fedoras
Patch13: cups-systemd-socket.patch
Patch8: cups-uri-compat.patch
# use IP_FREEBIND, because cupsd cannot bind to not yet existing IP address
# by default
Patch14: cups-freebind.patch
Patch9: cups-freebind.patch
# add support of multifile
Patch15: cups-ipp-multifile.patch
Patch10: cups-ipp-multifile.patch
# prolongs web ui timeout
Patch16: cups-web-devices-timeout.patch
# needs to be set to Yes to avoid race conditions
Patch17: cups-synconclose.patch
# ypbind must be started before cups if NIS configured
Patch18: cups-ypbind.patch
Patch11: cups-web-devices-timeout.patch
# failover backend for implementing failover functionality
# TODO: move it to the cups-filters upstream
Patch19: cups-failover-backend.patch
# reported upstream
# adds logs when job fails due bad conversion
Patch20: cups-filter-debug.patch
Patch12: cups-failover-backend.patch
# add device id for dymo printer
Patch21: cups-dymo-deviceid.patch
# 1822154 - cups.service doesn't execute automatically on request
# https://github.com/apple/cups/issues/5708
Patch22: cups-autostart-when-enabled.patch
Patch13: cups-dymo-deviceid.patch
%if %{lspp}
# selinux and audit enablement for CUPS - needs work and CUPS upstream wants
# to have these features implemented their way in the future
Patch100: cups-lspp.patch
%endif
#### UPSTREAM PATCHES ####
# needed for correct color support of Canon printers, which
# reports better options in print-color-mode-supported than
# in pwg-raster-document-type-supported
# https://github.com/apple/cups/pull/5722/
Patch23: cups-prioritize-print-color-mode.patch
# leaks ppd struct in ppdc
# https://github.com/apple/cups/pull/5738/
Patch24: cups-ppdleak.patch
# crashes with wide roll printers in rastertopwg filter
# https://github.com/apple/cups/pull/5773/
Patch25: cups-rastertopwg-crash.patch
# job for disconnected devices are processing for eternity
# https://github.com/apple/cups/pull/5782
Patch26: cups-etimedout.patch
# cgi script creates a bad uri in web ui
# https://github.com/apple/cups/pull/5792
Patch27: cups-webui-uri.patch
# ipptool doesn't support mdns uris
# https://github.com/apple/cups/pull/5793
Patch28: cups-ipptool-mdns-uri.patch
# ppd generator creates invalid cupsManualCopies entry, causing
# printing only one copy everytime
# https://github.com/apple/cups/pull/5807
Patch29: cups-manual-copies.patch
# invalid free for printer-alert IPP attribute, because it was
# freed as a different attribute type than it was allocated
# backported from upstream https://github.com/OpenPrinting/cups/pull/43
Patch30: 0001-backend-scheduler-ipp.c-Fix-printer-alert-invalid-fr.patch
Patch31: 0001-Fix-memory-leak-Issue-49.patch
#### UPSTREAM PATCHES (starts with 1000) ####
##### Patches removed because IMHO they aren't no longer needed
##### but still I'll leave them in git in case their removal
##### breaks something.
Requires: %{name}-filesystem = %{epoch}:%{version}-%{release}
Requires: %{name}-libs%{?_isa} = %{epoch}:%{version}-%{release}
Requires: %{name}-client%{?_isa} = %{epoch}:%{version}-%{release}
Requires: %{name}-ipptool%{?_isa} = %{epoch}:%{version}-%{release}
Provides: cupsddk cupsddk-drivers
BuildRequires: pam-devel pkgconf-pkg-config
BuildRequires: pkgconfig(gnutls)
BuildRequires: libacl-devel
BuildRequires: openldap-devel
BuildRequires: pkgconfig(libusb-1.0)
BuildRequires: krb5-devel
BuildRequires: pkgconfig(avahi-client)
BuildRequires: systemd
BuildRequires: pkgconfig(libsystemd)
BuildRequires: pkgconfig(dbus-1)
BuildRequires: automake
# needed for decompressing functions when reading from gzipped ppds
BuildRequires: zlib-devel
# gcc and gcc-c++ is no longer in buildroot by default
# gcc for most of files
BuildRequires: gcc
# gcc-c++ for ppdc and cups-driverd
Buildrequires: gcc-c++
BuildRequires: krb5-devel
BuildRequires: libacl-devel
# make is used for compilation
BuildRequires: make
BuildRequires: openldap-devel
BuildRequires: pam-devel
BuildRequires: pkgconf-pkg-config
BuildRequires: pkgconfig(avahi-client)
BuildRequires: pkgconfig(dbus-1)
BuildRequires: pkgconfig(gnutls)
BuildRequires: pkgconfig(libsystemd)
BuildRequires: pkgconfig(libusb-1.0)
# Make sure we get postscriptdriver tags.
BuildRequires: python3-cups
BuildRequires: systemd
# needed for systemd rpm macros according FPG
BuildRequires: systemd-rpm-macros
# needed for decompressing functions when reading from gzipped ppds
BuildRequires: zlib-devel
%if %{lspp}
BuildRequires: libselinux-devel
BuildRequires: audit-libs-devel
%endif
# getaddrinfo from glibc needs nss-mdns for resolving mdns .local addresses
# it is needed only for new devices (2012+), so make it only recommended for
# users with older devices
Recommends: nss-mdns
# avahi is needed for mDNS discovery
Recommends: avahi
# We ship udev rules which use setfacl.
Requires: acl
Requires: %{name}-client%{?_isa} = %{epoch}:%{version}-%{release}
Requires: %{name}-filesystem = %{epoch}:%{version}-%{release}
# Make sure we have some filters for converting to raster format.
Requires: cups-filters
Requires: %{name}-ipptool%{?_isa} = %{epoch}:%{version}-%{release}
Requires: %{name}-libs%{?_isa} = %{epoch}:%{version}-%{release}
Requires: dbus
Requires: systemd
# Requires working PrivateTmp (bug #807672)
Requires(pre): systemd
@ -178,19 +131,6 @@ Requires(post): grep, sed
Requires(preun): systemd
Requires(postun): systemd
# We ship udev rules which use setfacl.
Requires: systemd
Requires: acl
# Make sure we have some filters for converting to raster format.
Requires: cups-filters
# getaddrinfo from glibc needs nss-mdns for resolving mdns .local addresses
# it is needed only for new devices (2012+), so make it only recommended for
# users with older devices
Recommends: nss-mdns
# avahi is needed for mDNS discovery
Recommends: avahi
%package client
Summary: CUPS printing system - client programs
@ -233,11 +173,7 @@ Summary: CUPS printing system - tools for printer application
Requires: %{name}-libs%{?_isa} = %{epoch}:%{version}-%{release}
# ippeveprinter needs avahi for registering and sharing printer
Requires: avahi
# needed for mdns hostname translation - replaced by systemd-resolved in F34
# remove after F33 EOL
%if 0%{?fedora} <= 33 || 0%{?rhel} <= 8
Requires: nss-mdns
%endif
%description
CUPS printing system provides a portable printing layer for
@ -296,79 +232,37 @@ to CUPS daemon. This solution will substitute printer drivers and raw queues in
# Allow file-based usb device URIs.
%patch5 -p1 -b .direct-usb
# Increase driverd timeout to 70s to accommodate foomatic (bug #744715).
%patch7 -p1 -b .driverd-timeout
# Re-open the log if it has been logrotated under us.
%patch8 -p1 -b .logrotate
%patch6 -p1 -b .driverd-timeout
# Support for errno==ENOSPACE-based USB paper-out reporting.
%patch9 -p1 -b .usb-paperout
%patch7 -p1 -b .usb-paperout
# Allow the usb backend to understand old-style URI formats.
%patch10 -p1 -b .uri-compat
# Add an SNMP query for HP's device ID OID (STR #3552).
%patch11 -p1 -b .hp-deviceid-oid
# Add an SNMP query for Ricoh's device ID OID (STR #3552).
%patch12 -p1 -b .ricoh-deviceid-oid
# Make cups.service Type=notify (bug #1088918).
%patch13 -p1 -b .systemd-socket
%patch8 -p1 -b .uri-compat
# Use IP_FREEBIND socket option when binding listening sockets (bug #970809).
%patch14 -p1 -b .freebind
%patch9 -p1 -b .freebind
# Fixes for jobs with multiple files and multiple formats.
%patch15 -p1 -b .ipp-multifile
%patch10 -p1 -b .ipp-multifile
# Increase web interface get-devices timeout to 10s (bug #996664).
%patch16 -p1 -b .web-devices-timeout
# Set the default for SyncOnClose to Yes.
%patch17 -p1 -b .synconclose
# CUPS may fail to start if NIS groups are used (bug #1494558)
%patch18 -p1 -b .ypbind
%patch11 -p1 -b .web-devices-timeout
# Add failover backend (bug #1689209)
%patch19 -p1 -b .failover
%patch12 -p1 -b .failover
# Added IEEE 1284 Device ID for a Dymo device (bug #747866).
%patch13 -p1 -b .dymo-deviceid
%if %{lspp}
# LSPP support.
%patch100 -p1 -b .lspp
%endif
# Log extra debugging information if no filters are available.
%patch20 -p1 -b .filter-debug
# Added IEEE 1284 Device ID for a Dymo device (bug #747866).
%patch21 -p1 -b .dymo-deviceid
# 1822154 - cups.service doesn't execute automatically on request
%patch22 -p1 -b .autostart-when-enabled
%patch23 -p1 -b .print-color-mode
%patch24 -p1 -b .ppdleak
%patch25 -p1 -b .rastertopwg-crash
# job for disconnected devices are processing for eternity
# https://github.com/apple/cups/pull/5782
%patch26 -p1 -b .etimedout
%patch27 -p1 -b .webui-uri
%patch28 -p1 -b .ipptool-mdns-uri
%patch29 -p1 -b .manual-copies
%patch30 -p1 -b .printer-alert
%patch31 -p1 -b .avahi-leak
# if cupsd is set to log into /var/log/cups, then 'MaxLogSize 0' needs to be
# in cupsd.conf to disable cupsd logrotate functionality and use logrotated
sed -i -e '1iMaxLogSize 0' conf/cupsd.conf.in
# Log to the system journal by default (bug #1078781, bug #1519331).
sed -i -e 's,^ErrorLog .*$,ErrorLog syslog,' conf/cups-files.conf.in
sed -i -e 's,^AccessLog .*$,AccessLog syslog,' conf/cups-files.conf.in
sed -i -e 's,^PageLog .*,PageLog syslog,' conf/cups-files.conf.in
# Add comment text mentioning syslog is systemd journal (bug #1358589)
sed -i -e 's,\"syslog\",\"syslog\" \(syslog means systemd journal by default\),' conf/cups-files.conf.in
# Add group wheel to SystemGroups (bug #1405669)
sed -i -e 's,^SystemGroup .*$, SystemGroup sys root wheel,' conf/cups-files.conf.in
# Let's look at the compilation command lines.
perl -pi -e "s,^.SILENT:,," Makedefs.in
f=CREDITS.md
mv "$f" "$f"~
iconv -f MACINTOSH -t UTF-8 "$f"~ > "$f"
rm -f "$f"~
# remove this once we don't have any patches changing configure stuff
aclocal -I config-scripts
autoconf -f -I config-scripts
@ -398,6 +292,7 @@ export CFLAGS="$RPM_OPT_FLAGS -fstack-protector-all -DLDAP_DEPRECATED=1"
--with-access-log-level=actions \
--enable-page-logging \
--with-rundir=%{_rundir}/cups \
--enable-sync-on-close \
localedir=%{_datadir}/locale
# If we got this far, all prerequisite libraries must be here.
@ -433,21 +328,12 @@ mv lpc.8 lpc-cups.8
popd
%endif
mv %{buildroot}%{_unitdir}/org.cups.cupsd.path %{buildroot}%{_unitdir}/cups.path
mv %{buildroot}%{_unitdir}/org.cups.cupsd.service %{buildroot}%{_unitdir}/cups.service
mv %{buildroot}%{_unitdir}/org.cups.cupsd.socket %{buildroot}%{_unitdir}/cups.socket
mv %{buildroot}%{_unitdir}/org.cups.cups-lpd.socket %{buildroot}%{_unitdir}/cups-lpd.socket
mv %{buildroot}%{_unitdir}/org.cups.cups-lpd@.service %{buildroot}%{_unitdir}/cups-lpd@.service
/bin/sed -i -e "s,org.cups.cupsd,cups,g" %{buildroot}%{_unitdir}/cups.service
mkdir -p %{buildroot}%{_datadir}/pixmaps %{buildroot}%{_sysconfdir}/X11/sysconfig %{buildroot}%{_sysconfdir}/X11/applnk/System %{buildroot}%{_sysconfdir}/logrotate.d
mkdir -p %{buildroot}%{_datadir}/pixmaps %{buildroot}%{_sysconfdir}/X11/sysconfig %{buildroot}%{_sysconfdir}/X11/applnk/System
install -p -m 644 %{SOURCE1} %{buildroot}%{_datadir}/pixmaps
install -p -m 644 %{SOURCE2} %{buildroot}%{_sysconfdir}/logrotate.d/cups
install -p -m 755 %{SOURCE3} %{buildroot}%{cups_serverbin}/backend/ncp
# Ship an rpm macro for where to put driver executables.
mkdir -p %{buildroot}%{_rpmconfigdir}/macros.d
install -m 0644 %{SOURCE4} %{buildroot}%{_rpmconfigdir}/macros.d
install -m 0644 %{SOURCE2} %{buildroot}%{_rpmconfigdir}/macros.d
# Ship a printers.conf file, and a client.conf file. That way, they get
# their SELinux file contexts set correctly.
@ -469,8 +355,8 @@ rm -rf %{buildroot}%{_datadir}/cups/banners
rm -f %{buildroot}%{_datadir}/cups/data/testprint
# install /usr/lib/tmpfiles.d/cups.conf (bug #656566, bug #893834)
mkdir -p ${RPM_BUILD_ROOT}%{_tmpfilesdir}
cat > ${RPM_BUILD_ROOT}%{_tmpfilesdir}/cups.conf <<EOF
mkdir -p %{buildroot}%{_tmpfilesdir}
cat > %{buildroot}%{_tmpfilesdir}/cups.conf <<EOF
# See tmpfiles.d(5) for details
d %{_rundir}/cups 0755 root lp -
@ -480,7 +366,7 @@ d /var/spool/cups/tmp - - - 30d
EOF
# /usr/lib/tmpfiles.d/cups-lp.conf (bug #812641)
cat > ${RPM_BUILD_ROOT}%{_tmpfilesdir}/cups-lp.conf <<EOF
cat > %{buildroot}%{_tmpfilesdir}/cups-lp.conf <<EOF
# Legacy parallel port character device nodes, to trigger the
# auto-loading of the kernel module on access.
#
@ -492,6 +378,14 @@ c /dev/lp2 0660 root lp - 6:2
c /dev/lp3 0660 root lp - 6:3
EOF
# create server.conf into cups.service.d directory. The file is needed
# to automatically start cups.service during startup if enabled
mkdir -p %{buildroot}%{_unitdir}/cups.service.d
cat > %{buildroot}%{_unitdir}/cups.service.d/server.conf <<EOF
[Install]
WantedBy=multi-user.target
EOF
find %{buildroot} -type f -o -type l | sed '
s:.*\('%{_datadir}'/\)\([^/_]\+\)\(.*\.po$\):%lang(\2) \1\2\3:
/^%lang(C)/d
@ -501,18 +395,6 @@ s:.*\('%{_datadir}'/\)\([^/_]\+\)\(.*\.po$\):%lang(\2) \1\2\3:
%post
%systemd_post %{name}.path %{name}.socket %{name}.service
# Remove old-style certs directory; new-style is /var/run
# (see bug #194581 for why this is necessary).
rm -rf %{_sysconfdir}/cups/certs
rm -f %{_localstatedir}/cache/cups/*.ipp %{_localstatedir}/cache/cups/*.cache
# Previous migration script unnecessarily put PageLogFormat into cups-files.conf
# (see bug #1148995)
FILE=%{_sysconfdir}/cups/cups-files.conf
for keyword in PageLogFormat; do
/bin/sed -i -e "s,^$keyword,#$keyword,i" "$FILE" || :
done
# Because of moving logs to journal, we need to create placeholder files
# at /var/log/cups for users, whose are going to install CUPS on new OS
# machine with info message
@ -548,12 +430,6 @@ do
done
%endif
# needed for #1822154 for upgrade path, remove in newer releases
if [ -e /etc/systemd/system/printer.target.wants/cups.service ]
then
%{_bindir}/systemctl enable cups.service > /dev/null 2>&1
fi
exit 0
%post client
@ -598,7 +474,7 @@ exit 0
exit 0
%postun
# ignore the messages due #1614751 (systemd bug) and #1897023 (CUPS unit file design)
# ignore the messages due #1614751 (systemd bug)
%systemd_postun_with_restart %{name}.path %{name}.socket %{name}.service > /dev/null 2>&1
exit 0
@ -616,32 +492,43 @@ rm -f %{cups_serverbin}/backend/smb
%files -f %{name}.lang
%doc README.md CREDITS.md CHANGES.md
%dir %attr(0755,root,lp) %{_sysconfdir}/cups
%dir %attr(0755,root,lp) %{_rundir}/cups
%dir %attr(0511,lp,sys) %{_rundir}/cups/certs
%{_tmpfilesdir}/cups.conf
%{_tmpfilesdir}/cups-lp.conf
%verify(not md5 size mtime) %config(noreplace) %attr(0640,root,lp) %{_sysconfdir}/cups/cupsd.conf
%attr(0640,root,lp) %{_sysconfdir}/cups/cupsd.conf.default
%verify(not md5 size mtime) %config(noreplace) %attr(0640,root,lp) %{_sysconfdir}/cups/cups-files.conf
%attr(0640,root,lp) %{_sysconfdir}/cups/cups-files.conf.default
%verify(not md5 size mtime) %config(noreplace) %attr(0644,root,lp) %{_sysconfdir}/cups/client.conf
%verify(not md5 size mtime) %config(noreplace) %attr(0600,root,lp) %{_sysconfdir}/cups/classes.conf
%verify(not md5 size mtime) %config(noreplace) %attr(0600,root,lp) %{_sysconfdir}/cups/printers.conf
%verify(not md5 size mtime) %config(noreplace) %attr(0644,root,lp) %{_sysconfdir}/cups/snmp.conf
%attr(0640,root,lp) %{_sysconfdir}/cups/snmp.conf.default
%verify(not md5 size mtime) %config(noreplace) %attr(0640,root,lp) %{_sysconfdir}/cups/subscriptions.conf
%verify(not md5 size mtime) %config(noreplace) %attr(0644,root,lp) %{_sysconfdir}/cups/lpoptions
%dir %attr(0755,root,lp) %{_sysconfdir}/cups/ppd
%dir %attr(0700,root,lp) %{_sysconfdir}/cups/ssl
%config(noreplace) %{_sysconfdir}/pam.d/cups
%config(noreplace) %{_sysconfdir}/logrotate.d/cups
%{_bindir}/cupstestppd
%{_bindir}/ppd*
%{_sbindir}/*
# client subpackage
%exclude %{_sbindir}/lpc.cups
%dir %{cups_serverbin}/daemon
%{cups_serverbin}/daemon/cups-deviced
%{cups_serverbin}/daemon/cups-driverd
%{cups_serverbin}/daemon/cups-exec
%{cups_serverbin}/backend/*
%{cups_serverbin}/cgi-bin
%{cups_serverbin}/filter/*
%{cups_serverbin}/monitor
%{cups_serverbin}/notifier
%{_datadir}/cups/drv/sample.drv
%{_datadir}/cups/examples
%{_datadir}/cups/mime/mime.types
%{_datadir}/cups/mime/mime.convs
%{_datadir}/cups/ppdc/*.defs
%{_datadir}/cups/ppdc/*.h
%dir %{_datadir}/cups/templates
%{_datadir}/cups/templates/*.tmpl
%dir %{_datadir}/cups/templates/de
%{_datadir}/cups/templates/de/*.tmpl
%dir %{_datadir}/cups/templates/es
%{_datadir}/cups/templates/es/*.tmpl
%dir %{_datadir}/cups/templates/fr
%{_datadir}/cups/templates/fr/*.tmpl
%dir %{_datadir}/cups/templates/ja
%{_datadir}/cups/templates/ja/*.tmpl
%dir %{_datadir}/cups/templates/pt_BR
%{_datadir}/cups/templates/pt_BR/*.tmpl
%dir %{_datadir}/cups/templates/ru
%{_datadir}/cups/templates/ru/*.tmpl
%dir %{_datadir}/%{name}/usb
%{_datadir}/%{name}/usb/org.cups.usb-quirks
%dir %{_datadir}/%{name}/www
%dir %{_datadir}/%{name}/www/de
%dir %{_datadir}/%{name}/www/es
%dir %{_datadir}/%{name}/www/ja
%dir %{_datadir}/%{name}/www/pt_BR
%dir %{_datadir}/%{name}/www/ru
%{_datadir}/%{name}/www/images
%{_datadir}/%{name}/www/*.css
# 1658673 - html files cannot be docs, because CUPS web ui will not have
@ -656,22 +543,15 @@ rm -f %{cups_serverbin}/backend/smb
%{_datadir}/%{name}/www/ru/index.html
%{_datadir}/%{name}/www/pt_BR/index.html
%{_datadir}/%{name}/www/apple-touch-icon.png
%dir %{_datadir}/%{name}/usb
%{_datadir}/%{name}/usb/org.cups.usb-quirks
%{_unitdir}/%{name}.service
%{_unitdir}/%{name}.socket
%{_unitdir}/%{name}.path
%{_bindir}/cupstestppd
%{_bindir}/ppd*
%{cups_serverbin}/backend/*
%{cups_serverbin}/cgi-bin
%dir %{cups_serverbin}/daemon
%{cups_serverbin}/daemon/cups-deviced
%{cups_serverbin}/daemon/cups-driverd
%{cups_serverbin}/daemon/cups-exec
%{cups_serverbin}/notifier
%{cups_serverbin}/filter/*
%{cups_serverbin}/monitor
%dir %{_datadir}/%{name}/www/de
%dir %{_datadir}/%{name}/www/es
%dir %{_datadir}/%{name}/www/ja
%dir %{_datadir}/%{name}/www/pt_BR
%dir %{_datadir}/%{name}/www/ru
%{_datadir}/pixmaps/cupsprinter.png
%dir %attr(1770,root,lp) %{_localstatedir}/spool/cups/tmp
%dir %attr(0710,root,lp) %{_localstatedir}/spool/cups
%dir %attr(0755,lp,sys) %{_localstatedir}/log/cups
%{_mandir}/man[1578]/*
# client subpackage
%exclude %{_mandir}/man1/lp*.1.gz
@ -684,41 +564,42 @@ rm -f %{cups_serverbin}/backend/smb
%exclude %{_mandir}/man5/ipptoolfile.5.gz
# lpd subpackage
%exclude %{_mandir}/man8/cups-lpd.8.gz
%{_sbindir}/*
# client subpackage
%exclude %{_sbindir}/lpc.cups
%dir %{_datadir}/cups/templates
%dir %{_datadir}/cups/templates/de
%dir %{_datadir}/cups/templates/es
%dir %{_datadir}/cups/templates/fr
%dir %{_datadir}/cups/templates/ja
%dir %{_datadir}/cups/templates/ru
%dir %{_datadir}/cups/templates/pt_BR
%{_datadir}/cups/templates/*.tmpl
%{_datadir}/cups/templates/de/*.tmpl
%{_datadir}/cups/templates/fr/*.tmpl
%{_datadir}/cups/templates/es/*.tmpl
%{_datadir}/cups/templates/ja/*.tmpl
%{_datadir}/cups/templates/ru/*.tmpl
%{_datadir}/cups/templates/pt_BR/*.tmpl
%dir %attr(1770,root,lp) %{_localstatedir}/spool/cups/tmp
%dir %attr(0710,root,lp) %{_localstatedir}/spool/cups
%dir %attr(0755,lp,sys) %{_localstatedir}/log/cups
%{_datadir}/pixmaps/cupsprinter.png
# printerapp
%exclude %{_mandir}/man1/ippeveprinter.1.gz
%exclude %{_mandir}/man7/ippevepcl.7.gz
%exclude %{_mandir}/man7/ippeveps.7.gz
%dir %attr(0755,root,lp) %{_rundir}/cups
%dir %attr(0511,lp,sys) %{_rundir}/cups/certs
%dir %attr(0755,root,lp) %{_sysconfdir}/cups
%attr(0640,root,lp) %{_sysconfdir}/cups/cupsd.conf.default
%verify(not md5 size mtime) %config(noreplace) %attr(0640,root,lp) %{_sysconfdir}/cups/cupsd.conf
%verify(not md5 size mtime) %config(noreplace) %attr(0640,root,lp) %{_sysconfdir}/cups/cups-files.conf
%attr(0640,root,lp) %{_sysconfdir}/cups/cups-files.conf.default
%verify(not md5 size mtime) %config(noreplace) %attr(0644,root,lp) %{_sysconfdir}/cups/client.conf
%verify(not md5 size mtime) %config(noreplace) %attr(0600,root,lp) %{_sysconfdir}/cups/classes.conf
%verify(not md5 size mtime) %config(noreplace) %attr(0600,root,lp) %{_sysconfdir}/cups/printers.conf
%verify(not md5 size mtime) %config(noreplace) %attr(0644,root,lp) %{_sysconfdir}/cups/snmp.conf
%attr(0640,root,lp) %{_sysconfdir}/cups/snmp.conf.default
%verify(not md5 size mtime) %config(noreplace) %attr(0640,root,lp) %{_sysconfdir}/cups/subscriptions.conf
%verify(not md5 size mtime) %config(noreplace) %attr(0644,root,lp) %{_sysconfdir}/cups/lpoptions
%dir %attr(0755,root,lp) %{_sysconfdir}/cups/ppd
%dir %attr(0700,root,lp) %{_sysconfdir}/cups/ssl
%config(noreplace) %{_sysconfdir}/dbus-1/system.d/cups.conf
%{_datadir}/cups/drv/sample.drv
%{_datadir}/cups/examples
%{_datadir}/cups/mime/mime.types
%{_datadir}/cups/mime/mime.convs
%{_datadir}/cups/ppdc/*.defs
%{_datadir}/cups/ppdc/*.h
%config(noreplace) %{_sysconfdir}/pam.d/cups
%{_tmpfilesdir}/cups.conf
%{_tmpfilesdir}/cups-lp.conf
%dir %{_unitdir}/%{name}.service.d
%attr(0644, root, root)%{_unitdir}/%{name}.service.d/server.conf
%attr(0644, root, root)%{_unitdir}/%{name}.service
%attr(0644, root, root)%{_unitdir}/%{name}.socket
%attr(0644, root, root)%{_unitdir}/%{name}.path
%files client
%{_sbindir}/lpc.cups
%{_bindir}/cancel*
%{_bindir}/lp*
%{_mandir}/man1/lp*.1.gz
%{_sbindir}/lpc.cups
%{_mandir}/man1/cancel-cups.1.gz
%{_mandir}/man1/lp*.1.gz
%{_mandir}/man8/lpc-cups.8.gz
%files libs
@ -742,20 +623,20 @@ rm -f %{cups_serverbin}/backend/smb
%files devel
%{_bindir}/cups-config
%{_libdir}/*.so
%{_includedir}/cups
%{_libdir}/*.so
%{_mandir}/man1/cups-config.1.gz
%{_rpmconfigdir}/macros.d/macros.cups
%files lpd
%{_unitdir}/cups-lpd.socket
%{_unitdir}/cups-lpd@.service
%{cups_serverbin}/daemon/cups-lpd
%{_mandir}/man8/cups-lpd.8.gz
%attr(0644, root, root)%{_unitdir}/cups-lpd.socket
%attr(0644, root, root)%{_unitdir}/cups-lpd@.service
%files ipptool
%{_bindir}/ipptool
%{_bindir}/ippfind
%{_bindir}/ipptool
%dir %{_datadir}/cups/ipptool
%{_datadir}/cups/ipptool/*
%{_mandir}/man1/ipptool.1.gz
@ -768,10 +649,33 @@ rm -f %{cups_serverbin}/backend/smb
%{cups_serverbin}/command/ippeveps
%{_mandir}/man1/ippeveprinter.1.gz
%{_mandir}/man7/ippevepcl.7.gz
%{_mandir}/man7/ippeveps.7.gz
%changelog
* Mon Nov 30 2020 Zdenek Dohnal <zdohnal@redhat.com> - 1:2.3.3op1-1
- 2.3.3op1
* Fri Nov 27 2020 Zdenek Dohnal <zdohnal@redhat.com> - 1:2.3.3-20
- make unit files writeable by root
- remove %%post scriptlet - it is covered by drop-in now
- remove cups-filter-debug.patch
- backport cups-synconclose.patch from upstream
* Thu Nov 26 2020 Zdenek Dohnal <zdohnal@redhat.com> - 1:2.3.3-20
- remove downstream autostart patch - use systemd drop-in
* Tue Nov 24 2020 Zdenek Dohnal <zdohnal@redhat.com> - 1:2.3.3-20
- fix memory leak during device discovery
- remove logrotate patches and support - journal is now default
- remove eggcups patch - seems to cause no harm
- journal is in Fedora for long time - no need to mention it is Fedora syslog
- fix packaging of printerapp manpages
- wheel is now in system groups by default
- remove old scripts for older migrations
- CREDITS is now in markdown format, so we don't need to convert
- fix requires on nss-mdns for cups-printerapp
- take SNMP OID from upstream
- rename unit files and update their patches
* Thu Nov 12 2020 Zdenek Dohnal <zdohnal@redhat.com> - 1:2.3.3-19
- 1897023 - Cups service restart sequence during upgrade incorrect

View File

@ -1,51 +0,0 @@
#!/bin/sh
# This is a modified version of 'ncpprint'. It can now be used as a CUPS
# backend.
# Modifications:
# Copyright (C) 2002 Red Hat, inc
# Copyright (C) 2002 Tim Waugh
# Before modification: shipped as /usr/share/printconf/util/ncpprint
if [ -z "$*" ]
then
# This is where we would enumerate all the URIs we support.
# Patches welcome.
exit 0
fi
FILE=$6
if [ -z "$FILE" ]
then
FILE=-
fi
# $DEVICE_URI is 'ncp://[user:password@]server/queue'
URI=${DEVICE_URI#*://}
queue=${URI#*/}
URI=${URI%/$queue}
server=${URI#*@}
URI=${URI%$server}
URI=${URI%@}
if [ -n "$URI" ]
then
user=${URI%:*}
URI=${URI#$user}
password=${URI#:}
fi
#echo user: ${user-(none)}
#echo password: ${password-(none)}
#echo server: $server
#echo queue: $queue
if [ -n "$user" ]
then
if [ -n "$password" ]
then
/usr/bin/nprint -S "$server" -q "$queue" -U "$user" -P "$password" -N "$FILE" 2>/dev/null
else
/usr/bin/nprint -S "$server" -q "$queue" -U "$user" -n -N "$FILE" 2>/dev/null
fi
else
/usr/bin/nprint -S "$server" -q "$queue" -N "$FILE" 2>/dev/null
fi

View File

@ -1 +1 @@
SHA512 (cups-2.3.3-source.tar.gz) = 7d6f4a01794c5599cc71525778ea785fd17271c31ac146a56e8fc374a88f99e4035d018dae48e37e541455e9cc93b302e892b2e93ec558c1b4bfc46dad68c92d
SHA512 (cups-2.3.3op1-source.tar.gz) = 89949b4190288d5464f425cbff6b854e9da96ba3071e4e0d595ad581797b2db4724f49d884f3ea43e372ed4d0faec72839b0b7182cdde13b96f2824d619a4843