Compare commits

...

No commits in common. 'c9' and 'i10cs' have entirely different histories.
c9 ... i10cs

@ -1 +1 @@
b4096e5aa17d8e398b5cc352490476175af508fd SOURCES/cups-filters-1.28.7.tar.xz
8afcf955472351e23337255c7f9b2cffec7c3d8e SOURCES/cups-filters-2.0.0.tar.gz

2
.gitignore vendored

@ -1 +1 @@
SOURCES/cups-filters-1.28.7.tar.xz
SOURCES/cups-filters-2.0.0.tar.gz

@ -1,29 +0,0 @@
diff --git a/utils/cups-browsed.c b/utils/cups-browsed.c
index d4396d7..6dba2ed 100644
--- a/utils/cups-browsed.c
+++ b/utils/cups-browsed.c
@@ -8793,6 +8793,10 @@ gboolean update_cups_queues(gpointer unused) {
IPP_PRINTER_IDLE);
/* ... and accepting jobs */
ippAddBoolean(request, IPP_TAG_PRINTER, "printer-is-accepting-jobs", 1);
+ // Location (only if the remote server actually provides a location string)
+ if (p->location && p->location[0])
+ ippAddString(request, IPP_TAG_PRINTER, IPP_TAG_TEXT,
+ "printer-location", NULL, p->location);
num_options = 0;
options = NULL;
/* Device URI: ipp(s)://<remote host>:631/printers/<remote queue>
@@ -8808,6 +8812,13 @@ gboolean update_cups_queues(gpointer unused) {
num_options = cupsAddOption(p->options[i].name,
p->options[i].value,
num_options, &options);
+
+ // Description (only if the remote server actually provides a description
+ // string)
+ if (p->info && p->info[0])
+ num_options = cupsAddOption("printer-info", p->info,
+ num_options, &options);
+
/* Encode option list into IPP attributes */
cupsEncodeOptions2(request, num_options, options, IPP_TAG_OPERATION);
cupsEncodeOptions2(request, num_options, options, IPP_TAG_PRINTER);

@ -1,19 +0,0 @@
diff --git a/cupsfilters/ipp.c b/cupsfilters/ipp.c
index 2c3b740..6b2b784 100644
--- a/cupsfilters/ipp.c
+++ b/cupsfilters/ipp.c
@@ -377,6 +377,14 @@ get_printer_attributes5(http_t *http_printer,
total_attrs);
ippDelete(response);
} else {
+
+ // Check if the response is valid
+ if (!ippValidateAttributes(response))
+ {
+ ippDelete(response);
+ response = NULL;
+ }
+
/* Suitable response, we are done */
if (have_http == 0) httpClose(http_printer);
if (uri) free(uri);

@ -1,29 +0,0 @@
From 144322be6e06ff12f101fc35e472d62978861e28 Mon Sep 17 00:00:00 2001
From: Till Kamppeter <till.kamppeter@gmail.com>
Date: Thu, 15 Apr 2021 14:26:44 +0200
Subject: [PATCH] cups-browsed: Always save "...-default" option entries from
printers.conf
(cherry picked from commit cdd61132e1719a88dd8006c65e8e260c1aaa02e4)
---
utils/cups-browsed.c | 4 +---
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/utils/cups-browsed.c b/utils/cups-browsed.c
index bffd1e09..0c335055 100644
--- a/utils/cups-browsed.c
+++ b/utils/cups-browsed.c
@@ -5648,9 +5648,7 @@ record_printer_options(const char *printer) {
strcasecmp(key + strlen(key) - strlen(*ptr) + 1, *ptr + 1) == 0))
break;
if (*ptr != NULL) {
- if (strcasecmp(key, CUPS_BROWSED_DEST_PRINTER "-default") != 0 &&
- (ppdname == NULL ||
- strncasecmp(key + strlen(key) - 8, "-default", 8))) {
+ if (strcasecmp(key, CUPS_BROWSED_DEST_PRINTER "-default") != 0) {
ippAttributeString(attr, buf, sizeof(buf));
buf[sizeof(buf) - 1] = '\0';
c = buf;
--
2.30.2

@ -1,128 +0,0 @@
From d90a4fc57b00b4a1f6c196bcb96025251b555dd9 Mon Sep 17 00:00:00 2001
From: zdohnal <zdohnal@redhat.com>
Date: Fri, 18 Jun 2021 12:27:53 +0200
Subject: [PATCH] cups-browsed.c: Make NotifLeaseDuration configurable and
renew after half the lease duration not 60 sec before end
1) NotifLeaseDuration directive for cups-browsed.conf - it will make
lease duration for notifications configurable by users. IMO it is not
useful for regular users, but it is helpful during sanity testing
(for verifying that we actually renew the subscription when time
comes). The current hardcoded 1 day is unusuable for that :( .
I implemented the lowest threshold to 300s to prevent a possible DoS.
2) Subscription renewal is set to happen in the middle of NotifLeaseDuration,
not one minute before lease expiration. This was a problem on busy servers,
where cups-browsed was busy and wasn't able to renew the subscription
before cupsd removed it. Then if some jobs had come before the subscription
was created again, the queue got disabled. The proposed approach is based
on behavior of DHCP.
---
utils/cups-browsed.c | 17 +++++++++++++----
utils/cups-browsed.conf.5 | 11 +++++++++++
utils/cups-browsed.conf.in | 8 ++++++++
3 files changed, 32 insertions(+), 4 deletions(-)
diff --git a/utils/cups-browsed.c b/utils/cups-browsed.c
index 61d6c551..2d367c59 100644
--- a/utils/cups-browsed.c
+++ b/utils/cups-browsed.c
@@ -142,7 +142,6 @@ static int ldap_rebind_proc(LDAP *RebindLDAPHandle,
#define TIMEOUT_REMOVE -1
#define TIMEOUT_CHECK_LIST 2
-#define NOTIFY_LEASE_DURATION (24 * 60 * 60)
#define CUPS_DBUS_NAME "org.cups.cupsd.Notifier"
#define CUPS_DBUS_PATH "/org/cups/cupsd/Notifier"
#define CUPS_DBUS_INTERFACE "org.cups.cupsd.Notifier"
@@ -508,6 +507,7 @@ static int autoshutdown_timeout = 30;
static autoshutdown_inactivity_type_t autoshutdown_on = NO_QUEUES;
static guint autoshutdown_exec_id = 0;
static const char *default_printer = NULL;
+static unsigned int notify_lease_duration = 86400;
static int debug_stderr = 0;
static int debug_logfile = 0;
@@ -5017,7 +5017,7 @@ create_subscription ()
ippAddString (req, IPP_TAG_SUBSCRIPTION, IPP_TAG_URI,
"notify-recipient-uri", NULL, "dbus://");
ippAddInteger (req, IPP_TAG_SUBSCRIPTION, IPP_TAG_INTEGER,
- "notify-lease-duration", NOTIFY_LEASE_DURATION);
+ "notify-lease-duration", notify_lease_duration);
resp = cupsDoRequest (conn, req, "/");
if (!resp || cupsLastError() != IPP_STATUS_OK) {
@@ -5060,7 +5060,7 @@ renew_subscription (int id)
ippAddString (req, IPP_TAG_SUBSCRIPTION, IPP_TAG_URI,
"notify-recipient-uri", NULL, "dbus://");
ippAddInteger (req, IPP_TAG_SUBSCRIPTION, IPP_TAG_INTEGER,
- "notify-lease-duration", NOTIFY_LEASE_DURATION);
+ "notify-lease-duration", notify_lease_duration);
resp = cupsDoRequest (conn, req, "/");
if (!resp || cupsLastError() != IPP_STATUS_OK) {
@@ -11857,6 +11857,15 @@ read_configuration (const char *filename)
} else
debug_printf("Invalid %s value: %d\n",
line, t);
+ } else if (!strcasecmp(line, "NotifLeaseDuration") && value) {
+ int t = atoi(value);
+ if (t >= 300) {
+ notify_lease_duration = t;
+ debug_printf("Set %s to %d sec.\n",
+ line, t);
+ } else
+ debug_printf("Invalid %s value: %d\n",
+ line, t);
} else if (!strcasecmp(line, "HttpMaxRetries") && value) {
int t = atoi(value);
if (t > 0) {
@@ -12728,7 +12737,7 @@ int main(int argc, char*argv[]) {
/* Subscribe to CUPS' D-Bus notifications and create a proxy to receive
the notifications */
subscription_id = create_subscription ();
- g_timeout_add_seconds (NOTIFY_LEASE_DURATION - 60,
+ g_timeout_add_seconds (notify_lease_duration / 2,
renew_subscription_timeout,
&subscription_id);
cups_notifier = cups_notifier_proxy_new_for_bus_sync (G_BUS_TYPE_SYSTEM,
diff --git a/utils/cups-browsed.conf.5 b/utils/cups-browsed.conf.5
index c47f8e8d..263f0843 100644
--- a/utils/cups-browsed.conf.5
+++ b/utils/cups-browsed.conf.5
@@ -966,6 +966,17 @@ shutdown.
.fam T
.fi
+NotifLeaseDuration defines how long the D-BUS subscription created by cups-browsed
+in cupsd will last before cupsd cancels it. The default value is 1 day
+in seconds - 86400. The subscription renewal is set to happen after half of
+NotifLeaseDuration passed. The D-BUS notifications are used for watching over queues
+and doing specific actions when a D-BUS notification comes.
+.PP
+.nf
+.fam C
+ NotifLeaseDuration 86400
+.fam T
+.fi
.SH SEE ALSO
\fBcups-browsed\fP(8)
diff --git a/utils/cups-browsed.conf.in b/utils/cups-browsed.conf.in
index 3cc4ebb1..ffdf83d6 100644
--- a/utils/cups-browsed.conf.in
+++ b/utils/cups-browsed.conf.in
@@ -741,3 +741,11 @@ BrowseRemoteProtocols @BROWSEREMOTEPROTOCOLS@
# on the size of the file.
# DebugLogFileSize 300
+
+# NotifLeaseDuration defines how long the D-BUS subscription created by cups-browsed
+# in cupsd will last before cupsd cancels it. The default value is 1 day
+# in seconds - 86400. The subscription renewal is set to happen after half of
+# NotifLeaseDuration passed. The D-BUS notifications are used for watching over queues
+# and doing specific actions when a D-BUS notification comes.
+
+# NotifLeaseDuration 86400
--
2.31.1

@ -1,26 +0,0 @@
From 022c34fedb66f706b2ab82d7506d5b5b1fa18e1f Mon Sep 17 00:00:00 2001
From: Bryan Mason <bmason@redhat.com>
Date: Fri, 16 Jul 2021 11:19:42 -0700
Subject: [PATCH] libcupsfilter: Fix page range like "10-" in pdftopdf()
filter function
---
filter/pdftopdf/pdftopdf.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/filter/pdftopdf/pdftopdf.cc b/filter/pdftopdf/pdftopdf.cc
index 5725e199..979644f1 100644
--- a/filter/pdftopdf/pdftopdf.cc
+++ b/filter/pdftopdf/pdftopdf.cc
@@ -256,7 +256,7 @@ static void parseRanges(const char *range,IntervalSet &ret) // {{{
} else {
upper=strtol(range,(char **)&range,10);
if (upper>=2147483647) {
- ret.add(1);
+ ret.add(lower);
} else {
ret.add(lower,upper+1);
}
--
2.31.1

@ -1,107 +0,0 @@
diff --git a/backend/beh.c b/backend/beh.c
index 225fd27..5e9cee0 100644
--- a/backend/beh.c
+++ b/backend/beh.c
@@ -22,6 +22,7 @@
#include "backend-private.h"
#include <cups/array.h>
#include <ctype.h>
+#include <sys/wait.h>
/*
* Local globals...
@@ -213,10 +214,14 @@ call_backend(char *uri, /* I - URI of final destination */
char **argv, /* I - Command-line arguments */
char *filename) { /* I - File name of input data */
const char *cups_serverbin; /* Location of programs */
+ char *backend_argv[8]; // Arguments for called CUPS backend
char scheme[1024], /* Scheme from URI */
*ptr, /* Pointer into scheme */
- cmdline[65536]; /* Backend command line */
- int retval;
+ backend_path[2048]; // Backend path
+ int pid,
+ wait_pid,
+ wait_status,
+ retval = 0;
/*
* Build the backend command line...
@@ -235,16 +240,19 @@ call_backend(char *uri, /* I - URI of final destination */
fprintf(stderr,
"ERROR: beh: Direct output into a file not supported.\n");
exit (CUPS_BACKEND_FAILED);
- } else
- snprintf(cmdline, sizeof(cmdline),
- "%s/backend/%s '%s' '%s' '%s' '%s' '%s' %s",
- cups_serverbin, scheme, argv[1], argv[2], argv[3],
- /* Apply number of copies only if beh was called with a
- file name and not with the print data in stdin, as
- backends should handle copies only if they are called
- with a file name */
- (argc == 6 ? "1" : argv[4]),
- argv[5], filename);
+ }
+
+ backend_argv[0] = uri;
+ backend_argv[1] = argv[1];
+ backend_argv[2] = argv[2];
+ backend_argv[3] = argv[3];
+ backend_argv[4] = (argc == 6 ? "1" : argv[4]);
+ backend_argv[5] = argv[5];
+ backend_argv[6] = filename;
+ backend_argv[7] = NULL;
+
+ snprintf(backend_path, sizeof(backend_path),
+ "%s/backend/%s", cups_serverbin, scheme);
/*
* Overwrite the device URI and run the actual backend...
@@ -253,17 +261,41 @@ call_backend(char *uri, /* I - URI of final destination */
setenv("DEVICE_URI", uri, 1);
fprintf(stderr,
- "DEBUG: beh: Executing backend command line \"%s\"...\n",
- cmdline);
+ "DEBUG: beh: Executing backend command line \"%s '%s' '%s' '%s' '%s' '%s'%s%s\"...\n",
+ backend_path, backend_argv[1], backend_argv[2], backend_argv[3],
+ backend_argv[4], backend_argv[5],
+ (backend_argv[6] && backend_argv[6][0] ? " " : ""),
+ (backend_argv[6] && backend_argv[6][0] ? backend_argv[6] : ""));
fprintf(stderr,
"DEBUG: beh: Using device URI: %s\n",
uri);
- retval = system(cmdline) >> 8;
+ if ((pid = fork()) == 0)
+ {
+ retval = execv(backend_path, backend_argv);
+
+ if (retval == -1)
+ fprintf(stderr, "ERROR: Unable to execute backend: %s\n",
+ strerror(errno));
+ exit (CUPS_BACKEND_FAILED);
+ }
+ else if (pid < 0)
+ {
+ fprintf(stderr, "ERROR: Unable to fork for backend\n");
+ return (CUPS_BACKEND_FAILED);
+ }
+
+ while ((wait_pid = wait(&wait_status)) < 0 && errno == EINTR);
- if (retval == -1)
- fprintf(stderr, "ERROR: Unable to execute backend command line: %s\n",
- strerror(errno));
+ if (wait_pid >= 0 && wait_status)
+ {
+ if (WIFEXITED(wait_status))
+ retval = WEXITSTATUS(wait_status);
+ else if (WTERMSIG(wait_status) != SIGTERM)
+ retval = WTERMSIG(wait_status);
+ else
+ retval = 0;
+ }
return (retval);
}

@ -1,31 +0,0 @@
diff --git a/utils/cups-browsed.c b/utils/cups-browsed.c
index 6dba2ed..a5e5779 100644
--- a/utils/cups-browsed.c
+++ b/utils/cups-browsed.c
@@ -5641,6 +5641,12 @@ record_printer_options(const char *printer) {
printer);
attr = ippFirstAttribute(response);
while (attr) {
+ if (ippGetValueTag(attr) == IPP_TAG_NOVALUE)
+ {
+ attr = ippNextAttribute(response);
+ continue;
+ }
+
key = ippGetName(attr);
for (ptr = attrs_to_record; *ptr; ptr++)
if (strcasecmp(key, *ptr) == 0 ||
@@ -5657,6 +5663,13 @@ record_printer_options(const char *printer) {
memmove(c, c + 1, strlen(c));
if (*c) c ++;
}
+
+ if (strlen(buf) == 0)
+ {
+ attr = ippNextAttribute(response);
+ continue;
+ }
+
debug_printf(" %s=%s\n", key, buf);
p->num_options = cupsAddOption(key, buf, p->num_options,
&(p->options));

@ -1,376 +0,0 @@
diff --git a/cupsfilters/ppdgenerator.c b/cupsfilters/ppdgenerator.c
index 4e16383..1f3a7d8 100644
--- a/cupsfilters/ppdgenerator.c
+++ b/cupsfilters/ppdgenerator.c
@@ -92,6 +92,7 @@ typedef struct _pwg_finishings_s /**** PWG finishings mapping data ****/
static void pwg_ppdize_name(const char *ipp, char *name, size_t namesize);
static void pwg_ppdize_resolution(ipp_attribute_t *attr, int element,
int *xres, int *yres, char *name, size_t namesize);
+static void ppd_put_string(cups_file_t *fp, cups_lang_t *lang, const char *ppd_option, const char *ppd_choice, const char *pwg_msgid);
/*
* '_cupsSetError()' - Set the last PPD generator status-message.
@@ -1581,9 +1582,10 @@ ppdCreateFromIPP2(char *buffer, /* I - Filename buffer */
ipp_t *media_col, /* Media collection */
*media_size; /* Media size collection */
char make[256], /* Make and model */
- *model, /* Model name */
+ *mptr, // Pointer into make and model
ppdname[PPD_MAX_NAME];
/* PPD keyword */
+ const char *model; /* Model name */
int i, j, /* Looping vars */
count = 0, /* Number of values */
bottom, /* Largest bottom margin */
@@ -1663,6 +1665,68 @@ ppdCreateFromIPP2(char *buffer, /* I - Filename buffer */
return (NULL);
}
+ //
+ // Get a sanitized make and model...
+ //
+
+ if ((attr = ippFindAttribute(response, "printer-make-and-model", IPP_TAG_TEXT)) != NULL && ippValidateAttribute(attr))
+ {
+ // Sanitize the model name to only contain PPD-safe characters.
+ strlcpy(make, ippGetString(attr, 0, NULL), sizeof(make));
+
+ for (mptr = make; *mptr; mptr ++)
+ {
+ if (*mptr < ' ' || *mptr >= 127 || *mptr == '\"')
+ {
+ // Truncate the make and model on the first bad character...
+ *mptr = '\0';
+ break;
+ }
+ }
+
+ while (mptr > make)
+ {
+ // Strip trailing whitespace...
+ mptr --;
+ if (*mptr == ' ')
+ *mptr = '\0';
+ }
+
+ if (!make[0])
+ {
+ // Use a default make and model if nothing remains...
+ strlcpy(make, "Unknown", sizeof(make));
+ }
+ }
+ else
+ {
+ // Use a default make and model...
+ strlcpy(make, "Unknown", sizeof(make));
+ }
+
+ if (!strncasecmp(make, "Hewlett Packard ", 16) || !strncasecmp(make, "Hewlett-Packard ", 16))
+ {
+ // Normalize HP printer make and model...
+ model = make + 16;
+ strlcpy(make, "HP", sizeof(make));
+
+ if (!strncasecmp(model, "HP ", 3))
+ model += 3;
+ }
+ else if ((mptr = strchr(make, ' ')) != NULL)
+ {
+ // Separate "MAKE MODEL"...
+ while (*mptr && *mptr == ' ')
+ *mptr++ = '\0';
+
+ model = mptr;
+ }
+ else
+ {
+ // No separate model name...
+ model = "Printer";
+ }
+
/*
* Standard stuff for PPD file...
*/
@@ -1682,24 +1746,6 @@ ppdCreateFromIPP2(char *buffer, /* I - Filename buffer */
ippContainsString(attr, "faxout"))
is_fax = 1;
- if ((attr = ippFindAttribute(response, "printer-make-and-model",
- IPP_TAG_TEXT)) != NULL)
- strlcpy(make, ippGetString(attr, 0, NULL), sizeof(make));
- else if (make_model && make_model[0] != '\0')
- strlcpy(make, make_model, sizeof(make));
- else
- strlcpy(make, "Unknown Printer", sizeof(make));
-
- if (!_cups_strncasecmp(make, "Hewlett Packard ", 16) ||
- !_cups_strncasecmp(make, "Hewlett-Packard ", 16)) {
- model = make + 16;
- strlcpy(make, "HP", sizeof(make));
- }
- else if ((model = strchr(make, ' ')) != NULL)
- *model++ = '\0';
- else
- model = make;
-
cupsFilePrintf(fp, "*Manufacturer: \"%s\"\n", make);
cupsFilePrintf(fp, "*ModelName: \"%s %s\"\n", make, model);
cupsFilePrintf(fp, "*Product: \"(%s %s)\"\n", make, model);
@@ -1796,14 +1842,11 @@ ppdCreateFromIPP2(char *buffer, /* I - Filename buffer */
cupsFilePuts(fp, "*cupsSNMPSupplies: False\n");
cupsFilePuts(fp, "*cupsLanguages: \"en\"\n");
- if ((attr = ippFindAttribute(response, "printer-more-info", IPP_TAG_URI)) !=
- NULL)
+ if ((attr = ippFindAttribute(response, "printer-more-info", IPP_TAG_URI)) != NULL && ippValidateAttribute(attr))
cupsFilePrintf(fp, "*APSupplies: \"%s\"\n", ippGetString(attr, 0, NULL));
- if ((attr = ippFindAttribute(response, "printer-charge-info-uri",
- IPP_TAG_URI)) != NULL)
- cupsFilePrintf(fp, "*cupsChargeInfoURI: \"%s\"\n", ippGetString(attr, 0,
- NULL));
+ if ((attr = ippFindAttribute(response, "printer-charge-info-uri", IPP_TAG_URI)) != NULL && ippValidateAttribute(attr))
+ cupsFilePrintf(fp, "*cupsChargeInfoURI: \"%s\"\n", ippGetString(attr, 0, NULL));
/* Message catalogs for UI strings */
if (opt_strings_catalog == NULL) {
@@ -1811,7 +1854,8 @@ ppdCreateFromIPP2(char *buffer, /* I - Filename buffer */
load_opt_strings_catalog(NULL, opt_strings_catalog);
}
if ((attr = ippFindAttribute(response, "printer-strings-uri",
- IPP_TAG_URI)) != NULL) {
+ IPP_TAG_URI)) != NULL && ippValidateAttribute(attr))
+ {
printer_opt_strings_catalog = optArrayNew();
load_opt_strings_catalog(ippGetString(attr, 0, NULL),
printer_opt_strings_catalog);
@@ -2553,13 +2597,15 @@ ppdCreateFromIPP2(char *buffer, /* I - Filename buffer */
break;
}
if (j >= 0)
- cupsFilePrintf(fp, "*InputSlot %s/%s: \"<</MediaPosition %d>>setpagedevice\"\n",
- ppdname, human_readable, j);
+ {
+ cupsFilePrintf(fp, "*InputSlot %s: \"<</MediaPosition %d>>setpagedevice\"\n", ppdname, j);
+ ppd_put_string(fp, lang, "InputSlot", ppdname, human_readable);
+ }
else
- cupsFilePrintf(fp, "*InputSlot %s%s%s: \"\"\n",
- ppdname,
- (human_readable ? "/" : ""),
- (human_readable ? human_readable : ""));
+ {
+ cupsFilePrintf(fp, "*InputSlot %s%s%s:\"\"\n", ppdname, human_readable ? "/" : "", human_readable ? human_readable : "");
+ ppd_put_string(fp, lang, "InputSlot", ppdname, human_readable);
+ }
}
cupsFilePuts(fp, "*CloseUI: *InputSlot\n");
}
@@ -2743,11 +2789,8 @@ ppdCreateFromIPP2(char *buffer, /* I - Filename buffer */
human_readable = (char *)_cupsLangString(lang, media_types[j][1]);
break;
}
- cupsFilePrintf(fp, "*MediaType %s%s%s: \"<</MediaType(%s)>>setpagedevice\"\n",
- ppdname,
- (human_readable ? "/" : ""),
- (human_readable ? human_readable : ""),
- ppdname);
+ cupsFilePrintf(fp, "*MediaType %s: \"<</MediaType(%s)>>setpagedevice\"\n", ppdname, ppdname);
+ ppd_put_string(fp, lang, "MediaType", ppdname, human_readable);
}
cupsFilePuts(fp, "*CloseUI: *MediaType\n");
}
@@ -3184,10 +3227,8 @@ ppdCreateFromIPP2(char *buffer, /* I - Filename buffer */
human_readable = (char *)_cupsLangString(lang, output_bins[j][1]);
break;
}
- cupsFilePrintf(fp, "*OutputBin %s%s%s: \"\"\n",
- ppdname,
- (human_readable ? "/" : ""),
- (human_readable ? human_readable : ""));
+ cupsFilePrintf(fp, "*OutputBin %s: \"\"\n", ppdname);
+ ppd_put_string(fp, lang, "OutputBin", ppdname, human_readable);
outputorderinfofound = 0;
faceupdown = 1;
firsttolast = 1;
@@ -3425,9 +3466,8 @@ ppdCreateFromIPP2(char *buffer, /* I - Filename buffer */
human_readable = (char *)_cupsLangString(lang, finishings[j][1]);
break;
}
- cupsFilePrintf(fp, "*StapleLocation %s%s%s: \"\"\n", ppd_keyword,
- (human_readable ? "/" : ""),
- (human_readable ? human_readable : ""));
+ cupsFilePrintf(fp, "*StapleLocation %s: \"\"\n", ppd_keyword);
+ ppd_put_string(fp, lang, "StapleLocation", ppd_keyword, human_readable);
cupsFilePrintf(fp, "*cupsIPPFinishings %d/%s: \"*StapleLocation %s\"\n",
value, keyword, ppd_keyword);
}
@@ -3518,9 +3558,8 @@ ppdCreateFromIPP2(char *buffer, /* I - Filename buffer */
human_readable = (char *)_cupsLangString(lang, finishings[j][1]);
break;
}
- cupsFilePrintf(fp, "*FoldType %s%s%s: \"\"\n", ppd_keyword,
- (human_readable ? "/" : ""),
- (human_readable ? human_readable : ""));
+ cupsFilePrintf(fp, "*FoldType %s: \"\"\n", ppd_keyword);
+ ppd_put_string(fp, lang, "FoldType", ppd_keyword, human_readable);
cupsFilePrintf(fp, "*cupsIPPFinishings %d/%s: \"*FoldType %s\"\n",
value, keyword, ppd_keyword);
}
@@ -3618,9 +3657,8 @@ ppdCreateFromIPP2(char *buffer, /* I - Filename buffer */
human_readable = (char *)_cupsLangString(lang, finishings[j][1]);
break;
}
- cupsFilePrintf(fp, "*PunchMedia %s%s%s: \"\"\n", ppd_keyword,
- (human_readable ? "/" : ""),
- (human_readable ? human_readable : ""));
+ cupsFilePrintf(fp, "*PunchMedia %s: \"\"\n", ppd_keyword);
+ ppd_put_string(fp, lang, "PunchMedia", ppd_keyword, human_readable);
cupsFilePrintf(fp, "*cupsIPPFinishings %d/%s: \"*PunchMedia %s\"\n",
value, keyword, ppd_keyword);
}
@@ -3711,9 +3749,8 @@ ppdCreateFromIPP2(char *buffer, /* I - Filename buffer */
human_readable = (char *)_cupsLangString(lang, finishings[j][1]);
break;
}
- cupsFilePrintf(fp, "*CutMedia %s%s%s: \"\"\n", ppd_keyword,
- (human_readable ? "/" : ""),
- (human_readable ? human_readable : ""));
+ cupsFilePrintf(fp, "*CutMedia %s: \"\"\n", ppd_keyword);
+ ppd_put_string(fp, lang, "CutMedia", ppd_keyword, human_readable);
cupsFilePrintf(fp, "*cupsIPPFinishings %d/%s: \"*CutMedia %s\"\n",
value, keyword, ppd_keyword);
}
@@ -3759,8 +3796,9 @@ ppdCreateFromIPP2(char *buffer, /* I - Filename buffer */
printer_opt_strings_catalog);
if (human_readable == NULL)
human_readable = (char *)keyword;
- cupsFilePrintf(fp, "*cupsFinishingTemplate %s/%s: \"\n", keyword,
- human_readable);
+ pwg_ppdize_name(keyword, ppdname, sizeof(ppdname));
+ cupsFilePrintf(fp, "*cupsFinishingTemplate %s: \"\n", ppdname);
+ ppd_put_string(fp, lang, "cupsFinishingTemplate", ppdname, human_readable);
for (finishing_attr = ippFirstAttribute(finishing_col); finishing_attr;
finishing_attr = ippNextAttribute(finishing_col)) {
if (ippGetValueTag(finishing_attr) == IPP_TAG_BEGIN_COLLECTION) {
@@ -4072,13 +4110,11 @@ ppdCreateFromIPP2(char *buffer, /* I - Filename buffer */
if (!preset || !preset_name)
continue;
- if ((localized_name = lookup_option((char *)preset_name,
- opt_strings_catalog,
- printer_opt_strings_catalog)) == NULL)
- cupsFilePrintf(fp, "*APPrinterPreset %s: \"\n", preset_name);
- else
- cupsFilePrintf(fp, "*APPrinterPreset %s/%s: \"\n", preset_name,
- localized_name);
+ pwg_ppdize_name(preset_name, ppdname, sizeof(ppdname));
+
+ localized_name = lookup_option((char *)preset_name, opt_strings_catalog, printer_opt_strings_catalog);
+ cupsFilePrintf(fp, "*APPrinterPreset %s: \"\n", ppdname);
+ ppd_put_string(fp, lang, "APPrinterPreset", ppdname, localized_name);
for (member = ippFirstAttribute(preset); member;
member = ippNextAttribute(preset)) {
@@ -4119,7 +4155,10 @@ ppdCreateFromIPP2(char *buffer, /* I - Filename buffer */
ippGetString(ippFindAttribute(fin_col,
"finishing-template",
IPP_TAG_ZERO), 0, NULL)) != NULL)
- cupsFilePrintf(fp, "*cupsFinishingTemplate %s\n", keyword);
+ {
+ pwg_ppdize_name(keyword, ppdname, sizeof(ppdname));
+ cupsFilePrintf(fp, "*cupsFinishingTemplate %s\n", ppdname);
+ }
}
} else if (!strcmp(member_name, "media")) {
/*
@@ -4152,14 +4191,14 @@ ppdCreateFromIPP2(char *buffer, /* I - Filename buffer */
IPP_TAG_ZERO), 0,
NULL)) != NULL) {
pwg_ppdize_name(keyword, ppdname, sizeof(ppdname));
- cupsFilePrintf(fp, "*InputSlot %s\n", keyword);
+ cupsFilePrintf(fp, "*InputSlot %s\n", ppdname);
}
if ((keyword = ippGetString(ippFindAttribute(media_col, "media-type",
IPP_TAG_ZERO), 0,
NULL)) != NULL) {
pwg_ppdize_name(keyword, ppdname, sizeof(ppdname));
- cupsFilePrintf(fp, "*MediaType %s\n", keyword);
+ cupsFilePrintf(fp, "*MediaType %s\n", ppdname);
}
} else if (!strcmp(member_name, "print-quality")) {
/*
@@ -4422,15 +4461,28 @@ pwg_ppdize_name(const char *ipp, /* I - IPP keyword */
*end; /* End of name buffer */
+ if (!ipp || !_cups_isalnum(*ipp))
+ {
+ *name = '\0';
+ return;
+ }
+
*name = (char)toupper(*ipp++);
for (ptr = name + 1, end = name + namesize - 1; *ipp && ptr < end;) {
- if (*ipp == '-') {
+ if (*ipp == '-' && isalnum(ipp[1]))
+ {
ipp ++;
- if (_cups_isalpha(*ipp))
- *ptr++ = (char)toupper(*ipp++ & 255);
- } else
+ *ptr++ = (char)toupper(*ipp++ & 255);
+ }
+ else if (*ipp == '_' || *ipp == '.' || *ipp == '-' || isalnum(*ipp))
+ {
*ptr++ = *ipp++;
+ }
+ else
+ {
+ ipp ++;
+ }
}
*ptr = '\0';
@@ -4467,4 +4519,39 @@ pwg_ppdize_resolution(
snprintf(name, namesize, "%dx%ddpi", *xres, *yres);
}
}
+
+
+/*
+ * 'ppd_put_strings()' - Write localization attributes to a PPD file.
+ */
+
+static void
+ppd_put_string(cups_file_t *fp, /* I - PPD file */
+ cups_lang_t *lang, /* I - Language */
+ const char *ppd_option,/* I - PPD option */
+ const char *ppd_choice,/* I - PPD choice */
+ const char *text) /* I - Localized text */
+{
+ if (!text)
+ return;
+
+ // Add the first line of localized text...
+#if CUPS_VERSION_MAJOR > 2
+ cupsFilePrintf(fp, "*%s.%s %s/", cupsLangGetName(lang), ppd_option, ppd_choice);
+#else
+ cupsFilePrintf(fp, "*%s.%s %s/", lang->language, ppd_option, ppd_choice);
+#endif // CUPS_VERSION_MAJOR > 2
+
+ while (*text && *text != '\n')
+ {
+ // Escape ":" and "<"...
+ if (*text == ':' || *text == '<')
+ cupsFilePrintf(fp, "<%02X>", *text);
+ else
+ cupsFilePutChar(fp, *text);
+
+ text ++;
+ }
+ cupsFilePuts(fp, ": \"\"\n");
+}
#endif /* HAVE_CUPS_1_6 */

@ -1,176 +1,71 @@
# build braille subpackage on Fedora, don't do it on CentOS Stream 9 or older
%if 0%{?fedora} || 0%{?rhel} > 9
%if 0%{?fedora}
%bcond_without mdns
%bcond_without braille
%else
%bcond_with mdns
%bcond_with braille
%endif
# we build CUPS also with relro
%global _hardened_build 1
Summary: OpenPrinting CUPS filters and backends
Summary: OpenPrinting CUPS filters for CUPS 2.X
Name: cups-filters
Version: 1.28.7
Release: 18%{?dist}
# For a breakdown of the licensing, see COPYING file
# GPLv2: filters: commandto*, imagetoraster, pdftops, rasterto*,
# imagetopdf, pstopdf, texttopdf
# backends: parallel, serial
# GPLv2+: filters: gstopxl, textonly, texttops, imagetops, foomatic-rip
# GPLv3: filters: bannertopdf
# GPLv3+: filters: urftopdf, rastertopdf
# LGPLv2+: utils: cups-browsed
# MIT: filters: gstoraster, pdftoijs, pdftoopvp, pdftopdf, pdftoraster
License: GPLv2 and GPLv2+ and GPLv3 and GPLv3+ and LGPLv2+ and MIT and BSD with advertising
Url: http://www.linuxfoundation.org/collaborate/workgroups/openprinting/cups-filters
Source0: http://www.openprinting.org/download/cups-filters/cups-filters-%{version}.tar.xz
Epoch: 1
Version: 2.0.0
Release: 9%{?dist}
# the CUPS exception text is the same as LLVM exception, so using that name with
# agreement from legal team
# https://lists.fedoraproject.org/archives/list/legal@lists.fedoraproject.org/message/A7GFSD6M3GYGSI32L2FC5KB22DUAEQI3/
License: Apache-2.0 WITH LLVM-exception
URL: https://github.com/OpenPrinting/cups-filters
Source0: %{URL}/releases/download/%{version}/%{name}-%{version}.tar.gz
Source1: lftocrlf.ppd
Source2: lftocrlf
# backported from upstream
#Patch01: 0001-libcupsfilters-In-the-PPD-generator-really-give-prio.patch
# 1954523 - cups-browsed doesn't save "*-default" options
# upstream https://github.com/OpenPrinting/cups-filters/commit/cdd61132e1719a88dd8006c65e8e260c1aaa02e4
Patch01: 0001-cups-browsed-Always-save-.-default-option-entries-fr.patch
# 1973055 - cups-browsed doesn't renew DBus subscription in time and all printing comes to a halt
Patch02: 0001-cups-browsed.c-Make-NotifLeaseDuration-configurable-.patch
# 1982118 - [RHEL 9] pdftopdf doesn't handle "page-range=10-2147483647" correctly
Patch03: 0001-libcupsfilters-Fix-page-range-like-10-in-pdftopdf-fi.patch
# CVE-2023-24805 cups-filters: remote code execution in cups-filters, beh CUPS backend
Patch04: beh-cve2023.patch
# RHEL-16026 Cups Browsed does not correctly pull printer location and description information from print server
Patch05: 0001-Use-description-location-from-server-if-available-ot.patch
# RHEL-46785 Cups browsing with 'Autoclustering on' in RHEL 9 cannot find printer clusters for HA
Patch06: browsed-ignore-NULL-attrs.patch
# CVE-2024-47175 cups-filters: remote command injection via attacker controlled data in PPD file
Patch07: cups-filters-CVE-2024-47175.patch
# CVE-2024-47076 cups-filters: `cfGetPrinterAttributes` API does not perform sanitization on returned IPP attributes
Patch08: 0001-cfGetPrinterAttributes5-Validate-response-attributes.patch
# Patches
# driverless backend/driver was moved into a separate package to
# remove avahi dependency for filters
# remove once C10S is released and F40 is EOL
Conflicts: cups-filters-driverless < 1:2.0.0-3
# autogen.sh
BuildRequires: autoconf
# autogen.sh
BuildRequires: automake
BuildRequires: gettext-devel
BuildRequires: libtool
# build requirements for build system:
# gcc for backends (implicitclass, parallel, serial, backend error handling)
# cupsfilters (colord, color manager...), filter (banners,
# commandto*, braille, foomatic-rip, imagetoraster, imagetopdf, gstoraster e.g.),
# fontembed, cups-browsed
# filter binaries and backends are written in C
BuildRequires: gcc
# gcc-c++ for pdftoopvp, pdftopdf
BuildRequires: gcc-c++
# autogen.sh
BuildRequires: gettext-devel
# for autosetup
BuildRequires: git-core
# autogen.sh
BuildRequires: libtool
# uses make for compiling
BuildRequires: make
# we use pkgconfig to get a proper devel packages
# proper CFLAGS and LDFLAGS
BuildRequires: pkgconf-pkg-config
# uses CUPS API functions - arrays, ipp functions
BuildRequires: cups-devel
# pdftopdf
BuildRequires: pkgconfig(libqpdf)
# pdftops
BuildRequires: poppler-utils
# pdftoraster, gstoraster
BuildRequires: ghostscript
BuildRequires: libjpeg-turbo-devel
BuildRequires: libtiff-devel
BuildRequires: pkgconfig(dbus-1)
BuildRequires: pkgconfig(fontconfig)
BuildRequires: pkgconfig(freetype2)
BuildRequires: pkgconfig(lcms2)
BuildRequires: pkgconfig(libpng)
BuildRequires: pkgconfig(poppler)
BuildRequires: pkgconfig(zlib)
BuildRequires: poppler-cpp-devel
# cups-browsed
BuildRequires: avahi-devel
BuildRequires: pkgconfig(avahi-glib)
BuildRequires: pkgconfig(glib-2.0)
BuildRequires: systemd
# uses CUPS API
BuildRequires: pkgconfig(cups) >= 2.2.2
# uses cupsfilters API
BuildRequires: pkgconfig(libcupsfilters) >= 2.0b3
# uses PPD API
BuildRequires: pkgconfig(libppd) >= 2.0b3
# Make sure we get postscriptdriver tags.
BuildRequires: python3-cups
# Testing font for test scripts.
BuildRequires: dejavu-sans-fonts
# needed for systemd rpm macros in scriptlets
BuildRequires: systemd-rpm-macros
# cups-browsed needs systemd-resolved or nss-mdns for resolving .local addresses of remote print queues
# let's not require a specific package and let the user decide what he wants to use.
# just recommend nss-mdns for Fedora for now to have working default, but
# don't hardwire it for resolved users
%if 0%{?fedora}
Recommends: nss-mdns
%endif
# ippfind is used in driverless backend, not needed classic PPD based print queue
Recommends: cups-ipptool
%if %{with braille}
Recommends: %{name}-braille%{?_isa} = %{version}-%{release}
Recommends: braille-printer-app
%endif
# pstopdf
Requires: bc grep sed which
# for getting ICC profiles for filters (dbus must run)
Requires: colord
# needs cups dirs
Requires: cups-filesystem
# have the same libs for the package
Requires: cups-filters-libs%{?_isa} = %{version}-%{release}
# several filters calls 'gs' binary during filtering
Requires: ghostscript
# texttopdf
Requires: liberation-mono-fonts
# if --with-pdftops is set to hybrid, we use poppler filters for several printers
# and for printing banners, for other printers we need gs - ghostscript
Requires: poppler-utils
# cups-browsed
# cups-browsed needs to have cups.service to run
Requires(post): systemd
Requires(preun): systemd
Requires(postun): systemd
%package libs
Summary: OpenPrinting CUPS filters and backends - cupsfilters and fontembed libraries
# LGPLv2: libcupsfilters
# MIT: libfontembed
License: LGPLv2 and MIT
%package devel
Summary: OpenPrinting CUPS filters and backends - development environment
License: LGPLv2 and MIT
Requires: cups-filters-libs%{?_isa} = %{version}-%{release}
%if %{with braille}
%package braille
Summary: OpenPrinting CUPS filters and backends - braille filters and backend
License: GPLv2+ and MIT
BuildRequires: liblouis-devel
Conflicts: cups-filters < 1.28.7-11
# we need classic pdftopdf and other filters as well
Requires: cups-filters%{?_isa} = %{version}-%{release}
# one of lou_translate (from liblouis-utils package) and
# file2brl (from liblouisutdml-utils package) is used for file conversions:
# => prefer lou_translate from liblouis-utils because liblouis-utils are in
# CentOS Stream
# liblouis-utils for lou_translate
Requires: liblouis-utils
%endif
%description
Contains backends, filters, and other software that was
@ -179,17 +74,36 @@ Apple Inc. In addition it contains additional filters developed
independently of Apple, especially filters for the PDF-centric printing
workflow introduced by OpenPrinting.
%description libs
This package provides cupsfilters and fontembed libraries.
%package driverless
Summary: OpenPrinting driverless backends and drivers for CUPS 2.X
License: Apache-2.0 WITH LLVM-exception
%description devel
This is the development package for OpenPrinting CUPS filters and backends.
# backends and drivers has been moved from the main package to subpackage
# to remove the avahi/mdns dependency needed for driverless
# remove after F40 is EOL and C10S is released
Conflicts: cups-filters < 1:2.0.0-3
%if %{with braille}
%description braille
The package provides filters and cups-brf backend needed for braille printing.
# finding device via driverless depends on running avahi-daemon
Requires: avahi
# ippfind is used in driverless backend, not needed classic PPD based print queue
Requires: cups-ipptool
# cups-browsed needs systemd-resolved or nss-mdns for resolving .local addresses of remote print queues
# let's not require a specific package and let the user decide what he wants to use.
# just recommend nss-mdns for Fedora for now to have working default, but
# don't hardwire it for resolved users
%if %{with mdns}
Recommends: nss-mdns
%endif
# needs cups dirs
Requires: cups-filesystem
%description driverless
Contains backends and drivers for driverless implementation for cups-filters,
which makes driverless printers to be seen when listing printers nearby and gives
a specific generated driver for driverless printer in the local network. They are
tools for backward compatibility with applications which don't handle CUPS temporary
queues.
%prep
%autosetup -S git
@ -198,157 +112,52 @@ The package provides filters and cups-brf backend needed for braille printing.
# work-around Rpath
./autogen.sh
# --with-pdftops=hybrid - use Poppler's pdftops instead of Ghostscript for
# Brother, Minolta, and Konica Minolta to work around
# bugs in the printer's PS interpreters
# --with-rcdir=no - don't install SysV init script
# --enable-driverless - enable PPD generator for driverless printing in
# /usr/lib/cups/driver, it is for manual setup of
# driverless printers with printer setup tool
# --disable-static - do not build static libraries (becuase of Fedora Packaging
# Guidelines)
# --enable-dbus - enable DBus Connection Manager's code
# --disable-silent-rules - verbose build output
# --disable-mutool - mupdf is retired in Fedora, use qpdf
# --enable-pclm - support for pclm language
# --with-remote-cups-local-queue-naming=RemoteName - name created local queues, which point to
# remote CUPS queue, by its name from the server
%configure --disable-static \
--disable-silent-rules \
--with-pdftops=hybrid \
--enable-dbus \
--with-rcdir=no \
%configure --enable-driverless \
--enable-universal-cups-filter \
--disable-mutool \
--enable-driverless \
--enable-pclm \
--with-apple-raster-filter=rastertopdf \
%if %{with braille}
--enable-braille \
%else
--disable-braille \
%endif
--with-browseremoteprotocols=none\
--with-remote-cups-local-queue-naming=RemoteName
--disable-rpath \
--disable-silent-rules \
--disable-static
%make_build
%install
%make_install
# 2229784 - Add textonly driver back, but as lftocrlf
# 2229776 - Add textonly driver back, but as lftocrlf
install -p -m 0755 %{SOURCE2} %{buildroot}%{_cups_serverbin}/filter/lftocrlf
install -p -m 0644 %{SOURCE1} %{buildroot}%{_datadir}/ppd/cupsfilters/lftocrlf.ppd
# Don't ship libtool la files.
rm -f %{buildroot}%{_libdir}/lib*.la
# LSB3.2 requires /usr/bin/foomatic-rip,
# create it temporarily as a relative symlink
# we may use symlink to universal filter, but LSB is about guaranteed compatibility set
# among distibutions, so rather have the strict foomatic-rip filter...
ln -sf %{_cups_serverbin}/filter/foomatic-rip %{buildroot}%{_bindir}/foomatic-rip
#ln -sf %{_cups_serverbin}/filter/universal %{buildroot}%{_bindir}/foomatic-rip
# Not sure what is this good for.
rm -f %{buildroot}%{_bindir}/ttfread
# remove license files which are in %%pkgdocdir
rm -f %{buildroot}%{_pkgdocdir}/{COPYING,NOTICE,LICENSE}
# remove INSTALL since it is unnecessary
rm -f %{buildroot}%{_pkgdocdir}/INSTALL
mkdir -p %{buildroot}%{_pkgdocdir}/fontembed/
cp -p fontembed/README %{buildroot}%{_pkgdocdir}/fontembed/
# systemd unit file
mkdir -p %{buildroot}%{_unitdir}
install -p -m 644 utils/cups-browsed.service %{buildroot}%{_unitdir}
# LSB3.2 requires /usr/bin/foomatic-rip,
# create it temporarily as a relative symlink
ln -sf %{_cups_serverbin}/filter/foomatic-rip %{buildroot}%{_bindir}/foomatic-rip
# remove CHANGES-1.x.md, since it is carried by a dependency
rm -f %{buildroot}%{_pkgdocdir}/CHANGES-1.x.md
%check
make check
%post
%systemd_post cups-browsed.service
# put UpdateCUPSQueuesMaxPerCall and PauseBetweenCUPSQueueUpdates into cups-browsed.conf
# for making cups-browsed work more stable for environments with many print queues
# remove this after 1-2 releases
for directive in "UpdateCUPSQueuesMaxPerCall" "PauseBetweenCUPSQueueUpdates"
do
found=`%{_bindir}/grep "^[[:blank:]]*$directive" %{_sysconfdir}/cups/cups-browsed.conf`
if [ -z "$found" ]
then
if [ "x$directive" == "xUpdateCUPSQueuesMaxPerCall" ]
then
%{_bindir}/echo "UpdateCUPSQueuesMaxPerCall 20" >> %{_sysconfdir}/cups/cups-browsed.conf
else
%{_bindir}/echo "PauseBetweenCUPSQueueUpdates 5" >> %{_sysconfdir}/cups/cups-browsed.conf
fi
fi
done
# Set BrowseRemoteProtocols to none in light of CVE-2024-47176
if ! grep -Fxq "# added by post scriptlet" %{_sysconfdir}/cups/cups-browsed.conf
then
cp %{_sysconfdir}/cups/cups-browsed.conf %{_sysconfdir}/cups/cups-browsed.conf.rpmsave
sed -i "s/^\s*BrowseRemoteProtocols.*/# added by post scriptlet\nBrowseRemoteProtocols none/" %{_sysconfdir}/cups/cups-browsed.conf
fi
%preun
%systemd_preun cups-browsed.service
%postun
%systemd_postun_with_restart cups-browsed.service
%ldconfig_scriptlets libs
%posttrans
if ls -lah /var/cache/cups/cups-browsed* &> /dev/null
then
BROWSED_ACTIVE="0"
CUPSD_ACTIVE="0"
if systemctl is-active cups-browsed &> /dev/null
then
BROWSED_ACTIVE="1"
CUPSD_ACTIVE="1"
elif systemctl is-active cups &> /dev/null
then
CUPSD_ACTIVE="1"
fi
if test "x$CUPSD_ACTIVE" = "x1"
then
systemctl stop cups
fi
# RHEL-46785 - clean up recorded options to make the fix work
rm -rf /var/cache/cups/*.data /var/cache/cups/cups-browsed* &> /dev/null
if test "x$BROWSED_ACTIVE" = "x1"
then
systemctl start cups-browsed
elif test "x$CUPSD_ACTIVE" = "x1"
then
systemctl start cups
fi
fi
%files
%{_pkgdocdir}/README
%{_pkgdocdir}/ABOUT-NLS
%{_pkgdocdir}/AUTHORS
%{_pkgdocdir}/NEWS
%license COPYING LICENSE NOTICE
%doc AUTHORS ABOUT-NLS CHANGES.md CONTRIBUTING.md DEVELOPING.md README.md
%{_bindir}/foomatic-rip
%{_bindir}/driverless
%{_bindir}/driverless-fax
%{_sbindir}/cups-browsed
%attr(0700,root,root) %{_cups_serverbin}/backend/beh
# implicitclass backend must be run as root
%attr(0700,root,root) %{_cups_serverbin}/backend/implicitclass
%attr(0744,root,root) %{_cups_serverbin}/backend/beh
# all backends needs to be run only as root because of kerberos
%attr(0700,root,root) %{_cups_serverbin}/backend/parallel
%attr(0744,root,root) %{_cups_serverbin}/backend/parallel
# Serial backend needs to run as root (bug #212577#c4).
%attr(0700,root,root) %{_cups_serverbin}/backend/serial
%{_cups_serverbin}/backend/driverless
%{_cups_serverbin}/backend/driverless-fax
%attr(0744,root,root) %{_cups_serverbin}/backend/serial
%attr(0755,root,root) %{_cups_serverbin}/filter/bannertopdf
%attr(0755,root,root) %{_cups_serverbin}/filter/commandtoescpx
%attr(0755,root,root) %{_cups_serverbin}/filter/commandtopclx
@ -359,146 +168,190 @@ fi
%attr(0755,root,root) %{_cups_serverbin}/filter/imagetopdf
%attr(0755,root,root) %{_cups_serverbin}/filter/imagetops
%attr(0755,root,root) %{_cups_serverbin}/filter/imagetoraster
# 2229784 - Add textonly driver back, but as lftocrlf
# 2229776 - Add textonly driver back, but as lftocrlf
%attr(0755,root,root) %{_cups_serverbin}/filter/lftocrlf
%attr(0755,root,root) %{_cups_serverbin}/filter/pclmtoraster
%attr(0755,root,root) %{_cups_serverbin}/filter/pdftopdf
%attr(0755,root,root) %{_cups_serverbin}/filter/pdftops
%attr(0755,root,root) %{_cups_serverbin}/filter/pdftoraster
%attr(0755,root,root) %{_cups_serverbin}/filter/pwgtopclm
%attr(0755,root,root) %{_cups_serverbin}/filter/pwgtopdf
%attr(0755,root,root) %{_cups_serverbin}/filter/pwgtoraster
%attr(0755,root,root) %{_cups_serverbin}/filter/rastertoescpx
%attr(0755,root,root) %{_cups_serverbin}/filter/rastertopclm
%attr(0755,root,root) %{_cups_serverbin}/filter/rastertopclx
%attr(0755,root,root) %{_cups_serverbin}/filter/rastertopdf
%attr(0755,root,root) %{_cups_serverbin}/filter/rastertops
%attr(0755,root,root) %{_cups_serverbin}/filter/sys5ippprinter
%attr(0755,root,root) %{_cups_serverbin}/filter/texttopdf
%attr(0755,root,root) %{_cups_serverbin}/filter/texttops
%attr(0755,root,root) %{_cups_serverbin}/filter/texttotext
%{_cups_serverbin}/driver/driverless
%{_cups_serverbin}/driver/driverless-fax
%{_datadir}/cups/banners
%{_datadir}/cups/charsets
%{_datadir}/cups/data/*
%attr(0755,root,root) %{_cups_serverbin}/filter/universal
%{_datadir}/cups/drv/cupsfilters.drv
%{_datadir}/cups/mime/cupsfilters.types
%{_datadir}/cups/mime/cupsfilters.convs
%{_datadir}/cups/mime/cupsfilters-ghostscript.convs
%{_datadir}/cups/mime/cupsfilters-poppler.convs
%{_datadir}/cups/mime/cupsfilters-universal-postscript.convs
%{_datadir}/cups/mime/cupsfilters-universal.convs
%{_datadir}/ppd/cupsfilters
# this needs to be in the main package because of cupsfilters.drv
%{_datadir}/cups/ppdc/pcl.h
# escp.h and pcl.h are required during runtime, because
# CUPS PPD compiler (ppdc) uses them for generating drivers
# per request from cupsfilters.drv file
%{_datadir}/ppdc/escp.h
%{_datadir}/ppdc/pcl.h
%{_mandir}/man1/foomatic-rip.1.gz
%files driverless
%license COPYING LICENSE NOTICE
%{_bindir}/driverless
%{_bindir}/driverless-fax
%{_cups_serverbin}/backend/driverless
%{_cups_serverbin}/backend/driverless-fax
%{_cups_serverbin}/driver/driverless
%{_cups_serverbin}/driver/driverless-fax
%{_mandir}/man1/driverless.1.gz
%{_mandir}/man5/cups-browsed.conf.5.gz
%{_mandir}/man8/cups-browsed.8.gz
%config(noreplace) %verify(not size filedigest mtime) %{_sysconfdir}/cups/cups-browsed.conf
%{_unitdir}/cups-browsed.service
%files libs
%dir %{_pkgdocdir}/
%{_pkgdocdir}/COPYING
%dir %{_pkgdocdir}/fontembed
%{_pkgdocdir}/fontembed/README
%{_libdir}/libcupsfilters.so.1*
%{_libdir}/libfontembed.so.1*
%files devel
%{_datadir}/cups/ppdc/escp.h
%{_includedir}/cupsfilters
%{_includedir}/fontembed
%{_libdir}/libcupsfilters.so
%{_libdir}/libfontembed.so
%{_libdir}/pkgconfig/libcupsfilters.pc
%{_libdir}/pkgconfig/libfontembed.pc
%if %{with braille}
%files braille
# cups-brf needs to be run as root, otherwise it leaves error messages
# in journal
%attr(0700,root,root) %{_cups_serverbin}/backend/cups-brf
%attr(0755,root,root) %{_cups_serverbin}/filter/brftoembosser
%attr(0755,root,root) %{_cups_serverbin}/filter/brftopagedbrf
%attr(0755,root,root) %{_cups_serverbin}/filter/imagetobrf
%attr(0755,root,root) %{_cups_serverbin}/filter/imageubrltoindexv3
%attr(0755,root,root) %{_cups_serverbin}/filter/imageubrltoindexv4
%attr(0755,root,root) %{_cups_serverbin}/filter/musicxmltobrf
%attr(0755,root,root) %{_cups_serverbin}/filter/textbrftoindexv3
%attr(0755,root,root) %{_cups_serverbin}/filter/texttobrf
%attr(0755,root,root) %{_cups_serverbin}/filter/vectortobrf
%attr(0755,root,root) %{_cups_serverbin}/filter/vectortopdf
%{_cups_serverbin}/filter/cgmtopdf
%{_cups_serverbin}/filter/cmxtopdf
%{_cups_serverbin}/filter/emftopdf
%{_cups_serverbin}/filter/imagetoubrl
%{_cups_serverbin}/filter/svgtopdf
%{_cups_serverbin}/filter/textbrftoindexv4
%{_cups_serverbin}/filter/vectortoubrl
%{_cups_serverbin}/filter/xfigtopdf
%{_cups_serverbin}/filter/wmftopdf
%{_datadir}/cups/braille
%{_datadir}/cups/drv/generic-brf.drv
%{_datadir}/cups/drv/generic-ubrl.drv
%{_datadir}/cups/drv/indexv3.drv
%{_datadir}/cups/drv/indexv4.drv
%{_datadir}/cups/ppdc/braille.defs
%{_datadir}/cups/ppdc/fr-braille.po
%{_datadir}/cups/ppdc/imagemagick.defs
%{_datadir}/cups/ppdc/index.defs
%{_datadir}/cups/ppdc/liblouis.defs
%{_datadir}/cups/ppdc/liblouis1.defs
%{_datadir}/cups/ppdc/liblouis2.defs
%{_datadir}/cups/ppdc/liblouis3.defs
%{_datadir}/cups/ppdc/liblouis4.defs
%{_datadir}/cups/ppdc/media-braille.defs
%{_datadir}/cups/mime/braille.convs
%{_datadir}/cups/mime/braille.types
%endif
%changelog
* Tue Oct 01 2024 Zdenek Dohnal <zdohnal@redhat.com> - 1.28.7-18
- CVE-2024-47175 cups-filters: remote command injection via attacker controlled data in PPD file
- CVE-2024-47076 cups-filters: `cfGetPrinterAttributes` API does not perform sanitization on returned IPP attributes
- CVE-2024-47176 cups-filters: cups-browsed binds on UDP INADDR_ANY:631 trusting any packet from any source
* Tue Oct 29 2024 Troy Dawson <tdawson@redhat.com> - 1:2.0.0-9
- Bump release for October 2024 mass rebuild:
Resolves: RHEL-64018
* Fri Oct 25 2024 MSVSphere Packaging Team <packager@msvsphere-os.ru> - 1:2.0.0-8
- Rebuilt for MSVSphere 10
* Fri Jul 19 2024 Zdenek Dohnal <zdohnal@redhat.com> - 1:2.0.0-8
- RHEL-49766 Fix missing Epoch in conflicts reported by rpminspect
* Mon Jun 24 2024 Troy Dawson <tdawson@redhat.com> - 1:2.0.0-7
- Bump release for June 2024 mass rebuild
* Wed Jan 24 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1:2.0.0-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Fri Jan 19 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1:2.0.0-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Tue Dec 19 2023 Zdenek Dohnal <zdohnal@redhat.com> - 1:2.0.0-4
- make driverless subpackage require avahi and ipptool - they don't
work without them
* Tue Dec 19 2023 Zdenek Dohnal <zdohnal@redhat.com> - 1:2.0.0-3
- introduce cups-filters-driverless to strip avahi dependency for filters
* Tue Dec 19 2023 Zdenek Dohnal <zdohnal@redhat.com> - 1:2.0.0-2
- use exact foomatic-rip filter to comply with LSB
* Thu Oct 19 2023 Zdenek Dohnal <zdohnal@redhat.com> - 1:2.0.0-1
- rebase to 2.0.0
* Mon Aug 07 2023 Zdenek Dohnal <zdohnal@redhat.com> - 1:2.0~rc2-3
- 2229776 - Add textonly driver back as lftocrlf driver
* Wed Jul 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1:2.0~rc2-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
* Wed Jun 28 2023 Zdenek Dohnal <zdohnal@redhat.com> - 1:2.0~rc2-1
- 2.0rc2
* Wed May 17 2023 Zdenek Dohnal <zdohnal@redhat.com> - 1:2.0~rc1-2
- 2207970 - CVE-2023-24805 cups-filters: remote code execution in cups-filters, beh CUPS backend
* Thu Apr 27 2023 Zdenek Dohnal <zdohnal@redhat.com> - 1:2.0~rc1-1
- 2.0rc1
* Wed Mar 01 2023 Zdenek Dohnal <zdohnal@redhat.com> - 1:2.0~b3-2
- use epoch to ensure clean upgrade path, because I didn't read FPG carefully
* Mon Feb 20 2023 Zdenek Dohnal <zdohnal@redhat.com> - 2.0b3-1
- 2170538 - rebase to 2.0b3
* Thu Jan 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1.28.16-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
* Thu Oct 13 2022 Zdenek Dohnal <zdohnal@redhat.com> - 1.28.16-6
- really build with qpdf-11.1.1 (forgot to wait for qpdf in side tag...)
* Thu Oct 13 2022 Zdenek Dohnal <zdohnal@redhat.com> - 1.28.16-5
- rebuilt with qpdf-11.1.1
* Thu Sep 22 2022 Zdenek Dohnal <zdohnal@redhat.com> - 1.28.16-4
- rebuilt with qpdf-11.1.0
* Thu Sep 22 2022 Zdenek Dohnal <zdohnal@redhat.com> - 1.28.16-3
- build braille subpackage only on Fedora and CentOS Stream > 9
* Wed Sep 21 2022 Zdenek Dohnal <zdohnal@redhat.com> - 1.28.16-2
- disable frequent network interface data update, which slows down the queue creation
* Thu Sep 08 2022 Zdenek Dohnal <zdohnal@redhat.com> - 1.28.16-1
- 1.28.16
* Thu Sep 08 2022 Zdenek Dohnal <zdohnal@redhat.com> - 1.28.15-3
- 2123809 - rpm -Va reports error on /etc/cups/cups-browsed.conf
* Wed Jul 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.28.15-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
* Wed Apr 20 2022 Zdenek Dohnal <zdohnal@redhat.com> - 1.28.15-1
- 1.28.15
* Thu Apr 07 2022 Zdenek Dohnal <zdohnal@redhat.com> - 1.28.14-1
- 1.28.14
* Mon Mar 28 2022 Zdenek Dohnal <zdohnal@redhat.com> - 1.28.13-1
- 1.28.13
* Tue Mar 08 2022 Zdenek Dohnal <zdohnal@redhat.com> - 1.28.12-1
- 1.28.12
* Thu Jan 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.28.11-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
* Tue Jan 18 2022 Zdenek Dohnal <zdohnal@redhat.com> - 1.28.11-2
- raise the NVR to get a new build
* Mon Jan 17 2022 Zdenek Dohnal <zdohnal@redhat.com> - 1.28.11-1
- 1.28.11
* Mon Jan 17 2022 Zdenek Dohnal <zdohnal@redhat.com> - 1.28.10-4
- fix typo in braille requires
* Tue Aug 06 2024 Zdenek Dohnal <zdohnal@redhat.com> - 1.28.7-17
- RHEL-46785 - fix errors during installability tests about modified cups-browsed.conf
* Mon Jan 17 2022 Zdenek Dohnal <zdohnal@redhat.com> - 1.28.10-3
- 2040973 - Make Braille printing support optional
* Tue Jul 30 2024 Zdenek Dohnal <zdohnal@redhat.com> - 1.28.7-16
- RHEL-46785 Cups browsing with 'Autoclustering on' in RHEL 9 cannot find printer clusters for HA
* Mon Dec 06 2021 Zdenek Dohnal <zdohnal@redhat.com> - 1.28.10-2
- 1995728 - Enable braille printing
* Mon Feb 26 2024 Zdenek Dohnal <zdohnal@redhat.com> - 1.28.7-15
- RHEL-19201 redhat-lsb unnecessary pulls in cups and avahi dependencies
* Tue Sep 14 2021 Zdenek Dohnal <zdohnal@redhat.com> - 1.28.10-1
- 1.28.10
* Wed Dec 20 2023 Zdenek Dohnal <zdohnal@redhat.com> - 1.28.7-14
- RHEL-19201 redhat-lsb unnecessary pulls in cups and avahi dependencies
- RHEL-16026 Cups Browsed does not correctly pull printer location and description information from print server
* Tue Jul 27 2021 Zdenek Dohnal <zdohnal@redhat.com> - 1.28.9-5
- rebuilt with poppler-21.07.0
* Tue Aug 08 2023 Zdenek Dohnal <zdohnal@redhat.com> - 1.28.7-13
- 2229784 - Add textonly driver back, but as lftocrlf
* Tue Jul 27 2021 Zdenek Dohnal <zdohnal@redhat.com> - 1.28.9-4
- remove build requirement on poppler-devel - we need just poppler-cpp-devel
* Wed Jun 07 2023 Zdenek Dohnal <zdohnal@redhat.com> - 1.28.7-12
- CVE-2023-24805 cups-filters: remote code execution in cups-filters, beh CUPS backend
* Wed Jul 21 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.28.9-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
* Thu Sep 22 2022 Zdenek Dohnal <zdohnal@redhat.com> - 1.28.7-11
- 2129054 - build braille subpackage only on Fedora and CentOS Stream > 9
* Wed Jul 14 2021 Zdenek Dohnal <zdohnal@redhat.com> - 1.28.9-2
- 1981603 - pdftopdf doesn't handle "page-range=10-2147483647" correctly
* Mon Aug 09 2021 Mohan Boddu <mboddu@redhat.com> - 1.28.7-10
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
Related: rhbz#1991688
* Mon Jun 21 2021 Zdenek Dohnal <zdohnal@redhat.com> - 1.28.9-1
- 1.28.9
* Mon Jul 26 2021 Zdenek Dohnal <zdohnal@redhat.com> - 1.28.7-9
- 1982118 - [RHEL 9] pdftopdf doesn't handle "page-range=10-2147483647" correctly
* Mon Jun 21 2021 Zdenek Dohnal <zdohnal@redhat.com> - 1.28.8-2
- 1973056 - cups-browsed doesn't renew DBus subscription in time and all printing comes to a halt
* Mon Jun 21 2021 Zdenek Dohnal <zdohnal@redhat.com> - 1.28.7-8
- 1973055 - cups-browsed doesn't renew DBus subscription in time and all printing comes to a halt
* Fri May 14 2021 Zdenek Dohnal <zdohnal@redhat.com> - 1.28.8-1
- 1.28.8
* Thu May 20 2021 Zdenek Dohnal <zdohnal@redhat.com> - 1.28.7-7
- 1954523 - cups-browsed doesn't save "*-default" options
* Wed Apr 28 2021 Zdenek Dohnal <zdohnal@redhat.com> - 1.28.7-7
- 1954524 - cups-browsed doesn't save "*-default" options
* Thu Apr 15 2021 Mohan Boddu <mboddu@redhat.com> - 1.28.7-6
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
* Tue Mar 02 2021 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 1.28.7-6
- Rebuilt for updated systemd-rpm-macros
See https://pagure.io/fesco/issue/2583.
* Mon Feb 01 2021 Zdenek Dohnal <zdohnal@redhat.com> - 1.28.7-5
- rebuilt
- put nss-mdns only for Fedora
* Thu Jan 28 2021 Zdenek Dohnal <zdohnal@redhat.com> - 1.28.7-4
- remove nss-mdns - dont require a specific way how to resolve .local addresses

Loading…
Cancel
Save