From 9d78e7701c6597f3aae6b1fba8b696a45c585e85 Mon Sep 17 00:00:00 2001 From: Jiri Popelka Date: Tue, 21 Aug 2012 16:43:40 +0200 Subject: [PATCH 01/30] use new systemd-rpm macros (#850074) --- cups.spec | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/cups.spec b/cups.spec index fc8178a..a97c281 100644 --- a/cups.spec +++ b/cups.spec @@ -12,7 +12,7 @@ Summary: Common Unix Printing System Name: cups Version: 1.5.4 -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv2 Group: System Environment/Daemons Source: http://ftp.easysw.com/pub/cups/%{version}/cups-%{version}-source.tar.bz2 @@ -440,10 +440,7 @@ php --no-php-ini \ %post -if [ $1 -eq 1 ] ; then - # Initial installation - /bin/systemctl enable cups.{service,socket,path} >/dev/null 2>&1 || : -fi +%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). @@ -472,22 +469,17 @@ exit 0 %postun libs -p /sbin/ldconfig %preun -if [ $1 -eq 0 ] ; then - # Package removal, not upgrade - /bin/systemctl --no-reload disable %{name}.path %{name}.socket %{name}.service >/dev/null 2>&1 || : - /bin/systemctl stop %{name}.path %{name}.socket %{name}.service >/dev/null 2>&1 || : +%systemd_preun %{name}.path %{name}.socket %{name}.service + %if %use_alternatives +if [ $1 -eq 0 ] ; then /usr/sbin/alternatives --remove print %{_bindir}/lpr.cups -%endif fi +%endif exit 0 %postun -/bin/systemctl daemon-reload >/dev/null 2>&1 || : -if [ $1 -ge 1 ]; then - # Package upgrade, not uninstall - /bin/systemctl try-restart %{name}.service >/dev/null 2>&1 || : -fi +%systemd_postun_with_restart %{name}.service exit 0 %triggerun -- %{name} < 1:1.5.0-22 @@ -656,6 +648,9 @@ rm -f %{cups_serverbin}/backend/smb %{_mandir}/man1/ipptool.1.gz %changelog +* Tue Aug 21 2012 Jiri Popelka 1:1.5.4-2 +- use new systemd-rpm macros (#850074) + * Thu Jul 26 2012 Jiri Popelka 1:1.5.4-1 - 1.5.4 From 12d71f93038ddbd1a04dc941d9528d6f2a78d75d Mon Sep 17 00:00:00 2001 From: Jiri Popelka Date: Thu, 23 Aug 2012 13:45:22 +0200 Subject: [PATCH 02/30] quirk handler for port reset done by new USB backend (bug #847923, STR #4155) --- cups-usblp-quirks.patch | 86 +++++++++++++++++++++++++++++++++++++++++ cups.spec | 10 ++++- 2 files changed, 95 insertions(+), 1 deletion(-) create mode 100644 cups-usblp-quirks.patch diff --git a/cups-usblp-quirks.patch b/cups-usblp-quirks.patch new file mode 100644 index 0000000..135f939 --- /dev/null +++ b/cups-usblp-quirks.patch @@ -0,0 +1,86 @@ +diff -up cups-1.5.4/backend/usb-libusb.c.usblp-quirks cups-1.5.4/backend/usb-libusb.c +--- cups-1.5.4/backend/usb-libusb.c.usblp-quirks 2012-07-16 19:16:46.000000000 +0200 ++++ cups-1.5.4/backend/usb-libusb.c 2012-08-23 13:37:28.309013482 +0200 +@@ -70,7 +70,7 @@ typedef struct usb_printer_s /**** USB + read_endp, /* Read endpoint */ + protocol, /* Protocol: 1 = Uni-di, 2 = Bi-di. */ + usblp_attached, /* "usblp" kernel module attached? */ +- opened_for_job; /* Set to 1 by print_device() */ ++ reset_after_job; /* Set to 1 by print_device() */ + unsigned int quirks; /* Quirks flags */ + struct libusb_device_handle *handle; /* Open handle to device */ + } usb_printer_t; +@@ -122,6 +122,8 @@ struct quirk_printer_struct { + #define USBLP_QUIRK_USB_INIT 0x2 /* needs vendor USB init string */ + #define USBLP_QUIRK_BAD_CLASS 0x4 /* descriptor uses vendor-specific + Class or SubClass */ ++#define USBLP_QUIRK_RESET 0x4000 /* After printing do a reset ++ for clean-up */ + #define USBLP_QUIRK_NO_REATTACH 0x8000 /* After printing we cannot re-attach + the usblp kernel module */ + +@@ -141,15 +143,21 @@ static const struct quirk_printer_struct + { 0x0409, 0xf1be, USBLP_QUIRK_BIDIR }, /* NEC Picty800 (HP OEM) */ + { 0x0482, 0x0010, USBLP_QUIRK_BIDIR }, /* Kyocera Mita FS 820, + by zut */ ++ { 0x04a9, 0x10a2, USBLP_QUIRK_BIDIR }, /* Canon, Inc. PIXMA iP4200 ++ Printer, http://www.cups.org/str.php?L4155 */ ++ { 0x04a9, 0x10b6, USBLP_QUIRK_BIDIR }, /* Canon, Inc. PIXMA iP4300 ++ Printer, https://bugs.launchpad.net/bugs/1032385 */ + { 0x04f9, 0x000d, USBLP_QUIRK_BIDIR | + USBLP_QUIRK_NO_REATTACH }, /* Brother Industries, Ltd + HL-1440 Laser Printer */ + { 0x04b8, 0x0202, USBLP_QUIRK_BAD_CLASS }, /* Seiko Epson Receipt + Printer M129C */ + { 0x067b, 0x2305, USBLP_QUIRK_BIDIR | +- USBLP_QUIRK_NO_REATTACH }, ++ USBLP_QUIRK_NO_REATTACH | ++ USBLP_QUIRK_RESET }, + /* Prolific Technology, Inc. PL2305 Parallel Port + (USB -> Parallel adapter) */ ++ { 0x04e8, 0x0000, USBLP_QUIRK_RESET }, /* All Samsung devices */ + { 0, 0 } + }; + +@@ -256,7 +264,12 @@ print_device(const char *uri, /* I - De + } + + g.print_fd = print_fd; +- g.printer->opened_for_job = 1; ++ ++ /* ++ * Some devices need a reset after finishing a job, these devices are ++ * marked with the USBLP_QUIRK_RESET quirk. ++ */ ++ g.printer->reset_after_job = (g.printer->quirks & USBLP_QUIRK_RESET ? 1 : 0); + + /* + * If we are printing data from a print driver on stdin, ignore SIGTERM +@@ -772,7 +786,7 @@ close_device(usb_printer_t *printer) /* + * Reset the device to clean up after the job + */ + +- if (printer->opened_for_job == 1) ++ if (printer->reset_after_job == 1) + { + if ((errcode = libusb_reset_device(printer->handle)) < 0) + fprintf(stderr, +@@ -1288,7 +1302,7 @@ open_device(usb_printer_t *printer, /* I + } + + printer->usblp_attached = 0; +- printer->opened_for_job = 0; ++ printer->reset_after_job = 0; + + if (verbose) + fputs("STATE: +connecting-to-device\n", stderr); +@@ -1586,7 +1600,8 @@ static unsigned int quirks(int vendor, i + for (i = 0; quirk_printers[i].vendorId; i++) + { + if (vendor == quirk_printers[i].vendorId && +- product == quirk_printers[i].productId) ++ (quirk_printers[i].productId == 0x0000 || ++ product == quirk_printers[i].productId)) + return quirk_printers[i].quirks; + } + return 0; diff --git a/cups.spec b/cups.spec index a97c281..b275688 100644 --- a/cups.spec +++ b/cups.spec @@ -12,7 +12,7 @@ Summary: Common Unix Printing System Name: cups Version: 1.5.4 -Release: 2%{?dist} +Release: 3%{?dist} License: GPLv2 Group: System Environment/Daemons Source: http://ftp.easysw.com/pub/cups/%{version}/cups-%{version}-source.tar.bz2 @@ -55,6 +55,7 @@ Patch20: cups-filter-debug.patch Patch21: cups-uri-compat.patch Patch22: cups-cups-get-classes.patch Patch23: cups-str3382.patch +Patch24: cups-usblp-quirks.patch Patch25: cups-0755.patch Patch26: cups-snmp-quirks.patch Patch27: cups-hp-deviceid-oid.patch @@ -261,6 +262,10 @@ Sends IPP requests to the specified URI and tests and/or displays the results. %patch22 -p1 -b .cups-get-classes # Fix temporary filename creation. %patch23 -p1 -b .str3382 +# Problem is a port reset which is done by the new USB backend of CUPS 1.5.4 and 1.6.x to clean up after the job. +# This patch adds a quirk handler for this reset so that it will not be done for all printers. +#(bug #847923, STR #4155) +%patch24 -p1 -b .usblp-quirks # Use mode 0755 for binaries and libraries where appropriate. %patch25 -p1 -b .0755 # Handle SNMP supply level quirks (bug #581825). @@ -648,6 +653,9 @@ rm -f %{cups_serverbin}/backend/smb %{_mandir}/man1/ipptool.1.gz %changelog +* Thu Aug 23 2012 Jiri Popelka 1:1.5.4-3 +- quirk handler for port reset done by new USB backend (bug #847923, STR #4155) + * Tue Aug 21 2012 Jiri Popelka 1:1.5.4-2 - use new systemd-rpm macros (#850074) From 93d65f09f1e11f9c8fd6f7163cb81660d006402e Mon Sep 17 00:00:00 2001 From: Jiri Popelka Date: Wed, 29 Aug 2012 11:32:19 +0200 Subject: [PATCH 03/30] backport 2 upstream commits (r10572, r10573) --- cups-avahi-5-services.patch | 167 ++++++++++++++++++++++++------------ cups-r10572.patch | 30 +++++++ cups.spec | 10 ++- 3 files changed, 153 insertions(+), 54 deletions(-) create mode 100644 cups-r10572.patch diff --git a/cups-avahi-5-services.patch b/cups-avahi-5-services.patch index 820b3c3..23928c4 100644 --- a/cups-avahi-5-services.patch +++ b/cups-avahi-5-services.patch @@ -1,6 +1,6 @@ -diff -up cups-1.5.2/cgi-bin/admin.c.avahi-5-services cups-1.5.2/cgi-bin/admin.c ---- cups-1.5.2/cgi-bin/admin.c.avahi-5-services 2011-08-17 22:01:53.000000000 +0100 -+++ cups-1.5.2/cgi-bin/admin.c 2012-03-14 15:08:25.701611799 +0000 +diff -up cups-1.5.4/cgi-bin/admin.c.avahi-5-services cups-1.5.4/cgi-bin/admin.c +--- cups-1.5.4/cgi-bin/admin.c.avahi-5-services 2011-08-17 23:01:53.000000000 +0200 ++++ cups-1.5.4/cgi-bin/admin.c 2012-08-29 11:15:25.429920413 +0200 @@ -1643,7 +1643,7 @@ do_config_server(http_t *http) /* I - H else local_protocols[0] = '\0'; @@ -31,9 +31,9 @@ diff -up cups-1.5.2/cgi-bin/admin.c.avahi-5-services cups-1.5.2/cgi-bin/admin.c #ifdef HAVE_LDAP cgiSetVariable("HAVE_LDAP", "1"); -diff -up cups-1.5.2/scheduler/avahi.h.avahi-5-services cups-1.5.2/scheduler/avahi.h ---- cups-1.5.2/scheduler/avahi.h.avahi-5-services 2012-03-14 15:07:29.477542381 +0000 -+++ cups-1.5.2/scheduler/avahi.h 2012-03-14 15:08:25.701611799 +0000 +diff -up cups-1.5.4/scheduler/avahi.h.avahi-5-services cups-1.5.4/scheduler/avahi.h +--- cups-1.5.4/scheduler/avahi.h.avahi-5-services 2012-08-29 11:15:25.335921543 +0200 ++++ cups-1.5.4/scheduler/avahi.h 2012-08-29 11:15:25.429920413 +0200 @@ -3,7 +3,7 @@ * * Avahi poll implementation for the CUPS scheduler. @@ -96,10 +96,10 @@ diff -up cups-1.5.2/scheduler/avahi.h.avahi-5-services cups-1.5.2/scheduler/avah /* * End of "$Id$". -diff -up cups-1.5.2/scheduler/client.c.avahi-5-services cups-1.5.2/scheduler/client.c ---- cups-1.5.2/scheduler/client.c.avahi-5-services 2012-01-13 23:00:22.000000000 +0000 -+++ cups-1.5.2/scheduler/client.c 2012-03-14 15:08:25.703611797 +0000 -@@ -4989,7 +4989,7 @@ valid_host(cupsd_client_t *con) /* I - +diff -up cups-1.5.4/scheduler/client.c.avahi-5-services cups-1.5.4/scheduler/client.c +--- cups-1.5.4/scheduler/client.c.avahi-5-services 2012-03-07 07:05:39.000000000 +0100 ++++ cups-1.5.4/scheduler/client.c 2012-08-29 11:18:35.265583578 +0200 +@@ -5003,7 +5003,7 @@ valid_host(cupsd_client_t *con) /* I - !strncmp(host, "[::1]:", 6)); } @@ -108,7 +108,7 @@ diff -up cups-1.5.2/scheduler/client.c.avahi-5-services cups-1.5.2/scheduler/cli /* * Check if the hostname is something.local (Bonjour); if so, allow it. */ -@@ -4998,7 +4998,7 @@ valid_host(cupsd_client_t *con) /* I - +@@ -5012,7 +5012,7 @@ valid_host(cupsd_client_t *con) /* I - (!_cups_strcasecmp(end, ".local") || !_cups_strncasecmp(end, ".local:", 7) || !_cups_strcasecmp(end, ".local.") || !_cups_strncasecmp(end, ".local.:", 8))) return (1); @@ -117,21 +117,54 @@ diff -up cups-1.5.2/scheduler/client.c.avahi-5-services cups-1.5.2/scheduler/cli /* * Check if the hostname is an IP address... -diff -up cups-1.5.2/scheduler/conf.c.avahi-5-services cups-1.5.2/scheduler/conf.c ---- cups-1.5.2/scheduler/conf.c.avahi-5-services 2012-03-14 15:04:17.636305526 +0000 -+++ cups-1.5.2/scheduler/conf.c 2012-03-14 15:08:25.706611803 +0000 -@@ -652,7 +652,7 @@ cupsdReadConfiguration(void) +@@ -5073,7 +5073,7 @@ valid_host(cupsd_client_t *con) /* I - + } + } + +-#ifdef HAVE_DNSSD ++#if defined(HAVE_DNSSD) || defined(HAVE_AVAHI) + for (a = (cupsd_alias_t *)cupsArrayFirst(DNSSDAlias); + a; + a = (cupsd_alias_t *)cupsArrayNext(DNSSDAlias)) +@@ -5098,7 +5098,7 @@ valid_host(cupsd_client_t *con) /* I - + return (1); + } + } +-#endif /* HAVE_DNSSD */ ++#endif /* HAVE_DNSSD || HAVE_AVAHI */ + + /* + * Check for interface hostname matches... +diff -up cups-1.5.4/scheduler/conf.c.avahi-5-services cups-1.5.4/scheduler/conf.c +--- cups-1.5.4/scheduler/conf.c.avahi-5-services 2012-08-29 11:15:24.510931435 +0200 ++++ cups-1.5.4/scheduler/conf.c 2012-08-29 11:22:07.045867370 +0200 +@@ -85,9 +85,9 @@ static const cupsd_var_t variables[] = + { + { "AccessLog", &AccessLog, CUPSD_VARTYPE_STRING }, + { "AutoPurgeJobs", &JobAutoPurge, CUPSD_VARTYPE_BOOLEAN }, +-#ifdef HAVE_DNSSD ++#if defined(HAVE_DNSSD) || defined(HAVE_AVAHI) + { "BrowseDNSSDRegType", &DNSSDRegType, CUPSD_VARTYPE_STRING }, +-#endif /* HAVE_DNSSD */ ++#endif /* HAVE_DNSSD || HAVE_AVAHI */ + { "BrowseInterval", &BrowseInterval, CUPSD_VARTYPE_INTEGER }, + #ifdef HAVE_LDAP + { "BrowseLDAPBindDN", &BrowseLDAPBindDN, CUPSD_VARTYPE_STRING }, +@@ -652,9 +652,9 @@ cupsdReadConfiguration(void) Browsing = CUPS_DEFAULT_BROWSING; DefaultShared = CUPS_DEFAULT_DEFAULT_SHARED; -#ifdef HAVE_DNSSD +#if defined(HAVE_DNSSD) || defined(HAVE_AVAHI) cupsdSetString(&DNSSDRegType, "_ipp._tcp,_cups"); - #endif /* HAVE_DNSSD */ +-#endif /* HAVE_DNSSD */ ++#endif /* HAVE_DNSSD || HAVE_AVAHI */ -diff -up cups-1.5.2/scheduler/dirsvc.c.avahi-5-services cups-1.5.2/scheduler/dirsvc.c ---- cups-1.5.2/scheduler/dirsvc.c.avahi-5-services 2012-03-14 15:04:17.674305572 +0000 -+++ cups-1.5.2/scheduler/dirsvc.c 2012-03-14 15:08:25.709611806 +0000 + cupsdSetString(&LPDConfigFile, CUPS_DEFAULT_LPD_CONFIG_FILE); + cupsdSetString(&SMBConfigFile, CUPS_DEFAULT_SMB_CONFIG_FILE); +diff -up cups-1.5.4/scheduler/dirsvc.c.avahi-5-services cups-1.5.4/scheduler/dirsvc.c +--- cups-1.5.4/scheduler/dirsvc.c.avahi-5-services 2012-08-29 11:15:24.842927454 +0200 ++++ cups-1.5.4/scheduler/dirsvc.c 2012-08-29 11:15:25.553918926 +0200 @@ -27,6 +27,7 @@ * ldap_connect() - Start new LDAP connection * ldap_reconnect() - Reconnect to LDAP Server @@ -438,7 +471,7 @@ diff -up cups-1.5.2/scheduler/dirsvc.c.avahi-5-services cups-1.5.2/scheduler/dir #ifdef HAVE_LDAP -@@ -2334,13 +2442,15 @@ dnssdAddAlias(const void *key, /* I - K +@@ -2339,13 +2447,15 @@ dnssdAddAlias(const void *key, /* I - K "Bad Back to My Mac domain in dynamic store!"); } # endif /* HAVE_COREFOUNDATION */ @@ -455,7 +488,7 @@ diff -up cups-1.5.2/scheduler/dirsvc.c.avahi-5-services cups-1.5.2/scheduler/dir dnssdBuildTxtRecord( int *txt_len, /* O - TXT record length */ cupsd_printer_t *p, /* I - Printer information */ -@@ -2379,7 +2489,12 @@ dnssdBuildTxtRecord( +@@ -2384,7 +2494,12 @@ dnssdBuildTxtRecord( keyvalue[i ][0] = "ty"; keyvalue[i++][1] = p->make_model ? p->make_model : "Unknown"; @@ -469,7 +502,7 @@ diff -up cups-1.5.2/scheduler/dirsvc.c.avahi-5-services cups-1.5.2/scheduler/dir httpAssembleURIf(HTTP_URI_CODING_ALL, adminurl_str, sizeof(adminurl_str), "http", NULL, admin_hostname, DNSSDPort, "/%s/%s", (p->type & CUPS_PRINTER_CLASS) ? "classes" : "printers", -@@ -2462,19 +2577,12 @@ dnssdBuildTxtRecord( +@@ -2467,19 +2582,12 @@ dnssdBuildTxtRecord( * Then pack them into a proper txt record... */ @@ -494,7 +527,7 @@ diff -up cups-1.5.2/scheduler/dirsvc.c.avahi-5-services cups-1.5.2/scheduler/dir } -@@ -2489,6 +2597,10 @@ dnssdDeregisterPrinter( +@@ -2494,6 +2602,10 @@ dnssdDeregisterPrinter( { cupsdLogMessage(CUPSD_LOG_DEBUG2, "dnssdDeregisterPrinter(%s)", p->name); @@ -505,7 +538,7 @@ diff -up cups-1.5.2/scheduler/dirsvc.c.avahi-5-services cups-1.5.2/scheduler/dir /* * Closing the socket deregisters the service */ -@@ -2524,6 +2636,24 @@ dnssdDeregisterPrinter( +@@ -2529,6 +2641,24 @@ dnssdDeregisterPrinter( free(p->printer_txt); p->printer_txt = NULL; } @@ -530,7 +563,7 @@ diff -up cups-1.5.2/scheduler/dirsvc.c.avahi-5-services cups-1.5.2/scheduler/dir /* * Remove the printer from the array of DNS-SD printers, then clear the -@@ -2533,8 +2663,10 @@ dnssdDeregisterPrinter( +@@ -2538,8 +2668,10 @@ dnssdDeregisterPrinter( cupsArrayRemove(DNSSDPrinters, p); cupsdClearString(&p->reg_name); } @@ -541,7 +574,7 @@ diff -up cups-1.5.2/scheduler/dirsvc.c.avahi-5-services cups-1.5.2/scheduler/dir /* * 'dnssdPackTxtRecord()' - Pack an array of key/value pairs into the * TXT record format. -@@ -2644,8 +2776,10 @@ dnssdRegisterCallback( +@@ -2649,8 +2781,10 @@ dnssdRegisterCallback( LastEvent |= CUPSD_EVENT_PRINTER_MODIFIED; } } @@ -552,7 +585,7 @@ diff -up cups-1.5.2/scheduler/dirsvc.c.avahi-5-services cups-1.5.2/scheduler/dir /* * 'dnssdRegisterPrinter()' - Start sending broadcast information for a printer * or update the broadcast contents. -@@ -2654,20 +2788,40 @@ dnssdRegisterCallback( +@@ -2659,20 +2793,40 @@ dnssdRegisterCallback( static void dnssdRegisterPrinter(cupsd_printer_t *p)/* I - Printer */ { @@ -596,7 +629,7 @@ diff -up cups-1.5.2/scheduler/dirsvc.c.avahi-5-services cups-1.5.2/scheduler/dir /* * If per-printer sharing was just disabled make sure we're not * registered before returning. -@@ -2686,12 +2840,36 @@ dnssdRegisterPrinter(cupsd_printer_t *p) +@@ -2691,12 +2845,36 @@ dnssdRegisterPrinter(cupsd_printer_t *p) if (p->info && strlen(p->info) > 0) { if (DNSSDComputerName) @@ -635,7 +668,7 @@ diff -up cups-1.5.2/scheduler/dirsvc.c.avahi-5-services cups-1.5.2/scheduler/dir else strlcpy(name, p->name, sizeof(name)); -@@ -2712,6 +2890,7 @@ dnssdRegisterPrinter(cupsd_printer_t *p) +@@ -2717,6 +2895,7 @@ dnssdRegisterPrinter(cupsd_printer_t *p) * Register IPP and (optionally) LPD... */ @@ -643,7 +676,7 @@ diff -up cups-1.5.2/scheduler/dirsvc.c.avahi-5-services cups-1.5.2/scheduler/dir ipp_len = 0; /* anti-compiler-warning-code */ ipp_txt = dnssdBuildTxtRecord(&ipp_len, p, 0); -@@ -2884,6 +3063,209 @@ dnssdRegisterPrinter(cupsd_printer_t *p) +@@ -2889,6 +3068,209 @@ dnssdRegisterPrinter(cupsd_printer_t *p) if (printer_txt) free(printer_txt); @@ -853,7 +886,7 @@ diff -up cups-1.5.2/scheduler/dirsvc.c.avahi-5-services cups-1.5.2/scheduler/dir } -@@ -2896,6 +3278,10 @@ dnssdStop(void) +@@ -2901,6 +3283,10 @@ dnssdStop(void) { cupsd_printer_t *p; /* Current printer */ @@ -864,7 +897,7 @@ diff -up cups-1.5.2/scheduler/dirsvc.c.avahi-5-services cups-1.5.2/scheduler/dir /* * De-register the individual printers -@@ -2910,12 +3296,23 @@ dnssdStop(void) +@@ -2915,12 +3301,23 @@ dnssdStop(void) * Shutdown the rest of the service refs... */ @@ -888,7 +921,7 @@ diff -up cups-1.5.2/scheduler/dirsvc.c.avahi-5-services cups-1.5.2/scheduler/dir if (RemoteRef) { DNSServiceRefDeallocate(RemoteRef); -@@ -2926,14 +3323,17 @@ dnssdStop(void) +@@ -2931,14 +3328,17 @@ dnssdStop(void) DNSServiceRefDeallocate(DNSSDRef); DNSSDRef = NULL; @@ -906,7 +939,7 @@ diff -up cups-1.5.2/scheduler/dirsvc.c.avahi-5-services cups-1.5.2/scheduler/dir /* * 'dnssdUpdate()' - Handle DNS-SD queries. */ -@@ -2955,6 +3355,153 @@ dnssdUpdate(void) +@@ -2960,6 +3360,153 @@ dnssdUpdate(void) #endif /* HAVE_DNSSD */ @@ -1060,9 +1093,9 @@ diff -up cups-1.5.2/scheduler/dirsvc.c.avahi-5-services cups-1.5.2/scheduler/dir /* * 'get_auth_info_required()' - Get the auth-info-required value to advertise. */ -diff -up cups-1.5.2/scheduler/dirsvc.h.avahi-5-services cups-1.5.2/scheduler/dirsvc.h ---- cups-1.5.2/scheduler/dirsvc.h.avahi-5-services 2011-03-21 02:12:14.000000000 +0000 -+++ cups-1.5.2/scheduler/dirsvc.h 2012-03-14 15:08:25.711611808 +0000 +diff -up cups-1.5.4/scheduler/dirsvc.h.avahi-5-services cups-1.5.4/scheduler/dirsvc.h +--- cups-1.5.4/scheduler/dirsvc.h.avahi-5-services 2011-03-21 03:12:14.000000000 +0100 ++++ cups-1.5.4/scheduler/dirsvc.h 2012-08-29 11:15:25.595918423 +0200 @@ -31,6 +31,10 @@ # endif /* HAVE_LDAP_SSL_H */ #endif /* HAVE_LDAP */ @@ -1135,10 +1168,10 @@ diff -up cups-1.5.2/scheduler/dirsvc.h.avahi-5-services cups-1.5.2/scheduler/dir #ifdef HAVE_LDAP extern void cupsdUpdateLDAPBrowse(void); #endif /* HAVE_LDAP */ -diff -up cups-1.5.2/scheduler/ipp.c.avahi-5-services cups-1.5.2/scheduler/ipp.c ---- cups-1.5.2/scheduler/ipp.c.avahi-5-services 2012-03-14 15:04:17.665305560 +0000 -+++ cups-1.5.2/scheduler/ipp.c 2012-03-14 15:08:25.715611813 +0000 -@@ -6099,7 +6099,7 @@ copy_printer_attrs( +diff -up cups-1.5.4/scheduler/ipp.c.avahi-5-services cups-1.5.4/scheduler/ipp.c +--- cups-1.5.4/scheduler/ipp.c.avahi-5-services 2012-08-29 11:15:24.827927634 +0200 ++++ cups-1.5.4/scheduler/ipp.c 2012-08-29 11:15:25.598918387 +0200 +@@ -6098,7 +6098,7 @@ copy_printer_attrs( ippAddDate(con->response, IPP_TAG_PRINTER, "printer-current-time", ippTimeToDate(curtime)); @@ -1147,7 +1180,7 @@ diff -up cups-1.5.2/scheduler/ipp.c.avahi-5-services cups-1.5.2/scheduler/ipp.c if (!ra || cupsArrayFind(ra, "printer-dns-sd-name")) { if (printer->reg_name) -@@ -6109,7 +6109,7 @@ copy_printer_attrs( +@@ -6108,7 +6108,7 @@ copy_printer_attrs( ippAddInteger(con->response, IPP_TAG_PRINTER, IPP_TAG_NOVALUE, "printer-dns-sd-name", 0); } @@ -1156,9 +1189,9 @@ diff -up cups-1.5.2/scheduler/ipp.c.avahi-5-services cups-1.5.2/scheduler/ipp.c if (!ra || cupsArrayFind(ra, "printer-error-policy")) ippAddString(con->response, IPP_TAG_PRINTER, IPP_TAG_NAME, -diff -up cups-1.5.2/scheduler/main.c.avahi-5-services cups-1.5.2/scheduler/main.c ---- cups-1.5.2/scheduler/main.c.avahi-5-services 2012-03-14 15:06:36.511476986 +0000 -+++ cups-1.5.2/scheduler/main.c 2012-03-14 15:08:25.718611817 +0000 +diff -up cups-1.5.4/scheduler/main.c.avahi-5-services cups-1.5.4/scheduler/main.c +--- cups-1.5.4/scheduler/main.c.avahi-5-services 2012-08-29 11:15:25.045925022 +0200 ++++ cups-1.5.4/scheduler/main.c 2012-08-29 11:24:40.645852870 +0200 @@ -120,6 +120,10 @@ main(int argc, /* I - Number of comm cupsd_listener_t *lis; /* Current listener */ time_t current_time, /* Current time */ @@ -1180,6 +1213,34 @@ diff -up cups-1.5.2/scheduler/main.c.avahi-5-services cups-1.5.2/scheduler/main. browse_time = current_time; event_time = current_time; expire_time = current_time; +@@ -807,9 +814,9 @@ main(int argc, /* I - Number of comm + * Got an error from select! + */ + +-#ifdef HAVE_DNSSD ++#if defined(HAVE_DNSSD) || defined(HAVE_AVAHI) + cupsd_printer_t *p; /* Current printer */ +-#endif /* HAVE_DNSSD */ ++#endif /* HAVE_DNSSD || HAVE_AVAHI */ + + + if (errno == EINTR) /* Just interrupted by a signal */ +@@ -852,13 +859,13 @@ main(int argc, /* I - Number of comm + job->print_pipes[0], job->print_pipes[1], + job->back_pipes[0], job->back_pipes[1]); + +-#ifdef HAVE_DNSSD ++#if defined(HAVE_DNSSD) || defined(HAVE_AVAHI) + for (p = (cupsd_printer_t *)cupsArrayFirst(Printers); + p; + p = (cupsd_printer_t *)cupsArrayNext(Printers)) + cupsdLogMessage(CUPSD_LOG_EMERG, "printer[%s] reg_name=\"%s\"", p->name, + p->reg_name ? p->reg_name : "(null)"); +-#endif /* HAVE_DNSSD */ ++#endif /* HAVE_DNSSD || HAVE_AVAHI */ + + break; + } @@ -894,6 +901,16 @@ main(int argc, /* I - Number of comm tmo = cupsdNextTimeout (&tmo_delay); if (tmo && tmo_delay == 0) @@ -1197,9 +1258,9 @@ diff -up cups-1.5.2/scheduler/main.c.avahi-5-services cups-1.5.2/scheduler/main. #endif /* HAVE_AVAHI */ #ifndef __APPLE__ -diff -up cups-1.5.2/scheduler/printers.c.avahi-5-services cups-1.5.2/scheduler/printers.c ---- cups-1.5.2/scheduler/printers.c.avahi-5-services 2012-03-14 15:04:17.646305537 +0000 -+++ cups-1.5.2/scheduler/printers.c 2012-03-14 15:08:25.720611819 +0000 +diff -up cups-1.5.4/scheduler/printers.c.avahi-5-services cups-1.5.4/scheduler/printers.c +--- cups-1.5.4/scheduler/printers.c.avahi-5-services 2012-08-29 11:15:24.688929302 +0200 ++++ cups-1.5.4/scheduler/printers.c 2012-08-29 11:15:25.686917331 +0200 @@ -883,9 +883,9 @@ cupsdDeletePrinter( cupsdClearString(&p->alert); cupsdClearString(&p->alert_description); @@ -1212,7 +1273,7 @@ diff -up cups-1.5.2/scheduler/printers.c.avahi-5-services cups-1.5.2/scheduler/p cupsArrayDelete(p->filetypes); -@@ -3787,7 +3787,7 @@ add_printer_formats(cupsd_printer_t *p) +@@ -3819,7 +3819,7 @@ add_printer_formats(cupsd_printer_t *p) attr->values[i].string.text = _cupsStrAlloc(mimetype); } @@ -1221,7 +1282,7 @@ diff -up cups-1.5.2/scheduler/printers.c.avahi-5-services cups-1.5.2/scheduler/p { char pdl[1024]; /* Buffer to build pdl list */ mime_filter_t *filter; /* MIME filter looping var */ -@@ -3843,7 +3843,7 @@ add_printer_formats(cupsd_printer_t *p) +@@ -3875,7 +3875,7 @@ add_printer_formats(cupsd_printer_t *p) cupsdSetString(&p->pdl, pdl); } @@ -1230,9 +1291,9 @@ diff -up cups-1.5.2/scheduler/printers.c.avahi-5-services cups-1.5.2/scheduler/p } -diff -up cups-1.5.2/scheduler/printers.h.avahi-5-services cups-1.5.2/scheduler/printers.h ---- cups-1.5.2/scheduler/printers.h.avahi-5-services 2011-03-18 18:42:46.000000000 +0000 -+++ cups-1.5.2/scheduler/printers.h 2012-03-14 15:08:25.721611820 +0000 +diff -up cups-1.5.4/scheduler/printers.h.avahi-5-services cups-1.5.4/scheduler/printers.h +--- cups-1.5.4/scheduler/printers.h.avahi-5-services 2011-03-18 19:42:46.000000000 +0100 ++++ cups-1.5.4/scheduler/printers.h 2012-08-29 11:15:25.713917008 +0200 @@ -16,6 +16,9 @@ #ifdef HAVE_DNSSD # include diff --git a/cups-r10572.patch b/cups-r10572.patch new file mode 100644 index 0000000..6294a6a --- /dev/null +++ b/cups-r10572.patch @@ -0,0 +1,30 @@ +From 03b8c2d4e3f5f3528479288df6c738f671488e54 Mon Sep 17 00:00:00 2001 +From: mike +Date: Tue, 28 Aug 2012 21:54:13 +0000 +Subject: CUPS now includes the port number in the Host: header + for HTTP requests. + +diff --git a/cups/http.c b/cups/http.c +index 358701e..f818635 100644 +--- a/cups/http.c ++++ b/cups/http.c +@@ -3702,8 +3702,17 @@ http_send(http_t *http, /* I - Connection to server */ + DEBUG_printf(("9http_send: %s: %s", http_fields[i], + httpGetField(http, i))); + +- if (httpPrintf(http, "%s: %s\r\n", http_fields[i], +- httpGetField(http, i)) < 1) ++ if (i == HTTP_FIELD_HOST) ++ { ++ if (httpPrintf(http, "Host: %s:%d\r\n", httpGetField(http, i), ++ _httpAddrPort(http->hostaddr)) < 1) ++ { ++ http->status = HTTP_ERROR; ++ return (-1); ++ } ++ } ++ else if (httpPrintf(http, "%s: %s\r\n", http_fields[i], ++ httpGetField(http, i)) < 1) + { + http->status = HTTP_ERROR; + return (-1); diff --git a/cups.spec b/cups.spec index b275688..2f72161 100644 --- a/cups.spec +++ b/cups.spec @@ -12,7 +12,7 @@ Summary: Common Unix Printing System Name: cups Version: 1.5.4 -Release: 3%{?dist} +Release: 4%{?dist} License: GPLv2 Group: System Environment/Daemons Source: http://ftp.easysw.com/pub/cups/%{version}/cups-%{version}-source.tar.bz2 @@ -71,6 +71,8 @@ Patch34: cups-avahi-5-services.patch Patch35: cups-icc.patch Patch36: cups-systemd-socket.patch +Patch40: cups-r10572.patch + Patch100: cups-lspp.patch Epoch: 1 @@ -293,6 +295,9 @@ Sends IPP requests to the specified URI and tests and/or displays the results. # Poettering). %patch36 -p1 -b .systemd-socket +# CUPS now includes the port number in the Host: header for HTTP requests. (r10572) +%patch40 -p1 -b .r10572 + %if %lspp # LSPP support. %patch100 -p1 -b .lspp @@ -653,6 +658,9 @@ rm -f %{cups_serverbin}/backend/smb %{_mandir}/man1/ipptool.1.gz %changelog +* Wed Aug 29 2012 Jiri Popelka 1:1.5.4-4 +- backport 2 upstream commits (r10572, r10573) + * Thu Aug 23 2012 Jiri Popelka 1:1.5.4-3 - quirk handler for port reset done by new USB backend (bug #847923, STR #4155) From 46c9f563bf91a6766cbf7ea5e865f907427f6984 Mon Sep 17 00:00:00 2001 From: Jiri Popelka Date: Wed, 29 Aug 2012 12:17:52 +0200 Subject: [PATCH 04/30] Amend the last change. --- cups-avahi-5-services.patch | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/cups-avahi-5-services.patch b/cups-avahi-5-services.patch index 23928c4..95cf60f 100644 --- a/cups-avahi-5-services.patch +++ b/cups-avahi-5-services.patch @@ -117,24 +117,6 @@ diff -up cups-1.5.4/scheduler/client.c.avahi-5-services cups-1.5.4/scheduler/cli /* * Check if the hostname is an IP address... -@@ -5073,7 +5073,7 @@ valid_host(cupsd_client_t *con) /* I - - } - } - --#ifdef HAVE_DNSSD -+#if defined(HAVE_DNSSD) || defined(HAVE_AVAHI) - for (a = (cupsd_alias_t *)cupsArrayFirst(DNSSDAlias); - a; - a = (cupsd_alias_t *)cupsArrayNext(DNSSDAlias)) -@@ -5098,7 +5098,7 @@ valid_host(cupsd_client_t *con) /* I - - return (1); - } - } --#endif /* HAVE_DNSSD */ -+#endif /* HAVE_DNSSD || HAVE_AVAHI */ - - /* - * Check for interface hostname matches... diff -up cups-1.5.4/scheduler/conf.c.avahi-5-services cups-1.5.4/scheduler/conf.c --- cups-1.5.4/scheduler/conf.c.avahi-5-services 2012-08-29 11:15:24.510931435 +0200 +++ cups-1.5.4/scheduler/conf.c 2012-08-29 11:22:07.045867370 +0200 From 13ead681f330d118d266c1a8a7084df66e3267b2 Mon Sep 17 00:00:00 2001 From: Tim Waugh Date: Tue, 18 Sep 2012 10:31:41 +0100 Subject: [PATCH 05/30] Don't use the IPP Create-Job operation, widely implemented unreliably (bug #854989). Resolves: rhbz#854989 --- cups-ipp-no-create-job.patch | 25 +++++++++++++++++++++++++ cups.spec | 11 ++++++++++- 2 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 cups-ipp-no-create-job.patch diff --git a/cups-ipp-no-create-job.patch b/cups-ipp-no-create-job.patch new file mode 100644 index 0000000..2e902d2 --- /dev/null +++ b/cups-ipp-no-create-job.patch @@ -0,0 +1,25 @@ +diff -up cups-1.5.4/backend/ipp.c.no-create-job cups-1.5.4/backend/ipp.c +--- cups-1.5.4/backend/ipp.c.no-create-job 2012-09-18 10:27:00.674951341 +0100 ++++ cups-1.5.4/backend/ipp.c 2012-09-18 10:28:37.360322089 +0100 +@@ -1127,21 +1127,10 @@ main(int argc, /* I - Number of comm + { + if (operations_sup->values[i].integer == IPP_VALIDATE_JOB) + validate_job = 1; +- else if (operations_sup->values[i].integer == IPP_CREATE_JOB) +- create_job = 1; +- else if (operations_sup->values[i].integer == IPP_SEND_DOCUMENT) +- send_document = 1; + else if (operations_sup->values[i].integer == IPP_GET_JOB_ATTRIBUTES) + get_job_attrs = 1; + } + +- if (!send_document) +- { +- fputs("DEBUG: Printer supports Create-Job but not Send-Document.\n", +- stderr); +- create_job = 0; +- } +- + if (!validate_job) + update_reasons(NULL, "+cups-ipp-conformance-failure-report," + "cups-ipp-missing-validate-job"); diff --git a/cups.spec b/cups.spec index 2f72161..4d222ed 100644 --- a/cups.spec +++ b/cups.spec @@ -12,7 +12,7 @@ Summary: Common Unix Printing System Name: cups Version: 1.5.4 -Release: 4%{?dist} +Release: 5%{?dist} License: GPLv2 Group: System Environment/Daemons Source: http://ftp.easysw.com/pub/cups/%{version}/cups-%{version}-source.tar.bz2 @@ -72,6 +72,7 @@ Patch35: cups-icc.patch Patch36: cups-systemd-socket.patch Patch40: cups-r10572.patch +Patch41: cups-ipp-no-create-job.patch Patch100: cups-lspp.patch @@ -298,6 +299,10 @@ Sends IPP requests to the specified URI and tests and/or displays the results. # CUPS now includes the port number in the Host: header for HTTP requests. (r10572) %patch40 -p1 -b .r10572 +# Don't use the IPP Create-Job operation, widely implemented +# unreliably (bug #854989). +%patch41 -p1 -b .ipp-no-create-job + %if %lspp # LSPP support. %patch100 -p1 -b .lspp @@ -658,6 +663,10 @@ rm -f %{cups_serverbin}/backend/smb %{_mandir}/man1/ipptool.1.gz %changelog +* Tue Sep 18 2012 Tim Waugh 1:1.5.4-5 +- Don't use the IPP Create-Job operation, widely implemented + unreliably (bug #854989). + * Wed Aug 29 2012 Jiri Popelka 1:1.5.4-4 - backport 2 upstream commits (r10572, r10573) From 6f8df0299d35e1ef7388bb1ba1d7c6786020c61a Mon Sep 17 00:00:00 2001 From: Tim Waugh Date: Thu, 20 Sep 2012 14:22:05 +0100 Subject: [PATCH 06/30] The cups-libs subpackage contains code distributed under the zlib license (md5.c). --- cups.spec | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cups.spec b/cups.spec index 4d222ed..864a145 100644 --- a/cups.spec +++ b/cups.spec @@ -12,7 +12,7 @@ Summary: Common Unix Printing System Name: cups Version: 1.5.4 -Release: 5%{?dist} +Release: 6%{?dist} License: GPLv2 Group: System Environment/Daemons Source: http://ftp.easysw.com/pub/cups/%{version}/cups-%{version}-source.tar.bz2 @@ -163,7 +163,7 @@ Provides: cupsddk-devel = 1.2.3-7 %package libs Summary: Common Unix Printing System - libraries Group: System Environment/Libraries -License: LGPLv2 +License: LGPLv2 and zlib %package lpd Summary: Common Unix Printing System - lpd emulation @@ -663,6 +663,10 @@ rm -f %{cups_serverbin}/backend/smb %{_mandir}/man1/ipptool.1.gz %changelog +* Thu Sep 20 2012 Tim Waugh 1:1.5.4-6 +- The cups-libs subpackage contains code distributed under the zlib + license (md5.c). + * Tue Sep 18 2012 Tim Waugh 1:1.5.4-5 - Don't use the IPP Create-Job operation, widely implemented unreliably (bug #854989). From dbefc1a655425ed608a482dc34eff56ae28e8110 Mon Sep 17 00:00:00 2001 From: Jiri Popelka Date: Fri, 21 Sep 2012 16:15:55 +0200 Subject: [PATCH 07/30] backport fixes for STR #4072, STR #4124 --- cups-str4072.patch | 118 +++++++++++++++++++++++++++++++++++++++++++++ cups-str4124.patch | 12 +++++ cups.spec | 23 ++++++--- 3 files changed, 147 insertions(+), 6 deletions(-) create mode 100644 cups-str4072.patch create mode 100644 cups-str4124.patch diff --git a/cups-str4072.patch b/cups-str4072.patch new file mode 100644 index 0000000..d27669c --- /dev/null +++ b/cups-str4072.patch @@ -0,0 +1,118 @@ +diff -up cups-1.5.4/scheduler/ipp.c.str4072 cups-1.5.4/scheduler/ipp.c +--- cups-1.5.4/scheduler/ipp.c.str4072 2012-09-21 16:12:17.804952422 +0200 ++++ cups-1.5.4/scheduler/ipp.c 2012-09-21 16:13:15.032165941 +0200 +@@ -12131,7 +12131,8 @@ validate_job(cupsd_client_t *con, /* I + http_status_t status; /* Policy status */ + ipp_attribute_t *attr, /* Current attribute */ + *auth_info; /* auth-info attribute */ +- ipp_attribute_t *format; /* Document-format attribute */ ++ ipp_attribute_t *format, /* Document-format attribute */ ++ *name; /* Job-name attribute */ + cups_ptype_t dtype; /* Destination type (printer/class) */ + char super[MIME_MAX_SUPER], + /* Supertype of file */ +@@ -12158,7 +12159,7 @@ validate_job(cupsd_client_t *con, /* I + ) + { + send_ipp_status(con, IPP_ATTRIBUTES, +- _("Unsupported compression \"%s\"."), ++ _("Unsupported 'compression' value \"%s\"."), + attr->values[0].string.text); + ippAddString(con->response, IPP_TAG_UNSUPPORTED_GROUP, IPP_TAG_KEYWORD, + "compression", NULL, attr->values[0].string.text); +@@ -12176,7 +12177,8 @@ validate_job(cupsd_client_t *con, /* I + if (sscanf(format->values[0].string.text, "%15[^/]/%31[^;]", + super, type) != 2) + { +- send_ipp_status(con, IPP_BAD_REQUEST, _("Bad document-format \"%s\"."), ++ send_ipp_status(con, IPP_BAD_REQUEST, ++ _("Bad 'document-format' value \"%s\"."), + format->values[0].string.text); + return; + } +@@ -12187,7 +12189,7 @@ validate_job(cupsd_client_t *con, /* I + cupsdLogMessage(CUPSD_LOG_INFO, + "Hint: Do you have the raw file printing rules enabled?"); + send_ipp_status(con, IPP_DOCUMENT_FORMAT, +- _("Unsupported document-format \"%s\"."), ++ _("Unsupported 'document-format' value \"%s\"."), + format->values[0].string.text); + ippAddString(con->response, IPP_TAG_UNSUPPORTED_GROUP, IPP_TAG_MIMETYPE, + "document-format", NULL, format->values[0].string.text); +@@ -12195,6 +12197,76 @@ validate_job(cupsd_client_t *con, /* I + } + } + ++ /* ++ * Is the job-name valid? ++ */ ++ ++ if ((name = ippFindAttribute(con->request, "job-name", IPP_TAG_ZERO)) != NULL) ++ { ++ int bad_name = 0; /* Is the job-name value bad? */ ++ ++ if ((name->value_tag != IPP_TAG_NAME && name->value_tag != IPP_TAG_NAMELANG) || ++ name->num_values != 1) ++ { ++ bad_name = 1; ++ } ++ else ++ { ++ /* ++ * Validate that job-name conforms to RFC 5198 (Network Unicode) and ++ * IPP Everywhere requirements for "name" values... ++ */ ++ ++ const unsigned char *nameptr; /* Pointer into "job-name" attribute */ ++ ++ for (nameptr = (unsigned char *)name->values[0].string.text; ++ *nameptr; ++ nameptr ++) ++ { ++ if (*nameptr < ' ' && *nameptr != '\t') ++ break; ++ else if (*nameptr == 0x7f) ++ break; ++ else if ((*nameptr & 0xe0) == 0xc0) ++ { ++ if ((nameptr[1] & 0xc0) != 0x80) ++ break; ++ ++ nameptr ++; ++ } ++ else if ((*nameptr & 0xf0) == 0xe0) ++ { ++ if ((nameptr[1] & 0xc0) != 0x80 || ++ (nameptr[2] & 0xc0) != 0x80) ++ break; ++ ++ nameptr += 2; ++ } ++ else if ((*nameptr & 0xf8) == 0xf0) ++ { ++ if ((nameptr[1] & 0xc0) != 0x80 || ++ (nameptr[2] & 0xc0) != 0x80 || ++ (nameptr[3] & 0xc0) != 0x80) ++ break; ++ ++ nameptr += 3; ++ } ++ else if (*nameptr & 0x80) ++ break; ++ } ++ ++ if (*nameptr) ++ bad_name = 1; ++ } ++ ++ if (bad_name) ++ { ++ cupsdLogMessage(CUPSD_LOG_WARN, ++ "Unsupported 'job-name' value, deleting from request."); ++ ippDeleteAttribute(con->request, name); ++ } ++ } ++ + /* + * Is the destination valid? + */ diff --git a/cups-str4124.patch b/cups-str4124.patch new file mode 100644 index 0000000..338369a --- /dev/null +++ b/cups-str4124.patch @@ -0,0 +1,12 @@ +diff -up cups-1.5.4/cups/backend.c.str4124 cups-1.5.4/cups/backend.c +--- cups-1.5.4/cups/backend.c.str4124 2012-01-30 22:50:42.000000000 +0100 ++++ cups-1.5.4/cups/backend.c 2012-09-21 16:02:42.638864512 +0200 +@@ -125,7 +125,7 @@ quote_string(const char *s) /* I - Stri + if (*s == '\\' || *s == '\"') + putchar('\\'); + +- if (*s == '\n') ++ if (((*s & 255) < ' ' && *s != '\t') || *s == 0x7f) + putchar(' '); + else + putchar(*s); diff --git a/cups.spec b/cups.spec index 864a145..7d68cf3 100644 --- a/cups.spec +++ b/cups.spec @@ -12,7 +12,7 @@ Summary: Common Unix Printing System Name: cups Version: 1.5.4 -Release: 6%{?dist} +Release: 7%{?dist} License: GPLv2 Group: System Environment/Daemons Source: http://ftp.easysw.com/pub/cups/%{version}/cups-%{version}-source.tar.bz2 @@ -70,9 +70,11 @@ Patch34: cups-avahi-5-services.patch Patch35: cups-icc.patch Patch36: cups-systemd-socket.patch +Patch37: cups-ipp-no-create-job.patch Patch40: cups-r10572.patch -Patch41: cups-ipp-no-create-job.patch +Patch41: cups-str4072.patch +Patch42: cups-str4124.patch Patch100: cups-lspp.patch @@ -296,12 +298,18 @@ Sends IPP requests to the specified URI and tests and/or displays the results. # Poettering). %patch36 -p1 -b .systemd-socket -# CUPS now includes the port number in the Host: header for HTTP requests. (r10572) -%patch40 -p1 -b .r10572 - # Don't use the IPP Create-Job operation, widely implemented # unreliably (bug #854989). -%patch41 -p1 -b .ipp-no-create-job +%patch37 -p1 -b .ipp-no-create-job + +# CUPS now includes the port number in the Host: header for HTTP requests. (r10572) +%patch40 -p1 -b .r10572 +# The scheduler no longer allows job-name values +# that are not valid network Unicode strings (STR #4072) +%patch41 -p1 -b .str4072 +# cupsBackendReport() now filters out all control characters +# from the reported 1284 device IDs (STR #4124) +%patch42 -p1 -b .str4124 %if %lspp # LSPP support. @@ -663,6 +671,9 @@ rm -f %{cups_serverbin}/backend/smb %{_mandir}/man1/ipptool.1.gz %changelog +* Fri Sep 21 2012 Jiri Popelka 1:1.5.4-7 +- backport fixes for STR #4072, STR #4124 + * Thu Sep 20 2012 Tim Waugh 1:1.5.4-6 - The cups-libs subpackage contains code distributed under the zlib license (md5.c). From 7238440cc4fbc12a35a70219d91bfc4010832a0a Mon Sep 17 00:00:00 2001 From: Jiri Popelka Date: Mon, 1 Oct 2012 12:28:11 +0200 Subject: [PATCH 08/30] backport fixes for STR #4191, STR #4194 --- cups-str4194.patch | 24 ++++++++++++++++++++++++ cups-usblp-quirks.patch | 40 +++++++++++++++++++++++++++++++--------- cups.spec | 11 +++++++++-- 3 files changed, 64 insertions(+), 11 deletions(-) create mode 100644 cups-str4194.patch diff --git a/cups-str4194.patch b/cups-str4194.patch new file mode 100644 index 0000000..56905a6 --- /dev/null +++ b/cups-str4194.patch @@ -0,0 +1,24 @@ +From a94dbce56edeebbd3631ab6e734cf88248a41065 Mon Sep 17 00:00:00 2001 +From: mike +Date: Mon, 1 Oct 2012 02:10:26 +0000 +Subject: [PATCH] The IPP backend could get stuck in an endless loop on + certain network errors (STR #4194) + +git-svn-id: http://svn.easysw.com/public/cups/trunk@10623 7a7537e8-13f0-0310-91df-b6672ffda945 +--- +diff --git a/backend/ipp.c b/backend/ipp.c +index a53929e..b509996 100644 +--- a/backend/ipp.c ++++ b/backend/ipp.c +@@ -952,6 +952,8 @@ main(int argc, /* I - Number of command-line args */ + _cupsLangPrintFilter(stderr, "ERROR", + _("Unable to get printer status.")); + sleep(10); ++ ++ httpReconnect(http); + } + + ippDelete(supported); +-- +1.7.11.4 + diff --git a/cups-usblp-quirks.patch b/cups-usblp-quirks.patch index 135f939..59ec64b 100644 --- a/cups-usblp-quirks.patch +++ b/cups-usblp-quirks.patch @@ -1,6 +1,6 @@ diff -up cups-1.5.4/backend/usb-libusb.c.usblp-quirks cups-1.5.4/backend/usb-libusb.c --- cups-1.5.4/backend/usb-libusb.c.usblp-quirks 2012-07-16 19:16:46.000000000 +0200 -+++ cups-1.5.4/backend/usb-libusb.c 2012-08-23 13:37:28.309013482 +0200 ++++ cups-1.5.4/backend/usb-libusb.c 2012-10-01 12:25:00.971216077 +0200 @@ -70,7 +70,7 @@ typedef struct usb_printer_s /**** USB read_endp, /* Read endpoint */ protocol, /* Protocol: 1 = Uni-di, 2 = Bi-di. */ @@ -19,7 +19,7 @@ diff -up cups-1.5.4/backend/usb-libusb.c.usblp-quirks cups-1.5.4/backend/usb-lib #define USBLP_QUIRK_NO_REATTACH 0x8000 /* After printing we cannot re-attach the usblp kernel module */ -@@ -141,15 +143,21 @@ static const struct quirk_printer_struct +@@ -141,15 +143,41 @@ static const struct quirk_printer_struct { 0x0409, 0xf1be, USBLP_QUIRK_BIDIR }, /* NEC Picty800 (HP OEM) */ { 0x0482, 0x0010, USBLP_QUIRK_BIDIR }, /* Kyocera Mita FS 820, by zut */ @@ -27,9 +27,27 @@ diff -up cups-1.5.4/backend/usb-libusb.c.usblp-quirks cups-1.5.4/backend/usb-lib + Printer, http://www.cups.org/str.php?L4155 */ + { 0x04a9, 0x10b6, USBLP_QUIRK_BIDIR }, /* Canon, Inc. PIXMA iP4300 + Printer, https://bugs.launchpad.net/bugs/1032385 */ ++ { 0x04a9, 0x170c, USBLP_QUIRK_BIDIR }, /* Canon, Inc. MP500 ++ Printer, https://bugs.launchpad.net/bugs/1032456 */ ++ { 0x04a9, 0x1717, USBLP_QUIRK_BIDIR }, /* Canon, Inc. MP510 ++ Printer, https://bugs.launchpad.net/bugs/1050009 */ ++ { 0x04a9, 0x173d, USBLP_QUIRK_BIDIR }, /* Canon, Inc. MP550 ++ Printer, http://www.cups.org/str.php?L4155 */ ++ { 0x04a9, 0x173e, USBLP_QUIRK_BIDIR }, /* Canon, Inc. MP560 ++ Printer, http://www.cups.org/str.php?L4155 */ ++ { 0x04f9, 0x001a, USBLP_QUIRK_NO_REATTACH }, /* Brother Industries, Ltd ++ HL-1430 Laser Printer, ++ https://bugs.launchpad.net/bugs/1038695 */ { 0x04f9, 0x000d, USBLP_QUIRK_BIDIR | USBLP_QUIRK_NO_REATTACH }, /* Brother Industries, Ltd - HL-1440 Laser Printer */ +- HL-1440 Laser Printer */ ++ HL-1440 Laser Printer, ++ https://bugs.launchpad.net/bugs/1000253 */ ++ { 0x06bc, 0x000b, USBLP_QUIRK_NO_REATTACH }, /* Oki Data Corp. ++ Okipage 14ex Printer, ++ https://bugs.launchpad.net/bugs/872483 */ ++ { 0x06bc, 0x01c7, USBLP_QUIRK_NO_REATTACH }, /* Oki Data Corp. B410d, ++ https://bugs.launchpad.net/bugs/872483 */ { 0x04b8, 0x0202, USBLP_QUIRK_BAD_CLASS }, /* Seiko Epson Receipt Printer M129C */ { 0x067b, 0x2305, USBLP_QUIRK_BIDIR | @@ -37,12 +55,16 @@ diff -up cups-1.5.4/backend/usb-libusb.c.usblp-quirks cups-1.5.4/backend/usb-lib + USBLP_QUIRK_NO_REATTACH | + USBLP_QUIRK_RESET }, /* Prolific Technology, Inc. PL2305 Parallel Port - (USB -> Parallel adapter) */ -+ { 0x04e8, 0x0000, USBLP_QUIRK_RESET }, /* All Samsung devices */ +- (USB -> Parallel adapter) */ ++ (USB -> Parallel adapter), https://bugs.launchpad.net/bugs/987485 */ ++ { 0x04e8, 0x0000, USBLP_QUIRK_RESET }, /* All Samsung devices, ++ https://bugs.launchpad.net/bugs/1032456 */ ++ { 0x0a5f, 0x0000, USBLP_QUIRK_BIDIR }, /* All Zebra devices, ++ https://bugs.launchpad.net/bugs/1001028 */ { 0, 0 } }; -@@ -256,7 +264,12 @@ print_device(const char *uri, /* I - De +@@ -256,7 +284,12 @@ print_device(const char *uri, /* I - De } g.print_fd = print_fd; @@ -56,7 +78,7 @@ diff -up cups-1.5.4/backend/usb-libusb.c.usblp-quirks cups-1.5.4/backend/usb-lib /* * If we are printing data from a print driver on stdin, ignore SIGTERM -@@ -772,7 +786,7 @@ close_device(usb_printer_t *printer) /* +@@ -772,7 +805,7 @@ close_device(usb_printer_t *printer) /* * Reset the device to clean up after the job */ @@ -65,7 +87,7 @@ diff -up cups-1.5.4/backend/usb-libusb.c.usblp-quirks cups-1.5.4/backend/usb-lib { if ((errcode = libusb_reset_device(printer->handle)) < 0) fprintf(stderr, -@@ -1288,7 +1302,7 @@ open_device(usb_printer_t *printer, /* I +@@ -1288,7 +1321,7 @@ open_device(usb_printer_t *printer, /* I } printer->usblp_attached = 0; @@ -74,7 +96,7 @@ diff -up cups-1.5.4/backend/usb-libusb.c.usblp-quirks cups-1.5.4/backend/usb-lib if (verbose) fputs("STATE: +connecting-to-device\n", stderr); -@@ -1586,7 +1600,8 @@ static unsigned int quirks(int vendor, i +@@ -1586,7 +1619,8 @@ static unsigned int quirks(int vendor, i for (i = 0; quirk_printers[i].vendorId; i++) { if (vendor == quirk_printers[i].vendorId && diff --git a/cups.spec b/cups.spec index 7d68cf3..06893ac 100644 --- a/cups.spec +++ b/cups.spec @@ -12,7 +12,7 @@ Summary: Common Unix Printing System Name: cups Version: 1.5.4 -Release: 7%{?dist} +Release: 8%{?dist} License: GPLv2 Group: System Environment/Daemons Source: http://ftp.easysw.com/pub/cups/%{version}/cups-%{version}-source.tar.bz2 @@ -75,6 +75,7 @@ Patch37: cups-ipp-no-create-job.patch Patch40: cups-r10572.patch Patch41: cups-str4072.patch Patch42: cups-str4124.patch +Patch43: cups-str4194.patch Patch100: cups-lspp.patch @@ -269,7 +270,7 @@ Sends IPP requests to the specified URI and tests and/or displays the results. %patch23 -p1 -b .str3382 # Problem is a port reset which is done by the new USB backend of CUPS 1.5.4 and 1.6.x to clean up after the job. # This patch adds a quirk handler for this reset so that it will not be done for all printers. -#(bug #847923, STR #4155) +# (bug #847923, STR #4155, STR #4191) %patch24 -p1 -b .usblp-quirks # Use mode 0755 for binaries and libraries where appropriate. %patch25 -p1 -b .0755 @@ -310,6 +311,9 @@ Sends IPP requests to the specified URI and tests and/or displays the results. # cupsBackendReport() now filters out all control characters # from the reported 1284 device IDs (STR #4124) %patch42 -p1 -b .str4124 +# The IPP backend could get stuck in an endless loop on certain network errors +# (STR #4194) +%patch43 -p1 -b .str4194 %if %lspp # LSPP support. @@ -671,6 +675,9 @@ rm -f %{cups_serverbin}/backend/smb %{_mandir}/man1/ipptool.1.gz %changelog +* Mon Oct 01 2012 Jiri Popelka 1:1.5.4-8 +- backport fixes for STR #4191, STR #4194 + * Fri Sep 21 2012 Jiri Popelka 1:1.5.4-7 - backport fixes for STR #4072, STR #4124 From 95d92a2c9b928644d1ae1630a5a7382e8ad69c9e Mon Sep 17 00:00:00 2001 From: Jiri Popelka Date: Thu, 11 Oct 2012 10:51:52 +0200 Subject: [PATCH 09/30] backport 2 upstream commits (r10638, r10642) --- cups-r10638.patch | 24 ++++++++++++++++++++++++ cups-r10642.patch | 40 ++++++++++++++++++++++++++++++++++++++++ cups.spec | 12 +++++++++++- 3 files changed, 75 insertions(+), 1 deletion(-) create mode 100644 cups-r10638.patch create mode 100644 cups-r10642.patch diff --git a/cups-r10638.patch b/cups-r10638.patch new file mode 100644 index 0000000..16f61bb --- /dev/null +++ b/cups-r10638.patch @@ -0,0 +1,24 @@ +From b1c8da8900d3c854e108ce445bef9fce8522ca22 Mon Sep 17 00:00:00 2001 +From: mike +Date: Tue, 2 Oct 2012 16:30:35 +0000 +Subject: [PATCH] The IPP backend did not send a cancel request to printers + when a job was canceled and the printer did not support + Create-Job. + +git-svn-id: http://svn.easysw.com/public/cups/trunk@10638 7a7537e8-13f0-0310-91df-b6672ffda945 +--- +diff --git a/backend/ipp.c b/backend/ipp.c +index b509996..5eecc29 100644 +--- a/backend/ipp.c ++++ b/backend/ipp.c +@@ -89,6 +89,7 @@ static int child_pid = 0; /* Child process ID */ + #endif /* HAVE_GSSAPI && HAVE_XPC */ + static const char * const jattrs[] = /* Job attributes we want */ + { ++ "job-id", + "job-impressions-completed", + "job-media-sheets-completed", + "job-name", +-- +1.7.11.7 + diff --git a/cups-r10642.patch b/cups-r10642.patch new file mode 100644 index 0000000..684ae38 --- /dev/null +++ b/cups-r10642.patch @@ -0,0 +1,40 @@ +From c98bc4b769f85da3199485c85e8c98bb8c87ff04 Mon Sep 17 00:00:00 2001 +From: mike +Date: Tue, 9 Oct 2012 03:01:31 +0000 +Subject: [PATCH] Work around broken 1284 device IDs that use a newline + instead of a semicolon. + +git-svn-id: http://svn.easysw.com/public/cups/trunk@10642 7a7537e8-13f0-0310-91df-b6672ffda945 +--- +diff --git a/backend/snmp.c b/backend/snmp.c +index f672e37..fc40800 100644 +--- a/backend/snmp.c ++++ b/backend/snmp.c +@@ -1025,6 +1025,11 @@ read_snmp_response(int fd) /* I - SNMP socket file descriptor */ + * Description is the IEEE-1284 device ID... + */ + ++ char *ptr; /* Pointer into device ID */ ++ ++ for (ptr = (char *)packet.object_value.string.bytes; *ptr; ptr ++) ++ if (*ptr == '\n') ++ *ptr = ';'; /* A lot of bad printers put a newline */ + if (!device->id) + device->id = strdup((char *)packet.object_value.string.bytes); + +@@ -1066,8 +1071,11 @@ read_snmp_response(int fd) /* I - SNMP socket file descriptor */ + */ + + char make_model[256]; /* Make and model */ ++ char *ptr; /* Pointer into device ID */ + +- ++ for (ptr = (char *)packet.object_value.string.bytes; *ptr; ptr ++) ++ if (*ptr == '\n') ++ *ptr = ';'; /* A lot of bad printers put a newline */ + if (device->id) + free(device->id); + +-- +1.7.11.7 + diff --git a/cups.spec b/cups.spec index 06893ac..28713d4 100644 --- a/cups.spec +++ b/cups.spec @@ -12,7 +12,7 @@ Summary: Common Unix Printing System Name: cups Version: 1.5.4 -Release: 8%{?dist} +Release: 9%{?dist} License: GPLv2 Group: System Environment/Daemons Source: http://ftp.easysw.com/pub/cups/%{version}/cups-%{version}-source.tar.bz2 @@ -76,6 +76,8 @@ Patch40: cups-r10572.patch Patch41: cups-str4072.patch Patch42: cups-str4124.patch Patch43: cups-str4194.patch +Patch44: cups-r10638.patch +Patch45: cups-r10642.patch Patch100: cups-lspp.patch @@ -314,6 +316,11 @@ Sends IPP requests to the specified URI and tests and/or displays the results. # The IPP backend could get stuck in an endless loop on certain network errors # (STR #4194) %patch43 -p1 -b .str4194 +# The IPP backend did not send a cancel request to printers when a job was +# canceled and the printer did not support Create-Job. +%patch44 -p1 -b .r10638 +# Work around broken 1284 device IDs that use a newline instead of a semicolon. +%patch45 -p1 -b .r10642 %if %lspp # LSPP support. @@ -675,6 +682,9 @@ rm -f %{cups_serverbin}/backend/smb %{_mandir}/man1/ipptool.1.gz %changelog +* Thu Oct 11 2012 Jiri Popelka 1:1.5.4-9 +- backport 2 upstream commits (r10638, r10642) + * Mon Oct 01 2012 Jiri Popelka 1:1.5.4-8 - backport fixes for STR #4191, STR #4194 From d9c54275f78b50788e9b0bf3eeb17a7f80ec8d6c Mon Sep 17 00:00:00 2001 From: Tim Waugh Date: Thu, 11 Oct 2012 13:18:54 +0100 Subject: [PATCH 10/30] Avoid double-free crash in Avahi support (bug #863409). Resolves: rhbz#863409 --- cups-avahi-5-services.patch | 72 ++++++++++++++++++------------------- cups.spec | 5 ++- 2 files changed, 40 insertions(+), 37 deletions(-) diff --git a/cups-avahi-5-services.patch b/cups-avahi-5-services.patch index 95cf60f..e077786 100644 --- a/cups-avahi-5-services.patch +++ b/cups-avahi-5-services.patch @@ -1,6 +1,6 @@ diff -up cups-1.5.4/cgi-bin/admin.c.avahi-5-services cups-1.5.4/cgi-bin/admin.c ---- cups-1.5.4/cgi-bin/admin.c.avahi-5-services 2011-08-17 23:01:53.000000000 +0200 -+++ cups-1.5.4/cgi-bin/admin.c 2012-08-29 11:15:25.429920413 +0200 +--- cups-1.5.4/cgi-bin/admin.c.avahi-5-services 2011-08-17 22:01:53.000000000 +0100 ++++ cups-1.5.4/cgi-bin/admin.c 2012-10-11 13:00:35.888322772 +0100 @@ -1643,7 +1643,7 @@ do_config_server(http_t *http) /* I - H else local_protocols[0] = '\0'; @@ -32,8 +32,8 @@ diff -up cups-1.5.4/cgi-bin/admin.c.avahi-5-services cups-1.5.4/cgi-bin/admin.c #ifdef HAVE_LDAP cgiSetVariable("HAVE_LDAP", "1"); diff -up cups-1.5.4/scheduler/avahi.h.avahi-5-services cups-1.5.4/scheduler/avahi.h ---- cups-1.5.4/scheduler/avahi.h.avahi-5-services 2012-08-29 11:15:25.335921543 +0200 -+++ cups-1.5.4/scheduler/avahi.h 2012-08-29 11:15:25.429920413 +0200 +--- cups-1.5.4/scheduler/avahi.h.avahi-5-services 2012-10-11 13:00:28.757295603 +0100 ++++ cups-1.5.4/scheduler/avahi.h 2012-10-11 13:00:35.888322772 +0100 @@ -3,7 +3,7 @@ * * Avahi poll implementation for the CUPS scheduler. @@ -97,8 +97,8 @@ diff -up cups-1.5.4/scheduler/avahi.h.avahi-5-services cups-1.5.4/scheduler/avah /* * End of "$Id$". diff -up cups-1.5.4/scheduler/client.c.avahi-5-services cups-1.5.4/scheduler/client.c ---- cups-1.5.4/scheduler/client.c.avahi-5-services 2012-03-07 07:05:39.000000000 +0100 -+++ cups-1.5.4/scheduler/client.c 2012-08-29 11:18:35.265583578 +0200 +--- cups-1.5.4/scheduler/client.c.avahi-5-services 2012-03-07 06:05:39.000000000 +0000 ++++ cups-1.5.4/scheduler/client.c 2012-10-11 13:00:35.891322784 +0100 @@ -5003,7 +5003,7 @@ valid_host(cupsd_client_t *con) /* I - !strncmp(host, "[::1]:", 6)); } @@ -118,8 +118,8 @@ diff -up cups-1.5.4/scheduler/client.c.avahi-5-services cups-1.5.4/scheduler/cli /* * Check if the hostname is an IP address... diff -up cups-1.5.4/scheduler/conf.c.avahi-5-services cups-1.5.4/scheduler/conf.c ---- cups-1.5.4/scheduler/conf.c.avahi-5-services 2012-08-29 11:15:24.510931435 +0200 -+++ cups-1.5.4/scheduler/conf.c 2012-08-29 11:22:07.045867370 +0200 +--- cups-1.5.4/scheduler/conf.c.avahi-5-services 2012-10-11 13:00:28.670295210 +0100 ++++ cups-1.5.4/scheduler/conf.c 2012-10-11 13:00:35.892322789 +0100 @@ -85,9 +85,9 @@ static const cupsd_var_t variables[] = { { "AccessLog", &AccessLog, CUPSD_VARTYPE_STRING }, @@ -145,8 +145,8 @@ diff -up cups-1.5.4/scheduler/conf.c.avahi-5-services cups-1.5.4/scheduler/conf. cupsdSetString(&LPDConfigFile, CUPS_DEFAULT_LPD_CONFIG_FILE); cupsdSetString(&SMBConfigFile, CUPS_DEFAULT_SMB_CONFIG_FILE); diff -up cups-1.5.4/scheduler/dirsvc.c.avahi-5-services cups-1.5.4/scheduler/dirsvc.c ---- cups-1.5.4/scheduler/dirsvc.c.avahi-5-services 2012-08-29 11:15:24.842927454 +0200 -+++ cups-1.5.4/scheduler/dirsvc.c 2012-08-29 11:15:25.553918926 +0200 +--- cups-1.5.4/scheduler/dirsvc.c.avahi-5-services 2012-10-11 13:00:28.718295427 +0100 ++++ cups-1.5.4/scheduler/dirsvc.c 2012-10-11 13:00:35.893322793 +0100 @@ -27,6 +27,7 @@ * ldap_connect() - Start new LDAP connection * ldap_reconnect() - Reconnect to LDAP Server @@ -682,10 +682,11 @@ diff -up cups-1.5.4/scheduler/dirsvc.c.avahi-5-services cups-1.5.4/scheduler/dir + */ + + avahi_string_list_free (p->ipp_txt); -+ + if (p->printer_txt) + avahi_string_list_free (p->printer_txt); + ++ p->ipp_txt = p->printer_txt = NULL; ++ + /* + * Update the service group entry. + */ @@ -708,9 +709,6 @@ diff -up cups-1.5.4/scheduler/dirsvc.c.avahi-5-services cups-1.5.4/scheduler/dir + if (ret < 0) + goto update_failed; + -+ p->ipp_txt = ipp_txt; -+ ipp_txt = NULL; -+ + if (BrowseLocalProtocols & BROWSE_LPD) + { + ret = avahi_entry_group_update_service_txt_strlst (p->avahi_group, @@ -721,9 +719,6 @@ diff -up cups-1.5.4/scheduler/dirsvc.c.avahi-5-services cups-1.5.4/scheduler/dir + printer_txt); + if (ret < 0) + goto update_failed; -+ -+ p->printer_txt = printer_txt; -+ printer_txt = NULL; + } + + ret = avahi_entry_group_commit (p->avahi_group); @@ -736,8 +731,13 @@ diff -up cups-1.5.4/scheduler/dirsvc.c.avahi-5-services cups-1.5.4/scheduler/dir + avahi_entry_group_reset (p->avahi_group); + avahi_entry_group_free (p->avahi_group); + p->avahi_group = NULL; -+ ipp_txt = p->ipp_txt; -+ p->ipp_txt = NULL; ++ } ++ else ++ { ++ /* Success */ ++ p->ipp_txt = ipp_txt; ++ p->printer_txt = printer_txt; ++ ipp_txt = printer_txt = NULL; + } + } + @@ -817,8 +817,6 @@ diff -up cups-1.5.4/scheduler/dirsvc.c.avahi-5-services cups-1.5.4/scheduler/dir + } + + free (regtype_copy); -+ p->ipp_txt = ipp_txt; -+ ipp_txt = NULL; + + if (BrowseLocalProtocols & BROWSE_LPD) + { @@ -835,9 +833,6 @@ diff -up cups-1.5.4/scheduler/dirsvc.c.avahi-5-services cups-1.5.4/scheduler/dir + printer_txt); + if (ret < 0) + goto add_failed; -+ -+ p->printer_txt = printer_txt; -+ printer_txt = NULL; + } + + ret = avahi_entry_group_commit (p->avahi_group); @@ -854,8 +849,13 @@ diff -up cups-1.5.4/scheduler/dirsvc.c.avahi-5-services cups-1.5.4/scheduler/dir + avahi_entry_group_free (p->avahi_group); + p->avahi_group = NULL; + } -+ ipp_txt = p->ipp_txt; -+ p->ipp_txt = NULL; ++ } ++ else ++ { ++ /* Success */ ++ p->ipp_txt = ipp_txt; ++ p->printer_txt = printer_txt; ++ ipp_txt = printer_txt = NULL; + } + } + @@ -1076,8 +1076,8 @@ diff -up cups-1.5.4/scheduler/dirsvc.c.avahi-5-services cups-1.5.4/scheduler/dir * 'get_auth_info_required()' - Get the auth-info-required value to advertise. */ diff -up cups-1.5.4/scheduler/dirsvc.h.avahi-5-services cups-1.5.4/scheduler/dirsvc.h ---- cups-1.5.4/scheduler/dirsvc.h.avahi-5-services 2011-03-21 03:12:14.000000000 +0100 -+++ cups-1.5.4/scheduler/dirsvc.h 2012-08-29 11:15:25.595918423 +0200 +--- cups-1.5.4/scheduler/dirsvc.h.avahi-5-services 2011-03-21 02:12:14.000000000 +0000 ++++ cups-1.5.4/scheduler/dirsvc.h 2012-10-11 13:00:35.893322793 +0100 @@ -31,6 +31,10 @@ # endif /* HAVE_LDAP_SSL_H */ #endif /* HAVE_LDAP */ @@ -1151,8 +1151,8 @@ diff -up cups-1.5.4/scheduler/dirsvc.h.avahi-5-services cups-1.5.4/scheduler/dir extern void cupsdUpdateLDAPBrowse(void); #endif /* HAVE_LDAP */ diff -up cups-1.5.4/scheduler/ipp.c.avahi-5-services cups-1.5.4/scheduler/ipp.c ---- cups-1.5.4/scheduler/ipp.c.avahi-5-services 2012-08-29 11:15:24.827927634 +0200 -+++ cups-1.5.4/scheduler/ipp.c 2012-08-29 11:15:25.598918387 +0200 +--- cups-1.5.4/scheduler/ipp.c.avahi-5-services 2012-10-11 13:00:28.712295399 +0100 ++++ cups-1.5.4/scheduler/ipp.c 2012-10-11 13:00:35.895322802 +0100 @@ -6098,7 +6098,7 @@ copy_printer_attrs( ippAddDate(con->response, IPP_TAG_PRINTER, "printer-current-time", ippTimeToDate(curtime)); @@ -1172,8 +1172,8 @@ diff -up cups-1.5.4/scheduler/ipp.c.avahi-5-services cups-1.5.4/scheduler/ipp.c if (!ra || cupsArrayFind(ra, "printer-error-policy")) ippAddString(con->response, IPP_TAG_PRINTER, IPP_TAG_NAME, diff -up cups-1.5.4/scheduler/main.c.avahi-5-services cups-1.5.4/scheduler/main.c ---- cups-1.5.4/scheduler/main.c.avahi-5-services 2012-08-29 11:15:25.045925022 +0200 -+++ cups-1.5.4/scheduler/main.c 2012-08-29 11:24:40.645852870 +0200 +--- cups-1.5.4/scheduler/main.c.avahi-5-services 2012-10-11 13:00:28.755295593 +0100 ++++ cups-1.5.4/scheduler/main.c 2012-10-11 13:00:35.895322802 +0100 @@ -120,6 +120,10 @@ main(int argc, /* I - Number of comm cupsd_listener_t *lis; /* Current listener */ time_t current_time, /* Current time */ @@ -1241,8 +1241,8 @@ diff -up cups-1.5.4/scheduler/main.c.avahi-5-services cups-1.5.4/scheduler/main. #ifndef __APPLE__ diff -up cups-1.5.4/scheduler/printers.c.avahi-5-services cups-1.5.4/scheduler/printers.c ---- cups-1.5.4/scheduler/printers.c.avahi-5-services 2012-08-29 11:15:24.688929302 +0200 -+++ cups-1.5.4/scheduler/printers.c 2012-08-29 11:15:25.686917331 +0200 +--- cups-1.5.4/scheduler/printers.c.avahi-5-services 2012-10-11 13:00:28.677295241 +0100 ++++ cups-1.5.4/scheduler/printers.c 2012-10-11 13:00:35.896322807 +0100 @@ -883,9 +883,9 @@ cupsdDeletePrinter( cupsdClearString(&p->alert); cupsdClearString(&p->alert_description); @@ -1274,8 +1274,8 @@ diff -up cups-1.5.4/scheduler/printers.c.avahi-5-services cups-1.5.4/scheduler/p diff -up cups-1.5.4/scheduler/printers.h.avahi-5-services cups-1.5.4/scheduler/printers.h ---- cups-1.5.4/scheduler/printers.h.avahi-5-services 2011-03-18 19:42:46.000000000 +0100 -+++ cups-1.5.4/scheduler/printers.h 2012-08-29 11:15:25.713917008 +0200 +--- cups-1.5.4/scheduler/printers.h.avahi-5-services 2011-03-18 18:42:46.000000000 +0000 ++++ cups-1.5.4/scheduler/printers.h 2012-10-11 13:00:35.896322807 +0100 @@ -16,6 +16,9 @@ #ifdef HAVE_DNSSD # include diff --git a/cups.spec b/cups.spec index 28713d4..556dede 100644 --- a/cups.spec +++ b/cups.spec @@ -12,7 +12,7 @@ Summary: Common Unix Printing System Name: cups Version: 1.5.4 -Release: 9%{?dist} +Release: 10%{?dist} License: GPLv2 Group: System Environment/Daemons Source: http://ftp.easysw.com/pub/cups/%{version}/cups-%{version}-source.tar.bz2 @@ -682,6 +682,9 @@ rm -f %{cups_serverbin}/backend/smb %{_mandir}/man1/ipptool.1.gz %changelog +* Thu Oct 11 2012 Tim Waugh 1:1.5.4-10 +- Avoid double-free crash in Avahi support (bug #863409). + * Thu Oct 11 2012 Jiri Popelka 1:1.5.4-9 - backport 2 upstream commits (r10638, r10642) From 2645dcc9803934f30da9fcc6089c332c758d8cb9 Mon Sep 17 00:00:00 2001 From: Jiri Popelka Date: Mon, 22 Oct 2012 10:26:23 +0200 Subject: [PATCH 11/30] Add quirk rule for Xerox Phaser 3124 (#867392) --- cups-usblp-quirks.patch | 14 ++++++++------ cups.spec | 5 ++++- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/cups-usblp-quirks.patch b/cups-usblp-quirks.patch index 59ec64b..506564c 100644 --- a/cups-usblp-quirks.patch +++ b/cups-usblp-quirks.patch @@ -1,6 +1,6 @@ diff -up cups-1.5.4/backend/usb-libusb.c.usblp-quirks cups-1.5.4/backend/usb-libusb.c --- cups-1.5.4/backend/usb-libusb.c.usblp-quirks 2012-07-16 19:16:46.000000000 +0200 -+++ cups-1.5.4/backend/usb-libusb.c 2012-10-01 12:25:00.971216077 +0200 ++++ cups-1.5.4/backend/usb-libusb.c 2012-10-17 16:30:58.571793169 +0200 @@ -70,7 +70,7 @@ typedef struct usb_printer_s /**** USB read_endp, /* Read endpoint */ protocol, /* Protocol: 1 = Uni-di, 2 = Bi-di. */ @@ -19,7 +19,7 @@ diff -up cups-1.5.4/backend/usb-libusb.c.usblp-quirks cups-1.5.4/backend/usb-lib #define USBLP_QUIRK_NO_REATTACH 0x8000 /* After printing we cannot re-attach the usblp kernel module */ -@@ -141,15 +143,41 @@ static const struct quirk_printer_struct +@@ -141,15 +143,43 @@ static const struct quirk_printer_struct { 0x0409, 0xf1be, USBLP_QUIRK_BIDIR }, /* NEC Picty800 (HP OEM) */ { 0x0482, 0x0010, USBLP_QUIRK_BIDIR }, /* Kyocera Mita FS 820, by zut */ @@ -54,6 +54,8 @@ diff -up cups-1.5.4/backend/usb-libusb.c.usblp-quirks cups-1.5.4/backend/usb-lib - USBLP_QUIRK_NO_REATTACH }, + USBLP_QUIRK_NO_REATTACH | + USBLP_QUIRK_RESET }, ++ { 0x0924, 0x3ce9, USBLP_QUIRK_NO_REATTACH }, /* Xerox Phaser 3124 ++ https://bugzilla.redhat.com/show_bug.cgi?id=867392 */ /* Prolific Technology, Inc. PL2305 Parallel Port - (USB -> Parallel adapter) */ + (USB -> Parallel adapter), https://bugs.launchpad.net/bugs/987485 */ @@ -64,7 +66,7 @@ diff -up cups-1.5.4/backend/usb-libusb.c.usblp-quirks cups-1.5.4/backend/usb-lib { 0, 0 } }; -@@ -256,7 +284,12 @@ print_device(const char *uri, /* I - De +@@ -256,7 +286,12 @@ print_device(const char *uri, /* I - De } g.print_fd = print_fd; @@ -78,7 +80,7 @@ diff -up cups-1.5.4/backend/usb-libusb.c.usblp-quirks cups-1.5.4/backend/usb-lib /* * If we are printing data from a print driver on stdin, ignore SIGTERM -@@ -772,7 +805,7 @@ close_device(usb_printer_t *printer) /* +@@ -772,7 +807,7 @@ close_device(usb_printer_t *printer) /* * Reset the device to clean up after the job */ @@ -87,7 +89,7 @@ diff -up cups-1.5.4/backend/usb-libusb.c.usblp-quirks cups-1.5.4/backend/usb-lib { if ((errcode = libusb_reset_device(printer->handle)) < 0) fprintf(stderr, -@@ -1288,7 +1321,7 @@ open_device(usb_printer_t *printer, /* I +@@ -1288,7 +1323,7 @@ open_device(usb_printer_t *printer, /* I } printer->usblp_attached = 0; @@ -96,7 +98,7 @@ diff -up cups-1.5.4/backend/usb-libusb.c.usblp-quirks cups-1.5.4/backend/usb-lib if (verbose) fputs("STATE: +connecting-to-device\n", stderr); -@@ -1586,7 +1619,8 @@ static unsigned int quirks(int vendor, i +@@ -1586,7 +1621,8 @@ static unsigned int quirks(int vendor, i for (i = 0; quirk_printers[i].vendorId; i++) { if (vendor == quirk_printers[i].vendorId && diff --git a/cups.spec b/cups.spec index 556dede..81a05b1 100644 --- a/cups.spec +++ b/cups.spec @@ -12,7 +12,7 @@ Summary: Common Unix Printing System Name: cups Version: 1.5.4 -Release: 10%{?dist} +Release: 11%{?dist} License: GPLv2 Group: System Environment/Daemons Source: http://ftp.easysw.com/pub/cups/%{version}/cups-%{version}-source.tar.bz2 @@ -682,6 +682,9 @@ rm -f %{cups_serverbin}/backend/smb %{_mandir}/man1/ipptool.1.gz %changelog +* Mon Oct 22 2012 Jiri Popelka 1:1.5.4-11 +- Add quirk rule for Xerox Phaser 3124 (#867392) + * Thu Oct 11 2012 Tim Waugh 1:1.5.4-10 - Avoid double-free crash in Avahi support (bug #863409). From 88649b7a58bb87dd49a4d62c64914a4834adf8b9 Mon Sep 17 00:00:00 2001 From: Tim Waugh Date: Mon, 29 Oct 2012 11:44:35 +0000 Subject: [PATCH 12/30] Removed broken cups-get-classes patch (bug #870612). Resolves: rhbz#870612 --- cups-cups-get-classes.patch | 89 ------------------------------------- cups.spec | 8 ++-- 2 files changed, 4 insertions(+), 93 deletions(-) delete mode 100644 cups-cups-get-classes.patch diff --git a/cups-cups-get-classes.patch b/cups-cups-get-classes.patch deleted file mode 100644 index c998852..0000000 --- a/cups-cups-get-classes.patch +++ /dev/null @@ -1,89 +0,0 @@ -diff -up cups-1.5.0/cups/dest.c.cups-get-classes cups-1.5.0/cups/dest.c ---- cups-1.5.0/cups/dest.c.cups-get-classes 2011-05-20 04:49:49.000000000 +0100 -+++ cups-1.5.0/cups/dest.c 2011-09-14 12:10:05.111635428 +0100 -@@ -534,6 +534,7 @@ _cupsGetDests(http_t *http, /* I - - char uri[1024]; /* printer-uri value */ - int num_options; /* Number of options */ - cups_option_t *options; /* Options */ -+ int get_classes; /* Whether we need to fetch class */ - #ifdef __APPLE__ - char media_default[41]; /* Default paper size */ - #endif /* __APPLE__ */ -@@ -590,6 +591,8 @@ _cupsGetDests(http_t *http, /* I - - * printer-uri [for IPP_GET_PRINTER_ATTRIBUTES] - */ - -+ get_classes = (op == CUPS_GET_PRINTERS); -+ - request = ippNewRequest(op); - - ippAddStrings(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD, -@@ -647,6 +650,23 @@ _cupsGetDests(http_t *http, /* I - - attr->value_tag != IPP_TAG_URI) - continue; - -+ if (get_classes && -+ -+ /* Is this a class? */ -+ ((attr->value_tag == IPP_TAG_ENUM && -+ !strcmp(attr->name, "printer-type") && -+ (attr->values[0].integer & CUPS_PRINTER_CLASS)) || -+ -+ /* Or, is this an attribute from CUPS 1.2 or later? */ -+ !strcmp(attr->name, "auth-info-required") || -+ !strncmp(attr->name, "marker-", 7) || -+ !strcmp(attr->name, "printer-commands") || -+ !strcmp(attr->name, "printer-is-shared"))) -+ /* We are talking to a recent enough CUPS server that -+ * CUPS_GET_PRINTERS returns classes as well. -+ */ -+ get_classes = 0; -+ - if (!strcmp(attr->name, "auth-info-required") || - !strcmp(attr->name, "device-uri") || - !strcmp(attr->name, "marker-change-time") || -@@ -738,6 +758,28 @@ _cupsGetDests(http_t *http, /* I - - continue; - } - -+ /* -+ * If we sent a CUPS_GET_CLASSES request, check whether -+ * CUPS_GET_PRINTERS already gave us this destination and exit -+ * early if so. -+ */ -+ -+ if (op == CUPS_GET_CLASSES && num_dests > 0) -+ { -+ int diff; -+ cups_find_dest (printer_name, NULL, num_dests, *dests, 0, &diff); -+ if (diff == 0) -+ { -+ /* -+ * Found it. The CUPS server already gave us the classes in -+ * its CUPS_GET_PRINTERS response. -+ */ -+ -+ cupsFreeOptions(num_options, options); -+ break; -+ } -+ } -+ - if ((dest = cups_add_dest(printer_name, NULL, &num_dests, dests)) != NULL) - { - dest->num_options = num_options; -@@ -754,6 +796,15 @@ _cupsGetDests(http_t *http, /* I - - } - - /* -+ * If this is a CUPS_GET_PRINTERS request but we didn't see any -+ * classes we might be talking to an older CUPS server that requires -+ * CUPS_GET_CLASSES as well. -+ */ -+ -+ if (get_classes) -+ num_dests = _cupsGetDests (http, CUPS_GET_CLASSES, name, dests); -+ -+ /* - * Return the count... - */ - diff --git a/cups.spec b/cups.spec index 81a05b1..ccff782 100644 --- a/cups.spec +++ b/cups.spec @@ -12,7 +12,7 @@ Summary: Common Unix Printing System Name: cups Version: 1.5.4 -Release: 11%{?dist} +Release: 12%{?dist} License: GPLv2 Group: System Environment/Daemons Source: http://ftp.easysw.com/pub/cups/%{version}/cups-%{version}-source.tar.bz2 @@ -53,7 +53,6 @@ Patch18: cups-build.patch Patch19: cups-res_init.patch Patch20: cups-filter-debug.patch Patch21: cups-uri-compat.patch -Patch22: cups-cups-get-classes.patch Patch23: cups-str3382.patch Patch24: cups-usblp-quirks.patch Patch25: cups-0755.patch @@ -266,8 +265,6 @@ Sends IPP requests to the specified URI and tests and/or displays the results. %patch20 -p1 -b .filter-debug # Allow the usb backend to understand old-style URI formats. %patch21 -p1 -b .uri-compat -# Fix support for older CUPS servers in cupsGetDests. -%patch22 -p1 -b .cups-get-classes # Fix temporary filename creation. %patch23 -p1 -b .str3382 # Problem is a port reset which is done by the new USB backend of CUPS 1.5.4 and 1.6.x to clean up after the job. @@ -682,6 +679,9 @@ rm -f %{cups_serverbin}/backend/smb %{_mandir}/man1/ipptool.1.gz %changelog +* Mon Oct 29 2012 Tim Waugh 1:1.5.4-12 +- Removed broken cups-get-classes patch (bug #870612). + * Mon Oct 22 2012 Jiri Popelka 1:1.5.4-11 - Add quirk rule for Xerox Phaser 3124 (#867392) From b230f1803f90d690cbd0d49d5b99f70af09b86c7 Mon Sep 17 00:00:00 2001 From: Tim Waugh Date: Tue, 30 Oct 2012 16:49:20 +0000 Subject: [PATCH 13/30] Ensure attributes are valid UTF-8 in dbus notifier (bug #863387). Resolves: rhbz#863387 --- cups-dbus-utf8.patch | 126 +++++++++++++++++++++++++++++++++++++++++++ cups.spec | 8 ++- 2 files changed, 133 insertions(+), 1 deletion(-) create mode 100644 cups-dbus-utf8.patch diff --git a/cups-dbus-utf8.patch b/cups-dbus-utf8.patch new file mode 100644 index 0000000..cec3758 --- /dev/null +++ b/cups-dbus-utf8.patch @@ -0,0 +1,126 @@ +diff -up cups-1.5.4/notifier/dbus.c.dbus-utf8 cups-1.5.4/notifier/dbus.c +--- cups-1.5.4/notifier/dbus.c.dbus-utf8 2012-01-13 23:00:22.000000000 +0000 ++++ cups-1.5.4/notifier/dbus.c 2012-10-31 11:30:08.217215685 +0000 +@@ -31,6 +31,9 @@ + #include + #include + #include ++#include ++#include ++#include + + #include + #ifdef HAVE_DBUS_MESSAGE_ITER_INIT_APPEND +@@ -156,10 +159,82 @@ enum + * Local functions... + */ + +-static int acquire_lock(int *fd, char *lockfile, size_t locksize); ++static int acquire_lock(int *fd, char *lockfile, size_t locksize); ++static const char *validate_utf8(const char *str); + + + /* ++ * 'validate_utf8()' - Convert to valid UTF-8 ++ */ ++ ++static const char * ++validate_utf8 (const char *str) ++{ ++ static char *buffer = NULL; ++ static size_t buflen = 0; ++ char *p; ++ size_t str_len; ++ unsigned int i; ++ mbstate_t instate, outstate; ++ ++ if (str == NULL) ++ { ++ free (buffer); ++ return (NULL); ++ } ++ ++ /* Is it already valid? */ ++ if (mbstowcs (NULL, str, 0) != (size_t) -1) ++ return str; ++ ++ /* Make sure our buffer is at least as large as the input string */ ++ str_len = strlen (str); ++ if (str_len > buflen) ++ { ++ if (buffer == NULL) ++ /* Set encoding type to UTF-8 the first time we need to */ ++ setlocale (LC_CTYPE, "en_US.UTF-8"); ++ ++ buflen = str_len + 1; ++ buffer = realloc (buffer, buflen); ++ } ++ ++ memset (&instate, '\0', sizeof (mbstate_t)); ++ memset (&outstate, '\0', sizeof (mbstate_t)); ++ p = buffer; ++ i = 0; ++ while (i < str_len) ++ { ++ wchar_t wc; ++ size_t used, written; ++ mbstate_t orig_instate = instate; ++ used = mbrtowc (&wc, str + i, str_len - i, &instate); ++ switch (used) ++ { ++ case (size_t) -2: ++ case (size_t) -1: ++ wc = L'?'; /* so replacement is never longer than original char */ ++ instate = orig_instate; ++ /* fallthru */ ++ case 0: ++ used = 1; ++ } ++ ++ written = wcrtomb (p, wc, &outstate); ++ if (written != -1) ++ { ++ p += written; ++ assert (p - buffer < buflen); ++ } ++ ++ i += used; ++ } ++ ++ *p = '\0'; ++ return buffer; ++} ++ ++/* + * 'main()' - Read events and send DBUS notifications. + */ + +@@ -226,6 +301,7 @@ main(int argc, /* I - Number of comm + int no = 0; /* Boolean "no" value */ + int params = PARAMS_NONE; + /* What parameters to include? */ ++ const char *val; + + + /* +@@ -365,7 +441,8 @@ main(int argc, /* I - Number of comm + attr = ippFindAttribute(msg, "notify-text", IPP_TAG_TEXT); + if (!attr) + goto bail; +- if (!dbus_message_iter_append_string(&iter, &(attr->values[0].string.text))) ++ val = validate_utf8 (attr->values[0].string.text); ++ if (!dbus_message_iter_append_string(&iter, &val)) + goto bail; + + if (params >= PARAMS_PRINTER) +@@ -509,8 +586,8 @@ main(int argc, /* I - Number of comm + attr = ippFindAttribute(msg, "job-name", IPP_TAG_NAME); + if (attr) + { +- if (!dbus_message_iter_append_string(&iter, +- &(attr->values[0].string.text))) ++ val = validate_utf8 (attr->values[0].string.text); ++ if (!dbus_message_iter_append_string(&iter, &val)) + goto bail; + } + else diff --git a/cups.spec b/cups.spec index ccff782..1e85152 100644 --- a/cups.spec +++ b/cups.spec @@ -12,7 +12,7 @@ Summary: Common Unix Printing System Name: cups Version: 1.5.4 -Release: 12%{?dist} +Release: 13%{?dist} License: GPLv2 Group: System Environment/Daemons Source: http://ftp.easysw.com/pub/cups/%{version}/cups-%{version}-source.tar.bz2 @@ -53,6 +53,7 @@ Patch18: cups-build.patch Patch19: cups-res_init.patch Patch20: cups-filter-debug.patch Patch21: cups-uri-compat.patch +Patch22: cups-dbus-utf8.patch Patch23: cups-str3382.patch Patch24: cups-usblp-quirks.patch Patch25: cups-0755.patch @@ -265,6 +266,8 @@ Sends IPP requests to the specified URI and tests and/or displays the results. %patch20 -p1 -b .filter-debug # Allow the usb backend to understand old-style URI formats. %patch21 -p1 -b .uri-compat +# Ensure attributes are valid UTF-8 in dbus notifier (bug #863387). +%patch22 -p1 -b .dbus-utf8 # Fix temporary filename creation. %patch23 -p1 -b .str3382 # Problem is a port reset which is done by the new USB backend of CUPS 1.5.4 and 1.6.x to clean up after the job. @@ -679,6 +682,9 @@ rm -f %{cups_serverbin}/backend/smb %{_mandir}/man1/ipptool.1.gz %changelog +* Wed Oct 31 2012 Tim Waugh 1:1.5.4-13 +- Ensure attributes are valid UTF-8 in dbus notifier (bug #863387). + * Mon Oct 29 2012 Tim Waugh 1:1.5.4-12 - Removed broken cups-get-classes patch (bug #870612). From f40e66273441909f6256f11fbfab97686e00cfcc Mon Sep 17 00:00:00 2001 From: Tim Waugh Date: Mon, 5 Nov 2012 17:22:12 +0000 Subject: [PATCH 14/30] Apply upstream patch to stop backend spinning on failed auth (bug #873264). Resolves: rhbz#873264 --- cups-str4190.patch | 71 ++++++++++++++++++++++++++++++++++++++++++++++ cups.spec | 8 +++++- 2 files changed, 78 insertions(+), 1 deletion(-) create mode 100644 cups-str4190.patch diff --git a/cups-str4190.patch b/cups-str4190.patch new file mode 100644 index 0000000..9ec31e1 --- /dev/null +++ b/cups-str4190.patch @@ -0,0 +1,71 @@ +diff -up cups-1.5.4/backend/ipp.c.str4190 cups-1.5.4/backend/ipp.c +--- cups-1.5.4/backend/ipp.c.str4190 2012-11-05 17:18:56.265644206 +0000 ++++ cups-1.5.4/backend/ipp.c 2012-11-05 17:19:23.948745897 +0000 +@@ -1305,6 +1305,16 @@ main(int argc, /* I - Number of comm + } + + /* ++ * If the printer only claims to support IPP/1.0, or if the user specifically ++ * included version=1.0 in the URI, then do not try to use Create-Job or ++ * Send-Document. This is another dreaded compatibility hack, but unfortunately ++ * there are enough broken printers out there that we need this for now... ++ */ ++ ++ if (version == 10) ++ create_job = send_document = 0; ++ ++ /* + * Start monitoring the printer in the background... + */ + +@@ -1520,10 +1530,9 @@ main(int argc, /* I - Number of comm + goto cleanup; + } + } +- else if (ipp_status == IPP_ERROR_JOB_CANCELED) ++ else if (ipp_status == IPP_ERROR_JOB_CANCELED || ++ ipp_status == IPP_NOT_AUTHORIZED) + goto cleanup; +- else if (ipp_status == IPP_NOT_AUTHORIZED) +- continue; + else + { + /* +@@ -1709,14 +1718,35 @@ main(int argc, /* I - Number of comm + ipp_status == IPP_NOT_POSSIBLE || + ipp_status == IPP_PRINTER_BUSY) + continue; +- else if (ipp_status == IPP_REQUEST_VALUE) ++ else if (ipp_status == IPP_REQUEST_VALUE || ++ ipp_status == IPP_ERROR_JOB_CANCELED || ++ ipp_status == IPP_NOT_AUTHORIZED) + { + /* +- * Print file is too large, abort this job... ++ * Print file is too large, job was canceled, or we need new ++ * authentication data... + */ + + goto cleanup; + } ++ else if (ipp_status == IPP_NOT_FOUND) ++ { ++ /* ++ * Printer does not actually implement support for Create-Job/ ++ * Send-Document, so log the conformance issue and stop the printer. ++ */ ++ ++ fputs("DEBUG: This printer claims to support Create-Job and " ++ "Send-Document, but those operations failed.\n", stderr); ++ fputs("DEBUG: Add '?version=1.0' to the device URI to use legacy " ++ "compatibility mode.\n", stderr); ++ update_reasons(NULL, "+cups-ipp-conformance-failure-report," ++ "cups-ipp-missing-send-document"); ++ ++ ipp_status = IPP_INTERNAL_ERROR; /* Force queue to stop */ ++ ++ goto cleanup; ++ } + else + copies_remaining --; + diff --git a/cups.spec b/cups.spec index 1e85152..0995984 100644 --- a/cups.spec +++ b/cups.spec @@ -12,7 +12,7 @@ Summary: Common Unix Printing System Name: cups Version: 1.5.4 -Release: 13%{?dist} +Release: 14%{?dist} License: GPLv2 Group: System Environment/Daemons Source: http://ftp.easysw.com/pub/cups/%{version}/cups-%{version}-source.tar.bz2 @@ -78,6 +78,7 @@ Patch42: cups-str4124.patch Patch43: cups-str4194.patch Patch44: cups-r10638.patch Patch45: cups-r10642.patch +Patch46: cups-str4190.patch Patch100: cups-lspp.patch @@ -321,6 +322,8 @@ Sends IPP requests to the specified URI and tests and/or displays the results. %patch44 -p1 -b .r10638 # Work around broken 1284 device IDs that use a newline instead of a semicolon. %patch45 -p1 -b .r10642 +# Apply upstream patch to stop backend spinning on failed auth (bug #873264). +%patch46 -p1 -b .str4190 %if %lspp # LSPP support. @@ -682,6 +685,9 @@ rm -f %{cups_serverbin}/backend/smb %{_mandir}/man1/ipptool.1.gz %changelog +* Mon Nov 5 2012 Tim Waugh 1:1.5.4-14 +- Apply upstream patch to stop backend spinning on failed auth (bug #873264). + * Wed Oct 31 2012 Tim Waugh 1:1.5.4-13 - Ensure attributes are valid UTF-8 in dbus notifier (bug #863387). From 7800dede7e14cef14e452f4a836f0f85c341f7d1 Mon Sep 17 00:00:00 2001 From: Tim Waugh Date: Tue, 27 Nov 2012 11:33:25 +0000 Subject: [PATCH 15/30] Apply upstream fix for CVE-2012-5519 (STR #4223, bug #875898). Migrate configuration keywords as needed. Resolves: rhbz#875898 --- cups-lspp.patch | 168 +-- cups-str4223.patch | 2615 ++++++++++++++++++++++++++++++++++++++++++++ cups.spec | 49 +- 3 files changed, 2747 insertions(+), 85 deletions(-) create mode 100644 cups-str4223.patch diff --git a/cups-lspp.patch b/cups-lspp.patch index dbab270..a9b6add 100644 --- a/cups-lspp.patch +++ b/cups-lspp.patch @@ -1,7 +1,7 @@ -diff -up cups-1.5.2/config.h.in.lspp cups-1.5.2/config.h.in ---- cups-1.5.2/config.h.in.lspp 2012-02-15 13:02:38.423776301 +0000 -+++ cups-1.5.2/config.h.in 2012-02-15 13:02:38.438776307 +0000 -@@ -754,6 +754,12 @@ +diff -up cups-1.5.4/config.h.in.lspp cups-1.5.4/config.h.in +--- cups-1.5.4/config.h.in.lspp 2012-11-27 13:27:45.851112089 +0000 ++++ cups-1.5.4/config.h.in 2012-11-27 13:27:45.901112305 +0000 +@@ -761,6 +761,12 @@ #undef HAVE_XPC @@ -14,9 +14,9 @@ diff -up cups-1.5.2/config.h.in.lspp cups-1.5.2/config.h.in #endif /* !_CUPS_CONFIG_H_ */ -diff -up cups-1.5.2/config-scripts/cups-lspp.m4.lspp cups-1.5.2/config-scripts/cups-lspp.m4 ---- cups-1.5.2/config-scripts/cups-lspp.m4.lspp 2012-02-15 13:02:38.438776307 +0000 -+++ cups-1.5.2/config-scripts/cups-lspp.m4 2012-02-15 13:02:38.438776307 +0000 +diff -up cups-1.5.4/config-scripts/cups-lspp.m4.lspp cups-1.5.4/config-scripts/cups-lspp.m4 +--- cups-1.5.4/config-scripts/cups-lspp.m4.lspp 2012-11-27 13:27:45.902112309 +0000 ++++ cups-1.5.4/config-scripts/cups-lspp.m4 2012-11-27 13:27:45.902112309 +0000 @@ -0,0 +1,36 @@ +dnl +dnl LSPP code for the Common UNIX Printing System (CUPS). @@ -54,9 +54,9 @@ diff -up cups-1.5.2/config-scripts/cups-lspp.m4.lspp cups-1.5.2/config-scripts/c + ;; + esac +fi -diff -up cups-1.5.2/configure.in.lspp cups-1.5.2/configure.in ---- cups-1.5.2/configure.in.lspp 2012-02-15 13:02:38.424776301 +0000 -+++ cups-1.5.2/configure.in 2012-02-15 13:02:38.439776308 +0000 +diff -up cups-1.5.4/configure.in.lspp cups-1.5.4/configure.in +--- cups-1.5.4/configure.in.lspp 2012-11-27 13:27:45.892112265 +0000 ++++ cups-1.5.4/configure.in 2012-11-27 13:27:45.902112309 +0000 @@ -42,6 +42,8 @@ sinclude(config-scripts/cups-defaults.m4 sinclude(config-scripts/cups-pdf.m4) sinclude(config-scripts/cups-scripting.m4) @@ -66,9 +66,9 @@ diff -up cups-1.5.2/configure.in.lspp cups-1.5.2/configure.in INSTALL_LANGUAGES="" UNINSTALL_LANGUAGES="" LANGFILES="" -diff -up cups-1.5.2/filter/common.c.lspp cups-1.5.2/filter/common.c ---- cups-1.5.2/filter/common.c.lspp 2011-05-20 04:49:49.000000000 +0100 -+++ cups-1.5.2/filter/common.c 2012-02-15 13:02:38.441776309 +0000 +diff -up cups-1.5.4/filter/common.c.lspp cups-1.5.4/filter/common.c +--- cups-1.5.4/filter/common.c.lspp 2011-05-20 04:49:49.000000000 +0100 ++++ cups-1.5.4/filter/common.c 2012-11-27 13:27:45.903112313 +0000 @@ -30,6 +30,12 @@ * Include necessary headers... */ @@ -237,9 +237,9 @@ diff -up cups-1.5.2/filter/common.c.lspp cups-1.5.2/filter/common.c /* -diff -up cups-1.5.2/filter/pstops.c.lspp cups-1.5.2/filter/pstops.c ---- cups-1.5.2/filter/pstops.c.lspp 2011-09-02 19:14:34.000000000 +0100 -+++ cups-1.5.2/filter/pstops.c 2012-02-15 13:02:38.441776310 +0000 +diff -up cups-1.5.4/filter/pstops.c.lspp cups-1.5.4/filter/pstops.c +--- cups-1.5.4/filter/pstops.c.lspp 2011-09-02 19:14:34.000000000 +0100 ++++ cups-1.5.4/filter/pstops.c 2012-11-27 13:27:45.905112321 +0000 @@ -3259,6 +3259,18 @@ write_label_prolog(pstops_doc_t *doc, /* { const char *classification; /* CLASSIFICATION environment variable */ @@ -395,10 +395,10 @@ diff -up cups-1.5.2/filter/pstops.c.lspp cups-1.5.2/filter/pstops.c /* -diff -up cups-1.5.2/Makedefs.in.lspp cups-1.5.2/Makedefs.in ---- cups-1.5.2/Makedefs.in.lspp 2012-02-15 13:02:38.429776302 +0000 -+++ cups-1.5.2/Makedefs.in 2012-02-15 13:02:38.442776310 +0000 -@@ -159,7 +159,7 @@ LDFLAGS = -L../cgi-bin -L../cups -L../f +diff -up cups-1.5.4/Makedefs.in.lspp cups-1.5.4/Makedefs.in +--- cups-1.5.4/Makedefs.in.lspp 2012-11-27 13:27:45.853112098 +0000 ++++ cups-1.5.4/Makedefs.in 2012-11-27 13:27:45.906112326 +0000 +@@ -160,7 +160,7 @@ LDFLAGS = -L../cgi-bin -L../cups -L../f LEGACY_BACKENDS = @LEGACY_BACKENDS@ LINKCUPS = @LINKCUPS@ $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(LIBZ) LINKCUPSIMAGE = @LINKCUPSIMAGE@ @@ -407,9 +407,9 @@ diff -up cups-1.5.2/Makedefs.in.lspp cups-1.5.2/Makedefs.in OPTIM = @OPTIM@ OPTIONS = PAMLIBS = @PAMLIBS@ -diff -up cups-1.5.2/scheduler/client.c.lspp cups-1.5.2/scheduler/client.c ---- cups-1.5.2/scheduler/client.c.lspp 2012-02-15 13:02:38.394776287 +0000 -+++ cups-1.5.2/scheduler/client.c 2012-02-15 13:02:38.444776310 +0000 +diff -up cups-1.5.4/scheduler/client.c.lspp cups-1.5.4/scheduler/client.c +--- cups-1.5.4/scheduler/client.c.lspp 2012-11-27 13:27:45.895112279 +0000 ++++ cups-1.5.4/scheduler/client.c 2012-11-27 13:27:45.909112339 +0000 @@ -45,6 +45,7 @@ * valid_host() - Is the Host: field valid? * write_file() - Send a file via HTTP. @@ -508,7 +508,7 @@ diff -up cups-1.5.2/scheduler/client.c.lspp cups-1.5.2/scheduler/client.c status = HTTP_CONTINUE; -@@ -2140,6 +2206,67 @@ cupsdReadClient(cupsd_client_t *con) /* +@@ -2137,6 +2203,67 @@ cupsdReadClient(cupsd_client_t *con) /* fchmod(con->file, 0640); fchown(con->file, RunUser, Group); fcntl(con->file, F_SETFD, fcntl(con->file, F_GETFD) | FD_CLOEXEC); @@ -576,7 +576,7 @@ diff -up cups-1.5.2/scheduler/client.c.lspp cups-1.5.2/scheduler/client.c } if (con->http.state != HTTP_POST_SEND) -@@ -4550,6 +4677,50 @@ make_certificate(cupsd_client_t *con) /* +@@ -4551,6 +4678,50 @@ make_certificate(cupsd_client_t *con) /* #endif /* HAVE_SSL */ @@ -627,9 +627,9 @@ diff -up cups-1.5.2/scheduler/client.c.lspp cups-1.5.2/scheduler/client.c /* * 'pipe_command()' - Pipe the output of a command to the remote client. */ -diff -up cups-1.5.2/scheduler/client.h.lspp cups-1.5.2/scheduler/client.h ---- cups-1.5.2/scheduler/client.h.lspp 2012-02-15 13:02:38.430776303 +0000 -+++ cups-1.5.2/scheduler/client.h 2012-02-15 13:02:38.446776310 +0000 +diff -up cups-1.5.4/scheduler/client.h.lspp cups-1.5.4/scheduler/client.h +--- cups-1.5.4/scheduler/client.h.lspp 2012-11-27 13:27:45.853112098 +0000 ++++ cups-1.5.4/scheduler/client.h 2012-11-27 13:27:45.910112343 +0000 @@ -18,6 +18,13 @@ #endif /* HAVE_AUTHORIZATION_H */ @@ -665,10 +665,10 @@ diff -up cups-1.5.2/scheduler/client.h.lspp cups-1.5.2/scheduler/client.h /* -diff -up cups-1.5.2/scheduler/conf.c.lspp cups-1.5.2/scheduler/conf.c ---- cups-1.5.2/scheduler/conf.c.lspp 2012-02-15 13:02:38.397776287 +0000 -+++ cups-1.5.2/scheduler/conf.c 2012-02-15 13:02:38.448776311 +0000 -@@ -31,6 +31,7 @@ +diff -up cups-1.5.4/scheduler/conf.c.lspp cups-1.5.4/scheduler/conf.c +--- cups-1.5.4/scheduler/conf.c.lspp 2012-11-27 13:27:45.896112283 +0000 ++++ cups-1.5.4/scheduler/conf.c 2012-11-27 13:28:56.788369589 +0000 +@@ -32,6 +32,7 @@ * read_location() - Read a definition. * read_policy() - Read a definition. * set_policy_defaults() - Set default policy values as needed. @@ -676,7 +676,7 @@ diff -up cups-1.5.2/scheduler/conf.c.lspp cups-1.5.2/scheduler/conf.c */ /* -@@ -56,6 +57,9 @@ +@@ -57,6 +58,9 @@ # define INADDR_NONE 0xffffffff #endif /* !INADDR_NONE */ @@ -686,18 +686,18 @@ diff -up cups-1.5.2/scheduler/conf.c.lspp cups-1.5.2/scheduler/conf.c /* * Configuration variable structure... -@@ -173,6 +177,10 @@ static const cupsd_var_t variables[] = - # if defined(HAVE_LIBSSL) || defined(HAVE_GNUTLS) - { "ServerKey", &ServerKey, CUPSD_VARTYPE_PATHNAME }, - # endif /* HAVE_LIBSSL || HAVE_GNUTLS */ +@@ -157,6 +161,10 @@ static const cupsd_var_t cupsd_vars[] = + { "ServerName", &ServerName, CUPSD_VARTYPE_STRING }, + { "Timeout", &Timeout, CUPSD_VARTYPE_INTEGER }, + { "UseNetworkDefault", &UseNetworkDefault, CUPSD_VARTYPE_BOOLEAN }, +#ifdef WITH_LSPP + { "AuditLog", &AuditLog, CUPSD_VARTYPE_INTEGER }, + { "PerPageLabels", &PerPageLabels, CUPSD_VARTYPE_BOOLEAN }, +#endif /* WITH_LSPP */ - #endif /* HAVE_SSL */ - { "ServerName", &ServerName, CUPSD_VARTYPE_STRING }, - { "ServerRoot", &ServerRoot, CUPSD_VARTYPE_PATHNAME }, -@@ -434,6 +442,9 @@ cupsdReadConfiguration(void) + { "WebInterface", &WebInterface, CUPSD_VARTYPE_BOOLEAN } + }; + static const cupsd_var_t cupsfiles_vars[] = +@@ -440,6 +448,9 @@ cupsdReadConfiguration(void) const char *tmpdir; /* TMPDIR environment variable */ struct stat tmpinfo; /* Temporary directory info */ cupsd_policy_t *p; /* Policy */ @@ -707,7 +707,7 @@ diff -up cups-1.5.2/scheduler/conf.c.lspp cups-1.5.2/scheduler/conf.c /* -@@ -726,6 +737,25 @@ cupsdReadConfiguration(void) +@@ -758,6 +769,25 @@ cupsdReadConfiguration(void) RunUser = getuid(); @@ -733,7 +733,7 @@ diff -up cups-1.5.2/scheduler/conf.c.lspp cups-1.5.2/scheduler/conf.c cupsdLogMessage(CUPSD_LOG_INFO, "Remote access is %s.", RemotePort ? "enabled" : "disabled"); -@@ -1116,7 +1146,19 @@ cupsdReadConfiguration(void) +@@ -1148,7 +1178,19 @@ cupsdReadConfiguration(void) cupsdClearString(&Classification); if (Classification) @@ -753,7 +753,7 @@ diff -up cups-1.5.2/scheduler/conf.c.lspp cups-1.5.2/scheduler/conf.c /* * Check the MaxClients setting, and then allocate memory for it... -@@ -3781,6 +3823,18 @@ read_location(cups_file_t *fp, /* I - C +@@ -4024,6 +4066,18 @@ read_location(cups_file_t *fp, /* I - C return ((FatalErrors & CUPSD_FATAL_CONFIG) ? 0 : linenum); } @@ -772,10 +772,10 @@ diff -up cups-1.5.2/scheduler/conf.c.lspp cups-1.5.2/scheduler/conf.c /* * 'read_policy()' - Read a definition. -diff -up cups-1.5.2/scheduler/conf.h.lspp cups-1.5.2/scheduler/conf.h ---- cups-1.5.2/scheduler/conf.h.lspp 2012-02-15 13:02:38.320776250 +0000 -+++ cups-1.5.2/scheduler/conf.h 2012-02-15 13:02:38.450776313 +0000 -@@ -250,6 +250,12 @@ VAR char *ServerKey VALUE(NULL); +diff -up cups-1.5.4/scheduler/conf.h.lspp cups-1.5.4/scheduler/conf.h +--- cups-1.5.4/scheduler/conf.h.lspp 2012-11-27 13:27:45.896112283 +0000 ++++ cups-1.5.4/scheduler/conf.h 2012-11-27 13:27:45.912112351 +0000 +@@ -252,6 +252,12 @@ VAR char *ServerKey VALUE(NULL); VAR int SSLOptions VALUE(CUPSD_SSL_NONE); /* SSL/TLS options */ #endif /* HAVE_SSL */ @@ -788,7 +788,7 @@ diff -up cups-1.5.2/scheduler/conf.h.lspp cups-1.5.2/scheduler/conf.h #ifdef HAVE_LAUNCHD VAR int LaunchdTimeout VALUE(DEFAULT_KEEPALIVE); -@@ -261,6 +267,9 @@ VAR char *SystemGroupAuthKey VALUE(NULL +@@ -263,6 +269,9 @@ VAR char *SystemGroupAuthKey VALUE(NULL /* System group auth key */ #endif /* HAVE_AUTHORIZATION_H */ @@ -798,9 +798,9 @@ diff -up cups-1.5.2/scheduler/conf.h.lspp cups-1.5.2/scheduler/conf.h /* * Prototypes... -diff -up cups-1.5.2/scheduler/cupsd.h.lspp cups-1.5.2/scheduler/cupsd.h ---- cups-1.5.2/scheduler/cupsd.h.lspp 2012-02-15 13:02:38.383776281 +0000 -+++ cups-1.5.2/scheduler/cupsd.h 2012-02-15 13:02:38.450776313 +0000 +diff -up cups-1.5.4/scheduler/cupsd.h.lspp cups-1.5.4/scheduler/cupsd.h +--- cups-1.5.4/scheduler/cupsd.h.lspp 2012-11-27 13:27:45.815111935 +0000 ++++ cups-1.5.4/scheduler/cupsd.h 2012-11-27 13:27:45.912112351 +0000 @@ -13,6 +13,8 @@ * file is missing or damaged, see the license at "http://www.cups.org/". */ @@ -832,9 +832,9 @@ diff -up cups-1.5.2/scheduler/cupsd.h.lspp cups-1.5.2/scheduler/cupsd.h /* * Some OS's don't have hstrerror(), most notably Solaris... */ -diff -up cups-1.5.2/scheduler/ipp.c.lspp cups-1.5.2/scheduler/ipp.c ---- cups-1.5.2/scheduler/ipp.c.lspp 2012-02-15 13:02:38.417776295 +0000 -+++ cups-1.5.2/scheduler/ipp.c 2012-02-15 13:02:38.454776315 +0000 +diff -up cups-1.5.4/scheduler/ipp.c.lspp cups-1.5.4/scheduler/ipp.c +--- cups-1.5.4/scheduler/ipp.c.lspp 2012-11-27 13:27:45.865112149 +0000 ++++ cups-1.5.4/scheduler/ipp.c 2012-11-27 13:27:45.915112365 +0000 @@ -41,6 +41,7 @@ * cancel_all_jobs() - Cancel all or selected print jobs. * cancel_job() - Cancel a print job. @@ -1153,7 +1153,7 @@ diff -up cups-1.5.2/scheduler/ipp.c.lspp cups-1.5.2/scheduler/ipp.c /* * See if we need to add the starting sheet... -@@ -4709,6 +4941,111 @@ check_rss_recipient( +@@ -4708,6 +4940,111 @@ check_rss_recipient( } @@ -1265,7 +1265,7 @@ diff -up cups-1.5.2/scheduler/ipp.c.lspp cups-1.5.2/scheduler/ipp.c /* * 'check_quotas()' - Check quotas for a printer and user. */ -@@ -5349,6 +5686,15 @@ copy_banner(cupsd_client_t *con, /* I - +@@ -5348,6 +5685,15 @@ copy_banner(cupsd_client_t *con, /* I - char attrname[255], /* Name of attribute */ *s; /* Pointer into name */ ipp_attribute_t *attr; /* Attribute */ @@ -1281,7 +1281,7 @@ diff -up cups-1.5.2/scheduler/ipp.c.lspp cups-1.5.2/scheduler/ipp.c cupsdLogMessage(CUPSD_LOG_DEBUG2, -@@ -5384,6 +5730,82 @@ copy_banner(cupsd_client_t *con, /* I - +@@ -5383,6 +5729,82 @@ copy_banner(cupsd_client_t *con, /* I - fchmod(cupsFileNumber(out), 0640); fchown(cupsFileNumber(out), RunUser, Group); @@ -1364,7 +1364,7 @@ diff -up cups-1.5.2/scheduler/ipp.c.lspp cups-1.5.2/scheduler/ipp.c /* * Try the localized banner file under the subdirectory... -@@ -5478,6 +5900,24 @@ copy_banner(cupsd_client_t *con, /* I - +@@ -5477,6 +5899,24 @@ copy_banner(cupsd_client_t *con, /* I - else s = attrname; @@ -1389,7 +1389,7 @@ diff -up cups-1.5.2/scheduler/ipp.c.lspp cups-1.5.2/scheduler/ipp.c if (!strcmp(s, "printer-name")) { cupsFilePuts(out, job->dest); -@@ -7475,6 +7915,22 @@ get_job_attrs(cupsd_client_t *con, /* I +@@ -7474,6 +7914,22 @@ get_job_attrs(cupsd_client_t *con, /* I exclude = cupsdGetPrivateAttrs(policy, con, printer, job->username); @@ -1412,7 +1412,7 @@ diff -up cups-1.5.2/scheduler/ipp.c.lspp cups-1.5.2/scheduler/ipp.c /* * Copy attributes... */ -@@ -7828,6 +8284,11 @@ get_jobs(cupsd_client_t *con, /* I - C +@@ -7827,6 +8283,11 @@ get_jobs(cupsd_client_t *con, /* I - C if (username[0] && _cups_strcasecmp(username, job->username)) continue; @@ -1424,7 +1424,7 @@ diff -up cups-1.5.2/scheduler/ipp.c.lspp cups-1.5.2/scheduler/ipp.c if (count > 0) ippAddSeparator(con->response); -@@ -12287,6 +12748,11 @@ validate_user(cupsd_job_t *job, /* I +@@ -12380,6 +12841,11 @@ validate_user(cupsd_job_t *job, /* I strlcpy(username, get_username(con), userlen); @@ -1436,9 +1436,9 @@ diff -up cups-1.5.2/scheduler/ipp.c.lspp cups-1.5.2/scheduler/ipp.c /* * Check the username against the owner... */ -diff -up cups-1.5.2/scheduler/job.c.lspp cups-1.5.2/scheduler/job.c ---- cups-1.5.2/scheduler/job.c.lspp 2012-02-15 13:02:38.362776272 +0000 -+++ cups-1.5.2/scheduler/job.c 2012-02-15 13:02:38.457776315 +0000 +diff -up cups-1.5.4/scheduler/job.c.lspp cups-1.5.4/scheduler/job.c +--- cups-1.5.4/scheduler/job.c.lspp 2012-11-27 13:27:45.784111801 +0000 ++++ cups-1.5.4/scheduler/job.c 2012-11-27 13:27:45.916112369 +0000 @@ -64,6 +64,9 @@ * update_job_attrs() - Update the job-printer-* attributes. */ @@ -1568,7 +1568,7 @@ diff -up cups-1.5.2/scheduler/job.c.lspp cups-1.5.2/scheduler/job.c job->sheets = ippFindAttribute(job->attrs, "job-media-sheets-completed", IPP_TAG_INTEGER); job->job_sheets = ippFindAttribute(job->attrs, "job-sheets", IPP_TAG_NAME); -@@ -2116,6 +2210,14 @@ cupsdSaveJob(cupsd_job_t *job) /* I - J +@@ -2136,6 +2230,14 @@ cupsdSaveJob(cupsd_job_t *job) /* I - J char filename[1024], /* Job control filename */ newfile[1024]; /* New job control filename */ cups_file_t *fp; /* Job file */ @@ -1583,7 +1583,7 @@ diff -up cups-1.5.2/scheduler/job.c.lspp cups-1.5.2/scheduler/job.c cupsdLogMessage(CUPSD_LOG_DEBUG2, "cupsdSaveJob(job=%p(%d)): job->attrs=%p", -@@ -2135,6 +2237,76 @@ cupsdSaveJob(cupsd_job_t *job) /* I - J +@@ -2155,6 +2257,76 @@ cupsdSaveJob(cupsd_job_t *job) /* I - J fchmod(cupsFileNumber(fp), 0600); fchown(cupsFileNumber(fp), RunUser, Group); @@ -1660,7 +1660,7 @@ diff -up cups-1.5.2/scheduler/job.c.lspp cups-1.5.2/scheduler/job.c job->attrs->state = IPP_IDLE; if (ippWriteIO(fp, (ipp_iocb_t)cupsFileWrite, 1, NULL, -@@ -3525,6 +3697,18 @@ get_options(cupsd_job_t *job, /* I - Jo +@@ -3550,6 +3722,18 @@ get_options(cupsd_job_t *job, /* I - Jo banner_page) continue; @@ -1679,7 +1679,7 @@ diff -up cups-1.5.2/scheduler/job.c.lspp cups-1.5.2/scheduler/job.c /* * Otherwise add them to the list... */ -@@ -4159,6 +4343,19 @@ static void +@@ -4184,6 +4368,19 @@ static void start_job(cupsd_job_t *job, /* I - Job ID */ cupsd_printer_t *printer) /* I - Printer to print job */ { @@ -1699,7 +1699,7 @@ diff -up cups-1.5.2/scheduler/job.c.lspp cups-1.5.2/scheduler/job.c cupsdLogMessage(CUPSD_LOG_DEBUG2, "start_job(job=%p(%d), printer=%p(%s))", job, job->id, printer, printer->name); -@@ -4288,6 +4485,108 @@ start_job(cupsd_job_t *job, /* I - +@@ -4317,6 +4514,108 @@ start_job(cupsd_job_t *job, /* I - fcntl(job->side_pipes[1], F_SETFD, fcntl(job->side_pipes[1], F_GETFD) | FD_CLOEXEC); @@ -1808,9 +1808,9 @@ diff -up cups-1.5.2/scheduler/job.c.lspp cups-1.5.2/scheduler/job.c /* * Now start the first file in the job... */ -diff -up cups-1.5.2/scheduler/job.h.lspp cups-1.5.2/scheduler/job.h ---- cups-1.5.2/scheduler/job.h.lspp 2011-05-18 03:27:11.000000000 +0100 -+++ cups-1.5.2/scheduler/job.h 2012-02-15 13:02:38.459776316 +0000 +diff -up cups-1.5.4/scheduler/job.h.lspp cups-1.5.4/scheduler/job.h +--- cups-1.5.4/scheduler/job.h.lspp 2011-05-18 03:27:11.000000000 +0100 ++++ cups-1.5.4/scheduler/job.h 2012-11-27 13:27:45.917112373 +0000 @@ -13,6 +13,13 @@ * file is missing or damaged, see the license at "http://www.cups.org/". */ @@ -1836,9 +1836,9 @@ diff -up cups-1.5.2/scheduler/job.h.lspp cups-1.5.2/scheduler/job.h }; typedef struct cupsd_joblog_s /**** Job log message ****/ -diff -up cups-1.5.2/scheduler/main.c.lspp cups-1.5.2/scheduler/main.c ---- cups-1.5.2/scheduler/main.c.lspp 2012-02-15 13:02:38.436776304 +0000 -+++ cups-1.5.2/scheduler/main.c 2012-02-15 13:02:38.461776318 +0000 +diff -up cups-1.5.4/scheduler/main.c.lspp cups-1.5.4/scheduler/main.c +--- cups-1.5.4/scheduler/main.c.lspp 2012-11-27 13:27:45.897112287 +0000 ++++ cups-1.5.4/scheduler/main.c 2012-11-27 13:27:45.917112373 +0000 @@ -38,6 +38,8 @@ * usage() - Show scheduler usage. */ @@ -1868,7 +1868,7 @@ diff -up cups-1.5.2/scheduler/main.c.lspp cups-1.5.2/scheduler/main.c #ifdef __sgi cups_file_t *fp; /* Fake lpsched lock file */ struct stat statbuf; /* Needed for checking lpsched FIFO */ -@@ -472,6 +480,25 @@ main(int argc, /* I - Number of comm +@@ -523,6 +531,25 @@ main(int argc, /* I - Number of comm #endif /* DEBUG */ } @@ -1894,7 +1894,7 @@ diff -up cups-1.5.2/scheduler/main.c.lspp cups-1.5.2/scheduler/main.c /* * Set the timezone info... */ -@@ -1246,6 +1273,11 @@ main(int argc, /* I - Number of comm +@@ -1297,6 +1324,11 @@ main(int argc, /* I - Number of comm cupsdStopSelect(); @@ -1906,9 +1906,9 @@ diff -up cups-1.5.2/scheduler/main.c.lspp cups-1.5.2/scheduler/main.c return (!stop_scheduler); } -diff -up cups-1.5.2/scheduler/printers.c.lspp cups-1.5.2/scheduler/printers.c ---- cups-1.5.2/scheduler/printers.c.lspp 2012-02-15 13:02:38.420776300 +0000 -+++ cups-1.5.2/scheduler/printers.c 2012-02-15 13:02:38.463776320 +0000 +diff -up cups-1.5.4/scheduler/printers.c.lspp cups-1.5.4/scheduler/printers.c +--- cups-1.5.4/scheduler/printers.c.lspp 2012-11-27 13:27:45.846112069 +0000 ++++ cups-1.5.4/scheduler/printers.c 2012-11-27 13:27:45.918112378 +0000 @@ -56,6 +56,8 @@ * write_xml_string() - Write a string with XML escaping. */ @@ -1930,7 +1930,7 @@ diff -up cups-1.5.2/scheduler/printers.c.lspp cups-1.5.2/scheduler/printers.c /* * Local functions... */ -@@ -2199,6 +2206,13 @@ cupsdSetPrinterAttrs(cupsd_printer_t *p) +@@ -2231,6 +2238,13 @@ cupsdSetPrinterAttrs(cupsd_printer_t *p) "username", "password" }; @@ -1944,7 +1944,7 @@ diff -up cups-1.5.2/scheduler/printers.c.lspp cups-1.5.2/scheduler/printers.c DEBUG_printf(("cupsdSetPrinterAttrs: entering name = %s, type = %x\n", p->name, -@@ -2336,6 +2350,45 @@ cupsdSetPrinterAttrs(cupsd_printer_t *p) +@@ -2368,6 +2382,45 @@ cupsdSetPrinterAttrs(cupsd_printer_t *p) attr->values[1].string.text = _cupsStrAlloc(Classification ? Classification : p->job_sheets[1]); } @@ -1990,7 +1990,7 @@ diff -up cups-1.5.2/scheduler/printers.c.lspp cups-1.5.2/scheduler/printers.c } p->raw = 0; -@@ -5546,7 +5599,6 @@ write_irix_state(cupsd_printer_t *p) /* +@@ -5578,7 +5631,6 @@ write_irix_state(cupsd_printer_t *p) /* } #endif /* __sgi */ diff --git a/cups-str4223.patch b/cups-str4223.patch new file mode 100644 index 0000000..ae4804d --- /dev/null +++ b/cups-str4223.patch @@ -0,0 +1,2615 @@ +diff -up cups-1.5.4/conf/cupsd.conf.in.str4223 cups-1.5.4/conf/cupsd.conf.in +--- cups-1.5.4/conf/cupsd.conf.in.str4223 2010-12-09 21:24:51.000000000 +0000 ++++ cups-1.5.4/conf/cupsd.conf.in 2012-11-27 13:36:54.512147828 +0000 +@@ -9,10 +9,6 @@ + # for troubleshooting... + LogLevel @CUPS_LOG_LEVEL@ + +-# Administrator user group... +-SystemGroup @CUPS_SYSTEM_GROUPS@ +-@CUPS_SYSTEM_AUTHKEY@ +- + # Only listen for connections from the local machine. + Listen localhost:@DEFAULT_IPP_PORT@ + @CUPS_LISTEN_DOMAINSOCKET@ +diff -up cups-1.5.4/conf/cups-files.conf.in.str4223 cups-1.5.4/conf/cups-files.conf.in +--- cups-1.5.4/conf/cups-files.conf.in.str4223 2012-11-27 13:36:54.512147828 +0000 ++++ cups-1.5.4/conf/cups-files.conf.in 2012-11-27 13:36:54.512147828 +0000 +@@ -0,0 +1,98 @@ ++# ++# "$Id$" ++# ++# Sample file/directory/user/group configuration file for the CUPS scheduler. ++# See "man cups-files.conf" for a complete description of this file. ++# ++ ++# List of events that are considered fatal errors for the scheduler... ++#FatalErrors @CUPS_FATAL_ERRORS@ ++ ++# Default user and group for filters/backends/helper programs; this cannot be ++# any user or group that resolves to ID 0 for security reasons... ++#User @CUPS_USER@ ++#Group @CUPS_GROUP@ ++ ++# Administrator user group, used to match @SYSTEM in cupsd.conf policy rules... ++SystemGroup @CUPS_SYSTEM_GROUPS@ ++@CUPS_SYSTEM_AUTHKEY@ ++ ++# User that is substituted for unauthenticated (remote) root accesses... ++#RemoteRoot remroot ++ ++# Do we allow file: device URIs other than to /dev/null? ++#FileDevice No ++ ++# Permissions for configuration and log files... ++#ConfigFilePerm @CUPS_CONFIG_FILE_PERM@ ++#LogFilePerm @CUPS_LOG_FILE_PERM@ ++ ++# Location of the file logging all access to the scheduler; may be the name ++# "syslog". If not an absolute path, the value of ServerRoot is used as the ++# root directory. Also see the "AccessLogLevel" directive in cupsd.conf. ++AccessLog @CUPS_LOGDIR@/access_log ++ ++# Location of cache files used by the scheduler... ++#CacheDir @CUPS_CACHEDIR@ ++ ++# Location of data files used by the scheduler... ++#DataDir @CUPS_DATADIR@ ++ ++# Location of the static web content served by the scheduler... ++#DocRoot @CUPS_DOCROOT@ ++ ++# Location of the file logging all messages produced by the scheduler and any ++# helper programs; may be the name "syslog". If not an absolute path, the value ++# of ServerRoot is used as the root directory. Also see the "LogLevel" ++# directive in cupsd.conf. ++ErrorLog @CUPS_LOGDIR@/error_log ++ ++# Location of fonts used by older print filters... ++#FontPath @CUPS_FONTPATH@ ++ ++# Location of LPD configuration ++#LPDConfigFile @CUPS_DEFAULT_LPD_CONFIG_FILE@ ++ ++# Location of the file logging all pages printed by the scheduler and any ++# helper programs; may be the name "syslog". If not an absolute path, the value ++# of ServerRoot is used as the root directory. Also see the "PageLogFormat" ++# directive in cupsd.conf. ++PageLog @CUPS_LOGDIR@/page_log ++ ++# Location of the file listing all of the local printers... ++#Printcap @CUPS_DEFAULT_PRINTCAP@ ++ ++# Format of the Printcap file... ++#PrintcapFormat bsd ++#PrintcapFormat plist ++#PrintcapFormat solaris ++ ++# Location of all spool files... ++#RequestRoot @CUPS_REQUESTS@ ++ ++# Location of helper programs... ++#ServerBin @CUPS_SERVERBIN@ ++ ++# SSL/TLS certificate for the scheduler... ++#ServerCertificate @CUPS_SERVERCERT@ ++ ++# SSL/TLS private key for the scheduler... ++#ServerKey @CUPS_SERVERKEY@ ++ ++# Location of other configuration files... ++#ServerRoot @CUPS_SERVERROOT@ ++ ++# Location of Samba configuration file... ++#SMBConfigFile @CUPS_DEFAULT_SMB_CONFIG_FILE@ ++ ++# Location of scheduler state files... ++#StateDir @CUPS_STATEDIR@ ++ ++# Location of scheduler/helper temporary files. This directory is emptied on ++# scheduler startup and cannot be one of the standard (public) temporary ++# directory locations for security reasons... ++#TempDir @CUPS_REQUESTS@/tmp ++ ++# ++# End of "$Id$". ++# +diff -up cups-1.5.4/config-scripts/cups-defaults.m4.str4223 cups-1.5.4/config-scripts/cups-defaults.m4 +--- cups-1.5.4/config-scripts/cups-defaults.m4.str4223 2011-05-06 23:53:53.000000000 +0100 ++++ cups-1.5.4/config-scripts/cups-defaults.m4 2012-11-27 13:36:54.513147832 +0000 +@@ -367,6 +367,7 @@ else + fi + + AC_DEFINE_UNQUOTED(CUPS_DEFAULT_LPD_CONFIG_FILE, "$CUPS_DEFAULT_LPD_CONFIG_FILE") ++AC_SUBST(CUPS_DEFAULT_LPD_CONFIG_FILE) + + dnl Default SMB config file... + AC_ARG_WITH(smbconfigfile, [ --with-smbconfigfile set default SMBConfigFile URI], +@@ -388,6 +389,7 @@ else + fi + + AC_DEFINE_UNQUOTED(CUPS_DEFAULT_SMB_CONFIG_FILE, "$CUPS_DEFAULT_SMB_CONFIG_FILE") ++AC_SUBST(CUPS_DEFAULT_SMB_CONFIG_FILE) + + dnl Default MaxCopies value... + AC_ARG_WITH(max-copies, [ --with-max-copies set default max copies value, default=9999 ], +diff -up cups-1.5.4/config-scripts/cups-ssl.m4.str4223 cups-1.5.4/config-scripts/cups-ssl.m4 +--- cups-1.5.4/config-scripts/cups-ssl.m4.str4223 2012-11-27 13:36:54.356147158 +0000 ++++ cups-1.5.4/config-scripts/cups-ssl.m4 2012-11-27 13:36:54.513147832 +0000 +@@ -27,6 +27,8 @@ AC_ARG_WITH(openssl-includes, [ --with- + SSLFLAGS="" + SSLLIBS="" + have_ssl=0 ++CUPS_SERVERCERT="" ++CUPS_SERVERKEY="" + + if test x$enable_ssl != xno; then + dnl Look for CDSA... +@@ -36,6 +38,7 @@ if test x$enable_ssl != xno; then + have_ssl=1 + AC_DEFINE(HAVE_SSL) + AC_DEFINE(HAVE_CDSASSL) ++ CUPS_SERVERCERT="/Library/Keychains/System.keychain" + + dnl Check for the various security headers... + AC_CHECK_HEADER(Security/SecureTransportPriv.h, +@@ -112,6 +115,9 @@ if test x$enable_ssl != xno; then + fi + + if test $have_ssl = 1; then ++ CUPS_SERVERCERT="ssl/server.crt" ++ CUPS_SERVERKEY="ssl/server.key" ++ + if $PKGCONFIG --exists gcrypt; then + SSLLIBS="$SSLLIBS `$PKGCONFIG --libs gcrypt`" + SSLFLAGS="$SSLFLAGS `$PKGCONFIG --cflags gcrypt`" +@@ -154,6 +160,9 @@ if test x$enable_ssl != xno; then + done + + if test "x${SSLLIBS}" != "x"; then ++ CUPS_SERVERCERT="ssl/server.crt" ++ CUPS_SERVERKEY="ssl/server.key" ++ + LIBS="$SAVELIBS $SSLLIBS" + AC_CHECK_FUNCS(SSL_set_tlsext_host_name) + fi +@@ -171,6 +180,8 @@ elif test x$enable_cdsa = xyes -o x$enab + AC_MSG_ERROR([Unable to enable SSL support.]) + fi + ++AC_SUBST(CUPS_SERVERCERT) ++AC_SUBST(CUPS_SERVERKEY) + AC_SUBST(IPPALIASES) + AC_SUBST(SSLFLAGS) + AC_SUBST(SSLLIBS) +diff -up cups-1.5.4/configure.in.str4223 cups-1.5.4/configure.in +--- cups-1.5.4/configure.in.str4223 2012-11-27 13:36:54.482147699 +0000 ++++ cups-1.5.4/configure.in 2012-11-27 13:36:54.513147832 +0000 +@@ -66,6 +66,7 @@ AC_SUBST(INSTALL_LANGUAGES) + AC_SUBST(UNINSTALL_LANGUAGES) + + AC_OUTPUT(Makedefs ++ conf/cups-files.conf + conf/cupsd.conf + conf/mime.convs + conf/pam.std +@@ -82,6 +83,7 @@ AC_OUTPUT(Makedefs + man/client.conf.man + man/cups-deviced.man + man/cups-driverd.man ++ man/cups-files.conf.man + man/cups-lpd.man + man/cupsaddsmb.man + man/cupsd.conf.man +diff -up cups-1.5.4/conf/Makefile.str4223 cups-1.5.4/conf/Makefile +--- cups-1.5.4/conf/Makefile.str4223 2012-11-27 13:36:54.336147072 +0000 ++++ cups-1.5.4/conf/Makefile 2012-11-27 13:36:54.513147832 +0000 +@@ -19,7 +19,7 @@ include ../Makedefs + # Config files... + # + +-KEEP = cupsd.conf snmp.conf ++KEEP = cups-files.conf cupsd.conf snmp.conf + REPLACE = mime.convs mime.types + + +diff -up cups-1.5.4/doc/help/ref-cupsd-conf.html.in.str4223 cups-1.5.4/doc/help/ref-cupsd-conf.html.in +--- cups-1.5.4/doc/help/ref-cupsd-conf.html.in.str4223 2012-01-30 21:40:21.000000000 +0000 ++++ cups-1.5.4/doc/help/ref-cupsd-conf.html.in 2012-11-27 13:36:54.514147836 +0000 +@@ -191,82 +191,6 @@ HREF="#Location">LocationLimit section.

+ + +-

DeprecatedAuthClass

+- +-

Examples

+- +-
+-<Location /path>
+-  ...
+-  AuthClass Anonymous
+-  AuthClass User
+-  AuthClass System
+-  AuthClass Group
+-</Location>
+-
+- +-

Description

+- +-

The AuthClass directive defines what level of +-authentication is required:

+- +-
    +- +-
  • Anonymous - No authentication should be +- performed (default)
  • +- +-
  • User - A valid username and password is +- required
  • +- +-
  • System - A valid username and password +- is required, and the username must belong to the "sys" +- group; this can be changed using the SystemGroup +- directive
  • +- +-
  • Group - A valid username and password is +- required, and the username must belong to the group named +- by the AuthGroupName +- directive
  • +- +-
+- +-

The AuthClass directive must appear inside a Location or Limit section.

+- +-

This directive is deprecated and will be removed from a +-future release of CUPS. Consider using the more flexible Require directive instead.

+- +- +-

DeprecatedAuthGroupName

+- +-

Examples

+- +-
+-<Location /path>
+-  ...
+-  AuthGroupName mygroup
+-  AuthGroupName lp
+-</Location>
+-
+- +-

Description

+- +-

The AuthGroupName directive sets the group to use +-for Group authentication.

+- +-

The AuthGroupName directive must appear inside a +-Location or Limit section.

+- +-

This directive is deprecated and will be removed from a +-future release of CUPS. Consider using the more flexible Require directive instead.

+- +- +

AuthType

+ +

Examples

+@@ -2544,65 +2468,6 @@ purged.

+ files as soon as each job is completed, canceled, or aborted.

+ + +-

Printcap

+- +-

Examples

+- +-
+-Printcap
+-Printcap /etc/printcap
+-Printcap /etc/printers.conf
+-Printcap /Library/Preferences/org.cups.printers.plist
+-
+- +-

Description

+- +-

The Printcap directive controls whether or not a +-printcap file is automatically generated and updated with a list +-of available printers. If specified with no value, then no +-printcap file will be generated. The default is to generate a +-file named @CUPS_DEFAUL_PRINTCAP@.

+- +-

When a filename is specified (e.g. @CUPS_DEFAULT_PRINTCAP@), +-the printcap file is written whenever a printer is added or +-removed. The printcap file can then be used by applications that +-are hardcoded to look at the printcap file for the available +-printers.

+- +- +-

PrintcapFormat

+- +-

Examples

+- +-
+-PrintcapFormat BSD
+-PrintcapFormat Solaris
+-PrintcapFormat plist
+-
+- +-

Description

+- +-

The PrintcapFormat directive controls the output format of the +-printcap file. The default is to generate the plist format on Mac OS X, the +-Solaris format on Solaris, and the BSD format on other operating systems.

+- +- +-

CUPS 1.1.13PrintcapGUI

+- +-

Examples

+- +-
+-PrintGUI /usr/bin/glpoptions
+-
+- +-

Description

+- +-

The PrintcapGUI directive sets the program to +-associate with the IRIX printer GUI interface script which is +-used by IRIX applications to display printer-specific options. +-There is no default program.

+- +- +

CUPS 1.1.21ReloadTimeout

+ +

Examples

+@@ -2619,42 +2484,6 @@ of seconds the scheduler will wait for a + before doing a restart. The default is 30 seconds.

+ + +-

CUPS 1.1.3RemoteRoot

+- +-

Examples

+- +-
+-RemoteRoot remroot
+-RemoteRoot root
+-
+- +-

Description

+- +-

The RemoteRoot directive sets the username for +-unauthenticated root requests from remote hosts. The default +-username is remroot. Setting RemoteRoot +-to root effectively disables this security +-mechanism.

+- +- +-

RequestRoot

+- +-

Examples

+- +-
+-RequestRoot /var/spool/cups
+-RequestRoot /foo/bar/spool/cups
+-
+- +-

Description

+- +-

The RequestRoot directive sets the directory for +-incoming IPP requests and HTML forms. If an absolute path is not +-provided then it is assumed to be relative to the ServerRoot directory. The +-default request directory is @CUPS_REQUESTS@.

+- +- +

CUPS 1.1.7Require

+ +

Examples

+@@ -2806,64 +2635,6 @@ alternate name with a ServerAlias direct + + + +-

ServerBin

+- +-

Examples

+- +-
+-ServerBin /usr/lib/cups
+-ServerBin /foo/bar/lib/cups
+-
+- +-

Description

+- +-

The ServerBin directive sets the directory for +-server-run executables. If an absolute path is not provided then +-it is assumed to be relative to the ServerRoot directory. The +-default executable directory is /usr/lib/cups, +-/usr/lib32/cups, or /usr/libexec/cups +-depending on the operating system.

+- +- +-

ServerCertificate

+- +-

Examples

+- +-
+-ServerCertificate /etc/cups/ssl/server.crt
+-
+- +-

Description

+- +-

The ServerCertificate directive specifies the +-location of the SSL certificate file used by the server when +-negotiating encrypted connections. The certificate must not be +-encrypted (password protected) since the scheduler normally runs +-in the background and will be unable to ask for a password.

+- +-

The default certificate file is +-/etc/cups/ssl/server.crt.

+- +- +-

ServerKey

+- +-

Examples

+- +-
+-ServerKey /etc/cups/ssl/server.key
+-
+- +-

Description

+- +-

The ServerKey directive specifies the location of +-the SSL private key file used by the server when negotiating +-encrypted connections.

+- +-

The default key file is +-/etc/cups/ssl/server.crt.

+- +- +

ServerName

+ +

Examples

+@@ -2880,23 +2651,6 @@ that is reported to clients. By default + hostname.

+ + +-

ServerRoot

+- +-

Examples

+- +-
+-ServerRoot /etc/cups
+-ServerRoot /foo/bar/cups
+-
+- +-

Description

+- +-

The ServerRoot directive specifies the absolute +-path to the server configuration and state files. It is also used +-to resolve relative paths in the cupsd.conf file. The +-default server directory is /etc/cups.

+- +- +

CUPS 1.1.21ServerTokens

+ +

Examples

+@@ -3075,53 +2829,6 @@ subscription values to make private. The + HREF="#Policy">Policy section.

+ + +-

SystemGroup

+- +-

Examples

+- +-
+-SystemGroup lpadmin
+-SystemGroup sys
+-SystemGroup system
+-SystemGroup root
+-SystemGroup root lpadmin
+-
+- +-

Description

+- +-

The SystemGroup directive specifies the system +-administration group for System authentication. +-Multiple groups can be listed, separated with spaces. The default +-group list is @CUPS_SYSTEM_GROUPS@.

+- +- +-

TempDir

+- +-

Examples

+- +-
+-TempDir /var/tmp
+-TempDir /foo/bar/tmp
+-
+- +-

Description

+- +-

The TempDir directive specifies an absolute path +-for the directory to use for temporary files. The default +-directory is @CUPS_REQUESTS@/tmp.

+- +-

Temporary directories must be world-writable and should have +-the "sticky" permission bit enabled so that other users cannot +-delete filter temporary files. The following commands will create +-an appropriate temporary directory called +-/foo/bar/tmp:

+- +-
+-mkdir /foo/bar/tmp
+-chmod a+rwxt /foo/bar/tmp
+-
+- +- +

Timeout

+ +

Examples

+@@ -3160,31 +2867,6 @@ the same printer available from multiple +

The default is @CUPS_USE_NETWORK_DEFAULT@.

+ + +-

User

+- +-

Examples

+- +-
+-User lp
+-User guest
+-
+- +-

Description

+- +-

The User directive specifies the UNIX user that +-filter and CGI programs run as. The default user is +-@CUPS_USER@.

+- +-
Note: +- +-

You may not use user root, as that would expose +-the system to unacceptable security risks. The scheduler will +-automatically choose user nobody if you specify a +-user whose ID is 0.

+- +-
+- +- +

CUPS 1.5WebInterface

+ +

Examples

+diff -up cups-1.5.4/doc/help/ref-cups-files-conf.html.in.str4223 cups-1.5.4/doc/help/ref-cups-files-conf.html.in +--- cups-1.5.4/doc/help/ref-cups-files-conf.html.in.str4223 2012-11-27 13:36:54.514147836 +0000 ++++ cups-1.5.4/doc/help/ref-cups-files-conf.html.in 2012-11-27 13:36:54.514147836 +0000 +@@ -0,0 +1,531 @@ ++ ++ ++ ++ cups-files.conf ++ ++ ++ ++ ++

cups-files.conf

++ ++

The /etc/cups/cups-files.conf file contains configuration directives that control the files, directories. users. and groups that are used by the CUPS scheduler, cupsd(8). Each directive is listed on a line by itself followed by its value. Comments are introduced using the number sign ("#") character at the beginning of a line.

++ ++

AccessLog

++ ++

Examples

++ ++
++AccessLog /var/log/cups/access_log
++AccessLog /var/log/cups/access_log-%s
++AccessLog syslog
++
++ ++

Description

++ ++

The AccessLog directive sets the name of the ++access log file. If the filename is not absolute then it is ++assumed to be relative to the ServerRoot directory. The ++access log file is stored in "common log format" and can be used ++by any web access reporting tool to generate a report on CUPS ++server activity.

++ ++

The server name can be included in the filename by using ++%s in the name.

++ ++

The special name "syslog" can be used to send the access ++information to the system log instead of a plain file.

++ ++

The default access log file is ++@CUPS_LOGDIR@/access_log.

++ ++ ++

CUPS 1.1.15ConfigFilePerm

++ ++

Examples

++ ++
++ConfigFilePerm 0644
++ConfigFilePerm 0640
++
++ ++

Description

++ ++

The ConfigFilePerm directive specifies the permissions to use when the scheduler writes configuration and cache files, typically in response to IPP or HTTP requests. The default is @CUPS_CONFIG_FILE_PERM@.

++ ++
Note: ++ ++

The permissions for the printers.conf file are always masked to only allow access from the scheduler user (typically root). This is done because printer device URIs sometimes contain sensitive authentication information that should not be generally known on the system. There is no way to disable this security feature.

++ ++
++ ++ ++

DataDir

++ ++

Examples

++ ++
++DataDir /usr/share/cups
++
++ ++

Description

++ ++

The DataDir directive sets the directory to use ++for data files.

++ ++ ++

CUPS 1.2/OS X 10.5DefaultAuthType

++ ++

Examples

++ ++
++DefaultAuthType Basic
++DefaultAuthType BasicDigest
++DefaultAuthType Digest
++DefaultAuthType Negotiate
++
++ ++

Description

++ ++

The DefaultAuthType directive specifies the type ++of authentication to use for IPP operations that require a ++username. The default is Basic.

++ ++ ++

DocumentRoot

++ ++

Examples

++ ++
++DocumentRoot /usr/share/doc/cups
++DocumentRoot /foo/bar/doc/cups
++
++ ++

Description

++ ++

The DocumentRoot directive specifies the location ++of web content for the HTTP server in CUPS. If an absolute path ++is not specified then it is assumed to be relative to the ServerRoot directory. The ++default directory is @CUPS_DOCROOT@.

++ ++

Documents are first looked up in a sub-directory for the ++primary language requested by the client (e.g. ++@CUPS_DOCROOT@/fr/...) and then directly under ++the DocumentRoot directory (e.g. ++@CUPS_DOCROOT@/...), so it is possible to ++localize the web content by providing subdirectories for each ++language needed.

++ ++ ++

ErrorLog

++ ++

Examples

++ ++
++ErrorLog /var/log/cups/error_log
++ErrorLog /var/log/cups/error_log-%s
++ErrorLog syslog
++
++ ++

Description

++ ++

The ErrorLog directive sets the name of the error ++log file. If the filename is not absolute then it is assumed to ++be relative to the ServerRoot directory. The ++default error log file is @CUPS_LOGDIR@/error_log.

++ ++

The server name can be included in the filename by using ++%s in the name.

++ ++

The special name "syslog" can be used to send the error ++information to the system log instead of a plain file.

++ ++ ++

CUPS 1.4/OS X 10.6FatalErrors

++ ++

Examples

++ ++
++FatalErrors none
++FatalErrors all
++FatalErrors browse
++FatalErrors config
++FatalErrors listen
++FatalErrors log
++FatalErrors permissions
++FatalErrors all -permissions
++FatalErrors config permissions log
++
++ ++

Description

++ ++

The FatalErrors directive determines whether certain kinds of ++errors are fatal. The following kinds of errors are currently recognized:

++ ++
    ++ ++
  • none - No errors are fatal
  • ++ ++
  • all - All of the errors below are fatal
  • ++ ++
  • browse - Browsing initialization errors are fatal, ++ for example failed binding to the CUPS browse port or failed connections ++ to LDAP servers
  • ++ ++
  • config - Configuration file syntax errors are ++ fatal
  • ++ ++
  • listen - Listen or Port errors are fatal, except for ++ IPv6 failures on the loopback or "any" addresses
  • ++ ++
  • log - Log file creation or write errors are fatal
  • ++ ++
  • permissions - Bad startup file permissions are ++ fatal, for example shared SSL certificate and key files with world- ++ read permissions
  • ++ ++
++ ++

Multiple errors can be listed, and the form "-kind" can be used with ++all to remove specific kinds of errors. The default setting is ++@CUPS_FATAL_ERRORS@.

++ ++ ++

CUPS 1.1.18FileDevice

++ ++

Examples

++ ++
++FileDevice Yes
++FileDevice No
++
++ ++

Description

++ ++

The FileDevice directive determines whether the ++scheduler allows new printers to be added using device URIs of ++the form file:/filename. File devices are most often ++used to test new printer drivers and do not support raw file ++printing.

++ ++

The default setting is No.

++ ++
Note: ++ ++

File devices are managed by the scheduler. Since the ++scheduler normally runs as the root user, file devices ++can be used to overwrite system files and potentially ++gain unauthorized access to the system. If you must ++create printers using file devices, we recommend that ++you set the FileDevice directive to ++Yes for only as long as you need to add the ++printers to the system, and then reset the directive to ++No.

++ ++
++ ++ ++

CUPS 1.1.3FontPath

++ ++

Examples

++ ++
++FontPath /foo/bar/fonts
++FontPath /usr/share/cups/fonts:/foo/bar/fonts
++
++ ++

Description

++ ++

The FontPath directive specifies the font path to ++use when searching for fonts. The default font path is ++/usr/share/cups/fonts.

++ ++ ++

Group

++ ++

Examples

++ ++
++Group lp
++Group nobody
++
++ ++

Description

++ ++

The Group directive specifies the UNIX group that ++filter and CGI programs run as. The default group is ++system-specific but is usually lp or ++nobody.

++ ++ ++

CUPS 1.1.15LogFilePerm

++ ++

Examples

++ ++
++LogFilePerm 0644
++LogFilePerm 0600
++
++ ++

Description

++ ++

The LogFilePerm directive specifies the ++permissions to use when writing log files. The default ++is @CUPS_LOG_FILE_PERM@.

++ ++ ++

PageLog

++ ++

Examples

++ ++
++PageLog /var/log/cups/page_log
++PageLog /var/log/cups/page_log-%s
++PageLog syslog
++
++ ++

Description

++ ++

The PageLog directive sets the name of the page ++log file. If the filename is not absolute then it is assumed to ++be relative to the ServerRoot directory. The ++default page log file is @CUPS_LOGDIR@/page_log.

++ ++

The server name can be included in the filename by using ++%s in the name.

++ ++

The special name "syslog" can be used to send the page ++information to the system log instead of a plain file.

++ ++ ++

Printcap

++ ++

Examples

++ ++
++Printcap
++Printcap /etc/printcap
++Printcap /etc/printers.conf
++Printcap /Library/Preferences/org.cups.printers.plist
++
++ ++

Description

++ ++

The Printcap directive controls whether or not a ++printcap file is automatically generated and updated with a list ++of available printers. If specified with no value, then no ++printcap file will be generated. The default is to generate a ++file named @CUPS_DEFAULT_PRINTCAP@.

++ ++

When a filename is specified (e.g. @CUPS_DEFAULT_PRINTCAP@), ++the printcap file is written whenever a printer is added or ++removed. The printcap file can then be used by applications that ++are hardcoded to look at the printcap file for the available ++printers.

++ ++ ++

PrintcapFormat

++ ++

Examples

++ ++
++PrintcapFormat BSD
++PrintcapFormat Solaris
++PrintcapFormat plist
++
++ ++

Description

++ ++

The PrintcapFormat directive controls the output format of the ++printcap file. The default is to generate the plist format on OS X, the ++Solaris format on Solaris, and the BSD format on other operating systems.

++ ++ ++

CUPS 1.1.3RemoteRoot

++ ++

Examples

++ ++
++RemoteRoot remroot
++RemoteRoot root
++
++ ++

Description

++ ++

The RemoteRoot directive sets the username for ++unauthenticated root requests from remote hosts. The default ++username is remroot. Setting RemoteRoot ++to root effectively disables this security ++mechanism.

++ ++ ++

RequestRoot

++ ++

Examples

++ ++
++RequestRoot /var/spool/cups
++RequestRoot /foo/bar/spool/cups
++
++ ++

Description

++ ++

The RequestRoot directive sets the directory for ++incoming IPP requests and HTML forms. If an absolute path is not ++provided then it is assumed to be relative to the ServerRoot directory. The ++default request directory is @CUPS_REQUESTS@.

++ ++ ++

ServerBin

++ ++

Examples

++ ++
++ServerBin /usr/lib/cups
++ServerBin /foo/bar/lib/cups
++
++ ++

Description

++ ++

The ServerBin directive sets the directory for ++server-run executables. If an absolute path is not provided then ++it is assumed to be relative to the ServerRoot directory. The ++default executable directory is /usr/lib/cups, ++/usr/lib32/cups, or /usr/libexec/cups ++depending on the operating system.

++ ++ ++

ServerCertificate

++ ++

Examples

++ ++
++ServerCertificate /etc/cups/ssl/server.crt
++
++ ++

Description

++ ++

The ServerCertificate directive specifies the ++location of the SSL certificate file used by the server when ++negotiating encrypted connections. The certificate must not be ++encrypted (password protected) since the scheduler normally runs ++in the background and will be unable to ask for a password.

++ ++

The default certificate file is ++/etc/cups/ssl/server.crt.

++ ++ ++

ServerKey

++ ++

Examples

++ ++
++ServerKey /etc/cups/ssl/server.key
++
++ ++

Description

++ ++

The ServerKey directive specifies the location of ++the SSL private key file used by the server when negotiating ++encrypted connections.

++ ++

The default key file is ++/etc/cups/ssl/server.crt.

++ ++ ++

ServerRoot

++ ++

Examples

++ ++
++ServerRoot /etc/cups
++ServerRoot /foo/bar/cups
++
++ ++

Description

++ ++

The ServerRoot directive specifies the absolute ++path to the server configuration and state files. It is also used ++to resolve relative paths in the cupsd.conf file. The ++default server directory is /etc/cups.

++ ++ ++

SystemGroup

++ ++

Examples

++ ++
++SystemGroup lpadmin
++SystemGroup sys
++SystemGroup system
++SystemGroup root
++SystemGroup root lpadmin
++
++ ++

Description

++ ++

The SystemGroup directive specifies the system ++administration group for System authentication. ++Multiple groups can be listed, separated with spaces. The default ++group list is @CUPS_SYSTEM_GROUPS@.

++ ++ ++

TempDir

++ ++

Examples

++ ++
++TempDir /var/tmp
++TempDir /foo/bar/tmp
++
++ ++

Description

++ ++

The TempDir directive specifies an absolute path ++for the directory to use for temporary files. The default ++directory is @CUPS_REQUESTS@/tmp.

++ ++

Temporary directories must be world-writable and should have ++the "sticky" permission bit enabled so that other users cannot ++delete filter temporary files. The following commands will create ++an appropriate temporary directory called ++/foo/bar/tmp:

++ ++
++mkdir /foo/bar/tmp
++chmod a+rwxt /foo/bar/tmp
++
++ ++ ++

User

++ ++

Examples

++ ++
++User lp
++User guest
++
++ ++

Description

++ ++

The User directive specifies the UNIX user that ++filter and CGI programs run as. The default user is ++@CUPS_USER@.

++ ++
Note: ++ ++

You may not use user root, as that would expose ++the system to unacceptable security risks. The scheduler will ++automatically choose user nobody if you specify a ++user whose ID is 0.

++ ++
++ ++ ++ ++ +diff -up cups-1.5.4/doc/Makefile.str4223 cups-1.5.4/doc/Makefile +--- cups-1.5.4/doc/Makefile.str4223 2011-01-17 05:40:28.000000000 +0000 ++++ cups-1.5.4/doc/Makefile 2012-11-27 13:36:54.514147836 +0000 +@@ -3,7 +3,7 @@ + # + # Documentation makefile for CUPS. + # +-# Copyright 2007-2011 by Apple Inc. ++# Copyright 2007-2012 by Apple Inc. + # Copyright 1997-2007 by Easy Software Products. + # + # These coded instructions, statements, and computer programs are the +diff -up cups-1.5.4/man/cupsd.conf.man.in.str4223 cups-1.5.4/man/cupsd.conf.man.in +--- cups-1.5.4/man/cupsd.conf.man.in.str4223 2011-05-18 22:33:35.000000000 +0100 ++++ cups-1.5.4/man/cupsd.conf.man.in 2012-11-27 13:36:54.515147841 +0000 +@@ -12,12 +12,15 @@ + .\" which should have been included with this file. If this file is + .\" file is missing or damaged, see the license at "http://www.cups.org/". + .\" +-.TH cupsd.conf 5 "CUPS" "18 May 2011" "Apple Inc." ++.TH cupsd.conf 5 "CUPS" "19 November 2012" "Apple Inc." + .SH NAME + cupsd.conf \- server configuration file for cups + .SH DESCRIPTION + The \fIcupsd.conf\fR file configures the CUPS scheduler, \fIcupsd(8)\fR. It +-is normally located in the \fI@CUPS_SERVERROOT@\fR directory. ++is normally located in the \fI@CUPS_SERVERROOT@\fR directory. \fBNote:\fR ++File, directory, and user configuration directives that used to be allowed in ++the \fIcupsd.conf\fR file are now stored in the \fIcups-files.conf(5)\fR instead ++in order to prevent certain types of privilege escalation attacks. + .LP + Each line in the file can be a configuration directive, a blank line, + or a comment. Comment lines start with the # character. The +@@ -27,12 +30,6 @@ popular Apache web server software and a + The following directives are understood by \fIcupsd(8)\fR. Consult the + on-line help for detailed descriptions: + .TP 5 +-AccessLog filename +-.TP 5 +-AccessLog syslog +-.br +-Defines the access log filename. +-.TP 5 + AccessLogLevel config + .TP 5 + AccessLogLevel actions +@@ -61,20 +58,6 @@ Allow @LOCAL + .br + Allows access from the named hosts or addresses. + .TP 5 +-AuthClass User +-.TP 5 +-AuthClass Group +-.TP 5 +-AuthClass System +-.br +-Specifies the authentication class (User, Group, System) - +-\fBthis directive is deprecated\fR. +-.TP 5 +-AuthGroupName group-name +-.br +-Specifies the authentication group - \fBthis directive is +-deprecated\fR. +-.TP 5 + AuthType None + .TP 5 + AuthType Basic +@@ -220,7 +203,7 @@ Browsing Yes + .TP 5 + Browsing No + .br +-Specifies whether or not remote printer browsing should be enabled. ++Specifies whether or not shared printers should be advertised. + .TP 5 + Classification banner + .br +@@ -233,15 +216,6 @@ ClassifyOverride No + Specifies whether to allow users to override the classification + of individual print jobs. + .TP 5 +-ConfigFilePerm mode +-.br +-Specifies the permissions for all configuration files that the scheduler +-writes. +-.TP 5 +-DataDir path +-.br +-Specified the directory where data files can be found. +-.TP 5 + DefaultAuthType Basic + .TP 5 + DefaultAuthType BasicDigest +@@ -309,10 +283,6 @@ Specifies the delay for updating of conf + causes the update to happen as soon as possible, typically within a few + milliseconds. + .TP 5 +-DocumentRoot directory +-.br +-Specifies the root directory for the internal web server documents. +-.TP 5 + Encryption IfRequested + .TP 5 + Encryption Never +@@ -322,28 +292,6 @@ Encryption Required + Specifies the level of encryption that is required for a particular + location. + .TP 5 +-ErrorLog filename +-.TP 5 +-ErrorLog syslog +-.br +-Specifies the error log filename. +-.TP 5 +-FatalErrors none +-.TP 5 +-FatalErrors all -kind [... -kind] +-.TP 5 +-FatalErrors kind [... kind] +-.br +-Specifies which errors are fatal, causing the scheduler to exit. "Kind" is +-"browse", "config", "listen", "log", or "permissions". +-.TP 5 +-FileDevice Yes +-.TP 5 +-FileDevice No +-.br +-Specifies whether the file pseudo-device can be used for new +-printer queues. +-.TP 5 + FilterLimit limit + .br + Specifies the maximum cost of filters that are run concurrently. +@@ -353,15 +301,6 @@ FilterNice nice-value + Specifies the scheduling priority ("nice" value) of filters that + are run to print a job. + .TP 5 +-FontPath directory[:directory:...] +-.br +-Specifies the search path for fonts. +-.TP 5 +-Group group-name-or-number +-.br +-Specifies the group name or ID that will be used when executing +-external programs. +-.TP 5 + HideImplicitMembers Yes + .TP 5 + HideImplicitMembers No +@@ -469,10 +408,6 @@ LogDebugHistory #-messages + Specifies the number of debugging messages that are logged when an error + occurs in a print job. + .TP 5 +-LogFilePerm mode +-.br +-Specifies the permissions for all log files that the scheduler writes. +-.TP 5 + LogLevel alert + .TP 5 + LogLevel crit +@@ -546,12 +481,6 @@ Order deny,allow + .br + Specifies the order of HTTP access control (allow,deny or deny,allow) + .TP 5 +-PageLog filename +-.TP 5 +-PageLog syslog +-.br +-Specifies the page log filename. +-.TP 5 + PageLogFormat format string + .br + Specifies the format of page log lines. +@@ -581,15 +510,6 @@ PreserveJobHistory No + Specifies whether or not to preserve the job history after they are + printed. + .TP 5 +-Printcap +-.TP 5 +-Printcap filename +-.br +-Specifies the filename for a printcap file that is updated +-automatically with a list of available printers (needed for +-legacy applications); specifying Printcap with no filename +-disables printcap generation. +-.TP 5 + PrintcapFormat bsd + .TP 5 + PrintcapFormat plist +@@ -598,29 +518,11 @@ PrintcapFormat solaris + .br + Specifies the format of the printcap file. + .TP 5 +-PrintcapGUI +-.TP 5 +-PrintcapGUI gui-program-filename +-.br +-Specifies whether to generate option panel definition files on +-some operating systems. When provided with no program filename, +-disables option panel definition files. +-.TP 5 + ReloadTimeout seconds + .br + Specifies the amount of time to wait for job completion before + restarting the scheduler. + .TP 5 +-RemoteRoot user-name +-.br +-Specifies the username that is associated with unauthenticated root +-accesses. +-.TP 5 +-RequestRoot directory +-.br +-Specifies the directory to store print jobs and other HTTP request +-data. +-.TP 5 + Require group group-name-list + .TP 5 + Require user user-name-list +@@ -652,27 +554,10 @@ ServerAlias * + Specifies an alternate name that the server is known by. The special name "*" + allows any name to be used. + .TP 5 +-ServerBin directory +-.br +-Specifies the directory where backends, CGIs, daemons, and filters may +-be found. +-.TP 5 +-ServerCertificate filename +-.br +-Specifies the encryption certificate to use. +-.TP 5 +-ServerKey filename +-.br +-Specifies the encryption key to use. +-.TP 5 + ServerName hostname-or-ip-address + .br + Specifies the fully-qualified hostname of the server. + .TP 5 +-ServerRoot directory +-.br +-Specifies the directory where the server configuration files can be found. +-.TP 5 + ServerTokens Full + .TP 5 + ServerTokens Major +@@ -729,29 +614,17 @@ Specifies the list of job values to make + "notify-events", "notify-pull-method", "notify-recipient-uri", + "notify-subscriber-user-name", and "notify-user-data". + .TP 5 +-SystemGroup group-name [group-name ...] +-.br +-Specifies the group(s) to use for System class authentication. +-.TP 5 +-TempDir directory +-.br +-Specifies the directory where temporary files are stored. +-.TP 5 + Timeout seconds + .br + Specifies the HTTP request timeout in seconds. + .TP 5 +-User user-name +-.br +-Specifies the user name or ID that is used when running external programs. +-.TP 5 + WebInterface yes + .TP 5 + WebInterface no + Specifies whether the web interface is enabled. + .SH SEE ALSO +-\fIclasses.conf(5)\fR, \fIcupsd(8)\fR, \fImime.convs(5)\fR, +-\fImime.types(5)\fR, \fIprinters.conf(5)\fR, ++\fIclasses.conf(5)\fR, \fIcups-files.conf(5)\fR, \fIcupsd(8)\fR, ++\fImime.convs(5)\fR, \fImime.types(5)\fR, \fIprinters.conf(5)\fR, + \fIsubscriptions.conf(5)\fR, + .br + http://localhost:631/help +diff -up cups-1.5.4/man/cups-files.conf.man.in.str4223 cups-1.5.4/man/cups-files.conf.man.in +--- cups-1.5.4/man/cups-files.conf.man.in.str4223 2012-11-27 13:36:54.515147841 +0000 ++++ cups-1.5.4/man/cups-files.conf.man.in 2012-11-27 13:36:54.515147841 +0000 +@@ -0,0 +1,146 @@ ++.\" ++.\" "$Id$" ++.\" ++.\" cupsd.conf man page for CUPS. ++.\" ++.\" Copyright 2007-2012 by Apple Inc. ++.\" Copyright 1997-2006 by Easy Software Products. ++.\" ++.\" These coded instructions, statements, and computer programs are the ++.\" property of Apple Inc. and are protected by Federal copyright ++.\" law. Distribution and use rights are outlined in the file "LICENSE.txt" ++.\" which should have been included with this file. If this file is ++.\" file is missing or damaged, see the license at "http://www.cups.org/". ++.\" ++.TH cups-files.conf 5 "CUPS" "19 November 2012" "Apple Inc." ++.SH NAME ++cups-files.conf \- file and directory configuration file for cups ++.SH DESCRIPTION ++The \fIcups-file.conf\fR file configures the files and directories used by the ++CUPS scheduler, \fIcupsd(8)\fR. It is normally located in the ++\fI@CUPS_SERVERROOT@\fR directory. ++.LP ++Each line in the file can be a configuration directive, a blank line, ++or a comment. Comment lines start with the # character. ++.SH DIRECTIVES ++The following directives are understood by \fIcupsd(8)\fR. Consult the ++on-line help for detailed descriptions: ++.TP 5 ++AccessLog filename ++.TP 5 ++AccessLog syslog ++.br ++Defines the access log filename. ++.TP 5 ++ConfigFilePerm mode ++.br ++Specifies the permissions for all configuration files that the scheduler ++writes. ++.TP 5 ++DataDir path ++.br ++Specified the directory where data files can be found. ++.TP 5 ++DocumentRoot directory ++.br ++Specifies the root directory for the internal web server documents. ++.TP 5 ++ErrorLog filename ++.TP 5 ++ErrorLog syslog ++.br ++Specifies the error log filename. ++.TP 5 ++FatalErrors none ++.TP 5 ++FatalErrors all -kind [... -kind] ++.TP 5 ++FatalErrors kind [... kind] ++.br ++Specifies which errors are fatal, causing the scheduler to exit. "Kind" is ++"browse", "config", "listen", "log", or "permissions". ++.TP 5 ++FileDevice Yes ++.TP 5 ++FileDevice No ++.br ++Specifies whether the file pseudo-device can be used for new ++printer queues. ++.TP 5 ++FontPath directory[:directory:...] ++.br ++Specifies the search path for fonts. ++.TP 5 ++Group group-name-or-number ++.br ++Specifies the group name or ID that will be used when executing ++external programs. ++.TP 5 ++LogFilePerm mode ++.br ++Specifies the permissions for all log files that the scheduler writes. ++.TP 5 ++PageLog filename ++.TP 5 ++PageLog syslog ++.br ++Specifies the page log filename. ++.TP 5 ++Printcap ++.TP 5 ++Printcap filename ++.br ++Specifies the filename for a printcap file that is updated ++automatically with a list of available printers (needed for ++legacy applications); specifying Printcap with no filename ++disables printcap generation. ++.TP 5 ++RemoteRoot user-name ++.br ++Specifies the username that is associated with unauthenticated root ++accesses. ++.TP 5 ++RequestRoot directory ++.br ++Specifies the directory to store print jobs and other HTTP request ++data. ++.TP 5 ++ServerBin directory ++.br ++Specifies the directory where backends, CGIs, daemons, and filters may ++be found. ++.TP 5 ++ServerCertificate filename ++.br ++Specifies the encryption certificate to use. ++.TP 5 ++ServerKey filename ++.br ++Specifies the encryption key to use. ++.TP 5 ++ServerRoot directory ++.br ++Specifies the directory where the server configuration files can be found. ++.TP 5 ++SystemGroup group-name [group-name ...] ++.br ++Specifies the group(s) to use for System class authentication. ++.TP 5 ++TempDir directory ++.br ++Specifies the directory where temporary files are stored. ++.TP 5 ++User user-name ++.br ++Specifies the user name or ID that is used when running external programs. ++.SH SEE ALSO ++\fIclasses.conf(5)\fR, \fIcupsd(8)\fR, \fIcupsd.conf(5)\fR, \fImime.convs(5)\fR, ++\fImime.types(5)\fR, \fIprinters.conf(5)\fR, ++\fIsubscriptions.conf(5)\fR, ++.br ++http://localhost:631/help ++.SH COPYRIGHT ++Copyright 2007-2012 by Apple Inc. ++.\" ++.\" End of "$Id$". ++.\" +diff -up cups-1.5.4/man/Makefile.str4223 cups-1.5.4/man/Makefile +--- cups-1.5.4/man/Makefile.str4223 2010-06-22 22:21:37.000000000 +0100 ++++ cups-1.5.4/man/Makefile 2012-11-27 13:36:54.515147841 +0000 +@@ -39,6 +39,7 @@ MAN1 = cancel.$(MAN1EXT) \ + ppdpo.$(MAN1EXT) + MAN5 = classes.conf.$(MAN5EXT) \ + client.conf.$(MAN5EXT) \ ++ cups-files.conf.$(MAN5EXT) \ + cups-snmp.conf.$(MAN5EXT) \ + cupsd.conf.$(MAN5EXT) \ + ipptoolfile.$(MAN5EXT) \ +diff -up cups-1.5.4/packaging/cups.list.in.str4223 cups-1.5.4/packaging/cups.list.in +--- cups-1.5.4/packaging/cups.list.in.str4223 2012-04-24 00:49:19.000000000 +0100 ++++ cups-1.5.4/packaging/cups.list.in 2012-11-27 13:36:54.515147841 +0000 +@@ -588,6 +588,7 @@ d 0755 root $CUPS_GROUP $SERVERROOT/inte + d 0755 root $CUPS_GROUP $SERVERROOT/ppd - + d 0700 root $CUPS_GROUP $SERVERROOT/ssl - + c $CUPS_PERM root $CUPS_GROUP $SERVERROOT/ conf/*.conf ++f $CUPS_PERM root $CUPS_GROUP $SERVERROOT/cups-files.conf.default conf/cups-files.conf + f $CUPS_PERM root $CUPS_GROUP $SERVERROOT/cupsd.conf.default conf/cupsd.conf + + %if PAMDIR +diff -up cups-1.5.4/packaging/cups.spec.in.str4223 cups-1.5.4/packaging/cups.spec.in +--- cups-1.5.4/packaging/cups.spec.in.str4223 2012-04-23 18:46:53.000000000 +0100 ++++ cups-1.5.4/packaging/cups.spec.in 2012-11-27 13:36:54.516147846 +0000 +@@ -152,6 +152,7 @@ rm -rf $RPM_BUILD_ROOT + %defattr(-,root,root) + %dir /etc/cups + %config(noreplace) /etc/cups/*.conf ++/etc/cups/cups-files.conf.default + /etc/cups/cupsd.conf.default + %dir /etc/cups/interfaces + %dir /etc/cups/ppd +diff -up cups-1.5.4/scheduler/client.c.str4223 cups-1.5.4/scheduler/client.c +--- cups-1.5.4/scheduler/client.c.str4223 2012-11-27 13:36:54.461147608 +0000 ++++ cups-1.5.4/scheduler/client.c 2012-11-27 13:36:54.516147846 +0000 +@@ -35,7 +35,7 @@ + * data_ready() - Check whether data is available from a client. + * encrypt_client() - Enable encryption for the client... + * get_file() - Get a filename and state info. +- * install_conf_file() - Install a configuration file. ++ * install_cupsd_conf() - Install a configuration file. + * is_cgi() - Is the resource a CGI script/program? + * is_path_absolute() - Is a path absolute and free of relative elements + * (i.e. ".."). +@@ -75,7 +75,7 @@ static int encrypt_client(cupsd_client_ + #endif /* HAVE_SSL */ + static char *get_file(cupsd_client_t *con, struct stat *filestats, + char *filename, int len); +-static http_status_t install_conf_file(cupsd_client_t *con); ++static http_status_t install_cupsd_conf(cupsd_client_t *con); + static int is_cgi(cupsd_client_t *con, const char *filename, + struct stat *filestats, mime_type_t *type); + static int is_path_absolute(const char *path); +@@ -1685,17 +1685,14 @@ cupsdReadClient(cupsd_client_t *con) /* + * Validate the resource name... + */ + +- if (strncmp(con->uri, "/admin/conf/", 12) || +- strchr(con->uri + 12, '/') || +- strlen(con->uri) == 12) ++ if (strcmp(con->uri, "/admin/conf/cupsd.conf")) + { + /* +- * PUT can only be done to configuration files under +- * /admin/conf... ++ * PUT can only be done to the cupsd.conf file... + */ + + cupsdLogMessage(CUPSD_LOG_ERROR, +- "Request for subdirectory \"%s\"!", con->uri); ++ "Disallowed PUT request for \"%s\"!", con->uri); + + if (!cupsdSendError(con, HTTP_FORBIDDEN, CUPSD_AUTH_NONE)) + { +@@ -2059,7 +2056,7 @@ cupsdReadClient(cupsd_client_t *con) /* + * Install the configuration file... + */ + +- status = install_conf_file(con); ++ status = install_cupsd_conf(con); + + /* + * Return the status to the client... +@@ -3814,14 +3811,13 @@ get_file(cupsd_client_t *con, /* I - C + + + /* +- * 'install_conf_file()' - Install a configuration file. ++ * 'install_cupsd_conf()' - Install a configuration file. + */ + + static http_status_t /* O - Status */ +-install_conf_file(cupsd_client_t *con) /* I - Connection */ ++install_cupsd_conf(cupsd_client_t *con) /* I - Connection */ + { + char filename[1024]; /* Configuration filename */ +- mode_t mode; /* Permissions */ + cups_file_t *in, /* Input file */ + *out; /* Output file */ + char buffer[16384]; /* Copy buffer */ +@@ -3843,13 +3839,8 @@ install_conf_file(cupsd_client_t *con) / + * Open the new config file... + */ + +- snprintf(filename, sizeof(filename), "%s%s", ServerRoot, con->uri + 11); +- if (!strcmp(con->uri, "/admin/conf/printers.conf")) +- mode = ConfigFilePerm & 0600; +- else +- mode = ConfigFilePerm; +- +- if ((out = cupsdCreateConfFile(filename, mode)) == NULL) ++ snprintf(filename, sizeof(filename), "%s/cupsd.conf", ServerRoot); ++ if ((out = cupsdCreateConfFile(filename, ConfigFilePerm)) == NULL) + { + cupsFileClose(in); + return (HTTP_SERVER_ERROR); +@@ -3894,14 +3885,10 @@ install_conf_file(cupsd_client_t *con) / + cupsdClearString(&con->filename); + + /* +- * If the cupsd.conf file was updated, set the NeedReload flag... ++ * Set the NeedReload flag... + */ + +- if (!strcmp(con->uri, "/admin/conf/cupsd.conf")) +- NeedReload = RELOAD_CUPSD; +- else +- NeedReload = RELOAD_ALL; +- ++ NeedReload = RELOAD_CUPSD; + ReloadTime = time(NULL); + + /* +diff -up cups-1.5.4/scheduler/conf.c.str4223 cups-1.5.4/scheduler/conf.c +--- cups-1.5.4/scheduler/conf.c.str4223 2012-11-27 13:36:54.461147608 +0000 ++++ cups-1.5.4/scheduler/conf.c 2012-11-27 13:37:21.371244571 +0000 +@@ -27,7 +27,8 @@ + * parse_fatal_errors() - Parse FatalErrors values in a string. + * parse_groups() - Parse system group names in a string. + * parse_protocols() - Parse browse protocols in a string. +- * read_configuration() - Read a configuration file. ++ * read_cupsd_conf() - Read the cupsd.conf configuration file. ++ * read_cups_files_conf() - Read the cups-files.conf configuration file. + * read_location() - Read a definition. + * read_policy() - Read a definition. + * set_policy_defaults() - Set default policy values as needed. +@@ -81,9 +82,8 @@ typedef struct + * Local globals... + */ + +-static const cupsd_var_t variables[] = ++static const cupsd_var_t cupsd_vars[] = + { +- { "AccessLog", &AccessLog, CUPSD_VARTYPE_STRING }, + { "AutoPurgeJobs", &JobAutoPurge, CUPSD_VARTYPE_BOOLEAN }, + #if defined(HAVE_DNSSD) || defined(HAVE_AVAHI) + { "BrowseDNSSDRegType", &DNSSDRegType, CUPSD_VARTYPE_STRING }, +@@ -105,24 +105,17 @@ static const cupsd_var_t variables[] = + { "BrowseTimeout", &BrowseTimeout, CUPSD_VARTYPE_INTEGER }, + { "BrowseWebIF", &BrowseWebIF, CUPSD_VARTYPE_BOOLEAN }, + { "Browsing", &Browsing, CUPSD_VARTYPE_BOOLEAN }, +- { "CacheDir", &CacheDir, CUPSD_VARTYPE_STRING }, + { "Classification", &Classification, CUPSD_VARTYPE_STRING }, + { "ClassifyOverride", &ClassifyOverride, CUPSD_VARTYPE_BOOLEAN }, +- { "ConfigFilePerm", &ConfigFilePerm, CUPSD_VARTYPE_INTEGER }, +- { "DataDir", &DataDir, CUPSD_VARTYPE_STRING }, + { "DefaultLanguage", &DefaultLanguage, CUPSD_VARTYPE_STRING }, + { "DefaultLeaseDuration", &DefaultLeaseDuration, CUPSD_VARTYPE_INTEGER }, + { "DefaultPaperSize", &DefaultPaperSize, CUPSD_VARTYPE_STRING }, + { "DefaultPolicy", &DefaultPolicy, CUPSD_VARTYPE_STRING }, + { "DefaultShared", &DefaultShared, CUPSD_VARTYPE_BOOLEAN }, + { "DirtyCleanInterval", &DirtyCleanInterval, CUPSD_VARTYPE_INTEGER }, +- { "DocumentRoot", &DocumentRoot, CUPSD_VARTYPE_STRING }, +- { "ErrorLog", &ErrorLog, CUPSD_VARTYPE_STRING }, + { "ErrorPolicy", &ErrorPolicy, CUPSD_VARTYPE_STRING }, +- { "FileDevice", &FileDevice, CUPSD_VARTYPE_BOOLEAN }, + { "FilterLimit", &FilterLimit, CUPSD_VARTYPE_INTEGER }, + { "FilterNice", &FilterNice, CUPSD_VARTYPE_INTEGER }, +- { "FontPath", &FontPath, CUPSD_VARTYPE_STRING }, + { "HideImplicitMembers", &HideImplicitMembers, CUPSD_VARTYPE_BOOLEAN }, + { "ImplicitClasses", &ImplicitClasses, CUPSD_VARTYPE_BOOLEAN }, + { "ImplicitAnyClasses", &ImplicitAnyClasses, CUPSD_VARTYPE_BOOLEAN }, +@@ -137,8 +130,6 @@ static const cupsd_var_t variables[] = + { "LimitRequestBody", &MaxRequestSize, CUPSD_VARTYPE_INTEGER }, + { "ListenBackLog", &ListenBackLog, CUPSD_VARTYPE_INTEGER }, + { "LogDebugHistory", &LogDebugHistory, CUPSD_VARTYPE_INTEGER }, +- { "LogFilePerm", &LogFilePerm, CUPSD_VARTYPE_INTEGER }, +- { "LPDConfigFile", &LPDConfigFile, CUPSD_VARTYPE_STRING }, + { "MaxActiveJobs", &MaxActiveJobs, CUPSD_VARTYPE_INTEGER }, + { "MaxClients", &MaxClients, CUPSD_VARTYPE_INTEGER }, + { "MaxClientsPerHost", &MaxClientsPerHost, CUPSD_VARTYPE_INTEGER }, +@@ -155,18 +146,33 @@ static const cupsd_var_t variables[] = + { "MaxSubscriptionsPerPrinter",&MaxSubscriptionsPerPrinter, CUPSD_VARTYPE_INTEGER }, + { "MaxSubscriptionsPerUser", &MaxSubscriptionsPerUser, CUPSD_VARTYPE_INTEGER }, + { "MultipleOperationTimeout", &MultipleOperationTimeout, CUPSD_VARTYPE_INTEGER }, +- { "PageLog", &PageLog, CUPSD_VARTYPE_STRING }, + { "PageLogFormat", &PageLogFormat, CUPSD_VARTYPE_STRING }, + { "PreserveJobFiles", &JobFiles, CUPSD_VARTYPE_BOOLEAN }, + { "PreserveJobHistory", &JobHistory, CUPSD_VARTYPE_BOOLEAN }, +- { "Printcap", &Printcap, CUPSD_VARTYPE_STRING }, +- { "PrintcapGUI", &PrintcapGUI, CUPSD_VARTYPE_STRING }, + { "ReloadTimeout", &ReloadTimeout, CUPSD_VARTYPE_INTEGER }, + { "RemoteRoot", &RemoteRoot, CUPSD_VARTYPE_STRING }, +- { "RequestRoot", &RequestRoot, CUPSD_VARTYPE_STRING }, + { "RIPCache", &RIPCache, CUPSD_VARTYPE_STRING }, + { "RootCertDuration", &RootCertDuration, CUPSD_VARTYPE_INTEGER }, + { "ServerAdmin", &ServerAdmin, CUPSD_VARTYPE_STRING }, ++ { "ServerName", &ServerName, CUPSD_VARTYPE_STRING }, ++ { "Timeout", &Timeout, CUPSD_VARTYPE_INTEGER }, ++ { "UseNetworkDefault", &UseNetworkDefault, CUPSD_VARTYPE_BOOLEAN }, ++ { "WebInterface", &WebInterface, CUPSD_VARTYPE_BOOLEAN } ++}; ++static const cupsd_var_t cupsfiles_vars[] = ++{ ++ { "AccessLog", &AccessLog, CUPSD_VARTYPE_STRING }, ++ { "CacheDir", &CacheDir, CUPSD_VARTYPE_STRING }, ++ { "ConfigFilePerm", &ConfigFilePerm, CUPSD_VARTYPE_INTEGER }, ++ { "DataDir", &DataDir, CUPSD_VARTYPE_STRING }, ++ { "DocumentRoot", &DocumentRoot, CUPSD_VARTYPE_STRING }, ++ { "ErrorLog", &ErrorLog, CUPSD_VARTYPE_STRING }, ++ { "FileDevice", &FileDevice, CUPSD_VARTYPE_BOOLEAN }, ++ { "FontPath", &FontPath, CUPSD_VARTYPE_STRING }, ++ { "PageLog", &PageLog, CUPSD_VARTYPE_STRING }, ++ { "Printcap", &Printcap, CUPSD_VARTYPE_STRING }, ++ { "RequestRoot", &RequestRoot, CUPSD_VARTYPE_STRING }, ++ + { "ServerBin", &ServerBin, CUPSD_VARTYPE_PATHNAME }, + #ifdef HAVE_SSL + { "ServerCertificate", &ServerCertificate, CUPSD_VARTYPE_PATHNAME }, +@@ -174,19 +180,14 @@ static const cupsd_var_t variables[] = + { "ServerKey", &ServerKey, CUPSD_VARTYPE_PATHNAME }, + # endif /* HAVE_LIBSSL || HAVE_GNUTLS */ + #endif /* HAVE_SSL */ +- { "ServerName", &ServerName, CUPSD_VARTYPE_STRING }, + { "ServerRoot", &ServerRoot, CUPSD_VARTYPE_PATHNAME }, + { "SMBConfigFile", &SMBConfigFile, CUPSD_VARTYPE_STRING }, + { "StateDir", &StateDir, CUPSD_VARTYPE_STRING }, + #ifdef HAVE_AUTHORIZATION_H + { "SystemGroupAuthKey", &SystemGroupAuthKey, CUPSD_VARTYPE_STRING }, + #endif /* HAVE_AUTHORIZATION_H */ +- { "TempDir", &TempDir, CUPSD_VARTYPE_PATHNAME }, +- { "Timeout", &Timeout, CUPSD_VARTYPE_INTEGER }, +- { "UseNetworkDefault", &UseNetworkDefault, CUPSD_VARTYPE_BOOLEAN }, +- { "WebInterface", &WebInterface, CUPSD_VARTYPE_BOOLEAN } ++ { "TempDir", &TempDir, CUPSD_VARTYPE_PATHNAME } + }; +-#define NUM_VARS (sizeof(variables) / sizeof(variables[0])) + + + static const unsigned ones[4] = +@@ -212,7 +213,12 @@ static int parse_aaa(cupsd_location_t * + static int parse_fatal_errors(const char *s); + static int parse_groups(const char *s); + static int parse_protocols(const char *s); +-static int read_configuration(cups_file_t *fp); ++static int parse_variable(const char *filename, int linenum, ++ const char *line, const char *value, ++ size_t num_vars, ++ const cupsd_var_t *vars); ++static int read_cupsd_conf(cups_file_t *fp); ++static int read_cups_files_conf(cups_file_t *fp); + static int read_location(cups_file_t *fp, char *name, int linenum); + static int read_policy(cups_file_t *fp, char *name, int linenum); + static void set_policy_defaults(cupsd_policy_t *pol); +@@ -708,22 +714,48 @@ cupsdReadConfiguration(void) + cupsdInitEnv(); + + /* +- * Read the configuration file... ++ * Read the cups-files.conf file... ++ */ ++ ++ if ((fp = cupsFileOpen(CupsFilesFile, "r")) != NULL) ++ { ++ status = read_cups_files_conf(fp); ++ ++ cupsFileClose(fp); ++ ++ if (!status) ++ return (0); ++ } ++ else if (errno == ENOENT) ++ cupsdLogMessage(CUPSD_LOG_INFO, "No %s, using defaults.", CupsFilesFile); ++ else ++ { ++ cupsdLogMessage(CUPSD_LOG_CRIT, "Unable to open %s: %s", CupsFilesFile, ++ strerror(errno)); ++ return (0); ++ } ++ ++ if (!ErrorLog) ++ cupsdSetString(&ErrorLog, CUPS_LOGDIR "/error_log"); ++ ++ /* ++ * Read the cupsd.conf file... + */ + + if ((fp = cupsFileOpen(ConfigurationFile, "r")) == NULL) ++ { ++ cupsdLogMessage(CUPSD_LOG_CRIT, "Unable to open %s: %s", ConfigurationFile, ++ strerror(errno)); + return (0); ++ } + +- status = read_configuration(fp); ++ status = read_cupsd_conf(fp); + + cupsFileClose(fp); + + if (!status) + return (0); + +- if (!ErrorLog) +- cupsdSetString(&ErrorLog, CUPS_LOGDIR "/error_log"); +- + RunUser = getuid(); + + cupsdLogMessage(CUPSD_LOG_INFO, "Remote access is %s.", +@@ -2512,13 +2544,174 @@ parse_protocols(const char *s) /* I - S + + + /* +- * 'read_configuration()' - Read a configuration file. ++ * 'parse_variable()' - Parse a variable line. + */ + + static int /* O - 1 on success, 0 on failure */ +-read_configuration(cups_file_t *fp) /* I - File to read from */ ++parse_variable( ++ const char *filename, /* I - Name of configuration file */ ++ int linenum, /* I - Line in configuration file */ ++ const char *line, /* I - Line from configuration file */ ++ const char *value, /* I - Value from configuration file */ ++ size_t num_vars, /* I - Number of variables */ ++ const cupsd_var_t *vars) /* I - Variables */ ++{ ++ size_t i; /* Looping var */ ++ const cupsd_var_t *var; /* Variables */ ++ char temp[1024]; /* Temporary string */ ++ ++ ++ for (i = num_vars, var = vars; i > 0; i --, var ++) ++ if (!_cups_strcasecmp(line, var->name)) ++ break; ++ ++ if (i == 0) ++ { ++ /* ++ * Unknown directive! Output an error message and continue... ++ */ ++ ++ if (!value) ++ cupsdLogMessage(CUPSD_LOG_ERROR, "Missing value for %s on line %d of %s.", ++ line, linenum, filename); ++ else ++ cupsdLogMessage(CUPSD_LOG_ERROR, "Unknown directive %s on line %d of %s.", ++ line, linenum, filename); ++ ++ return (0); ++ } ++ ++ switch (var->type) ++ { ++ case CUPSD_VARTYPE_INTEGER : ++ if (!value) ++ { ++ cupsdLogMessage(CUPSD_LOG_ERROR, ++ "Missing integer value for %s on line %d of %s.", ++ line, linenum, filename); ++ return (0); ++ } ++ else if (!isdigit(*value & 255)) ++ { ++ cupsdLogMessage(CUPSD_LOG_ERROR, ++ "Bad integer value for %s on line %d of %s.", ++ line, linenum, filename); ++ return (0); ++ } ++ else ++ { ++ int n; /* Number */ ++ char *units; /* Units */ ++ ++ n = strtol(value, &units, 0); ++ ++ if (units && *units) ++ { ++ if (tolower(units[0] & 255) == 'g') ++ n *= 1024 * 1024 * 1024; ++ else if (tolower(units[0] & 255) == 'm') ++ n *= 1024 * 1024; ++ else if (tolower(units[0] & 255) == 'k') ++ n *= 1024; ++ else if (tolower(units[0] & 255) == 't') ++ n *= 262144; ++ else ++ { ++ cupsdLogMessage(CUPSD_LOG_ERROR, ++ "Unknown integer value for %s on line %d of %s.", ++ line, linenum, filename); ++ return (0); ++ } ++ } ++ ++ if (n < 0) ++ { ++ cupsdLogMessage(CUPSD_LOG_ERROR, ++ "Bad negative integer value for %s on line %d of " ++ "%s.", line, linenum, filename); ++ return (0); ++ } ++ else ++ { ++ *((int *)var->ptr) = n; ++ } ++ } ++ break; ++ ++ case CUPSD_VARTYPE_BOOLEAN : ++ if (!value) ++ { ++ cupsdLogMessage(CUPSD_LOG_ERROR, ++ "Missing boolean value for %s on line %d of %s.", ++ line, linenum, filename); ++ return (0); ++ } ++ else if (!_cups_strcasecmp(value, "true") || ++ !_cups_strcasecmp(value, "on") || ++ !_cups_strcasecmp(value, "enabled") || ++ !_cups_strcasecmp(value, "yes") || ++ atoi(value) != 0) ++ { ++ *((int *)var->ptr) = TRUE; ++ } ++ else if (!_cups_strcasecmp(value, "false") || ++ !_cups_strcasecmp(value, "off") || ++ !_cups_strcasecmp(value, "disabled") || ++ !_cups_strcasecmp(value, "no") || ++ !_cups_strcasecmp(value, "0")) ++ { ++ *((int *)var->ptr) = FALSE; ++ } ++ else ++ { ++ cupsdLogMessage(CUPSD_LOG_ERROR, ++ "Unknown boolean value %s on line %d of %s.", ++ value, linenum, filename); ++ return (0); ++ } ++ break; ++ ++ case CUPSD_VARTYPE_PATHNAME : ++ if (!value) ++ { ++ cupsdLogMessage(CUPSD_LOG_ERROR, ++ "Missing pathname value for %s on line %d of %s.", ++ line, linenum, filename); ++ return (0); ++ } ++ ++ if (value[0] == '/') ++ strlcpy(temp, value, sizeof(temp)); ++ else ++ snprintf(temp, sizeof(temp), "%s/%s", ServerRoot, value); ++ ++ if (access(temp, 0)) ++ { ++ cupsdLogMessage(CUPSD_LOG_ERROR, ++ "File or directory for \"%s %s\" on line %d of %s " ++ "does not exist.", line, value, linenum, filename); ++ return (0); ++ } ++ ++ cupsdSetString((char **)var->ptr, temp); ++ break; ++ ++ case CUPSD_VARTYPE_STRING : ++ cupsdSetString((char **)var->ptr, value); ++ break; ++ } ++ ++ return (1); ++} ++ ++ ++/* ++ * 'read_cupsd_conf()' - Read the cupsd.conf configuration file. ++ */ ++ ++static int /* O - 1 on success, 0 on failure */ ++read_cupsd_conf(cups_file_t *fp) /* I - File to read from */ + { +- int i; /* Looping var */ + int linenum; /* Current line number */ + char line[HTTP_MAX_BUFFER], + /* Line from file */ +@@ -2528,7 +2721,6 @@ read_configuration(cups_file_t *fp) /* I + *value, /* Pointer to value */ + *valueptr; /* Pointer into value */ + int valuelen; /* Length of value */ +- cupsd_var_t const *var; /* Current variable */ + http_addrlist_t *addrlist, /* Address list */ + *addr; /* Current address */ + unsigned ip[4], /* Address value */ +@@ -2538,7 +2730,6 @@ read_configuration(cups_file_t *fp) /* I + cupsd_location_t *location; /* Browse location */ + cups_file_t *incfile; /* Include file */ + char incname[1024]; /* Include filename */ +- struct group *group; /* Group */ + + + /* +@@ -2570,7 +2761,7 @@ read_configuration(cups_file_t *fp) /* I + incname, strerror(errno)); + else + { +- read_configuration(incfile); ++ read_cupsd_conf(incfile); + cupsFileClose(incfile); + } + } +@@ -2594,8 +2785,6 @@ read_configuration(cups_file_t *fp) /* I + if (linenum == 0) + return (0); + } +- else if (!_cups_strcasecmp(line, "FatalErrors")) +- FatalErrors = parse_fatal_errors(value); + else if (!_cups_strcasecmp(line, "FaxRetryInterval") && value) + { + JobRetryInterval = atoi(value); +@@ -3254,81 +3443,6 @@ read_configuration(cups_file_t *fp) /* I + } + } + #endif /* HAVE_SSL */ +- else if (!_cups_strcasecmp(line, "User") && value) +- { +- /* +- * User ID to run as... +- */ +- +- if (isdigit(value[0] & 255)) +- { +- int uid = atoi(value); +- +- if (!uid) +- cupsdLogMessage(CUPSD_LOG_ERROR, +- "Will not use User 0 as specified on line %d " +- "for security reasons. You must use a non-" +- "privileged account instead.", +- linenum); +- else +- User = atoi(value); +- } +- else +- { +- struct passwd *p; /* Password information */ +- +- endpwent(); +- p = getpwnam(value); +- +- if (p) +- { +- if (!p->pw_uid) +- cupsdLogMessage(CUPSD_LOG_ERROR, +- "Will not use User %s (UID=0) as specified on line " +- "%d for security reasons. You must use a non-" +- "privileged account instead.", +- value, linenum); +- else +- User = p->pw_uid; +- } +- else +- cupsdLogMessage(CUPSD_LOG_ERROR, +- "Unknown User \"%s\" on line %d, ignoring.", +- value, linenum); +- } +- } +- else if (!_cups_strcasecmp(line, "Group") && value) +- { +- /* +- * Group ID to run as... +- */ +- +- if (isdigit(value[0])) +- Group = atoi(value); +- else +- { +- endgrent(); +- group = getgrnam(value); +- +- if (group != NULL) +- Group = group->gr_gid; +- else +- cupsdLogMessage(CUPSD_LOG_ERROR, +- "Unknown Group \"%s\" on line %d, ignoring.", +- value, linenum); +- } +- } +- else if (!_cups_strcasecmp(line, "SystemGroup") && value) +- { +- /* +- * SystemGroup (admin) group(s)... +- */ +- +- if (!parse_groups(value)) +- cupsdLogMessage(CUPSD_LOG_ERROR, +- "Unknown SystemGroup \"%s\" on line %d, ignoring.", +- value, linenum); +- } + else if (!_cups_strcasecmp(line, "HostNameLookups") && value) + { + /* +@@ -3407,22 +3521,6 @@ read_configuration(cups_file_t *fp) /* I + cupsdLogMessage(CUPSD_LOG_WARN, "Unknown LogTimeFormat %s on line %d.", + value, linenum); + } +- else if (!_cups_strcasecmp(line, "PrintcapFormat") && value) +- { +- /* +- * Format of printcap file? +- */ +- +- if (!_cups_strcasecmp(value, "bsd")) +- PrintcapFormat = PRINTCAP_BSD; +- else if (!_cups_strcasecmp(value, "plist")) +- PrintcapFormat = PRINTCAP_PLIST; +- else if (!_cups_strcasecmp(value, "solaris")) +- PrintcapFormat = PRINTCAP_SOLARIS; +- else +- cupsdLogMessage(CUPSD_LOG_WARN, "Unknown PrintcapFormat %s on line %d.", +- value, linenum); +- } + else if (!_cups_strcasecmp(line, "ServerTokens") && value) + { + /* +@@ -3548,117 +3646,192 @@ read_configuration(cups_file_t *fp) /* I + "line %d.", value, linenum); + } + #endif /* HAVE_SSL */ ++ else if (!_cups_strcasecmp(line, "AccessLog") || ++ !_cups_strcasecmp(line, "CacheDir") || ++ !_cups_strcasecmp(line, "ConfigFilePerm") || ++ !_cups_strcasecmp(line, "DataDir") || ++ !_cups_strcasecmp(line, "DocumentRoot") || ++ !_cups_strcasecmp(line, "ErrorLog") || ++ !_cups_strcasecmp(line, "FatalErrors") || ++ !_cups_strcasecmp(line, "FileDevice") || ++ !_cups_strcasecmp(line, "FontPath") || ++ !_cups_strcasecmp(line, "Group") || ++ !_cups_strcasecmp(line, "LogFilePerm") || ++ !_cups_strcasecmp(line, "LPDConfigFile") || ++ !_cups_strcasecmp(line, "PageLog") || ++ !_cups_strcasecmp(line, "Printcap") || ++ !_cups_strcasecmp(line, "PrintcapFormat") || ++ !_cups_strcasecmp(line, "RequestRoot") || ++ !_cups_strcasecmp(line, "ServerBin") || ++ !_cups_strcasecmp(line, "ServerCertificate") || ++ !_cups_strcasecmp(line, "ServerKey") || ++ !_cups_strcasecmp(line, "ServerRoot") || ++ !_cups_strcasecmp(line, "SMBConfigFile") || ++ !_cups_strcasecmp(line, "StateDir") || ++ !_cups_strcasecmp(line, "SystemGroup") || ++ !_cups_strcasecmp(line, "SystemGroupAuthKey") || ++ !_cups_strcasecmp(line, "TempDir") || ++ !_cups_strcasecmp(line, "User")) ++ { ++ cupsdLogMessage(CUPSD_LOG_WARN, ++ "Please move \"%s%s%s\" on line %d of %s to the %s file; " ++ "this will become an error in a future release.", ++ line, value ? " " : "", value ? value : "", linenum, ++ ConfigurationFile, CupsFilesFile); ++ } + else ++ parse_variable(ConfigurationFile, linenum, line, value, ++ sizeof(cupsd_vars) / sizeof(cupsd_vars[0]), cupsd_vars); ++ } ++ ++ return (1); ++} ++ ++ ++/* ++ * 'read_cups_files_conf()' - Read the cups-files.conf configuration file. ++ */ ++ ++static int /* O - 1 on success, 0 on failure */ ++read_cups_files_conf(cups_file_t *fp) /* I - File to read from */ ++{ ++ int linenum; /* Current line number */ ++ char line[HTTP_MAX_BUFFER], /* Line from file */ ++ *value; /* Value from line */ ++ struct group *group; /* Group */ ++ ++ ++ /* ++ * Loop through each line in the file... ++ */ ++ ++ linenum = 0; ++ ++ while (cupsFileGetConf(fp, line, sizeof(line), &value, &linenum)) ++ { ++ if (!_cups_strcasecmp(line, "FatalErrors")) ++ FatalErrors = parse_fatal_errors(value); ++ else if (!_cups_strcasecmp(line, "Group") && value) + { + /* +- * Find a simple variable in the list... ++ * Group ID to run as... + */ + +- for (i = NUM_VARS, var = variables; i > 0; i --, var ++) +- if (!_cups_strcasecmp(line, var->name)) +- break; +- +- if (i == 0) ++ if (isdigit(value[0])) ++ Group = atoi(value); ++ else + { +- /* +- * Unknown directive! Output an error message and continue... +- */ ++ endgrent(); ++ group = getgrnam(value); + +- if (!value) +- cupsdLogMessage(CUPSD_LOG_ERROR, "Missing value for %s on line %d.", +- line, linenum); ++ if (group != NULL) ++ Group = group->gr_gid; + else +- cupsdLogMessage(CUPSD_LOG_ERROR, "Unknown directive %s on line %d.", +- line, linenum); +- continue; ++ { ++ cupsdLogMessage(CUPSD_LOG_ERROR, ++ "Unknown Group \"%s\" on line %d of %s.", value, ++ linenum, CupsFilesFile); ++ if (FatalErrors & CUPSD_FATAL_CONFIG) ++ return (0); ++ } + } ++ } ++ else if (!_cups_strcasecmp(line, "PrintcapFormat") && value) ++ { ++ /* ++ * Format of printcap file? ++ */ + +- switch (var->type) ++ if (!_cups_strcasecmp(value, "bsd")) ++ PrintcapFormat = PRINTCAP_BSD; ++ else if (!_cups_strcasecmp(value, "plist")) ++ PrintcapFormat = PRINTCAP_PLIST; ++ else if (!_cups_strcasecmp(value, "solaris")) ++ PrintcapFormat = PRINTCAP_SOLARIS; ++ else + { +- case CUPSD_VARTYPE_INTEGER : +- if (!value) +- cupsdLogMessage(CUPSD_LOG_ERROR, +- "Missing integer value for %s on line %d.", +- line, linenum); +- else +- { +- int n; /* Number */ +- char *units; /* Units */ +- +- +- n = strtol(value, &units, 0); +- +- if (units && *units) +- { +- if (tolower(units[0] & 255) == 'g') +- n *= 1024 * 1024 * 1024; +- else if (tolower(units[0] & 255) == 'm') +- n *= 1024 * 1024; +- else if (tolower(units[0] & 255) == 'k') +- n *= 1024; +- else if (tolower(units[0] & 255) == 't') +- n *= 262144; +- } +- +- if (n < 0) +- cupsdLogMessage(CUPSD_LOG_ERROR, +- "Bad negative integer value for %s on line %d.", +- line, linenum); +- else +- *((int *)var->ptr) = n; +- } +- break; ++ cupsdLogMessage(CUPSD_LOG_ERROR, ++ "Unknown PrintcapFormat \"%s\" on line %d of %s.", ++ value, linenum, CupsFilesFile); ++ if (FatalErrors & CUPSD_FATAL_CONFIG) ++ return (0); ++ } ++ } ++ else if (!_cups_strcasecmp(line, "SystemGroup") && value) ++ { ++ /* ++ * SystemGroup (admin) group(s)... ++ */ + +- case CUPSD_VARTYPE_BOOLEAN : +- if (!value) +- cupsdLogMessage(CUPSD_LOG_ERROR, +- "Missing boolean value for %s on line %d.", +- line, linenum); +- else if (!_cups_strcasecmp(value, "true") || +- !_cups_strcasecmp(value, "on") || +- !_cups_strcasecmp(value, "enabled") || +- !_cups_strcasecmp(value, "yes") || +- atoi(value) != 0) +- *((int *)var->ptr) = TRUE; +- else if (!_cups_strcasecmp(value, "false") || +- !_cups_strcasecmp(value, "off") || +- !_cups_strcasecmp(value, "disabled") || +- !_cups_strcasecmp(value, "no") || +- !_cups_strcasecmp(value, "0")) +- *((int *)var->ptr) = FALSE; +- else +- cupsdLogMessage(CUPSD_LOG_ERROR, +- "Unknown boolean value %s on line %d.", +- value, linenum); +- break; ++ if (!parse_groups(value)) ++ { ++ cupsdLogMessage(CUPSD_LOG_ERROR, ++ "Unknown SystemGroup \"%s\" on line %d of %s.", value, ++ linenum, CupsFilesFile); ++ if (FatalErrors & CUPSD_FATAL_CONFIG) ++ return (0); ++ } ++ } ++ else if (!_cups_strcasecmp(line, "User") && value) ++ { ++ /* ++ * User ID to run as... ++ */ + +- case CUPSD_VARTYPE_PATHNAME : +- if (!value) +- { +- cupsdLogMessage(CUPSD_LOG_ERROR, +- "Missing pathname value for %s on line %d.", +- line, linenum); +- break; +- } ++ if (isdigit(value[0] & 255)) ++ { ++ int uid = atoi(value); + +- if (value[0] == '/') +- strlcpy(temp, value, sizeof(temp)); +- else +- snprintf(temp, sizeof(temp), "%s/%s", ServerRoot, value); ++ if (!uid) ++ { ++ cupsdLogMessage(CUPSD_LOG_ERROR, ++ "Will not use User 0 as specified on line %d of %s " ++ "for security reasons. You must use a non-" ++ "privileged account instead.", ++ linenum, CupsFilesFile); ++ if (FatalErrors & CUPSD_FATAL_CONFIG) ++ return (0); ++ } ++ else ++ User = atoi(value); ++ } ++ else ++ { ++ struct passwd *p; /* Password information */ + +- if (access(temp, 0)) +- { +- cupsdLogMessage(CUPSD_LOG_ERROR, +- "File or directory for \"%s %s\" on line %d " +- "does not exist.", line, value, linenum); +- break; +- } ++ endpwent(); ++ p = getpwnam(value); + +- case CUPSD_VARTYPE_STRING : +- cupsdSetString((char **)var->ptr, value); +- break; ++ if (p) ++ { ++ if (!p->pw_uid) ++ { ++ cupsdLogMessage(CUPSD_LOG_ERROR, ++ "Will not use User %s (UID=0) as specified on line " ++ "%d of %s for security reasons. You must use a " ++ "non-privileged account instead.", ++ value, linenum, CupsFilesFile); ++ if (FatalErrors & CUPSD_FATAL_CONFIG) ++ return (0); ++ } ++ else ++ User = p->pw_uid; ++ } ++ else ++ { ++ cupsdLogMessage(CUPSD_LOG_ERROR, ++ "Unknown User \"%s\" on line %d of %s.", ++ value, linenum, CupsFilesFile); ++ if (FatalErrors & CUPSD_FATAL_CONFIG) ++ return (0); ++ } + } + } ++ else if (!parse_variable(CupsFilesFile, linenum, line, value, ++ sizeof(cupsfiles_vars) / sizeof(cupsfiles_vars[0]), ++ cupsfiles_vars) && ++ (FatalErrors & CUPSD_FATAL_CONFIG)) ++ return (0); + } + + return (1); +diff -up cups-1.5.4/scheduler/conf.h.str4223 cups-1.5.4/scheduler/conf.h +--- cups-1.5.4/scheduler/conf.h.str4223 2012-11-27 13:36:54.347147118 +0000 ++++ cups-1.5.4/scheduler/conf.h 2012-11-27 13:36:54.518147854 +0000 +@@ -96,7 +96,9 @@ typedef struct + */ + + VAR char *ConfigurationFile VALUE(NULL), +- /* Configuration file to use */ ++ /* cupsd.conf file to use */ ++ *CupsFilesFile VALUE(NULL), ++ /* cups-files.conf file to use */ + *ServerName VALUE(NULL), + /* FQDN for server */ + *ServerAdmin VALUE(NULL), +diff -up cups-1.5.4/scheduler/main.c.str4223 cups-1.5.4/scheduler/main.c +--- cups-1.5.4/scheduler/main.c.str4223 2012-11-27 13:36:54.491147738 +0000 ++++ cups-1.5.4/scheduler/main.c 2012-11-27 13:36:54.518147854 +0000 +@@ -225,7 +225,6 @@ main(int argc, /* I - Number of comm + + char *current; /* Current directory */ + +- + /* + * Allocate a buffer for the current working directory to + * reduce run-time stack usage; this approximates the +@@ -251,6 +250,35 @@ main(int argc, /* I - Number of comm + cupsdSetStringf(&ConfigurationFile, "%s/%s", current, argv[i]); + free(current); + } ++ ++ if (!CupsFilesFile) ++ { ++ char *filename, /* Copy of cupsd.conf filename */ ++ *slash; /* Final slash in cupsd.conf filename */ ++ size_t len; /* Size of buffer */ ++ ++ len = strlen(ConfigurationFile) + 15; ++ if ((filename = malloc(len)) == NULL) ++ { ++ _cupsLangPrintf(stderr, ++ _("cupsd: Unable to get path to " ++ "cups-files.conf file.")); ++ return (1); ++ } ++ ++ strlcpy(filename, ConfigurationFile, len); ++ if ((slash = strrchr(filename, '/')) == NULL) ++ { ++ _cupsLangPrintf(stderr, ++ _("cupsd: Unable to get path to " ++ "cups-files.conf file.")); ++ return (1); ++ } ++ ++ strlcpy(slash, "/cups-files.conf", len - (slash - filename)); ++ cupsdSetString(&CupsFilesFile, filename); ++ free(filename); ++ } + break; + + case 'f' : /* Run in foreground... */ +@@ -289,6 +317,29 @@ main(int argc, /* I - Number of comm + UseProfiles = 0; + break; + ++ case 's' : /* Set cups-files.conf location */ ++ i ++; ++ if (i >= argc) ++ { ++ _cupsLangPuts(stderr, _("cupsd: Expected cups-files.conf " ++ "filename after \"-s\" option.")); ++ usage(1); ++ } ++ ++ if (argv[i][0] != '/') ++ { ++ /* ++ * Relative filename not allowed... ++ */ ++ ++ _cupsLangPuts(stderr, _("cupsd: Relative cups-files.conf " ++ "filename not allowed.")); ++ usage(1); ++ } ++ ++ cupsdSetString(&CupsFilesFile, argv[i]); ++ break; ++ + #ifdef __APPLE__ + case 'S' : /* Disable system management functions */ + fputs("cupsd: -S (disable system management) for internal " +diff -up cups-1.5.4/test/run-stp-tests.sh.str4223 cups-1.5.4/test/run-stp-tests.sh +--- cups-1.5.4/test/run-stp-tests.sh.str4223 2012-05-15 15:04:18.000000000 +0100 ++++ cups-1.5.4/test/run-stp-tests.sh 2012-11-27 13:36:54.518147854 +0000 +@@ -337,25 +337,10 @@ fi + + cat >/tmp/cups-$user/cupsd.conf < + EOF + ++cat >/tmp/cups-$user/cups-files.conf <= 13 Requires(post): systemd-units +Requires(post): grep, sed Requires(preun): systemd-units Requires(postun): systemd-units Requires(post): systemd-sysv @@ -325,6 +328,9 @@ Sends IPP requests to the specified URI and tests and/or displays the results. # Apply upstream patch to stop backend spinning on failed auth (bug #873264). %patch46 -p1 -b .str4190 +# Apply upstream fix for CVE-2012-5519 (STR #4223, bug #875898). +%patch47 -p1 -b .str4223 + %if %lspp # LSPP support. %patch100 -p1 -b .lspp @@ -477,6 +483,42 @@ php --no-php-ini \ %post +# Deal with config migration due to CVE-2012-5519 (STR #4223) +IN=%{_sysconfdir}/cups/cupsd.conf +OUT=%{_sysconfdir}/cups/cups-files.conf +copiedany=no +for keyword in AccessLog CacheDir ConfigFilePerm \ + DataDir DocumentRoot ErrorLog FatalErrors \ + FileDevice FontPath Group LogFilePerm \ + LPDConfigFile PageLog Printcap PrintcapFormat \ + RequestRoot ServerBin ServerCertificate \ + ServerKey ServerRoot SMBConfigFile StateDir \ + SystemGroup SystemGroupAuthKey TempDir User; do + if ! /usr/bin/grep -iq ^$keyword "$IN"; then continue; fi + copy=yes + if /usr/bin/grep -iq ^$keyword "$OUT"; then + if [ "`/usr/bin/grep -i ^$keyword "$IN"`" == \ + "`/usr/bin/grep -i ^$keyword "$OUT"`" ]; then + copy=no + else + /usr/bin/sed -i -e "s,^$keyword,#$keyword,i" "$OUT" + fi + fi + if [ "$copy" == "yes" ]; then + if [ "$copiedany" == "no" ]; then + cat >> "$OUT" <> "$OUT" + copiedany=yes + fi + + /usr/bin/sed -i -e "s,^$keyword,#$keyword,i" "$IN" +done + %systemd_post %{name}.path %{name}.socket %{name}.service # Remove old-style certs directory; new-style is /var/run @@ -562,6 +604,7 @@ rm -f %{cups_serverbin}/backend/smb %{_prefix}/lib/tmpfiles.d/cups.conf %{_prefix}/lib/tmpfiles.d/cups-lp.conf %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/cupsd.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 @@ -685,6 +728,10 @@ rm -f %{cups_serverbin}/backend/smb %{_mandir}/man1/ipptool.1.gz %changelog +* Mon Nov 26 2012 Tim Waugh 1:1.5.4-15 +- Apply upstream fix for CVE-2012-5519 (STR #4223, bug #875898). + Migrate configuration keywords as needed. + * Mon Nov 5 2012 Tim Waugh 1:1.5.4-14 - Apply upstream patch to stop backend spinning on failed auth (bug #873264). From 117b7ad17ffb32b35529263f31df11fd938f63c3 Mon Sep 17 00:00:00 2001 From: Tim Waugh Date: Wed, 28 Nov 2012 11:23:30 +0000 Subject: [PATCH 16/30] Fixed paths in config migration %post script. --- cups.spec | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/cups.spec b/cups.spec index bf5b569..55853d9 100644 --- a/cups.spec +++ b/cups.spec @@ -12,7 +12,7 @@ Summary: Common Unix Printing System Name: cups Version: 1.5.4 -Release: 15%{?dist} +Release: 16%{?dist} License: GPLv2 Group: System Environment/Daemons Source: http://ftp.easysw.com/pub/cups/%{version}/cups-%{version}-source.tar.bz2 @@ -494,14 +494,14 @@ for keyword in AccessLog CacheDir ConfigFilePerm \ RequestRoot ServerBin ServerCertificate \ ServerKey ServerRoot SMBConfigFile StateDir \ SystemGroup SystemGroupAuthKey TempDir User; do - if ! /usr/bin/grep -iq ^$keyword "$IN"; then continue; fi + if ! /bin/grep -iq ^$keyword "$IN"; then continue; fi copy=yes - if /usr/bin/grep -iq ^$keyword "$OUT"; then - if [ "`/usr/bin/grep -i ^$keyword "$IN"`" == \ - "`/usr/bin/grep -i ^$keyword "$OUT"`" ]; then + if /bin/grep -iq ^$keyword "$OUT"; then + if [ "`/bin/grep -i ^$keyword "$IN"`" == \ + "`/bin/grep -i ^$keyword "$OUT"`" ]; then copy=no else - /usr/bin/sed -i -e "s,^$keyword,#$keyword,i" "$OUT" + /bin/sed -i -e "s,^$keyword,#$keyword,i" "$OUT" fi fi if [ "$copy" == "yes" ]; then @@ -512,11 +512,11 @@ for keyword in AccessLog CacheDir ConfigFilePerm \ EOF fi - /usr/bin/grep -i ^$keyword "$IN" >> "$OUT" + /bin/grep -i ^$keyword "$IN" >> "$OUT" copiedany=yes fi - /usr/bin/sed -i -e "s,^$keyword,#$keyword,i" "$IN" + /bin/sed -i -e "s,^$keyword,#$keyword,i" "$IN" done %systemd_post %{name}.path %{name}.socket %{name}.service @@ -728,6 +728,9 @@ rm -f %{cups_serverbin}/backend/smb %{_mandir}/man1/ipptool.1.gz %changelog +* Wed Nov 28 2012 Tim Waugh 1:1.5.4-16 +- Fixed paths in config migration %%post script. + * Mon Nov 26 2012 Tim Waugh 1:1.5.4-15 - Apply upstream fix for CVE-2012-5519 (STR #4223, bug #875898). Migrate configuration keywords as needed. From 64253b426537cb149a25f9383020eea01b339f87 Mon Sep 17 00:00:00 2001 From: Tim Waugh Date: Wed, 28 Nov 2012 11:42:47 +0000 Subject: [PATCH 17/30] Set default cups-files.conf filename. --- cups-str4223.patch | 39 +++++++++++++++------------------------ cups.spec | 1 + 2 files changed, 16 insertions(+), 24 deletions(-) diff --git a/cups-str4223.patch b/cups-str4223.patch index ae4804d..f0eb86f 100644 --- a/cups-str4223.patch +++ b/cups-str4223.patch @@ -1,4 +1,3 @@ -diff -up cups-1.5.4/conf/cupsd.conf.in.str4223 cups-1.5.4/conf/cupsd.conf.in --- cups-1.5.4/conf/cupsd.conf.in.str4223 2010-12-09 21:24:51.000000000 +0000 +++ cups-1.5.4/conf/cupsd.conf.in 2012-11-27 13:36:54.512147828 +0000 @@ -9,10 +9,6 @@ @@ -12,7 +11,6 @@ diff -up cups-1.5.4/conf/cupsd.conf.in.str4223 cups-1.5.4/conf/cupsd.conf.in # Only listen for connections from the local machine. Listen localhost:@DEFAULT_IPP_PORT@ @CUPS_LISTEN_DOMAINSOCKET@ -diff -up cups-1.5.4/conf/cups-files.conf.in.str4223 cups-1.5.4/conf/cups-files.conf.in --- cups-1.5.4/conf/cups-files.conf.in.str4223 2012-11-27 13:36:54.512147828 +0000 +++ cups-1.5.4/conf/cups-files.conf.in 2012-11-27 13:36:54.512147828 +0000 @@ -0,0 +1,98 @@ @@ -114,7 +112,6 @@ diff -up cups-1.5.4/conf/cups-files.conf.in.str4223 cups-1.5.4/conf/cups-files.c +# +# End of "$Id$". +# -diff -up cups-1.5.4/config-scripts/cups-defaults.m4.str4223 cups-1.5.4/config-scripts/cups-defaults.m4 --- cups-1.5.4/config-scripts/cups-defaults.m4.str4223 2011-05-06 23:53:53.000000000 +0100 +++ cups-1.5.4/config-scripts/cups-defaults.m4 2012-11-27 13:36:54.513147832 +0000 @@ -367,6 +367,7 @@ else @@ -133,7 +130,6 @@ diff -up cups-1.5.4/config-scripts/cups-defaults.m4.str4223 cups-1.5.4/config-sc dnl Default MaxCopies value... AC_ARG_WITH(max-copies, [ --with-max-copies set default max copies value, default=9999 ], -diff -up cups-1.5.4/config-scripts/cups-ssl.m4.str4223 cups-1.5.4/config-scripts/cups-ssl.m4 --- cups-1.5.4/config-scripts/cups-ssl.m4.str4223 2012-11-27 13:36:54.356147158 +0000 +++ cups-1.5.4/config-scripts/cups-ssl.m4 2012-11-27 13:36:54.513147832 +0000 @@ -27,6 +27,8 @@ AC_ARG_WITH(openssl-includes, [ --with- @@ -182,7 +178,6 @@ diff -up cups-1.5.4/config-scripts/cups-ssl.m4.str4223 cups-1.5.4/config-scripts AC_SUBST(IPPALIASES) AC_SUBST(SSLFLAGS) AC_SUBST(SSLLIBS) -diff -up cups-1.5.4/configure.in.str4223 cups-1.5.4/configure.in --- cups-1.5.4/configure.in.str4223 2012-11-27 13:36:54.482147699 +0000 +++ cups-1.5.4/configure.in 2012-11-27 13:36:54.513147832 +0000 @@ -66,6 +66,7 @@ AC_SUBST(INSTALL_LANGUAGES) @@ -201,7 +196,6 @@ diff -up cups-1.5.4/configure.in.str4223 cups-1.5.4/configure.in man/cups-lpd.man man/cupsaddsmb.man man/cupsd.conf.man -diff -up cups-1.5.4/conf/Makefile.str4223 cups-1.5.4/conf/Makefile --- cups-1.5.4/conf/Makefile.str4223 2012-11-27 13:36:54.336147072 +0000 +++ cups-1.5.4/conf/Makefile 2012-11-27 13:36:54.513147832 +0000 @@ -19,7 +19,7 @@ include ../Makedefs @@ -213,7 +207,6 @@ diff -up cups-1.5.4/conf/Makefile.str4223 cups-1.5.4/conf/Makefile REPLACE = mime.convs mime.types -diff -up cups-1.5.4/doc/help/ref-cupsd-conf.html.in.str4223 cups-1.5.4/doc/help/ref-cupsd-conf.html.in --- cups-1.5.4/doc/help/ref-cupsd-conf.html.in.str4223 2012-01-30 21:40:21.000000000 +0000 +++ cups-1.5.4/doc/help/ref-cupsd-conf.html.in 2012-11-27 13:36:54.514147836 +0000 @@ -191,82 +191,6 @@ HREF="#Location">LocationCUPS 1.5WebInterface

Examples

-diff -up cups-1.5.4/doc/help/ref-cups-files-conf.html.in.str4223 cups-1.5.4/doc/help/ref-cups-files-conf.html.in --- cups-1.5.4/doc/help/ref-cups-files-conf.html.in.str4223 2012-11-27 13:36:54.514147836 +0000 +++ cups-1.5.4/doc/help/ref-cups-files-conf.html.in 2012-11-27 13:36:54.514147836 +0000 @@ -0,0 +1,531 @@ @@ -1118,7 +1110,6 @@ diff -up cups-1.5.4/doc/help/ref-cups-files-conf.html.in.str4223 cups-1.5.4/doc/ + + + -diff -up cups-1.5.4/doc/Makefile.str4223 cups-1.5.4/doc/Makefile --- cups-1.5.4/doc/Makefile.str4223 2011-01-17 05:40:28.000000000 +0000 +++ cups-1.5.4/doc/Makefile 2012-11-27 13:36:54.514147836 +0000 @@ -3,7 +3,7 @@ @@ -1130,7 +1121,6 @@ diff -up cups-1.5.4/doc/Makefile.str4223 cups-1.5.4/doc/Makefile # Copyright 1997-2007 by Easy Software Products. # # These coded instructions, statements, and computer programs are the -diff -up cups-1.5.4/man/cupsd.conf.man.in.str4223 cups-1.5.4/man/cupsd.conf.man.in --- cups-1.5.4/man/cupsd.conf.man.in.str4223 2011-05-18 22:33:35.000000000 +0100 +++ cups-1.5.4/man/cupsd.conf.man.in 2012-11-27 13:36:54.515147841 +0000 @@ -12,12 +12,15 @@ @@ -1396,7 +1386,6 @@ diff -up cups-1.5.4/man/cupsd.conf.man.in.str4223 cups-1.5.4/man/cupsd.conf.man. \fIsubscriptions.conf(5)\fR, .br http://localhost:631/help -diff -up cups-1.5.4/man/cups-files.conf.man.in.str4223 cups-1.5.4/man/cups-files.conf.man.in --- cups-1.5.4/man/cups-files.conf.man.in.str4223 2012-11-27 13:36:54.515147841 +0000 +++ cups-1.5.4/man/cups-files.conf.man.in 2012-11-27 13:36:54.515147841 +0000 @@ -0,0 +1,146 @@ @@ -1546,7 +1535,6 @@ diff -up cups-1.5.4/man/cups-files.conf.man.in.str4223 cups-1.5.4/man/cups-files +.\" +.\" End of "$Id$". +.\" -diff -up cups-1.5.4/man/Makefile.str4223 cups-1.5.4/man/Makefile --- cups-1.5.4/man/Makefile.str4223 2010-06-22 22:21:37.000000000 +0100 +++ cups-1.5.4/man/Makefile 2012-11-27 13:36:54.515147841 +0000 @@ -39,6 +39,7 @@ MAN1 = cancel.$(MAN1EXT) \ @@ -1557,7 +1545,6 @@ diff -up cups-1.5.4/man/Makefile.str4223 cups-1.5.4/man/Makefile cups-snmp.conf.$(MAN5EXT) \ cupsd.conf.$(MAN5EXT) \ ipptoolfile.$(MAN5EXT) \ -diff -up cups-1.5.4/packaging/cups.list.in.str4223 cups-1.5.4/packaging/cups.list.in --- cups-1.5.4/packaging/cups.list.in.str4223 2012-04-24 00:49:19.000000000 +0100 +++ cups-1.5.4/packaging/cups.list.in 2012-11-27 13:36:54.515147841 +0000 @@ -588,6 +588,7 @@ d 0755 root $CUPS_GROUP $SERVERROOT/inte @@ -1568,7 +1555,6 @@ diff -up cups-1.5.4/packaging/cups.list.in.str4223 cups-1.5.4/packaging/cups.lis f $CUPS_PERM root $CUPS_GROUP $SERVERROOT/cupsd.conf.default conf/cupsd.conf %if PAMDIR -diff -up cups-1.5.4/packaging/cups.spec.in.str4223 cups-1.5.4/packaging/cups.spec.in --- cups-1.5.4/packaging/cups.spec.in.str4223 2012-04-23 18:46:53.000000000 +0100 +++ cups-1.5.4/packaging/cups.spec.in 2012-11-27 13:36:54.516147846 +0000 @@ -152,6 +152,7 @@ rm -rf $RPM_BUILD_ROOT @@ -1579,7 +1565,6 @@ diff -up cups-1.5.4/packaging/cups.spec.in.str4223 cups-1.5.4/packaging/cups.spe /etc/cups/cupsd.conf.default %dir /etc/cups/interfaces %dir /etc/cups/ppd -diff -up cups-1.5.4/scheduler/client.c.str4223 cups-1.5.4/scheduler/client.c --- cups-1.5.4/scheduler/client.c.str4223 2012-11-27 13:36:54.461147608 +0000 +++ cups-1.5.4/scheduler/client.c 2012-11-27 13:36:54.516147846 +0000 @@ -35,7 +35,7 @@ @@ -1680,7 +1665,6 @@ diff -up cups-1.5.4/scheduler/client.c.str4223 cups-1.5.4/scheduler/client.c ReloadTime = time(NULL); /* -diff -up cups-1.5.4/scheduler/conf.c.str4223 cups-1.5.4/scheduler/conf.c --- cups-1.5.4/scheduler/conf.c.str4223 2012-11-27 13:36:54.461147608 +0000 +++ cups-1.5.4/scheduler/conf.c 2012-11-27 13:37:21.371244571 +0000 @@ -27,7 +27,8 @@ @@ -2468,7 +2452,6 @@ diff -up cups-1.5.4/scheduler/conf.c.str4223 cups-1.5.4/scheduler/conf.c } return (1); -diff -up cups-1.5.4/scheduler/conf.h.str4223 cups-1.5.4/scheduler/conf.h --- cups-1.5.4/scheduler/conf.h.str4223 2012-11-27 13:36:54.347147118 +0000 +++ cups-1.5.4/scheduler/conf.h 2012-11-27 13:36:54.518147854 +0000 @@ -96,7 +96,9 @@ typedef struct @@ -2482,10 +2465,9 @@ diff -up cups-1.5.4/scheduler/conf.h.str4223 cups-1.5.4/scheduler/conf.h *ServerName VALUE(NULL), /* FQDN for server */ *ServerAdmin VALUE(NULL), -diff -up cups-1.5.4/scheduler/main.c.str4223 cups-1.5.4/scheduler/main.c ---- cups-1.5.4/scheduler/main.c.str4223 2012-11-27 13:36:54.491147738 +0000 -+++ cups-1.5.4/scheduler/main.c 2012-11-27 13:36:54.518147854 +0000 -@@ -225,7 +225,6 @@ main(int argc, /* I - Number of comm +--- cups-1.5.4/scheduler/main.c 2012-11-27 13:36:54.518147854 +0000 ++++ cups-1.5.4/scheduler/main.c 2012-11-28 11:41:13.992801205 +0000 +@@ -225,7 +225,6 @@ char *current; /* Current directory */ @@ -2493,7 +2475,7 @@ diff -up cups-1.5.4/scheduler/main.c.str4223 cups-1.5.4/scheduler/main.c /* * Allocate a buffer for the current working directory to * reduce run-time stack usage; this approximates the -@@ -251,6 +250,35 @@ main(int argc, /* I - Number of comm +@@ -251,6 +250,35 @@ cupsdSetStringf(&ConfigurationFile, "%s/%s", current, argv[i]); free(current); } @@ -2529,7 +2511,7 @@ diff -up cups-1.5.4/scheduler/main.c.str4223 cups-1.5.4/scheduler/main.c break; case 'f' : /* Run in foreground... */ -@@ -289,6 +317,29 @@ main(int argc, /* I - Number of comm +@@ -289,6 +317,29 @@ UseProfiles = 0; break; @@ -2559,7 +2541,16 @@ diff -up cups-1.5.4/scheduler/main.c.str4223 cups-1.5.4/scheduler/main.c #ifdef __APPLE__ case 'S' : /* Disable system management functions */ fputs("cupsd: -S (disable system management) for internal " -diff -up cups-1.5.4/test/run-stp-tests.sh.str4223 cups-1.5.4/test/run-stp-tests.sh +@@ -318,6 +369,9 @@ + if (!ConfigurationFile) + cupsdSetString(&ConfigurationFile, CUPS_SERVERROOT "/cupsd.conf"); + ++ if (!CupsFilesFile) ++ cupsdSetString(&CupsFilesFile, CUPS_SERVERROOT "/cups-files.conf"); ++ + /* + * If the user hasn't specified "-f", run in the background... + */ --- cups-1.5.4/test/run-stp-tests.sh.str4223 2012-05-15 15:04:18.000000000 +0100 +++ cups-1.5.4/test/run-stp-tests.sh 2012-11-27 13:36:54.518147854 +0000 @@ -337,25 +337,10 @@ fi diff --git a/cups.spec b/cups.spec index 55853d9..ee03a95 100644 --- a/cups.spec +++ b/cups.spec @@ -730,6 +730,7 @@ rm -f %{cups_serverbin}/backend/smb %changelog * Wed Nov 28 2012 Tim Waugh 1:1.5.4-16 - Fixed paths in config migration %%post script. +- Set default cups-files.conf filename. * Mon Nov 26 2012 Tim Waugh 1:1.5.4-15 - Apply upstream fix for CVE-2012-5519 (STR #4223, bug #875898). From 734d6304f332b424cfa5115f5f240e5a7b9069fb Mon Sep 17 00:00:00 2001 From: Tim Waugh Date: Mon, 3 Dec 2012 09:13:48 +0000 Subject: [PATCH 18/30] Fixed patch for CVE-2012-5519 (bug #882379). Now LogFilePerm and LPDConfigFile are recognised keywords for cups-files.conf. Resolves: rhbz#882379 --- cups-str4223.patch | 111 +++++++++++++++++++++++++++------------------ cups.spec | 6 ++- 2 files changed, 71 insertions(+), 46 deletions(-) diff --git a/cups-str4223.patch b/cups-str4223.patch index f0eb86f..b33fed9 100644 --- a/cups-str4223.patch +++ b/cups-str4223.patch @@ -1,5 +1,6 @@ +diff -up cups-1.5.4/conf/cupsd.conf.in.str4223 cups-1.5.4/conf/cupsd.conf.in --- cups-1.5.4/conf/cupsd.conf.in.str4223 2010-12-09 21:24:51.000000000 +0000 -+++ cups-1.5.4/conf/cupsd.conf.in 2012-11-27 13:36:54.512147828 +0000 ++++ cups-1.5.4/conf/cupsd.conf.in 2012-12-03 09:11:03.138115925 +0000 @@ -9,10 +9,6 @@ # for troubleshooting... LogLevel @CUPS_LOG_LEVEL@ @@ -11,8 +12,9 @@ # Only listen for connections from the local machine. Listen localhost:@DEFAULT_IPP_PORT@ @CUPS_LISTEN_DOMAINSOCKET@ ---- cups-1.5.4/conf/cups-files.conf.in.str4223 2012-11-27 13:36:54.512147828 +0000 -+++ cups-1.5.4/conf/cups-files.conf.in 2012-11-27 13:36:54.512147828 +0000 +diff -up cups-1.5.4/conf/cups-files.conf.in.str4223 cups-1.5.4/conf/cups-files.conf.in +--- cups-1.5.4/conf/cups-files.conf.in.str4223 2012-12-03 09:11:03.139115936 +0000 ++++ cups-1.5.4/conf/cups-files.conf.in 2012-12-03 09:11:03.139115936 +0000 @@ -0,0 +1,98 @@ +# +# "$Id$" @@ -112,8 +114,9 @@ +# +# End of "$Id$". +# +diff -up cups-1.5.4/config-scripts/cups-defaults.m4.str4223 cups-1.5.4/config-scripts/cups-defaults.m4 --- cups-1.5.4/config-scripts/cups-defaults.m4.str4223 2011-05-06 23:53:53.000000000 +0100 -+++ cups-1.5.4/config-scripts/cups-defaults.m4 2012-11-27 13:36:54.513147832 +0000 ++++ cups-1.5.4/config-scripts/cups-defaults.m4 2012-12-03 09:11:03.139115936 +0000 @@ -367,6 +367,7 @@ else fi @@ -130,8 +133,9 @@ dnl Default MaxCopies value... AC_ARG_WITH(max-copies, [ --with-max-copies set default max copies value, default=9999 ], ---- cups-1.5.4/config-scripts/cups-ssl.m4.str4223 2012-11-27 13:36:54.356147158 +0000 -+++ cups-1.5.4/config-scripts/cups-ssl.m4 2012-11-27 13:36:54.513147832 +0000 +diff -up cups-1.5.4/config-scripts/cups-ssl.m4.str4223 cups-1.5.4/config-scripts/cups-ssl.m4 +--- cups-1.5.4/config-scripts/cups-ssl.m4.str4223 2012-12-03 09:11:02.996114329 +0000 ++++ cups-1.5.4/config-scripts/cups-ssl.m4 2012-12-03 09:11:03.140115947 +0000 @@ -27,6 +27,8 @@ AC_ARG_WITH(openssl-includes, [ --with- SSLFLAGS="" SSLLIBS="" @@ -178,8 +182,9 @@ AC_SUBST(IPPALIASES) AC_SUBST(SSLFLAGS) AC_SUBST(SSLLIBS) ---- cups-1.5.4/configure.in.str4223 2012-11-27 13:36:54.482147699 +0000 -+++ cups-1.5.4/configure.in 2012-11-27 13:36:54.513147832 +0000 +diff -up cups-1.5.4/configure.in.str4223 cups-1.5.4/configure.in +--- cups-1.5.4/configure.in.str4223 2012-12-03 09:11:03.107115578 +0000 ++++ cups-1.5.4/configure.in 2012-12-03 09:11:03.141115959 +0000 @@ -66,6 +66,7 @@ AC_SUBST(INSTALL_LANGUAGES) AC_SUBST(UNINSTALL_LANGUAGES) @@ -196,8 +201,9 @@ man/cups-lpd.man man/cupsaddsmb.man man/cupsd.conf.man ---- cups-1.5.4/conf/Makefile.str4223 2012-11-27 13:36:54.336147072 +0000 -+++ cups-1.5.4/conf/Makefile 2012-11-27 13:36:54.513147832 +0000 +diff -up cups-1.5.4/conf/Makefile.str4223 cups-1.5.4/conf/Makefile +--- cups-1.5.4/conf/Makefile.str4223 2012-12-03 09:11:02.972114055 +0000 ++++ cups-1.5.4/conf/Makefile 2012-12-03 09:11:03.141115959 +0000 @@ -19,7 +19,7 @@ include ../Makedefs # Config files... # @@ -207,8 +213,9 @@ REPLACE = mime.convs mime.types +diff -up cups-1.5.4/doc/help/ref-cupsd-conf.html.in.str4223 cups-1.5.4/doc/help/ref-cupsd-conf.html.in --- cups-1.5.4/doc/help/ref-cupsd-conf.html.in.str4223 2012-01-30 21:40:21.000000000 +0000 -+++ cups-1.5.4/doc/help/ref-cupsd-conf.html.in 2012-11-27 13:36:54.514147836 +0000 ++++ cups-1.5.4/doc/help/ref-cupsd-conf.html.in 2012-12-03 09:11:03.143115982 +0000 @@ -191,82 +191,6 @@ HREF="#Location">LocationLimit section.

@@ -576,8 +583,9 @@

CUPS 1.5WebInterface

Examples

---- cups-1.5.4/doc/help/ref-cups-files-conf.html.in.str4223 2012-11-27 13:36:54.514147836 +0000 -+++ cups-1.5.4/doc/help/ref-cups-files-conf.html.in 2012-11-27 13:36:54.514147836 +0000 +diff -up cups-1.5.4/doc/help/ref-cups-files-conf.html.in.str4223 cups-1.5.4/doc/help/ref-cups-files-conf.html.in +--- cups-1.5.4/doc/help/ref-cups-files-conf.html.in.str4223 2012-12-03 09:11:03.143115982 +0000 ++++ cups-1.5.4/doc/help/ref-cups-files-conf.html.in 2012-12-03 09:11:03.143115982 +0000 @@ -0,0 +1,531 @@ + + @@ -1110,8 +1118,9 @@ + + + +diff -up cups-1.5.4/doc/Makefile.str4223 cups-1.5.4/doc/Makefile --- cups-1.5.4/doc/Makefile.str4223 2011-01-17 05:40:28.000000000 +0000 -+++ cups-1.5.4/doc/Makefile 2012-11-27 13:36:54.514147836 +0000 ++++ cups-1.5.4/doc/Makefile 2012-12-03 09:11:03.144115993 +0000 @@ -3,7 +3,7 @@ # # Documentation makefile for CUPS. @@ -1121,8 +1130,9 @@ # Copyright 1997-2007 by Easy Software Products. # # These coded instructions, statements, and computer programs are the +diff -up cups-1.5.4/man/cupsd.conf.man.in.str4223 cups-1.5.4/man/cupsd.conf.man.in --- cups-1.5.4/man/cupsd.conf.man.in.str4223 2011-05-18 22:33:35.000000000 +0100 -+++ cups-1.5.4/man/cupsd.conf.man.in 2012-11-27 13:36:54.515147841 +0000 ++++ cups-1.5.4/man/cupsd.conf.man.in 2012-12-03 09:11:03.144115993 +0000 @@ -12,12 +12,15 @@ .\" which should have been included with this file. If this file is .\" file is missing or damaged, see the license at "http://www.cups.org/". @@ -1386,8 +1396,9 @@ \fIsubscriptions.conf(5)\fR, .br http://localhost:631/help ---- cups-1.5.4/man/cups-files.conf.man.in.str4223 2012-11-27 13:36:54.515147841 +0000 -+++ cups-1.5.4/man/cups-files.conf.man.in 2012-11-27 13:36:54.515147841 +0000 +diff -up cups-1.5.4/man/cups-files.conf.man.in.str4223 cups-1.5.4/man/cups-files.conf.man.in +--- cups-1.5.4/man/cups-files.conf.man.in.str4223 2012-12-03 09:11:03.145116004 +0000 ++++ cups-1.5.4/man/cups-files.conf.man.in 2012-12-03 09:11:03.145116004 +0000 @@ -0,0 +1,146 @@ +.\" +.\" "$Id$" @@ -1535,8 +1546,9 @@ +.\" +.\" End of "$Id$". +.\" +diff -up cups-1.5.4/man/Makefile.str4223 cups-1.5.4/man/Makefile --- cups-1.5.4/man/Makefile.str4223 2010-06-22 22:21:37.000000000 +0100 -+++ cups-1.5.4/man/Makefile 2012-11-27 13:36:54.515147841 +0000 ++++ cups-1.5.4/man/Makefile 2012-12-03 09:11:03.145116004 +0000 @@ -39,6 +39,7 @@ MAN1 = cancel.$(MAN1EXT) \ ppdpo.$(MAN1EXT) MAN5 = classes.conf.$(MAN5EXT) \ @@ -1545,8 +1557,9 @@ cups-snmp.conf.$(MAN5EXT) \ cupsd.conf.$(MAN5EXT) \ ipptoolfile.$(MAN5EXT) \ +diff -up cups-1.5.4/packaging/cups.list.in.str4223 cups-1.5.4/packaging/cups.list.in --- cups-1.5.4/packaging/cups.list.in.str4223 2012-04-24 00:49:19.000000000 +0100 -+++ cups-1.5.4/packaging/cups.list.in 2012-11-27 13:36:54.515147841 +0000 ++++ cups-1.5.4/packaging/cups.list.in 2012-12-03 09:11:03.146116015 +0000 @@ -588,6 +588,7 @@ d 0755 root $CUPS_GROUP $SERVERROOT/inte d 0755 root $CUPS_GROUP $SERVERROOT/ppd - d 0700 root $CUPS_GROUP $SERVERROOT/ssl - @@ -1555,8 +1568,9 @@ f $CUPS_PERM root $CUPS_GROUP $SERVERROOT/cupsd.conf.default conf/cupsd.conf %if PAMDIR +diff -up cups-1.5.4/packaging/cups.spec.in.str4223 cups-1.5.4/packaging/cups.spec.in --- cups-1.5.4/packaging/cups.spec.in.str4223 2012-04-23 18:46:53.000000000 +0100 -+++ cups-1.5.4/packaging/cups.spec.in 2012-11-27 13:36:54.516147846 +0000 ++++ cups-1.5.4/packaging/cups.spec.in 2012-12-03 09:11:03.146116015 +0000 @@ -152,6 +152,7 @@ rm -rf $RPM_BUILD_ROOT %defattr(-,root,root) %dir /etc/cups @@ -1565,8 +1579,9 @@ /etc/cups/cupsd.conf.default %dir /etc/cups/interfaces %dir /etc/cups/ppd ---- cups-1.5.4/scheduler/client.c.str4223 2012-11-27 13:36:54.461147608 +0000 -+++ cups-1.5.4/scheduler/client.c 2012-11-27 13:36:54.516147846 +0000 +diff -up cups-1.5.4/scheduler/client.c.str4223 cups-1.5.4/scheduler/client.c +--- cups-1.5.4/scheduler/client.c.str4223 2012-12-03 09:11:03.087115353 +0000 ++++ cups-1.5.4/scheduler/client.c 2012-12-03 09:11:03.148116037 +0000 @@ -35,7 +35,7 @@ * data_ready() - Check whether data is available from a client. * encrypt_client() - Enable encryption for the client... @@ -1665,8 +1680,9 @@ ReloadTime = time(NULL); /* ---- cups-1.5.4/scheduler/conf.c.str4223 2012-11-27 13:36:54.461147608 +0000 -+++ cups-1.5.4/scheduler/conf.c 2012-11-27 13:37:21.371244571 +0000 +diff -up cups-1.5.4/scheduler/conf.c.str4223 cups-1.5.4/scheduler/conf.c +--- cups-1.5.4/scheduler/conf.c.str4223 2012-12-03 09:11:03.089115374 +0000 ++++ cups-1.5.4/scheduler/conf.c 2012-12-03 09:12:01.425297753 +0000 @@ -27,7 +27,8 @@ * parse_fatal_errors() - Parse FatalErrors values in a string. * parse_groups() - Parse system group names in a string. @@ -1722,7 +1738,7 @@ { "MaxActiveJobs", &MaxActiveJobs, CUPSD_VARTYPE_INTEGER }, { "MaxClients", &MaxClients, CUPSD_VARTYPE_INTEGER }, { "MaxClientsPerHost", &MaxClientsPerHost, CUPSD_VARTYPE_INTEGER }, -@@ -155,18 +146,33 @@ static const cupsd_var_t variables[] = +@@ -155,18 +146,35 @@ static const cupsd_var_t variables[] = { "MaxSubscriptionsPerPrinter",&MaxSubscriptionsPerPrinter, CUPSD_VARTYPE_INTEGER }, { "MaxSubscriptionsPerUser", &MaxSubscriptionsPerUser, CUPSD_VARTYPE_INTEGER }, { "MultipleOperationTimeout", &MultipleOperationTimeout, CUPSD_VARTYPE_INTEGER }, @@ -1753,6 +1769,8 @@ + { "ErrorLog", &ErrorLog, CUPSD_VARTYPE_STRING }, + { "FileDevice", &FileDevice, CUPSD_VARTYPE_BOOLEAN }, + { "FontPath", &FontPath, CUPSD_VARTYPE_STRING }, ++ { "LogFilePerm", &LogFilePerm, CUPSD_VARTYPE_INTEGER }, ++ { "LPDConfigFile", &LPDConfigFile, CUPSD_VARTYPE_STRING }, + { "PageLog", &PageLog, CUPSD_VARTYPE_STRING }, + { "Printcap", &Printcap, CUPSD_VARTYPE_STRING }, + { "RequestRoot", &RequestRoot, CUPSD_VARTYPE_STRING }, @@ -1760,7 +1778,7 @@ { "ServerBin", &ServerBin, CUPSD_VARTYPE_PATHNAME }, #ifdef HAVE_SSL { "ServerCertificate", &ServerCertificate, CUPSD_VARTYPE_PATHNAME }, -@@ -174,19 +180,14 @@ static const cupsd_var_t variables[] = +@@ -174,19 +182,14 @@ static const cupsd_var_t variables[] = { "ServerKey", &ServerKey, CUPSD_VARTYPE_PATHNAME }, # endif /* HAVE_LIBSSL || HAVE_GNUTLS */ #endif /* HAVE_SSL */ @@ -1781,7 +1799,7 @@ static const unsigned ones[4] = -@@ -212,7 +213,12 @@ static int parse_aaa(cupsd_location_t * +@@ -212,7 +215,12 @@ static int parse_aaa(cupsd_location_t * static int parse_fatal_errors(const char *s); static int parse_groups(const char *s); static int parse_protocols(const char *s); @@ -1795,7 +1813,7 @@ static int read_location(cups_file_t *fp, char *name, int linenum); static int read_policy(cups_file_t *fp, char *name, int linenum); static void set_policy_defaults(cupsd_policy_t *pol); -@@ -708,22 +714,48 @@ cupsdReadConfiguration(void) +@@ -708,22 +716,48 @@ cupsdReadConfiguration(void) cupsdInitEnv(); /* @@ -1849,7 +1867,7 @@ RunUser = getuid(); cupsdLogMessage(CUPSD_LOG_INFO, "Remote access is %s.", -@@ -2512,13 +2544,174 @@ parse_protocols(const char *s) /* I - S +@@ -2512,13 +2546,174 @@ parse_protocols(const char *s) /* I - S /* @@ -2027,7 +2045,7 @@ int linenum; /* Current line number */ char line[HTTP_MAX_BUFFER], /* Line from file */ -@@ -2528,7 +2721,6 @@ read_configuration(cups_file_t *fp) /* I +@@ -2528,7 +2723,6 @@ read_configuration(cups_file_t *fp) /* I *value, /* Pointer to value */ *valueptr; /* Pointer into value */ int valuelen; /* Length of value */ @@ -2035,7 +2053,7 @@ http_addrlist_t *addrlist, /* Address list */ *addr; /* Current address */ unsigned ip[4], /* Address value */ -@@ -2538,7 +2730,6 @@ read_configuration(cups_file_t *fp) /* I +@@ -2538,7 +2732,6 @@ read_configuration(cups_file_t *fp) /* I cupsd_location_t *location; /* Browse location */ cups_file_t *incfile; /* Include file */ char incname[1024]; /* Include filename */ @@ -2043,7 +2061,7 @@ /* -@@ -2570,7 +2761,7 @@ read_configuration(cups_file_t *fp) /* I +@@ -2570,7 +2763,7 @@ read_configuration(cups_file_t *fp) /* I incname, strerror(errno)); else { @@ -2052,7 +2070,7 @@ cupsFileClose(incfile); } } -@@ -2594,8 +2785,6 @@ read_configuration(cups_file_t *fp) /* I +@@ -2594,8 +2787,6 @@ read_configuration(cups_file_t *fp) /* I if (linenum == 0) return (0); } @@ -2061,7 +2079,7 @@ else if (!_cups_strcasecmp(line, "FaxRetryInterval") && value) { JobRetryInterval = atoi(value); -@@ -3254,81 +3443,6 @@ read_configuration(cups_file_t *fp) /* I +@@ -3254,81 +3445,6 @@ read_configuration(cups_file_t *fp) /* I } } #endif /* HAVE_SSL */ @@ -2143,7 +2161,7 @@ else if (!_cups_strcasecmp(line, "HostNameLookups") && value) { /* -@@ -3407,22 +3521,6 @@ read_configuration(cups_file_t *fp) /* I +@@ -3407,22 +3523,6 @@ read_configuration(cups_file_t *fp) /* I cupsdLogMessage(CUPSD_LOG_WARN, "Unknown LogTimeFormat %s on line %d.", value, linenum); } @@ -2166,7 +2184,7 @@ else if (!_cups_strcasecmp(line, "ServerTokens") && value) { /* -@@ -3548,117 +3646,192 @@ read_configuration(cups_file_t *fp) /* I +@@ -3548,117 +3648,192 @@ read_configuration(cups_file_t *fp) /* I "line %d.", value, linenum); } #endif /* HAVE_SSL */ @@ -2452,8 +2470,9 @@ } return (1); ---- cups-1.5.4/scheduler/conf.h.str4223 2012-11-27 13:36:54.347147118 +0000 -+++ cups-1.5.4/scheduler/conf.h 2012-11-27 13:36:54.518147854 +0000 +diff -up cups-1.5.4/scheduler/conf.h.str4223 cups-1.5.4/scheduler/conf.h +--- cups-1.5.4/scheduler/conf.h.str4223 2012-12-03 09:11:02.987114226 +0000 ++++ cups-1.5.4/scheduler/conf.h 2012-12-03 09:11:03.152116083 +0000 @@ -96,7 +96,9 @@ typedef struct */ @@ -2465,9 +2484,10 @@ *ServerName VALUE(NULL), /* FQDN for server */ *ServerAdmin VALUE(NULL), ---- cups-1.5.4/scheduler/main.c 2012-11-27 13:36:54.518147854 +0000 -+++ cups-1.5.4/scheduler/main.c 2012-11-28 11:41:13.992801205 +0000 -@@ -225,7 +225,6 @@ +diff -up cups-1.5.4/scheduler/main.c.str4223 cups-1.5.4/scheduler/main.c +--- cups-1.5.4/scheduler/main.c.str4223 2012-12-03 09:11:03.110115610 +0000 ++++ cups-1.5.4/scheduler/main.c 2012-12-03 09:11:03.153116094 +0000 +@@ -225,7 +225,6 @@ main(int argc, /* I - Number of comm char *current; /* Current directory */ @@ -2475,7 +2495,7 @@ /* * Allocate a buffer for the current working directory to * reduce run-time stack usage; this approximates the -@@ -251,6 +250,35 @@ +@@ -251,6 +250,35 @@ main(int argc, /* I - Number of comm cupsdSetStringf(&ConfigurationFile, "%s/%s", current, argv[i]); free(current); } @@ -2511,7 +2531,7 @@ break; case 'f' : /* Run in foreground... */ -@@ -289,6 +317,29 @@ +@@ -289,6 +317,29 @@ main(int argc, /* I - Number of comm UseProfiles = 0; break; @@ -2541,7 +2561,7 @@ #ifdef __APPLE__ case 'S' : /* Disable system management functions */ fputs("cupsd: -S (disable system management) for internal " -@@ -318,6 +369,9 @@ +@@ -318,6 +369,9 @@ main(int argc, /* I - Number of comm if (!ConfigurationFile) cupsdSetString(&ConfigurationFile, CUPS_SERVERROOT "/cupsd.conf"); @@ -2551,8 +2571,9 @@ /* * If the user hasn't specified "-f", run in the background... */ +diff -up cups-1.5.4/test/run-stp-tests.sh.str4223 cups-1.5.4/test/run-stp-tests.sh --- cups-1.5.4/test/run-stp-tests.sh.str4223 2012-05-15 15:04:18.000000000 +0100 -+++ cups-1.5.4/test/run-stp-tests.sh 2012-11-27 13:36:54.518147854 +0000 ++++ cups-1.5.4/test/run-stp-tests.sh 2012-12-03 09:11:03.153116094 +0000 @@ -337,25 +337,10 @@ fi cat >/tmp/cups-$user/cupsd.conf < 1:1.5.4-17 +- Fixed patch for CVE-2012-5519 so that LogFilePerm and LPDConfigFile + are recognised keywords for cups-files.conf (bug #882379). + * Wed Nov 28 2012 Tim Waugh 1:1.5.4-16 - Fixed paths in config migration %%post script. - Set default cups-files.conf filename. From 3f793149459c6450d671d20ac72a27e544b38e6d Mon Sep 17 00:00:00 2001 From: Tim Waugh Date: Mon, 3 Dec 2012 11:46:35 +0000 Subject: [PATCH 19/30] Applied additional upstream patch for CVE-2012-5519. Now the RemoteRoot keyword is recognised in the correct configuration file. --- cups-str4223.patch | 176 +++++++++++++++++++++++---------------------- cups.spec | 8 ++- 2 files changed, 97 insertions(+), 87 deletions(-) diff --git a/cups-str4223.patch b/cups-str4223.patch index b33fed9..0da21f3 100644 --- a/cups-str4223.patch +++ b/cups-str4223.patch @@ -1,6 +1,6 @@ diff -up cups-1.5.4/conf/cupsd.conf.in.str4223 cups-1.5.4/conf/cupsd.conf.in --- cups-1.5.4/conf/cupsd.conf.in.str4223 2010-12-09 21:24:51.000000000 +0000 -+++ cups-1.5.4/conf/cupsd.conf.in 2012-12-03 09:11:03.138115925 +0000 ++++ cups-1.5.4/conf/cupsd.conf.in 2012-12-03 11:42:12.451165079 +0000 @@ -9,10 +9,6 @@ # for troubleshooting... LogLevel @CUPS_LOG_LEVEL@ @@ -13,8 +13,8 @@ diff -up cups-1.5.4/conf/cupsd.conf.in.str4223 cups-1.5.4/conf/cupsd.conf.in Listen localhost:@DEFAULT_IPP_PORT@ @CUPS_LISTEN_DOMAINSOCKET@ diff -up cups-1.5.4/conf/cups-files.conf.in.str4223 cups-1.5.4/conf/cups-files.conf.in ---- cups-1.5.4/conf/cups-files.conf.in.str4223 2012-12-03 09:11:03.139115936 +0000 -+++ cups-1.5.4/conf/cups-files.conf.in 2012-12-03 09:11:03.139115936 +0000 +--- cups-1.5.4/conf/cups-files.conf.in.str4223 2012-12-03 11:42:12.451165079 +0000 ++++ cups-1.5.4/conf/cups-files.conf.in 2012-12-03 11:42:38.553234214 +0000 @@ -0,0 +1,98 @@ +# +# "$Id$" @@ -57,7 +57,7 @@ diff -up cups-1.5.4/conf/cups-files.conf.in.str4223 cups-1.5.4/conf/cups-files.c +#DataDir @CUPS_DATADIR@ + +# Location of the static web content served by the scheduler... -+#DocRoot @CUPS_DOCROOT@ ++#DocumentRoot @CUPS_DOCROOT@ + +# Location of the file logging all messages produced by the scheduler and any +# helper programs; may be the name "syslog". If not an absolute path, the value @@ -116,7 +116,7 @@ diff -up cups-1.5.4/conf/cups-files.conf.in.str4223 cups-1.5.4/conf/cups-files.c +# diff -up cups-1.5.4/config-scripts/cups-defaults.m4.str4223 cups-1.5.4/config-scripts/cups-defaults.m4 --- cups-1.5.4/config-scripts/cups-defaults.m4.str4223 2011-05-06 23:53:53.000000000 +0100 -+++ cups-1.5.4/config-scripts/cups-defaults.m4 2012-12-03 09:11:03.139115936 +0000 ++++ cups-1.5.4/config-scripts/cups-defaults.m4 2012-12-03 11:42:12.452165082 +0000 @@ -367,6 +367,7 @@ else fi @@ -134,8 +134,8 @@ diff -up cups-1.5.4/config-scripts/cups-defaults.m4.str4223 cups-1.5.4/config-sc dnl Default MaxCopies value... AC_ARG_WITH(max-copies, [ --with-max-copies set default max copies value, default=9999 ], diff -up cups-1.5.4/config-scripts/cups-ssl.m4.str4223 cups-1.5.4/config-scripts/cups-ssl.m4 ---- cups-1.5.4/config-scripts/cups-ssl.m4.str4223 2012-12-03 09:11:02.996114329 +0000 -+++ cups-1.5.4/config-scripts/cups-ssl.m4 2012-12-03 09:11:03.140115947 +0000 +--- cups-1.5.4/config-scripts/cups-ssl.m4.str4223 2012-12-03 11:42:12.302164578 +0000 ++++ cups-1.5.4/config-scripts/cups-ssl.m4 2012-12-03 11:42:12.452165082 +0000 @@ -27,6 +27,8 @@ AC_ARG_WITH(openssl-includes, [ --with- SSLFLAGS="" SSLLIBS="" @@ -183,8 +183,8 @@ diff -up cups-1.5.4/config-scripts/cups-ssl.m4.str4223 cups-1.5.4/config-scripts AC_SUBST(SSLFLAGS) AC_SUBST(SSLLIBS) diff -up cups-1.5.4/configure.in.str4223 cups-1.5.4/configure.in ---- cups-1.5.4/configure.in.str4223 2012-12-03 09:11:03.107115578 +0000 -+++ cups-1.5.4/configure.in 2012-12-03 09:11:03.141115959 +0000 +--- cups-1.5.4/configure.in.str4223 2012-12-03 11:42:12.426164994 +0000 ++++ cups-1.5.4/configure.in 2012-12-03 11:42:12.452165082 +0000 @@ -66,6 +66,7 @@ AC_SUBST(INSTALL_LANGUAGES) AC_SUBST(UNINSTALL_LANGUAGES) @@ -202,8 +202,8 @@ diff -up cups-1.5.4/configure.in.str4223 cups-1.5.4/configure.in man/cupsaddsmb.man man/cupsd.conf.man diff -up cups-1.5.4/conf/Makefile.str4223 cups-1.5.4/conf/Makefile ---- cups-1.5.4/conf/Makefile.str4223 2012-12-03 09:11:02.972114055 +0000 -+++ cups-1.5.4/conf/Makefile 2012-12-03 09:11:03.141115959 +0000 +--- cups-1.5.4/conf/Makefile.str4223 2012-12-03 11:42:12.281164507 +0000 ++++ cups-1.5.4/conf/Makefile 2012-12-03 11:42:12.453165085 +0000 @@ -19,7 +19,7 @@ include ../Makedefs # Config files... # @@ -215,7 +215,7 @@ diff -up cups-1.5.4/conf/Makefile.str4223 cups-1.5.4/conf/Makefile diff -up cups-1.5.4/doc/help/ref-cupsd-conf.html.in.str4223 cups-1.5.4/doc/help/ref-cupsd-conf.html.in --- cups-1.5.4/doc/help/ref-cupsd-conf.html.in.str4223 2012-01-30 21:40:21.000000000 +0000 -+++ cups-1.5.4/doc/help/ref-cupsd-conf.html.in 2012-12-03 09:11:03.143115982 +0000 ++++ cups-1.5.4/doc/help/ref-cupsd-conf.html.in 2012-12-03 11:42:12.453165085 +0000 @@ -191,82 +191,6 @@ HREF="#Location">LocationLimit section.

@@ -584,8 +584,8 @@ diff -up cups-1.5.4/doc/help/ref-cupsd-conf.html.in.str4223 cups-1.5.4/doc/help/

Examples

diff -up cups-1.5.4/doc/help/ref-cups-files-conf.html.in.str4223 cups-1.5.4/doc/help/ref-cups-files-conf.html.in ---- cups-1.5.4/doc/help/ref-cups-files-conf.html.in.str4223 2012-12-03 09:11:03.143115982 +0000 -+++ cups-1.5.4/doc/help/ref-cups-files-conf.html.in 2012-12-03 09:11:03.143115982 +0000 +--- cups-1.5.4/doc/help/ref-cups-files-conf.html.in.str4223 2012-12-03 11:42:12.454165088 +0000 ++++ cups-1.5.4/doc/help/ref-cups-files-conf.html.in 2012-12-03 11:42:12.454165088 +0000 @@ -0,0 +1,531 @@ + + @@ -1120,7 +1120,7 @@ diff -up cups-1.5.4/doc/help/ref-cups-files-conf.html.in.str4223 cups-1.5.4/doc/ + diff -up cups-1.5.4/doc/Makefile.str4223 cups-1.5.4/doc/Makefile --- cups-1.5.4/doc/Makefile.str4223 2011-01-17 05:40:28.000000000 +0000 -+++ cups-1.5.4/doc/Makefile 2012-12-03 09:11:03.144115993 +0000 ++++ cups-1.5.4/doc/Makefile 2012-12-03 11:42:12.454165088 +0000 @@ -3,7 +3,7 @@ # # Documentation makefile for CUPS. @@ -1132,7 +1132,7 @@ diff -up cups-1.5.4/doc/Makefile.str4223 cups-1.5.4/doc/Makefile # These coded instructions, statements, and computer programs are the diff -up cups-1.5.4/man/cupsd.conf.man.in.str4223 cups-1.5.4/man/cupsd.conf.man.in --- cups-1.5.4/man/cupsd.conf.man.in.str4223 2011-05-18 22:33:35.000000000 +0100 -+++ cups-1.5.4/man/cupsd.conf.man.in 2012-12-03 09:11:03.144115993 +0000 ++++ cups-1.5.4/man/cupsd.conf.man.in 2012-12-03 11:42:12.454165088 +0000 @@ -12,12 +12,15 @@ .\" which should have been included with this file. If this file is .\" file is missing or damaged, see the license at "http://www.cups.org/". @@ -1397,8 +1397,8 @@ diff -up cups-1.5.4/man/cupsd.conf.man.in.str4223 cups-1.5.4/man/cupsd.conf.man. .br http://localhost:631/help diff -up cups-1.5.4/man/cups-files.conf.man.in.str4223 cups-1.5.4/man/cups-files.conf.man.in ---- cups-1.5.4/man/cups-files.conf.man.in.str4223 2012-12-03 09:11:03.145116004 +0000 -+++ cups-1.5.4/man/cups-files.conf.man.in 2012-12-03 09:11:03.145116004 +0000 +--- cups-1.5.4/man/cups-files.conf.man.in.str4223 2012-12-03 11:42:12.454165088 +0000 ++++ cups-1.5.4/man/cups-files.conf.man.in 2012-12-03 11:42:12.454165088 +0000 @@ -0,0 +1,146 @@ +.\" +.\" "$Id$" @@ -1548,7 +1548,7 @@ diff -up cups-1.5.4/man/cups-files.conf.man.in.str4223 cups-1.5.4/man/cups-files +.\" diff -up cups-1.5.4/man/Makefile.str4223 cups-1.5.4/man/Makefile --- cups-1.5.4/man/Makefile.str4223 2010-06-22 22:21:37.000000000 +0100 -+++ cups-1.5.4/man/Makefile 2012-12-03 09:11:03.145116004 +0000 ++++ cups-1.5.4/man/Makefile 2012-12-03 11:42:12.454165088 +0000 @@ -39,6 +39,7 @@ MAN1 = cancel.$(MAN1EXT) \ ppdpo.$(MAN1EXT) MAN5 = classes.conf.$(MAN5EXT) \ @@ -1559,7 +1559,7 @@ diff -up cups-1.5.4/man/Makefile.str4223 cups-1.5.4/man/Makefile ipptoolfile.$(MAN5EXT) \ diff -up cups-1.5.4/packaging/cups.list.in.str4223 cups-1.5.4/packaging/cups.list.in --- cups-1.5.4/packaging/cups.list.in.str4223 2012-04-24 00:49:19.000000000 +0100 -+++ cups-1.5.4/packaging/cups.list.in 2012-12-03 09:11:03.146116015 +0000 ++++ cups-1.5.4/packaging/cups.list.in 2012-12-03 11:42:12.455165091 +0000 @@ -588,6 +588,7 @@ d 0755 root $CUPS_GROUP $SERVERROOT/inte d 0755 root $CUPS_GROUP $SERVERROOT/ppd - d 0700 root $CUPS_GROUP $SERVERROOT/ssl - @@ -1570,7 +1570,7 @@ diff -up cups-1.5.4/packaging/cups.list.in.str4223 cups-1.5.4/packaging/cups.lis %if PAMDIR diff -up cups-1.5.4/packaging/cups.spec.in.str4223 cups-1.5.4/packaging/cups.spec.in --- cups-1.5.4/packaging/cups.spec.in.str4223 2012-04-23 18:46:53.000000000 +0100 -+++ cups-1.5.4/packaging/cups.spec.in 2012-12-03 09:11:03.146116015 +0000 ++++ cups-1.5.4/packaging/cups.spec.in 2012-12-03 11:42:12.455165091 +0000 @@ -152,6 +152,7 @@ rm -rf $RPM_BUILD_ROOT %defattr(-,root,root) %dir /etc/cups @@ -1580,8 +1580,8 @@ diff -up cups-1.5.4/packaging/cups.spec.in.str4223 cups-1.5.4/packaging/cups.spe %dir /etc/cups/interfaces %dir /etc/cups/ppd diff -up cups-1.5.4/scheduler/client.c.str4223 cups-1.5.4/scheduler/client.c ---- cups-1.5.4/scheduler/client.c.str4223 2012-12-03 09:11:03.087115353 +0000 -+++ cups-1.5.4/scheduler/client.c 2012-12-03 09:11:03.148116037 +0000 +--- cups-1.5.4/scheduler/client.c.str4223 2012-12-03 11:42:12.408164934 +0000 ++++ cups-1.5.4/scheduler/client.c 2012-12-03 11:42:12.456165095 +0000 @@ -35,7 +35,7 @@ * data_ready() - Check whether data is available from a client. * encrypt_client() - Enable encryption for the client... @@ -1681,8 +1681,8 @@ diff -up cups-1.5.4/scheduler/client.c.str4223 cups-1.5.4/scheduler/client.c /* diff -up cups-1.5.4/scheduler/conf.c.str4223 cups-1.5.4/scheduler/conf.c ---- cups-1.5.4/scheduler/conf.c.str4223 2012-12-03 09:11:03.089115374 +0000 -+++ cups-1.5.4/scheduler/conf.c 2012-12-03 09:12:01.425297753 +0000 +--- cups-1.5.4/scheduler/conf.c.str4223 2012-12-03 11:42:12.409164937 +0000 ++++ cups-1.5.4/scheduler/conf.c 2012-12-03 11:43:54.795434434 +0000 @@ -27,7 +27,8 @@ * parse_fatal_errors() - Parse FatalErrors values in a string. * parse_groups() - Parse system group names in a string. @@ -1749,7 +1749,7 @@ diff -up cups-1.5.4/scheduler/conf.c.str4223 cups-1.5.4/scheduler/conf.c - { "Printcap", &Printcap, CUPSD_VARTYPE_STRING }, - { "PrintcapGUI", &PrintcapGUI, CUPSD_VARTYPE_STRING }, { "ReloadTimeout", &ReloadTimeout, CUPSD_VARTYPE_INTEGER }, - { "RemoteRoot", &RemoteRoot, CUPSD_VARTYPE_STRING }, +- { "RemoteRoot", &RemoteRoot, CUPSD_VARTYPE_STRING }, - { "RequestRoot", &RequestRoot, CUPSD_VARTYPE_STRING }, { "RIPCache", &RIPCache, CUPSD_VARTYPE_STRING }, { "RootCertDuration", &RootCertDuration, CUPSD_VARTYPE_INTEGER }, @@ -1773,6 +1773,7 @@ diff -up cups-1.5.4/scheduler/conf.c.str4223 cups-1.5.4/scheduler/conf.c + { "LPDConfigFile", &LPDConfigFile, CUPSD_VARTYPE_STRING }, + { "PageLog", &PageLog, CUPSD_VARTYPE_STRING }, + { "Printcap", &Printcap, CUPSD_VARTYPE_STRING }, ++ { "RemoteRoot", &RemoteRoot, CUPSD_VARTYPE_STRING }, + { "RequestRoot", &RequestRoot, CUPSD_VARTYPE_STRING }, + { "ServerBin", &ServerBin, CUPSD_VARTYPE_PATHNAME }, @@ -1867,16 +1868,29 @@ diff -up cups-1.5.4/scheduler/conf.c.str4223 cups-1.5.4/scheduler/conf.c RunUser = getuid(); cupsdLogMessage(CUPSD_LOG_INFO, "Remote access is %s.", -@@ -2512,13 +2546,174 @@ parse_protocols(const char *s) /* I - S +@@ -842,6 +876,13 @@ cupsdReadConfiguration(void) + BrowseACL = cupsdFindLocation("CUPS_INTERNAL_BROWSE_ACL"); + + /* ++ * Make sure ConfigFilePerm and LogFilePerm have sane values... ++ */ ++ ++ ConfigFilePerm &= 0664; ++ LogFilePerm &= 0664; ++ ++ /* + * Open the system log for cupsd if necessary... + */ + +@@ -2512,13 +2553,174 @@ parse_protocols(const char *s) /* I - S /* - * 'read_configuration()' - Read a configuration file. + * 'parse_variable()' - Parse a variable line. - */ - - static int /* O - 1 on success, 0 on failure */ --read_configuration(cups_file_t *fp) /* I - File to read from */ ++ */ ++ ++static int /* O - 1 on success, 0 on failure */ +parse_variable( + const char *filename, /* I - Name of configuration file */ + int linenum, /* I - Line in configuration file */ @@ -2036,16 +2050,17 @@ diff -up cups-1.5.4/scheduler/conf.c.str4223 cups-1.5.4/scheduler/conf.c + +/* + * 'read_cupsd_conf()' - Read the cupsd.conf configuration file. -+ */ -+ -+static int /* O - 1 on success, 0 on failure */ + */ + + static int /* O - 1 on success, 0 on failure */ +-read_configuration(cups_file_t *fp) /* I - File to read from */ +read_cupsd_conf(cups_file_t *fp) /* I - File to read from */ { - int i; /* Looping var */ int linenum; /* Current line number */ char line[HTTP_MAX_BUFFER], /* Line from file */ -@@ -2528,7 +2723,6 @@ read_configuration(cups_file_t *fp) /* I +@@ -2528,7 +2730,6 @@ read_configuration(cups_file_t *fp) /* I *value, /* Pointer to value */ *valueptr; /* Pointer into value */ int valuelen; /* Length of value */ @@ -2053,7 +2068,7 @@ diff -up cups-1.5.4/scheduler/conf.c.str4223 cups-1.5.4/scheduler/conf.c http_addrlist_t *addrlist, /* Address list */ *addr; /* Current address */ unsigned ip[4], /* Address value */ -@@ -2538,7 +2732,6 @@ read_configuration(cups_file_t *fp) /* I +@@ -2538,7 +2739,6 @@ read_configuration(cups_file_t *fp) /* I cupsd_location_t *location; /* Browse location */ cups_file_t *incfile; /* Include file */ char incname[1024]; /* Include filename */ @@ -2061,7 +2076,7 @@ diff -up cups-1.5.4/scheduler/conf.c.str4223 cups-1.5.4/scheduler/conf.c /* -@@ -2570,7 +2763,7 @@ read_configuration(cups_file_t *fp) /* I +@@ -2570,7 +2770,7 @@ read_configuration(cups_file_t *fp) /* I incname, strerror(errno)); else { @@ -2070,7 +2085,7 @@ diff -up cups-1.5.4/scheduler/conf.c.str4223 cups-1.5.4/scheduler/conf.c cupsFileClose(incfile); } } -@@ -2594,8 +2787,6 @@ read_configuration(cups_file_t *fp) /* I +@@ -2594,8 +2794,6 @@ read_configuration(cups_file_t *fp) /* I if (linenum == 0) return (0); } @@ -2079,7 +2094,7 @@ diff -up cups-1.5.4/scheduler/conf.c.str4223 cups-1.5.4/scheduler/conf.c else if (!_cups_strcasecmp(line, "FaxRetryInterval") && value) { JobRetryInterval = atoi(value); -@@ -3254,81 +3445,6 @@ read_configuration(cups_file_t *fp) /* I +@@ -3254,81 +3452,6 @@ read_configuration(cups_file_t *fp) /* I } } #endif /* HAVE_SSL */ @@ -2161,7 +2176,7 @@ diff -up cups-1.5.4/scheduler/conf.c.str4223 cups-1.5.4/scheduler/conf.c else if (!_cups_strcasecmp(line, "HostNameLookups") && value) { /* -@@ -3407,22 +3523,6 @@ read_configuration(cups_file_t *fp) /* I +@@ -3407,22 +3530,6 @@ read_configuration(cups_file_t *fp) /* I cupsdLogMessage(CUPSD_LOG_WARN, "Unknown LogTimeFormat %s on line %d.", value, linenum); } @@ -2184,7 +2199,7 @@ diff -up cups-1.5.4/scheduler/conf.c.str4223 cups-1.5.4/scheduler/conf.c else if (!_cups_strcasecmp(line, "ServerTokens") && value) { /* -@@ -3548,117 +3648,192 @@ read_configuration(cups_file_t *fp) /* I +@@ -3548,117 +3655,193 @@ read_configuration(cups_file_t *fp) /* I "line %d.", value, linenum); } #endif /* HAVE_SSL */ @@ -2203,6 +2218,7 @@ diff -up cups-1.5.4/scheduler/conf.c.str4223 cups-1.5.4/scheduler/conf.c + !_cups_strcasecmp(line, "PageLog") || + !_cups_strcasecmp(line, "Printcap") || + !_cups_strcasecmp(line, "PrintcapFormat") || ++ !_cups_strcasecmp(line, "RemoteRoot") || + !_cups_strcasecmp(line, "RequestRoot") || + !_cups_strcasecmp(line, "ServerBin") || + !_cups_strcasecmp(line, "ServerCertificate") || @@ -2471,8 +2487,8 @@ diff -up cups-1.5.4/scheduler/conf.c.str4223 cups-1.5.4/scheduler/conf.c return (1); diff -up cups-1.5.4/scheduler/conf.h.str4223 cups-1.5.4/scheduler/conf.h ---- cups-1.5.4/scheduler/conf.h.str4223 2012-12-03 09:11:02.987114226 +0000 -+++ cups-1.5.4/scheduler/conf.h 2012-12-03 09:11:03.152116083 +0000 +--- cups-1.5.4/scheduler/conf.h.str4223 2012-12-03 11:42:12.291164541 +0000 ++++ cups-1.5.4/scheduler/conf.h 2012-12-03 11:42:12.457165099 +0000 @@ -96,7 +96,9 @@ typedef struct */ @@ -2485,8 +2501,8 @@ diff -up cups-1.5.4/scheduler/conf.h.str4223 cups-1.5.4/scheduler/conf.h /* FQDN for server */ *ServerAdmin VALUE(NULL), diff -up cups-1.5.4/scheduler/main.c.str4223 cups-1.5.4/scheduler/main.c ---- cups-1.5.4/scheduler/main.c.str4223 2012-12-03 09:11:03.110115610 +0000 -+++ cups-1.5.4/scheduler/main.c 2012-12-03 09:11:03.153116094 +0000 +--- cups-1.5.4/scheduler/main.c.str4223 2012-12-03 11:42:12.428165001 +0000 ++++ cups-1.5.4/scheduler/main.c 2012-12-03 11:44:31.837533988 +0000 @@ -225,7 +225,6 @@ main(int argc, /* I - Number of comm char *current; /* Current directory */ @@ -2495,43 +2511,7 @@ diff -up cups-1.5.4/scheduler/main.c.str4223 cups-1.5.4/scheduler/main.c /* * Allocate a buffer for the current working directory to * reduce run-time stack usage; this approximates the -@@ -251,6 +250,35 @@ main(int argc, /* I - Number of comm - cupsdSetStringf(&ConfigurationFile, "%s/%s", current, argv[i]); - free(current); - } -+ -+ if (!CupsFilesFile) -+ { -+ char *filename, /* Copy of cupsd.conf filename */ -+ *slash; /* Final slash in cupsd.conf filename */ -+ size_t len; /* Size of buffer */ -+ -+ len = strlen(ConfigurationFile) + 15; -+ if ((filename = malloc(len)) == NULL) -+ { -+ _cupsLangPrintf(stderr, -+ _("cupsd: Unable to get path to " -+ "cups-files.conf file.")); -+ return (1); -+ } -+ -+ strlcpy(filename, ConfigurationFile, len); -+ if ((slash = strrchr(filename, '/')) == NULL) -+ { -+ _cupsLangPrintf(stderr, -+ _("cupsd: Unable to get path to " -+ "cups-files.conf file.")); -+ return (1); -+ } -+ -+ strlcpy(slash, "/cups-files.conf", len - (slash - filename)); -+ cupsdSetString(&CupsFilesFile, filename); -+ free(filename); -+ } - break; - - case 'f' : /* Run in foreground... */ -@@ -289,6 +317,29 @@ main(int argc, /* I - Number of comm +@@ -289,6 +288,29 @@ main(int argc, /* I - Number of comm UseProfiles = 0; break; @@ -2561,19 +2541,45 @@ diff -up cups-1.5.4/scheduler/main.c.str4223 cups-1.5.4/scheduler/main.c #ifdef __APPLE__ case 'S' : /* Disable system management functions */ fputs("cupsd: -S (disable system management) for internal " -@@ -318,6 +369,9 @@ main(int argc, /* I - Number of comm +@@ -318,6 +340,35 @@ main(int argc, /* I - Number of comm if (!ConfigurationFile) cupsdSetString(&ConfigurationFile, CUPS_SERVERROOT "/cupsd.conf"); + if (!CupsFilesFile) -+ cupsdSetString(&CupsFilesFile, CUPS_SERVERROOT "/cups-files.conf"); ++ { ++ char *filename, /* Copy of cupsd.conf filename */ ++ *slash; /* Final slash in cupsd.conf filename */ ++ size_t len; /* Size of buffer */ ++ ++ len = strlen(ConfigurationFile) + 15; ++ if ((filename = malloc(len)) == NULL) ++ { ++ _cupsLangPrintf(stderr, ++ _("cupsd: Unable to get path to " ++ "cups-files.conf file.")); ++ return (1); ++ } ++ ++ strlcpy(filename, ConfigurationFile, len); ++ if ((slash = strrchr(filename, '/')) == NULL) ++ { ++ _cupsLangPrintf(stderr, ++ _("cupsd: Unable to get path to " ++ "cups-files.conf file.")); ++ return (1); ++ } ++ ++ strlcpy(slash, "/cups-files.conf", len - (slash - filename)); ++ cupsdSetString(&CupsFilesFile, filename); ++ free(filename); ++ } + /* * If the user hasn't specified "-f", run in the background... */ diff -up cups-1.5.4/test/run-stp-tests.sh.str4223 cups-1.5.4/test/run-stp-tests.sh --- cups-1.5.4/test/run-stp-tests.sh.str4223 2012-05-15 15:04:18.000000000 +0100 -+++ cups-1.5.4/test/run-stp-tests.sh 2012-12-03 09:11:03.153116094 +0000 ++++ cups-1.5.4/test/run-stp-tests.sh 2012-12-03 11:42:12.457165099 +0000 @@ -337,25 +337,10 @@ fi cat >/tmp/cups-$user/cupsd.conf < 1:1.5.4-18 +- Applied additional upstream patch for CVE-2012-5519 so that the + RemoteRoot keyword is recognised in the correct configuration file. + * Mon Dec 3 2012 Tim Waugh 1:1.5.4-17 - Fixed patch for CVE-2012-5519 so that LogFilePerm and LPDConfigFile are recognised keywords for cups-files.conf (bug #882379). From ce45da456ba77f4def71f7a98b3db06dc96c8f28 Mon Sep 17 00:00:00 2001 From: Jiri Popelka Date: Mon, 3 Dec 2012 15:59:55 +0100 Subject: [PATCH 20/30] move ipptoolfile(5) to ipptool subpackage --- cups.spec | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/cups.spec b/cups.spec index 097ee99..f9542cc 100644 --- a/cups.spec +++ b/cups.spec @@ -12,7 +12,7 @@ Summary: Common Unix Printing System Name: cups Version: 1.5.4 -Release: 18%{?dist} +Release: 19%{?dist} License: GPLv2 Group: System Environment/Daemons Source: http://ftp.easysw.com/pub/cups/%{version}/cups-%{version}-source.tar.bz2 @@ -658,11 +658,12 @@ rm -f %{cups_serverbin}/backend/smb %{cups_serverbin}/filter %{cups_serverbin}/monitor %{cups_serverbin}/driver -%{_mandir}/man1/cancel* -%{_mandir}/man1/cupstest* -%{_mandir}/man1/lp* -%{_mandir}/man1/ppd* -%{_mandir}/man[578]/* +%{_mandir}/man[1578]/* +# devel subpackage +%exclude %{_mandir}/man1/cups-config.1.gz +# ipptool subpackage +%exclude %{_mandir}/man1/ipptool.1.gz +%exclude %{_mandir}/man5/ipptoolfile.5.gz %{_sbindir}/* %dir %{_datadir}/cups %dir %{_datadir}/cups/banners @@ -708,7 +709,7 @@ rm -f %{cups_serverbin}/backend/smb %{_bindir}/cups-config %{_libdir}/*.so %{_includedir}/cups -%{_mandir}/man1/cups-config.1* +%{_mandir}/man1/cups-config.1.gz %{_sysconfdir}/rpm/macros.cups %files lpd @@ -726,8 +727,12 @@ rm -f %{cups_serverbin}/backend/smb %dir %{_datadir}/cups/ipptool %{_datadir}/cups/ipptool/* %{_mandir}/man1/ipptool.1.gz +%{_mandir}/man5/ipptoolfile.5.gz %changelog +* Mon Dec 3 2012 Jiri Popelka 1:1.5.4-19 +- move ipptoolfile(5) to ipptool subpackage + * Mon Dec 3 2012 Tim Waugh 1:1.5.4-18 - Applied additional upstream patch for CVE-2012-5519 so that the RemoteRoot keyword is recognised in the correct configuration file. From c8cf6b41b080ab99778d816a4bc1e22968d749a1 Mon Sep 17 00:00:00 2001 From: Tim Waugh Date: Tue, 4 Dec 2012 11:19:28 +0000 Subject: [PATCH 21/30] Small error handling improvements in the configuration migration script. --- cups.spec | 80 ++++++++++++++++++++++++++++++------------------------- 1 file changed, 43 insertions(+), 37 deletions(-) diff --git a/cups.spec b/cups.spec index f9542cc..787e379 100644 --- a/cups.spec +++ b/cups.spec @@ -12,7 +12,7 @@ Summary: Common Unix Printing System Name: cups Version: 1.5.4 -Release: 19%{?dist} +Release: 20%{?dist} License: GPLv2 Group: System Environment/Daemons Source: http://ftp.easysw.com/pub/cups/%{version}/cups-%{version}-source.tar.bz2 @@ -483,42 +483,6 @@ php --no-php-ini \ %post -# Deal with config migration due to CVE-2012-5519 (STR #4223) -IN=%{_sysconfdir}/cups/cupsd.conf -OUT=%{_sysconfdir}/cups/cups-files.conf -copiedany=no -for keyword in AccessLog CacheDir ConfigFilePerm \ - DataDir DocumentRoot ErrorLog FatalErrors \ - FileDevice FontPath Group LogFilePerm \ - LPDConfigFile PageLog Printcap PrintcapFormat \ - RemoteRoot RequestRoot ServerBin ServerCertificate \ - ServerKey ServerRoot SMBConfigFile StateDir \ - SystemGroup SystemGroupAuthKey TempDir User; do - if ! /bin/grep -iq ^$keyword "$IN"; then continue; fi - copy=yes - if /bin/grep -iq ^$keyword "$OUT"; then - if [ "`/bin/grep -i ^$keyword "$IN"`" == \ - "`/bin/grep -i ^$keyword "$OUT"`" ]; then - copy=no - else - /bin/sed -i -e "s,^$keyword,#$keyword,i" "$OUT" - fi - fi - if [ "$copy" == "yes" ]; then - if [ "$copiedany" == "no" ]; then - cat >> "$OUT" <> "$OUT" - copiedany=yes - fi - - /bin/sed -i -e "s,^$keyword,#$keyword,i" "$IN" -done - %systemd_post %{name}.path %{name}.socket %{name}.service # Remove old-style certs directory; new-style is /var/run @@ -541,6 +505,44 @@ done --slave %{_mandir}/man1/lpstat.1.gz print-lpstatman %{_mandir}/man1/lpstat-cups.1.gz %endif rm -f %{_localstatedir}/cache/cups/*.ipp %{_localstatedir}/cache/cups/*.cache + +# Deal with config migration due to CVE-2012-5519 (STR #4223) +IN=%{_sysconfdir}/cups/cupsd.conf +OUT=%{_sysconfdir}/cups/cups-files.conf +copiedany=no +for keyword in AccessLog CacheDir ConfigFilePerm \ + DataDir DocumentRoot ErrorLog FatalErrors \ + FileDevice FontPath Group LogFilePerm \ + LPDConfigFile PageLog Printcap PrintcapFormat \ + RemoteRoot RequestRoot ServerBin ServerCertificate \ + ServerKey ServerRoot SMBConfigFile StateDir \ + SystemGroup SystemGroupAuthKey TempDir User; do + if ! /bin/grep -iq ^$keyword "$IN"; then continue; fi + copy=yes + if /bin/grep -iq ^$keyword "$OUT"; then + if [ "`/bin/grep -i ^$keyword "$IN"`" == \ + "`/bin/grep -i ^$keyword "$OUT"`" ]; then + copy=no + else + /bin/sed -i -e "s,^$keyword,#$keyword,i" "$OUT" || : + fi + fi + if [ "$copy" == "yes" ]; then + if [ "$copiedany" == "no" ]; then + ( cat >> "$OUT" <> "$OUT" ) || : + copiedany=yes + fi + + /bin/sed -i -e "s,^$keyword,#$keyword,i" "$IN" || : +done + exit 0 %post libs -p /sbin/ldconfig @@ -730,6 +732,10 @@ rm -f %{cups_serverbin}/backend/smb %{_mandir}/man5/ipptoolfile.5.gz %changelog +* Tue Dec 4 2012 Tim Waugh 1:1.5.4-20 +- Small error handling improvements in the configuration migration + script. + * Mon Dec 3 2012 Jiri Popelka 1:1.5.4-19 - move ipptoolfile(5) to ipptool subpackage From 86c1073fa84c72a2c865b3a34dc2440ad0ef3721 Mon Sep 17 00:00:00 2001 From: Tim Waugh Date: Thu, 6 Dec 2012 12:33:18 +0000 Subject: [PATCH 22/30] Additional fix relating to CVE-2012-5519 to avoid misleading error message. The FileDevice directive lives in cups-files.conf, not cupsd.conf. --- cups-str4223.patch | 548 ++++++++++++++++++++++++++++++++++++++++++--- cups.spec | 6 +- 2 files changed, 524 insertions(+), 30 deletions(-) diff --git a/cups-str4223.patch b/cups-str4223.patch index 0da21f3..567add7 100644 --- a/cups-str4223.patch +++ b/cups-str4223.patch @@ -1,6 +1,6 @@ diff -up cups-1.5.4/conf/cupsd.conf.in.str4223 cups-1.5.4/conf/cupsd.conf.in --- cups-1.5.4/conf/cupsd.conf.in.str4223 2010-12-09 21:24:51.000000000 +0000 -+++ cups-1.5.4/conf/cupsd.conf.in 2012-12-03 11:42:12.451165079 +0000 ++++ cups-1.5.4/conf/cupsd.conf.in 2012-12-06 12:52:04.943832641 +0000 @@ -9,10 +9,6 @@ # for troubleshooting... LogLevel @CUPS_LOG_LEVEL@ @@ -13,8 +13,8 @@ diff -up cups-1.5.4/conf/cupsd.conf.in.str4223 cups-1.5.4/conf/cupsd.conf.in Listen localhost:@DEFAULT_IPP_PORT@ @CUPS_LISTEN_DOMAINSOCKET@ diff -up cups-1.5.4/conf/cups-files.conf.in.str4223 cups-1.5.4/conf/cups-files.conf.in ---- cups-1.5.4/conf/cups-files.conf.in.str4223 2012-12-03 11:42:12.451165079 +0000 -+++ cups-1.5.4/conf/cups-files.conf.in 2012-12-03 11:42:38.553234214 +0000 +--- cups-1.5.4/conf/cups-files.conf.in.str4223 2012-12-06 12:52:04.943832641 +0000 ++++ cups-1.5.4/conf/cups-files.conf.in 2012-12-06 12:52:04.943832641 +0000 @@ -0,0 +1,98 @@ +# +# "$Id$" @@ -116,7 +116,7 @@ diff -up cups-1.5.4/conf/cups-files.conf.in.str4223 cups-1.5.4/conf/cups-files.c +# diff -up cups-1.5.4/config-scripts/cups-defaults.m4.str4223 cups-1.5.4/config-scripts/cups-defaults.m4 --- cups-1.5.4/config-scripts/cups-defaults.m4.str4223 2011-05-06 23:53:53.000000000 +0100 -+++ cups-1.5.4/config-scripts/cups-defaults.m4 2012-12-03 11:42:12.452165082 +0000 ++++ cups-1.5.4/config-scripts/cups-defaults.m4 2012-12-06 12:52:04.944832644 +0000 @@ -367,6 +367,7 @@ else fi @@ -134,8 +134,8 @@ diff -up cups-1.5.4/config-scripts/cups-defaults.m4.str4223 cups-1.5.4/config-sc dnl Default MaxCopies value... AC_ARG_WITH(max-copies, [ --with-max-copies set default max copies value, default=9999 ], diff -up cups-1.5.4/config-scripts/cups-ssl.m4.str4223 cups-1.5.4/config-scripts/cups-ssl.m4 ---- cups-1.5.4/config-scripts/cups-ssl.m4.str4223 2012-12-03 11:42:12.302164578 +0000 -+++ cups-1.5.4/config-scripts/cups-ssl.m4 2012-12-03 11:42:12.452165082 +0000 +--- cups-1.5.4/config-scripts/cups-ssl.m4.str4223 2012-12-06 12:52:04.863832402 +0000 ++++ cups-1.5.4/config-scripts/cups-ssl.m4 2012-12-06 12:52:04.944832644 +0000 @@ -27,6 +27,8 @@ AC_ARG_WITH(openssl-includes, [ --with- SSLFLAGS="" SSLLIBS="" @@ -183,8 +183,8 @@ diff -up cups-1.5.4/config-scripts/cups-ssl.m4.str4223 cups-1.5.4/config-scripts AC_SUBST(SSLFLAGS) AC_SUBST(SSLLIBS) diff -up cups-1.5.4/configure.in.str4223 cups-1.5.4/configure.in ---- cups-1.5.4/configure.in.str4223 2012-12-03 11:42:12.426164994 +0000 -+++ cups-1.5.4/configure.in 2012-12-03 11:42:12.452165082 +0000 +--- cups-1.5.4/configure.in.str4223 2012-12-06 12:52:04.922832578 +0000 ++++ cups-1.5.4/configure.in 2012-12-06 12:52:04.944832644 +0000 @@ -66,6 +66,7 @@ AC_SUBST(INSTALL_LANGUAGES) AC_SUBST(UNINSTALL_LANGUAGES) @@ -202,8 +202,8 @@ diff -up cups-1.5.4/configure.in.str4223 cups-1.5.4/configure.in man/cupsaddsmb.man man/cupsd.conf.man diff -up cups-1.5.4/conf/Makefile.str4223 cups-1.5.4/conf/Makefile ---- cups-1.5.4/conf/Makefile.str4223 2012-12-03 11:42:12.281164507 +0000 -+++ cups-1.5.4/conf/Makefile 2012-12-03 11:42:12.453165085 +0000 +--- cups-1.5.4/conf/Makefile.str4223 2012-12-06 12:52:04.852832369 +0000 ++++ cups-1.5.4/conf/Makefile 2012-12-06 12:52:04.944832644 +0000 @@ -19,7 +19,7 @@ include ../Makedefs # Config files... # @@ -215,7 +215,7 @@ diff -up cups-1.5.4/conf/Makefile.str4223 cups-1.5.4/conf/Makefile diff -up cups-1.5.4/doc/help/ref-cupsd-conf.html.in.str4223 cups-1.5.4/doc/help/ref-cupsd-conf.html.in --- cups-1.5.4/doc/help/ref-cupsd-conf.html.in.str4223 2012-01-30 21:40:21.000000000 +0000 -+++ cups-1.5.4/doc/help/ref-cupsd-conf.html.in 2012-12-03 11:42:12.453165085 +0000 ++++ cups-1.5.4/doc/help/ref-cupsd-conf.html.in 2012-12-06 12:52:04.945832647 +0000 @@ -191,82 +191,6 @@ HREF="#Location">LocationLimit section.

@@ -584,8 +584,8 @@ diff -up cups-1.5.4/doc/help/ref-cupsd-conf.html.in.str4223 cups-1.5.4/doc/help/

Examples

diff -up cups-1.5.4/doc/help/ref-cups-files-conf.html.in.str4223 cups-1.5.4/doc/help/ref-cups-files-conf.html.in ---- cups-1.5.4/doc/help/ref-cups-files-conf.html.in.str4223 2012-12-03 11:42:12.454165088 +0000 -+++ cups-1.5.4/doc/help/ref-cups-files-conf.html.in 2012-12-03 11:42:12.454165088 +0000 +--- cups-1.5.4/doc/help/ref-cups-files-conf.html.in.str4223 2012-12-06 12:52:04.945832647 +0000 ++++ cups-1.5.4/doc/help/ref-cups-files-conf.html.in 2012-12-06 12:52:04.945832647 +0000 @@ -0,0 +1,531 @@ + + @@ -1120,7 +1120,7 @@ diff -up cups-1.5.4/doc/help/ref-cups-files-conf.html.in.str4223 cups-1.5.4/doc/ + diff -up cups-1.5.4/doc/Makefile.str4223 cups-1.5.4/doc/Makefile --- cups-1.5.4/doc/Makefile.str4223 2011-01-17 05:40:28.000000000 +0000 -+++ cups-1.5.4/doc/Makefile 2012-12-03 11:42:12.454165088 +0000 ++++ cups-1.5.4/doc/Makefile 2012-12-06 12:52:04.945832647 +0000 @@ -3,7 +3,7 @@ # # Documentation makefile for CUPS. @@ -1130,9 +1130,487 @@ diff -up cups-1.5.4/doc/Makefile.str4223 cups-1.5.4/doc/Makefile # Copyright 1997-2007 by Easy Software Products. # # These coded instructions, statements, and computer programs are the +diff -up cups-1.5.4/locale/cups_da.po.str4223 cups-1.5.4/locale/cups_da.po +--- cups-1.5.4/locale/cups_da.po.str4223 2012-03-07 21:38:28.000000000 +0000 ++++ cups-1.5.4/locale/cups_da.po 2012-12-06 12:52:23.562877028 +0000 +@@ -2759,7 +2759,7 @@ msgstr "Arkivmappe - 9/16 x 3 7/16\"" + #, c-format + msgid "" + "File device URIs have been disabled. To enable, see the FileDevice directive " +-"in \"%s/cupsd.conf\"." ++"in \"%s/cups-files.conf\"." + msgstr "" + + #, c-format +@@ -7066,10 +7066,10 @@ msgstr "variable-bindings bruger uendeli + + #~ msgid "" + #~ "File device URIs have been disabled! To enable, see the FileDevice " +-#~ "directive in \"%s/cupsd.conf\"." ++#~ "directive in \"%s/cups-files.conf\"." + #~ msgstr "" + #~ "Arkivets enheds-URI'er er blevet slået fra! Du slår det til ved at se i " +-#~ "FileDevice-direktivet i \"%s/cupsd.conf\"." ++#~ "FileDevice-direktivet i \"%s/cups-files.conf\"." + + #~ msgid "Fuser temperature high!" + #~ msgstr "Fixertemperatur høj!" +diff -up cups-1.5.4/locale/cups_de.po.str4223 cups-1.5.4/locale/cups_de.po +--- cups-1.5.4/locale/cups_de.po.str4223 2012-03-07 21:38:28.000000000 +0000 ++++ cups-1.5.4/locale/cups_de.po 2012-12-06 12:52:23.576877070 +0000 +@@ -2760,7 +2760,7 @@ msgstr "Dateiordner – 9/16 x 3 7/16 Zo + #, c-format + msgid "" + "File device URIs have been disabled. To enable, see the FileDevice directive " +-"in \"%s/cupsd.conf\"." ++"in \"%s/cups-files.conf\"." + msgstr "" + + #, c-format +@@ -7104,10 +7104,10 @@ msgstr "variable-bindings hat unbestimmt + + #~ msgid "" + #~ "File device URIs have been disabled! To enable, see the FileDevice " +-#~ "directive in \"%s/cupsd.conf\"." ++#~ "directive in \"%s/cups-files.conf\"." + #~ msgstr "" + #~ "Dateigeräte-URIs wurden deaktiviert! Infos zum Aktivieren finden Sie im " +-#~ "FileDevice-Verzeichnis unter „%s/cupsd.conf“." ++#~ "FileDevice-Verzeichnis unter „%s/cups-files.conf“." + + #~ msgid "Fuser temperature high!" + #~ msgstr "Die Temperatur des Fixierers ist zu hoch!" +diff -up cups-1.5.4/locale/cups_es.po.str4223 cups-1.5.4/locale/cups_es.po +--- cups-1.5.4/locale/cups_es.po.str4223 2012-03-07 21:38:28.000000000 +0000 ++++ cups-1.5.4/locale/cups_es.po 2012-12-06 12:52:23.585877097 +0000 +@@ -2991,10 +2991,10 @@ msgstr "Carpeta de archivosr - 9/16 x 3 + #, c-format + msgid "" + "File device URIs have been disabled. To enable, see the FileDevice directive " +-"in \"%s/cupsd.conf\"." ++"in \"%s/cups-files.conf\"." + msgstr "" + "Los URIs del dispositivo de archivo han sido deshabilitados. Para " +-"habilitarlos, vea la directiva FileDevice en \"%s/cupsd.conf\"." ++"habilitarlos, vea la directiva FileDevice en \"%s/cups-files.conf\"." + + #, c-format + msgid "Finished page %d." +diff -up cups-1.5.4/locale/cups_eu.po.str4223 cups-1.5.4/locale/cups_eu.po +--- cups-1.5.4/locale/cups_eu.po.str4223 2012-03-07 21:38:28.000000000 +0000 ++++ cups-1.5.4/locale/cups_eu.po 2012-12-06 12:52:23.599877139 +0000 +@@ -2793,7 +2793,7 @@ msgstr "Fitxategien karpeta - 9/16 x 3 7 + #, c-format + msgid "" + "File device URIs have been disabled. To enable, see the FileDevice directive " +-"in \"%s/cupsd.conf\"." ++"in \"%s/cups-files.conf\"." + msgstr "" + + #, c-format +@@ -7181,10 +7181,10 @@ msgstr "'variable-bindings'-ek definitu + + #~ msgid "" + #~ "File device URIs have been disabled! To enable, see the FileDevice " +-#~ "directive in \"%s/cupsd.conf\"." ++#~ "directive in \"%s/cups-files.conf\"." + #~ msgstr "" + #~ "Fitxategiaren gailuaren URIak desgaitu egin dira. Gaitzeko, ikus " +-#~ "FileDevice direktiba \"%s/cupsd.conf\" fitxategian." ++#~ "FileDevice direktiba \"%s/cups-files.conf\" fitxategian." + + #~ msgid "Fuser temperature high!" + #~ msgstr "Fuser-aren tenperatura altua." +diff -up cups-1.5.4/locale/cups_fi.po.str4223 cups-1.5.4/locale/cups_fi.po +--- cups-1.5.4/locale/cups_fi.po.str4223 2012-03-07 21:38:28.000000000 +0000 ++++ cups-1.5.4/locale/cups_fi.po 2012-12-06 12:52:23.613877181 +0000 +@@ -2759,7 +2759,7 @@ msgstr "Arkistokansio - 9/16 x 3 7/16 \" + #, c-format + msgid "" + "File device URIs have been disabled. To enable, see the FileDevice directive " +-"in \"%s/cupsd.conf\"." ++"in \"%s/cups-files.conf\"." + msgstr "" + + #, c-format +@@ -7070,10 +7070,10 @@ msgstr "variable-bindings käyttää mä + + #~ msgid "" + #~ "File device URIs have been disabled! To enable, see the FileDevice " +-#~ "directive in \"%s/cupsd.conf\"." ++#~ "directive in \"%s/cups-files.conf\"." + #~ msgstr "" + #~ "Tiedostolaitteiden osoitteet on poistettu käytöstä! Voit ottaa ne " +-#~ "käyttöön ”%s/cupsd.conf”-tiedoston FileDevice-säännöllä." ++#~ "käyttöön ”%s/cups-files.conf”-tiedoston FileDevice-säännöllä." + + #~ msgid "Fuser temperature high!" + #~ msgstr "Lämpövastuksen lämpötila on korkea!" +diff -up cups-1.5.4/locale/cups_fr.po.str4223 cups-1.5.4/locale/cups_fr.po +--- cups-1.5.4/locale/cups_fr.po.str4223 2012-03-07 21:38:28.000000000 +0000 ++++ cups-1.5.4/locale/cups_fr.po 2012-12-06 12:52:23.627877223 +0000 +@@ -2760,7 +2760,7 @@ msgstr "Dossier de fichier - 9/16 x 3 7/ + #, c-format + msgid "" + "File device URIs have been disabled. To enable, see the FileDevice directive " +-"in \"%s/cupsd.conf\"." ++"in \"%s/cups-files.conf\"." + msgstr "" + + #, c-format +@@ -7117,10 +7117,10 @@ msgstr "variable-bindings s’avère êt + + #~ msgid "" + #~ "File device URIs have been disabled! To enable, see the FileDevice " +-#~ "directive in \"%s/cupsd.conf\"." ++#~ "directive in \"%s/cups-files.conf\"." + #~ msgstr "" + #~ "Les URI des périphériques de fichier ont été désactivés. Pour l’activer, " +-#~ "reportez-vous à la directive FileDevice dans « %s/cupsd.conf »." ++#~ "reportez-vous à la directive FileDevice dans « %s/cups-files.conf »." + + #~ msgid "Fuser temperature high!" + #~ msgstr "Température de l’unité-fusible élevée." +diff -up cups-1.5.4/locale/cups_hu.po.str4223 cups-1.5.4/locale/cups_hu.po +--- cups-1.5.4/locale/cups_hu.po.str4223 2012-03-07 21:38:28.000000000 +0000 ++++ cups-1.5.4/locale/cups_hu.po 2012-12-06 12:52:23.637877253 +0000 +@@ -2963,10 +2963,10 @@ msgstr "Fájlmappa - 9/16 x 3 7/16\"" + #, c-format + msgid "" + "File device URIs have been disabled. To enable, see the FileDevice directive " +-"in \"%s/cupsd.conf\"." ++"in \"%s/cups-files.conf\"." + msgstr "" + "A fájl eszközök URI-címei le lettek tiltva. Az engedélyezéshez lásd a " +-"FileDevice direktívát a(z) „%s/cupsd.conf” fájlban." ++"FileDevice direktívát a(z) „%s/cups-files.conf” fájlban." + + #, c-format + msgid "Finished page %d." +diff -up cups-1.5.4/locale/cups_id.po.str4223 cups-1.5.4/locale/cups_id.po +--- cups-1.5.4/locale/cups_id.po.str4223 2012-03-07 21:38:28.000000000 +0000 ++++ cups-1.5.4/locale/cups_id.po 2012-12-06 12:52:23.651877295 +0000 +@@ -2791,7 +2791,7 @@ msgstr "Map - 9/16 x 3 7/16\"" + #, c-format + msgid "" + "File device URIs have been disabled. To enable, see the FileDevice directive " +-"in \"%s/cupsd.conf\"." ++"in \"%s/cups-files.conf\"." + msgstr "" + + #, c-format +@@ -7011,10 +7011,10 @@ msgstr "variable-bindings memiliki panja + + #~ msgid "" + #~ "File device URIs have been disabled! To enable, see the FileDevice " +-#~ "directive in \"%s/cupsd.conf\"." ++#~ "directive in \"%s/cups-files.conf\"." + #~ msgstr "" + #~ "Berkas URI perangkat telah dinonaktifkan! Untuk mengaktifkannya, lihatlah " +-#~ "petunjuk FileDevice dalam \"%s/cupsd.conf\"." ++#~ "petunjuk FileDevice dalam \"%s/cups-files.conf\"." + + #~ msgid "Fuser temperature high!" + #~ msgstr "Suhu fusi tinggi!" +diff -up cups-1.5.4/locale/cups_it.po.str4223 cups-1.5.4/locale/cups_it.po +--- cups-1.5.4/locale/cups_it.po.str4223 2012-03-07 21:38:28.000000000 +0000 ++++ cups-1.5.4/locale/cups_it.po 2012-12-06 12:52:23.665877337 +0000 +@@ -2761,7 +2761,7 @@ msgstr "Cartella documento: 9/16 x 3 7/1 + #, c-format + msgid "" + "File device URIs have been disabled. To enable, see the FileDevice directive " +-"in \"%s/cupsd.conf\"." ++"in \"%s/cups-files.conf\"." + msgstr "" + + #, c-format +@@ -7160,10 +7160,10 @@ msgstr "variable-bindings utilizza una l + + #~ msgid "" + #~ "File device URIs have been disabled! To enable, see the FileDevice " +-#~ "directive in \"%s/cupsd.conf\"." ++#~ "directive in \"%s/cups-files.conf\"." + #~ msgstr "" + #~ "Gli URI del dispositivo documento sono stati disabilitati! Per " +-#~ "abilitarli, consulta l'istruzione del FileDevice in \"%s/cupsd.conf\"." ++#~ "abilitarli, consulta l'istruzione del FileDevice in \"%s/cups-files.conf\"." + + #~ msgid "Fuser temperature high!" + #~ msgstr "Temperatura del fusibile elevata!" +diff -up cups-1.5.4/locale/cups_ja.po.str4223 cups-1.5.4/locale/cups_ja.po +--- cups-1.5.4/locale/cups_ja.po.str4223 2012-03-07 21:38:28.000000000 +0000 ++++ cups-1.5.4/locale/cups_ja.po 2012-12-06 12:52:23.679877379 +0000 +@@ -2788,7 +2788,7 @@ msgstr "ファイルフォルダー - 9/ + #, c-format + msgid "" + "File device URIs have been disabled. To enable, see the FileDevice directive " +-"in \"%s/cupsd.conf\"." ++"in \"%s/cups-files.conf\"." + msgstr "" + + #, c-format +@@ -7155,9 +7155,9 @@ msgstr "variable-bindings の長さが + + #~ msgid "" + #~ "File device URIs have been disabled! To enable, see the FileDevice " +-#~ "directive in \"%s/cupsd.conf\"." ++#~ "directive in \"%s/cups-files.conf\"." + #~ msgstr "" +-#~ "ファイルデバイス URI は無効になっています! 有効にするには、\"%s/cupsd.conf" ++#~ "ファイルデバイス URI は無効になっています! 有効にするには、\"%s/cups-files.conf" + #~ "\" の FileDevice ディレクティブを参照してください。" + + #~ msgid "Fuser temperature high!" +diff -up cups-1.5.4/locale/cups_ko.po.str4223 cups-1.5.4/locale/cups_ko.po +--- cups-1.5.4/locale/cups_ko.po.str4223 2012-03-07 21:38:28.000000000 +0000 ++++ cups-1.5.4/locale/cups_ko.po 2012-12-06 12:52:23.692877418 +0000 +@@ -2759,7 +2759,7 @@ msgstr "파일 폴더 - 9/16 x 3 7/16\"" + #, c-format + msgid "" + "File device URIs have been disabled. To enable, see the FileDevice directive " +-"in \"%s/cupsd.conf\"." ++"in \"%s/cups-files.conf\"." + msgstr "" + + #, c-format +@@ -7043,9 +7043,9 @@ msgstr "variable-bindings의 길이가 + + #~ msgid "" + #~ "File device URIs have been disabled! To enable, see the FileDevice " +-#~ "directive in \"%s/cupsd.conf\"." ++#~ "directive in \"%s/cups-files.conf\"." + #~ msgstr "" +-#~ "파일 장비 URI가 비활성화되었습니다! 활성화하려면, \"%s/cupsd.conf\"에 있" ++#~ "파일 장비 URI가 비활성화되었습니다! 활성화하려면, \"%s/cups-files.conf\"에 있" + #~ "는 FileDevice 지시문을 보십시오." + + #~ msgid "Fuser temperature high!" +diff -up cups-1.5.4/locale/cups_nl.po.str4223 cups-1.5.4/locale/cups_nl.po +--- cups-1.5.4/locale/cups_nl.po.str4223 2012-03-07 21:38:28.000000000 +0000 ++++ cups-1.5.4/locale/cups_nl.po 2012-12-06 12:52:23.706877460 +0000 +@@ -2760,7 +2760,7 @@ msgstr "Dossiermap - 9/16 x 3 7/16\"" + #, c-format + msgid "" + "File device URIs have been disabled. To enable, see the FileDevice directive " +-"in \"%s/cupsd.conf\"." ++"in \"%s/cups-files.conf\"." + msgstr "" + + #, c-format +@@ -7096,10 +7096,10 @@ msgstr "onbepaalde lengte gebruikt voor + + #~ msgid "" + #~ "File device URIs have been disabled! To enable, see the FileDevice " +-#~ "directive in \"%s/cupsd.conf\"." ++#~ "directive in \"%s/cups-files.conf\"." + #~ msgstr "" + #~ "File device-URI&aops;s zijn uitgeschakeld! Raadpleeg als u de URI&aops;s " +-#~ "weer wilt inschakelen de richtlijn voor FileDevice in \"%s/cupsd.conf\"." ++#~ "weer wilt inschakelen de richtlijn voor FileDevice in \"%s/cups-files.conf\"." + + #~ msgid "Fuser temperature high!" + #~ msgstr "Fusertemperatuur te hoog!" +diff -up cups-1.5.4/locale/cups_no.po.str4223 cups-1.5.4/locale/cups_no.po +--- cups-1.5.4/locale/cups_no.po.str4223 2012-03-07 21:38:28.000000000 +0000 ++++ cups-1.5.4/locale/cups_no.po 2012-12-06 12:52:23.719877498 +0000 +@@ -2759,7 +2759,7 @@ msgstr "Filmappe – 9/16 x 3 7/16\"" + #, c-format + msgid "" + "File device URIs have been disabled. To enable, see the FileDevice directive " +-"in \"%s/cupsd.conf\"." ++"in \"%s/cups-files.conf\"." + msgstr "" + + #, c-format +@@ -7044,10 +7044,10 @@ msgstr "variable-bindings bruker uendeli + + #~ msgid "" + #~ "File device URIs have been disabled! To enable, see the FileDevice " +-#~ "directive in \"%s/cupsd.conf\"." ++#~ "directive in \"%s/cups-files.conf\"." + #~ msgstr "" + #~ "Enhets-URIer for filer er deaktivert! Hvis du vil aktivere funksjonen, " +-#~ "leser du FileDevice-direktivet i «%s/cupsd.conf»." ++#~ "leser du FileDevice-direktivet i «%s/cups-files.conf»." + + #~ msgid "Fuser temperature high!" + #~ msgstr "Fikseringsenhetens temperatur er høy!" +diff -up cups-1.5.4/locale/cups_pl.po.str4223 cups-1.5.4/locale/cups_pl.po +--- cups-1.5.4/locale/cups_pl.po.str4223 2012-03-07 21:38:28.000000000 +0000 ++++ cups-1.5.4/locale/cups_pl.po 2012-12-06 12:52:23.733877540 +0000 +@@ -2759,7 +2759,7 @@ msgstr "Folder - 9/16 x 3 7/16\"" + #, c-format + msgid "" + "File device URIs have been disabled. To enable, see the FileDevice directive " +-"in \"%s/cupsd.conf\"." ++"in \"%s/cups-files.conf\"." + msgstr "" + + #, c-format +@@ -7080,10 +7080,10 @@ msgstr "variable-bindings używa niesko + + #~ msgid "" + #~ "File device URIs have been disabled! To enable, see the FileDevice " +-#~ "directive in \"%s/cupsd.conf\"." ++#~ "directive in \"%s/cups-files.conf\"." + #~ msgstr "" + #~ "URI pliku urządzenia zostało wyłączone! Aby włączyć, zobacz dyrektywę " +-#~ "FileDevice w \"%s/cupsd.conf\"." ++#~ "FileDevice w \"%s/cups-files.conf\"." + + #~ msgid "Fuser temperature high!" + #~ msgstr "Wysoka temperatura wygrzewacza!" +diff -up cups-1.5.4/locale/cups_pt_BR.po.str4223 cups-1.5.4/locale/cups_pt_BR.po +--- cups-1.5.4/locale/cups_pt_BR.po.str4223 2012-03-07 21:38:28.000000000 +0000 ++++ cups-1.5.4/locale/cups_pt_BR.po 2012-12-06 12:52:23.747877582 +0000 +@@ -2759,7 +2759,7 @@ msgstr "Pasta de Arquivo - 9/16 x 3 7/16 + #, c-format + msgid "" + "File device URIs have been disabled. To enable, see the FileDevice directive " +-"in \"%s/cupsd.conf\"." ++"in \"%s/cups-files.conf\"." + msgstr "" + + #, c-format +@@ -7085,10 +7085,10 @@ msgstr "variable-bindings usa compriment + + #~ msgid "" + #~ "File device URIs have been disabled! To enable, see the FileDevice " +-#~ "directive in \"%s/cupsd.conf\"." ++#~ "directive in \"%s/cups-files.conf\"." + #~ msgstr "" + #~ "URIs de dispositivo de arquivo foram desativados! Para ativá-los, " +-#~ "consulte a diretiva FileDevice em \"%s/cupsd.conf\"." ++#~ "consulte a diretiva FileDevice em \"%s/cups-files.conf\"." + + #~ msgid "Fuser temperature high!" + #~ msgstr "Temperatura do fuser alta!" +diff -up cups-1.5.4/locale/cups_pt.po.str4223 cups-1.5.4/locale/cups_pt.po +--- cups-1.5.4/locale/cups_pt.po.str4223 2012-03-07 21:38:28.000000000 +0000 ++++ cups-1.5.4/locale/cups_pt.po 2012-12-06 12:52:23.760877621 +0000 +@@ -2759,7 +2759,7 @@ msgstr "Pasta de ficheiros - 9/16 x 3 7/ + #, c-format + msgid "" + "File device URIs have been disabled. To enable, see the FileDevice directive " +-"in \"%s/cupsd.conf\"." ++"in \"%s/cups-files.conf\"." + msgstr "" + + #, c-format +@@ -7081,10 +7081,10 @@ msgstr "variable-bindings com compriment + + #~ msgid "" + #~ "File device URIs have been disabled! To enable, see the FileDevice " +-#~ "directive in \"%s/cupsd.conf\"." ++#~ "directive in \"%s/cups-files.conf\"." + #~ msgstr "" + #~ "URIs do periférico do ficheiro foram desactivados! Para activar, consulte " +-#~ "a directiva FileDevice em \"%s/cupsd.conf\"." ++#~ "a directiva FileDevice em \"%s/cups-files.conf\"." + + #~ msgid "Fuser temperature high!" + #~ msgstr "Temperatura do fusor elevada!" +diff -up cups-1.5.4/locale/cups_ru.po.str4223 cups-1.5.4/locale/cups_ru.po +--- cups-1.5.4/locale/cups_ru.po.str4223 2012-03-07 21:38:28.000000000 +0000 ++++ cups-1.5.4/locale/cups_ru.po 2012-12-06 12:52:23.774877663 +0000 +@@ -2759,7 +2759,7 @@ msgstr "Каталог файла - 9 16 + #, c-format + msgid "" + "File device URIs have been disabled. To enable, see the FileDevice directive " +-"in \"%s/cupsd.conf\"." ++"in \"%s/cups-files.conf\"." + msgstr "" + + #, c-format +@@ -7060,10 +7060,10 @@ msgstr "Для variable-bindings дли + + #~ msgid "" + #~ "File device URIs have been disabled! To enable, see the FileDevice " +-#~ "directive in \"%s/cupsd.conf\"." ++#~ "directive in \"%s/cups-files.conf\"." + #~ msgstr "" + #~ "URI-адреса файлового устройства отключены! Чтобы включить их, используйте " +-#~ "директиву FileDevice в «%s/cupsd.conf»." ++#~ "директиву FileDevice в «%s/cups-files.conf»." + + #~ msgid "Fuser temperature high!" + #~ msgstr "Высокая температура термофиксатора!" +diff -up cups-1.5.4/locale/cups_sv.po.str4223 cups-1.5.4/locale/cups_sv.po +--- cups-1.5.4/locale/cups_sv.po.str4223 2012-03-07 21:38:28.000000000 +0000 ++++ cups-1.5.4/locale/cups_sv.po 2012-12-06 12:52:23.787877702 +0000 +@@ -2759,7 +2759,7 @@ msgstr "Filmapp - 9/16 x 3 7/16\"" + #, c-format + msgid "" + "File device URIs have been disabled. To enable, see the FileDevice directive " +-"in \"%s/cupsd.conf\"." ++"in \"%s/cups-files.conf\"." + msgstr "" + + #, c-format +@@ -7056,10 +7056,10 @@ msgstr "variabelbindningar använder obe + + #~ msgid "" + #~ "File device URIs have been disabled! To enable, see the FileDevice " +-#~ "directive in \"%s/cupsd.conf\"." ++#~ "directive in \"%s/cups-files.conf\"." + #~ msgstr "" + #~ "Filenhets URI:er har blivit avaktiverade! För att aktivera, se direktivet " +-#~ "FileDevice i \"%s/cupsd.conf\"." ++#~ "FileDevice i \"%s/cups-files.conf\"." + + #~ msgid "Fuser temperature high!" + #~ msgstr "Hög fixeringstemperatur!" +diff -up cups-1.5.4/locale/cups_zh.po.str4223 cups-1.5.4/locale/cups_zh.po +--- cups-1.5.4/locale/cups_zh.po.str4223 2012-03-07 21:38:28.000000000 +0000 ++++ cups-1.5.4/locale/cups_zh.po 2012-12-06 12:52:23.801877744 +0000 +@@ -2758,7 +2758,7 @@ msgstr "文件夹 - 9/16 x 3 7/16 英寸 + #, c-format + msgid "" + "File device URIs have been disabled. To enable, see the FileDevice directive " +-"in \"%s/cupsd.conf\"." ++"in \"%s/cups-files.conf\"." + msgstr "" + + #, c-format +@@ -7010,9 +7010,9 @@ msgstr "variable-bindings 使用不定 + + #~ msgid "" + #~ "File device URIs have been disabled! To enable, see the FileDevice " +-#~ "directive in \"%s/cupsd.conf\"." ++#~ "directive in \"%s/cups-files.conf\"." + #~ msgstr "" +-#~ "文件设备 URI 已被停用!要启用,请参阅“%s/cupsd.conf”中的 FileDevice 指令。" ++#~ "文件设备 URI 已被停用!要启用,请参阅“%s/cups-files.conf”中的 FileDevice 指令。" + + #~ msgid "Fuser temperature high!" + #~ msgstr "加热鼓温度过高!" +diff -up cups-1.5.4/locale/cups_zh_TW.po.str4223 cups-1.5.4/locale/cups_zh_TW.po +--- cups-1.5.4/locale/cups_zh_TW.po.str4223 2012-03-07 21:38:28.000000000 +0000 ++++ cups-1.5.4/locale/cups_zh_TW.po 2012-12-06 12:52:23.814877783 +0000 +@@ -2758,7 +2758,7 @@ msgstr "檔案夾 - 9/16 x 3 7/16\"" + #, c-format + msgid "" + "File device URIs have been disabled. To enable, see the FileDevice directive " +-"in \"%s/cupsd.conf\"." ++"in \"%s/cups-files.conf\"." + msgstr "" + + #, c-format +@@ -7012,9 +7012,9 @@ msgstr "variable-bindings 使用的長 + + #~ msgid "" + #~ "File device URIs have been disabled! To enable, see the FileDevice " +-#~ "directive in \"%s/cupsd.conf\"." ++#~ "directive in \"%s/cups-files.conf\"." + #~ msgstr "" +-#~ "已停用檔案設備 URI!若要啟用,請參閱“%s/cupsd.conf”中的 FileDevice 指示。" ++#~ "已停用檔案設備 URI!若要啟用,請參閱“%s/cups-files.conf”中的 FileDevice 指示。" + + #~ msgid "Fuser temperature high!" + #~ msgstr "加熱器溫度高!" diff -up cups-1.5.4/man/cupsd.conf.man.in.str4223 cups-1.5.4/man/cupsd.conf.man.in --- cups-1.5.4/man/cupsd.conf.man.in.str4223 2011-05-18 22:33:35.000000000 +0100 -+++ cups-1.5.4/man/cupsd.conf.man.in 2012-12-03 11:42:12.454165088 +0000 ++++ cups-1.5.4/man/cupsd.conf.man.in 2012-12-06 12:52:04.946832650 +0000 @@ -12,12 +12,15 @@ .\" which should have been included with this file. If this file is .\" file is missing or damaged, see the license at "http://www.cups.org/". @@ -1397,8 +1875,8 @@ diff -up cups-1.5.4/man/cupsd.conf.man.in.str4223 cups-1.5.4/man/cupsd.conf.man. .br http://localhost:631/help diff -up cups-1.5.4/man/cups-files.conf.man.in.str4223 cups-1.5.4/man/cups-files.conf.man.in ---- cups-1.5.4/man/cups-files.conf.man.in.str4223 2012-12-03 11:42:12.454165088 +0000 -+++ cups-1.5.4/man/cups-files.conf.man.in 2012-12-03 11:42:12.454165088 +0000 +--- cups-1.5.4/man/cups-files.conf.man.in.str4223 2012-12-06 12:52:04.946832650 +0000 ++++ cups-1.5.4/man/cups-files.conf.man.in 2012-12-06 12:52:04.946832650 +0000 @@ -0,0 +1,146 @@ +.\" +.\" "$Id$" @@ -1548,7 +2026,7 @@ diff -up cups-1.5.4/man/cups-files.conf.man.in.str4223 cups-1.5.4/man/cups-files +.\" diff -up cups-1.5.4/man/Makefile.str4223 cups-1.5.4/man/Makefile --- cups-1.5.4/man/Makefile.str4223 2010-06-22 22:21:37.000000000 +0100 -+++ cups-1.5.4/man/Makefile 2012-12-03 11:42:12.454165088 +0000 ++++ cups-1.5.4/man/Makefile 2012-12-06 12:52:04.946832650 +0000 @@ -39,6 +39,7 @@ MAN1 = cancel.$(MAN1EXT) \ ppdpo.$(MAN1EXT) MAN5 = classes.conf.$(MAN5EXT) \ @@ -1559,7 +2037,7 @@ diff -up cups-1.5.4/man/Makefile.str4223 cups-1.5.4/man/Makefile ipptoolfile.$(MAN5EXT) \ diff -up cups-1.5.4/packaging/cups.list.in.str4223 cups-1.5.4/packaging/cups.list.in --- cups-1.5.4/packaging/cups.list.in.str4223 2012-04-24 00:49:19.000000000 +0100 -+++ cups-1.5.4/packaging/cups.list.in 2012-12-03 11:42:12.455165091 +0000 ++++ cups-1.5.4/packaging/cups.list.in 2012-12-06 12:52:04.946832650 +0000 @@ -588,6 +588,7 @@ d 0755 root $CUPS_GROUP $SERVERROOT/inte d 0755 root $CUPS_GROUP $SERVERROOT/ppd - d 0700 root $CUPS_GROUP $SERVERROOT/ssl - @@ -1570,7 +2048,7 @@ diff -up cups-1.5.4/packaging/cups.list.in.str4223 cups-1.5.4/packaging/cups.lis %if PAMDIR diff -up cups-1.5.4/packaging/cups.spec.in.str4223 cups-1.5.4/packaging/cups.spec.in --- cups-1.5.4/packaging/cups.spec.in.str4223 2012-04-23 18:46:53.000000000 +0100 -+++ cups-1.5.4/packaging/cups.spec.in 2012-12-03 11:42:12.455165091 +0000 ++++ cups-1.5.4/packaging/cups.spec.in 2012-12-06 12:52:04.947832653 +0000 @@ -152,6 +152,7 @@ rm -rf $RPM_BUILD_ROOT %defattr(-,root,root) %dir /etc/cups @@ -1580,8 +2058,8 @@ diff -up cups-1.5.4/packaging/cups.spec.in.str4223 cups-1.5.4/packaging/cups.spe %dir /etc/cups/interfaces %dir /etc/cups/ppd diff -up cups-1.5.4/scheduler/client.c.str4223 cups-1.5.4/scheduler/client.c ---- cups-1.5.4/scheduler/client.c.str4223 2012-12-03 11:42:12.408164934 +0000 -+++ cups-1.5.4/scheduler/client.c 2012-12-03 11:42:12.456165095 +0000 +--- cups-1.5.4/scheduler/client.c.str4223 2012-12-06 12:52:04.911832546 +0000 ++++ cups-1.5.4/scheduler/client.c 2012-12-06 12:52:04.948832656 +0000 @@ -35,7 +35,7 @@ * data_ready() - Check whether data is available from a client. * encrypt_client() - Enable encryption for the client... @@ -1681,8 +2159,8 @@ diff -up cups-1.5.4/scheduler/client.c.str4223 cups-1.5.4/scheduler/client.c /* diff -up cups-1.5.4/scheduler/conf.c.str4223 cups-1.5.4/scheduler/conf.c ---- cups-1.5.4/scheduler/conf.c.str4223 2012-12-03 11:42:12.409164937 +0000 -+++ cups-1.5.4/scheduler/conf.c 2012-12-03 11:43:54.795434434 +0000 +--- cups-1.5.4/scheduler/conf.c.str4223 2012-12-06 12:52:04.912832549 +0000 ++++ cups-1.5.4/scheduler/conf.c 2012-12-06 12:52:04.949832659 +0000 @@ -27,7 +27,8 @@ * parse_fatal_errors() - Parse FatalErrors values in a string. * parse_groups() - Parse system group names in a string. @@ -2487,8 +2965,8 @@ diff -up cups-1.5.4/scheduler/conf.c.str4223 cups-1.5.4/scheduler/conf.c return (1); diff -up cups-1.5.4/scheduler/conf.h.str4223 cups-1.5.4/scheduler/conf.h ---- cups-1.5.4/scheduler/conf.h.str4223 2012-12-03 11:42:12.291164541 +0000 -+++ cups-1.5.4/scheduler/conf.h 2012-12-03 11:42:12.457165099 +0000 +--- cups-1.5.4/scheduler/conf.h.str4223 2012-12-06 12:52:04.859832390 +0000 ++++ cups-1.5.4/scheduler/conf.h 2012-12-06 12:52:04.949832659 +0000 @@ -96,7 +96,9 @@ typedef struct */ @@ -2500,9 +2978,21 @@ diff -up cups-1.5.4/scheduler/conf.h.str4223 cups-1.5.4/scheduler/conf.h *ServerName VALUE(NULL), /* FQDN for server */ *ServerAdmin VALUE(NULL), +diff -up cups-1.5.4/scheduler/ipp.c.str4223 cups-1.5.4/scheduler/ipp.c +--- cups-1.5.4/scheduler/ipp.c.str4223 2012-12-06 12:52:04.931832605 +0000 ++++ cups-1.5.4/scheduler/ipp.c 2012-12-06 12:52:04.951832665 +0000 +@@ -2568,7 +2568,7 @@ add_printer(cupsd_client_t *con, /* I - + send_ipp_status(con, IPP_NOT_POSSIBLE, + _("File device URIs have been disabled. " + "To enable, see the FileDevice directive in " +- "\"%s/cupsd.conf\"."), ++ "\"%s/cups-files.conf\"."), + ServerRoot); + return; + } diff -up cups-1.5.4/scheduler/main.c.str4223 cups-1.5.4/scheduler/main.c ---- cups-1.5.4/scheduler/main.c.str4223 2012-12-03 11:42:12.428165001 +0000 -+++ cups-1.5.4/scheduler/main.c 2012-12-03 11:44:31.837533988 +0000 +--- cups-1.5.4/scheduler/main.c.str4223 2012-12-06 12:52:04.925832587 +0000 ++++ cups-1.5.4/scheduler/main.c 2012-12-06 12:52:04.951832665 +0000 @@ -225,7 +225,6 @@ main(int argc, /* I - Number of comm char *current; /* Current directory */ @@ -2579,7 +3069,7 @@ diff -up cups-1.5.4/scheduler/main.c.str4223 cups-1.5.4/scheduler/main.c */ diff -up cups-1.5.4/test/run-stp-tests.sh.str4223 cups-1.5.4/test/run-stp-tests.sh --- cups-1.5.4/test/run-stp-tests.sh.str4223 2012-05-15 15:04:18.000000000 +0100 -+++ cups-1.5.4/test/run-stp-tests.sh 2012-12-03 11:42:12.457165099 +0000 ++++ cups-1.5.4/test/run-stp-tests.sh 2012-12-06 12:52:04.951832665 +0000 @@ -337,25 +337,10 @@ fi cat >/tmp/cups-$user/cupsd.conf < 1:1.5.4-21 +- Additional fix relating to CVE-2012-5519 to avoid misleading error + message about actions to take to enable file device URIs. + * Tue Dec 4 2012 Tim Waugh 1:1.5.4-20 - Small error handling improvements in the configuration migration script. From 9db046f6c4f1b7f8afc79cec03780144c9244631 Mon Sep 17 00:00:00 2001 From: Jiri Popelka Date: Tue, 18 Dec 2012 15:32:27 +0100 Subject: [PATCH 23/30] backport fixes for STR #4125, STR #4140, STR #4187, STR #4205, STR #4232 --- cups-icc.patch | 2 +- cups-lspp.patch | 6 ++-- cups-str4125.patch | 54 ++++++++++++++++++++++++++++++++++++ cups-str4140.patch | 29 +++++++++++++++++++ cups-str4187.patch | 41 +++++++++++++++++++++++++++ cups-str4205.patch | 69 ++++++++++++++++++++++++++++++++++++++++++++++ cups.spec | 21 +++++++++++++- 7 files changed, 217 insertions(+), 5 deletions(-) create mode 100644 cups-str4125.patch create mode 100644 cups-str4140.patch create mode 100644 cups-str4187.patch create mode 100644 cups-str4205.patch diff --git a/cups-icc.patch b/cups-icc.patch index db4ae22..3e5db6c 100644 --- a/cups-icc.patch +++ b/cups-icc.patch @@ -517,7 +517,7 @@ index 0000000..bd06e1c + "DeleteDevice"); + + dbus_message_iter_init_append(message, &args); -+ dbus_message_iter_append_basic(&args, DBUS_TYPE_STRING, &device_id); ++ dbus_message_iter_append_basic(&args, DBUS_TYPE_OBJECT_PATH, &device_id); + + /* send syncronous */ + dbus_error_init(&error); diff --git a/cups-lspp.patch b/cups-lspp.patch index a9b6add..57fa80b 100644 --- a/cups-lspp.patch +++ b/cups-lspp.patch @@ -1931,9 +1931,9 @@ diff -up cups-1.5.4/scheduler/printers.c.lspp cups-1.5.4/scheduler/printers.c * Local functions... */ @@ -2231,6 +2238,13 @@ cupsdSetPrinterAttrs(cupsd_printer_t *p) - "username", - "password" - }; + cups_option_t *option; /* Current printer option */ + char *name, /* Current user/group name */ + *filter; /* Current filter */ +#ifdef WITH_LSPP + char *audit_message; /* Audit message string */ + char *printerfile; /* Path to a local printer dev */ diff --git a/cups-str4125.patch b/cups-str4125.patch new file mode 100644 index 0000000..83d02b5 --- /dev/null +++ b/cups-str4125.patch @@ -0,0 +1,54 @@ +From 997514f0f7eb360d55a0e77fdba916221a395cb0 Mon Sep 17 00:00:00 2001 +From: mike +Date: Thu, 13 Dec 2012 16:38:56 +0000 +Subject: [PATCH] The IPP backend now stops queues when the server + configuration prevents successful job submission (STR #4125) + +git-svn-id: http://svn.easysw.com/public/cups/trunk@10758 7a7537e8-13f0-0310-91df-b6672ffda945 +diff --git a/backend/ipp.c b/backend/ipp.c +index 05843ea..c61d6c8 100644 +--- a/backend/ipp.c ++++ b/backend/ipp.c +@@ -1354,8 +1354,9 @@ main(int argc, /* I - Number of command-line args */ + /* + * If the printer only claims to support IPP/1.0, or if the user specifically + * included version=1.0 in the URI, then do not try to use Create-Job or +- * Send-Document. This is another dreaded compatibility hack, but unfortunately +- * there are enough broken printers out there that we need this for now... ++ * Send-Document. This is another dreaded compatibility hack, but ++ * unfortunately there are enough broken printers out there that we need ++ * this for now... + */ + + if (version == 10) +@@ -1812,6 +1813,27 @@ main(int argc, /* I - Number of command-line args */ + + goto cleanup; + } ++ else if (ipp_status == IPP_UPGRADE_REQUIRED) ++ { ++ /* ++ * Server is configured incorrectly; the policy for Create-Job and ++ * Send-Document has to be the same (auth or no auth, encryption or ++ * no encryption). Force the queue to stop since printing will never ++ * work. ++ */ ++ ++ fputs("DEBUG: The server or printer is configured incorrectly.\n", ++ stderr); ++ fputs("DEBUG: The policy for Create-Job and Send-Document must have the " ++ "same authentication and encryption requirements.\n", stderr); ++ ++ ipp_status = IPP_INTERNAL_ERROR; ++ ++ if (job_id > 0) ++ cancel_job(http, uri, job_id, resource, argv[2], version); ++ ++ goto cleanup; ++ } + else if (ipp_status == IPP_NOT_FOUND) + { + /* +-- +1.8.0.1 + diff --git a/cups-str4140.patch b/cups-str4140.patch new file mode 100644 index 0000000..33e49bc --- /dev/null +++ b/cups-str4140.patch @@ -0,0 +1,29 @@ +From b28fd9a0ad2262e7caa8615d891cff2422e496e5 Mon Sep 17 00:00:00 2001 +From: mike +Date: Mon, 17 Dec 2012 22:40:54 +0000 +Subject: [PATCH] Fixed a problem with local Kerberos authentication (STR + #4140) + +git-svn-id: http://svn.easysw.com/public/cups/trunk@10778 7a7537e8-13f0-0310-91df-b6672ffda945 +diff --git a/scheduler/client.c b/scheduler/client.c +index 663c64b..e9abb82 100644 +--- a/scheduler/client.c ++++ b/scheduler/client.c +@@ -2580,14 +2580,7 @@ cupsdSendHeader( + con->http.hostname); + #ifdef HAVE_GSSAPI + else if (auth_type == CUPSD_AUTH_NEGOTIATE) +- { +-# ifdef AF_LOCAL +- if (_httpAddrFamily(con->http.hostaddr) == AF_LOCAL) +- strlcpy(auth_str, "Basic realm=\"CUPS\"", sizeof(auth_str)); +- else +-# endif /* AF_LOCAL */ + strlcpy(auth_str, "Negotiate", sizeof(auth_str)); +- } + #endif /* HAVE_GSSAPI */ + + if (con->best && auth_type != CUPSD_AUTH_NEGOTIATE && +-- +1.8.0.1 + diff --git a/cups-str4187.patch b/cups-str4187.patch new file mode 100644 index 0000000..c54dd07 --- /dev/null +++ b/cups-str4187.patch @@ -0,0 +1,41 @@ +From c6ae62cb67ef957fea5bf0e0bcd0a3201a2d6b4d Mon Sep 17 00:00:00 2001 +From: mike +Date: Thu, 13 Dec 2012 19:57:25 +0000 +Subject: [PATCH] The CUPS library did not always detect a timed out connection + to the server which could cause temporary loss of printing from applications + (STR #4187) + +git-svn-id: http://svn.easysw.com/public/cups/trunk@10760 7a7537e8-13f0-0310-91df-b6672ffda945 +diff --git a/cups/request.c b/cups/request.c +index a04fbb3..f81785d 100644 +--- a/cups/request.c ++++ b/cups/request.c +@@ -1007,6 +1007,25 @@ _cupsConnect(void) + httpClose(cg->http); + cg->http = NULL; + } ++ else ++ { ++ /* ++ * Same server, see if the connection is still established... ++ */ ++ ++ char ch; /* Connection check byte */ ++ ++ if (recv(cg->http->fd, &ch, 1, MSG_PEEK | MSG_DONTWAIT) < 0 && ++ errno != EWOULDBLOCK) ++ { ++ /* ++ * Nope, close the connection... ++ */ ++ ++ httpClose(cg->http); ++ cg->http = NULL; ++ } ++ } + } + + /* +-- +1.8.0.1 + diff --git a/cups-str4205.patch b/cups-str4205.patch new file mode 100644 index 0000000..78a1fc4 --- /dev/null +++ b/cups-str4205.patch @@ -0,0 +1,69 @@ +From 7d54edf278380093a00fd850ca3f88d6e4777e46 Mon Sep 17 00:00:00 2001 +From: mike +Date: Wed, 12 Dec 2012 12:27:27 +0000 +Subject: [PATCH] Don't set auth-info-required all of the time (STR #4205) + +git-svn-id: http://svn.easysw.com/public/cups/trunk@10749 7a7537e8-13f0-0310-91df-b6672ffda945 + +diff -up cups-1.5.4/scheduler/printers.c.str4205 cups-1.5.4/scheduler/printers.c +--- cups-1.5.4/scheduler/printers.c.str4205 2012-12-18 14:15:01.000000000 +0100 ++++ cups-1.5.4/scheduler/printers.c 2012-12-18 14:24:12.269701428 +0100 +@@ -2213,8 +2213,6 @@ cupsdSetPrinterAttrs(cupsd_printer_t *p) + int i, /* Looping var */ + length; /* Length of browse attributes */ + char resource[HTTP_MAX_URI]; /* Resource portion of URI */ +- int num_air; /* Number of auth-info-required values */ +- const char * const *air; /* auth-info-required values */ + cupsd_location_t *auth; /* Pointer to authentication element */ + const char *auth_supported; /* Authentication supported */ + ipp_t *oldattrs; /* Old printer attributes */ +@@ -2222,15 +2220,6 @@ cupsdSetPrinterAttrs(cupsd_printer_t *p) + cups_option_t *option; /* Current printer option */ + char *name, /* Current user/group name */ + *filter; /* Current filter */ +- static const char * const air_none[] = +- { /* No authentication */ +- "none" +- }; +- static const char * const air_userpass[] = +- { /* Basic/Digest authentication */ +- "username", +- "password" +- }; + + + DEBUG_printf(("cupsdSetPrinterAttrs: entering name = %s, type = %x\n", p->name, +@@ -2254,20 +2243,6 @@ cupsdSetPrinterAttrs(cupsd_printer_t *p) + */ + + auth_supported = "requesting-user-name"; +- num_air = 1; +- air = air_none; +- +- if (p->num_auth_info_required > 0 && strcmp(p->auth_info_required[0], "none")) +- { +- num_air = p->num_auth_info_required; +- air = p->auth_info_required; +- } +- else if ((p->type & CUPS_PRINTER_AUTHENTICATED) && +- (p->type & CUPS_PRINTER_DISCOVERED)) +- { +- num_air = 2; +- air = air_userpass; +- } + + if (p->type & CUPS_PRINTER_CLASS) + snprintf(resource, sizeof(resource), "/classes/%s", p->name); +@@ -2349,8 +2324,10 @@ cupsdSetPrinterAttrs(cupsd_printer_t *p) + "job-k-limit", p->k_limit); + ippAddInteger(p->attrs, IPP_TAG_PRINTER, IPP_TAG_INTEGER, + "job-page-limit", p->page_limit); +- ippAddStrings(p->attrs, IPP_TAG_PRINTER, IPP_TAG_KEYWORD, +- "auth-info-required", num_air, NULL, air); ++ if (p->num_auth_info_required > 0 && strcmp(p->auth_info_required[0], "none")) ++ ippAddStrings(p->attrs, IPP_TAG_PRINTER, IPP_TAG_KEYWORD, ++ "auth-info-required", p->num_auth_info_required, NULL, ++ p->auth_info_required); + + if (cupsArrayCount(Banners) > 0 && !(p->type & CUPS_PRINTER_DISCOVERED)) + { diff --git a/cups.spec b/cups.spec index 6d65dcd..4babc52 100644 --- a/cups.spec +++ b/cups.spec @@ -12,7 +12,7 @@ Summary: Common Unix Printing System Name: cups Version: 1.5.4 -Release: 21%{?dist} +Release: 22%{?dist} License: GPLv2 Group: System Environment/Daemons Source: http://ftp.easysw.com/pub/cups/%{version}/cups-%{version}-source.tar.bz2 @@ -82,6 +82,11 @@ Patch46: cups-str4190.patch Patch47: cups-str4223.patch +Patch48: cups-str4125.patch +Patch49: cups-str4140.patch +Patch50: cups-str4187.patch +Patch51: cups-str4205.patch + Patch100: cups-lspp.patch Epoch: 1 @@ -331,6 +336,17 @@ Sends IPP requests to the specified URI and tests and/or displays the results. # Apply upstream fix for CVE-2012-5519 (STR #4223, bug #875898). %patch47 -p1 -b .str4223 +# The IPP backend now stops queues when the server +# configuration prevents successful job submission (STR #4125) +%patch48 -p1 -b .str4125 +# Fixed a problem with local Kerberos authentication (STR #4140, bug #837602) +%patch49 -p1 -b .str4140 +# The CUPS library did not always detect a timed out connection to the server +# which could cause temporary loss of printing from applications (STR #4187) +%patch50 -p1 -b .str4187 +# Don't set auth-info-required all of the time (STR #4205) +%patch51 -p1 -b .str4205 + %if %lspp # LSPP support. %patch100 -p1 -b .lspp @@ -732,6 +748,9 @@ rm -f %{cups_serverbin}/backend/smb %{_mandir}/man5/ipptoolfile.5.gz %changelog +* Tue Dec 18 2012 Jiri Popelka 1:1.5.4-22 +- backport fixes for STR #4125, STR #4140, STR #4187, STR #4205, STR #4232 + * Thu Dec 6 2012 Tim Waugh 1:1.5.4-21 - Additional fix relating to CVE-2012-5519 to avoid misleading error message about actions to take to enable file device URIs. From 72e2830726ce2cdd651ecb37b89bfe5042d92e9b Mon Sep 17 00:00:00 2001 From: Jiri Popelka Date: Wed, 2 Jan 2013 16:18:17 +0100 Subject: [PATCH 24/30] Remove unused cups.service file. We ship the one from cups-systemd-socket.patch --- cups.service | 15 --------------- 1 file changed, 15 deletions(-) delete mode 100644 cups.service diff --git a/cups.service b/cups.service deleted file mode 100644 index dfb87b8..0000000 --- a/cups.service +++ /dev/null @@ -1,15 +0,0 @@ -[Unit] -Description=CUPS scheduler -Requires=printer.target -After=syslog.target - -[Service] -Type=forking -PIDFile=/var/run/cupsd.pid -ExecStartPre=/usr/sbin/cupsd -t -ExecStart=/usr/sbin/cupsd -ExecStartPost=/sbin/udevadm trigger --subsystem-match=usb --attr-match=bInterfaceClass=07 --attr-match=bInterfaceSubClass=01 --action=add -ExecStartPost=/sbin/udevadm trigger --subsystem-match=usb --property-match=DEVNAME="/dev/usb/lp*" --action=add - -[Install] -WantedBy=multi-user.target From cccba8b8b1622551e8513ec275488966ba93ea49 Mon Sep 17 00:00:00 2001 From: Jiri Popelka Date: Mon, 14 Jan 2013 12:10:00 +0100 Subject: [PATCH 25/30] Fix unowned directories (#894531). --- cups.spec | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/cups.spec b/cups.spec index 4babc52..efed074 100644 --- a/cups.spec +++ b/cups.spec @@ -12,7 +12,7 @@ Summary: Common Unix Printing System Name: cups Version: 1.5.4 -Release: 22%{?dist} +Release: 23%{?dist} License: GPLv2 Group: System Environment/Daemons Source: http://ftp.easysw.com/pub/cups/%{version}/cups-%{version}-source.tar.bz2 @@ -636,8 +636,13 @@ rm -f %{cups_serverbin}/backend/smb %config(noreplace) %{_sysconfdir}/pam.d/cups %config(noreplace) %{_sysconfdir}/logrotate.d/cups %dir %{_datadir}/%{name}/www +%dir %{_datadir}/%{name}/www/de %dir %{_datadir}/%{name}/www/es %dir %{_datadir}/%{name}/www/eu +%dir %{_datadir}/%{name}/www/fr +%dir %{_datadir}/%{name}/www/hu +%dir %{_datadir}/%{name}/www/id +%dir %{_datadir}/%{name}/www/it %dir %{_datadir}/%{name}/www/ja %dir %{_datadir}/%{name}/www/pl %dir %{_datadir}/%{name}/www/ru @@ -691,6 +696,16 @@ rm -f %{cups_serverbin}/backend/smb %{_datadir}/cups/fonts %{_datadir}/cups/model %dir %{_datadir}/cups/templates +%dir %{_datadir}/cups/templates/de +%dir %{_datadir}/cups/templates/es +%dir %{_datadir}/cups/templates/eu +%dir %{_datadir}/cups/templates/fr +%dir %{_datadir}/cups/templates/hu +%dir %{_datadir}/cups/templates/id +%dir %{_datadir}/cups/templates/it +%dir %{_datadir}/cups/templates/ja +%dir %{_datadir}/cups/templates/pl +%dir %{_datadir}/cups/templates/ru %{_datadir}/cups/templates/*.tmpl %{_datadir}/cups/templates/de/*.tmpl %{_datadir}/cups/templates/es/*.tmpl @@ -748,6 +763,9 @@ rm -f %{cups_serverbin}/backend/smb %{_mandir}/man5/ipptoolfile.5.gz %changelog +* Mon Jan 14 2013 Jiri Popelka 1:1.5.4-23 +- Fix unowned directories (#894531). + * Tue Dec 18 2012 Jiri Popelka 1:1.5.4-22 - backport fixes for STR #4125, STR #4140, STR #4187, STR #4205, STR #4232 From 1027b2e21130d4827798e80e9a2d1f60b1f05be4 Mon Sep 17 00:00:00 2001 From: Jiri Popelka Date: Fri, 18 Jan 2013 15:48:13 +0100 Subject: [PATCH 26/30] Add quirk rule for Canon MP210 (#847923). --- cups-usblp-quirks.patch | 4 +++- cups.spec | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/cups-usblp-quirks.patch b/cups-usblp-quirks.patch index 506564c..ebf5d4c 100644 --- a/cups-usblp-quirks.patch +++ b/cups-usblp-quirks.patch @@ -19,7 +19,7 @@ diff -up cups-1.5.4/backend/usb-libusb.c.usblp-quirks cups-1.5.4/backend/usb-lib #define USBLP_QUIRK_NO_REATTACH 0x8000 /* After printing we cannot re-attach the usblp kernel module */ -@@ -141,15 +143,43 @@ static const struct quirk_printer_struct +@@ -141,15 +143,45 @@ static const struct quirk_printer_struct { 0x0409, 0xf1be, USBLP_QUIRK_BIDIR }, /* NEC Picty800 (HP OEM) */ { 0x0482, 0x0010, USBLP_QUIRK_BIDIR }, /* Kyocera Mita FS 820, by zut */ @@ -27,6 +27,8 @@ diff -up cups-1.5.4/backend/usb-libusb.c.usblp-quirks cups-1.5.4/backend/usb-lib + Printer, http://www.cups.org/str.php?L4155 */ + { 0x04a9, 0x10b6, USBLP_QUIRK_BIDIR }, /* Canon, Inc. PIXMA iP4300 + Printer, https://bugs.launchpad.net/bugs/1032385 */ ++ { 0x04a9, 0x1721, USBLP_QUIRK_BIDIR }, /* Canon, Inc. MP210 ++ https://bugzilla.redhat.com/show_bug.cgi?id=847923#c53 */ + { 0x04a9, 0x170c, USBLP_QUIRK_BIDIR }, /* Canon, Inc. MP500 + Printer, https://bugs.launchpad.net/bugs/1032456 */ + { 0x04a9, 0x1717, USBLP_QUIRK_BIDIR }, /* Canon, Inc. MP510 diff --git a/cups.spec b/cups.spec index efed074..0acfb16 100644 --- a/cups.spec +++ b/cups.spec @@ -12,7 +12,7 @@ Summary: Common Unix Printing System Name: cups Version: 1.5.4 -Release: 23%{?dist} +Release: 24%{?dist} License: GPLv2 Group: System Environment/Daemons Source: http://ftp.easysw.com/pub/cups/%{version}/cups-%{version}-source.tar.bz2 @@ -763,6 +763,9 @@ rm -f %{cups_serverbin}/backend/smb %{_mandir}/man5/ipptoolfile.5.gz %changelog +* Fri Jan 18 2013 Jiri Popelka 1:1.5.4-24 +- Add quirk rule for Canon MP210 (#847923). + * Mon Jan 14 2013 Jiri Popelka 1:1.5.4-23 - Fix unowned directories (#894531). From 744b8f82c0b0b8c5aff189d09d3da79835125e4d Mon Sep 17 00:00:00 2001 From: Tim Waugh Date: Fri, 15 Feb 2013 17:07:56 +0000 Subject: [PATCH 27/30] Fixed STR #4232 fix (STR #4276). --- cups-icc.patch | 2 +- cups.spec | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/cups-icc.patch b/cups-icc.patch index 3e5db6c..ee4079c 100644 --- a/cups-icc.patch +++ b/cups-icc.patch @@ -517,7 +517,7 @@ index 0000000..bd06e1c + "DeleteDevice"); + + dbus_message_iter_init_append(message, &args); -+ dbus_message_iter_append_basic(&args, DBUS_TYPE_OBJECT_PATH, &device_id); ++ dbus_message_iter_append_basic(&args, DBUS_TYPE_OBJECT_PATH, &device_path); + + /* send syncronous */ + dbus_error_init(&error); diff --git a/cups.spec b/cups.spec index 0acfb16..e54f180 100644 --- a/cups.spec +++ b/cups.spec @@ -12,7 +12,7 @@ Summary: Common Unix Printing System Name: cups Version: 1.5.4 -Release: 24%{?dist} +Release: 25%{?dist} License: GPLv2 Group: System Environment/Daemons Source: http://ftp.easysw.com/pub/cups/%{version}/cups-%{version}-source.tar.bz2 @@ -763,6 +763,9 @@ rm -f %{cups_serverbin}/backend/smb %{_mandir}/man5/ipptoolfile.5.gz %changelog +* Fri Feb 15 2013 Jiri Popelka 1:1.5.4-25 +- Fixed STR #4232 fix (STR #4276). + * Fri Jan 18 2013 Jiri Popelka 1:1.5.4-24 - Add quirk rule for Canon MP210 (#847923). From d47e634478011f5f594fa9a7d9e36521e53a318d Mon Sep 17 00:00:00 2001 From: Tim Waugh Date: Tue, 5 Mar 2013 15:34:51 +0000 Subject: [PATCH 28/30] Documentation fixes from STR #4223 (bug #915981). Resolves: rhbz#915981 (cherry picked from commit 19635ac1b10a6573f556960655793a343ebeefec) --- cups-str4223.patch | 582 +++++++++++++++++++++++++++++++++++++++++---- cups.spec | 5 +- 2 files changed, 538 insertions(+), 49 deletions(-) diff --git a/cups-str4223.patch b/cups-str4223.patch index 567add7..c45ba89 100644 --- a/cups-str4223.patch +++ b/cups-str4223.patch @@ -193,7 +193,14 @@ diff -up cups-1.5.4/configure.in.str4223 cups-1.5.4/configure.in conf/cupsd.conf conf/mime.convs conf/pam.std -@@ -82,6 +83,7 @@ AC_OUTPUT(Makedefs +@@ -76,12 +77,14 @@ AC_OUTPUT(Makedefs + data/cups.socket + data/cups.path + desktop/cups.desktop ++ doc/help/ref-cups-files-conf.html + doc/help/ref-cupsd-conf.html + doc/help/standard.html + doc/index.html man/client.conf.man man/cups-deviced.man man/cups-driverd.man @@ -215,8 +222,45 @@ diff -up cups-1.5.4/conf/Makefile.str4223 cups-1.5.4/conf/Makefile diff -up cups-1.5.4/doc/help/ref-cupsd-conf.html.in.str4223 cups-1.5.4/doc/help/ref-cupsd-conf.html.in --- cups-1.5.4/doc/help/ref-cupsd-conf.html.in.str4223 2012-01-30 21:40:21.000000000 +0000 -+++ cups-1.5.4/doc/help/ref-cupsd-conf.html.in 2012-12-06 12:52:04.945832647 +0000 -@@ -191,82 +191,6 @@ HREF="#Location">Location + + +-

AccessLog

+- +-

Examples

+- +-
+-AccessLog /var/log/cups/access_log
+-AccessLog /var/log/cups/access_log-%s
+-AccessLog syslog
+-
+- +-

Description

+- +-

The AccessLog directive sets the name of the +-access log file. If the filename is not absolute then it is +-assumed to be relative to the ServerRoot directory. The +-access log file is stored in "common log format" and can be used +-by any web access reporting tool to generate a report on CUPS +-server activity.

+- +-

The server name can be included in the filename by using +-%s in the name.

+- +-

The special name "syslog" can be used to send the access +-information to the system log instead of a plain file.

+- +-

The default access log file is +-@CUPS_LOGDIR@/access_log.

+- +- +

AccessLogLevel

+ +

Examples

+@@ -191,82 +161,6 @@ HREF="#Location">LocationLimit section.

@@ -299,7 +343,299 @@ diff -up cups-1.5.4/doc/help/ref-cupsd-conf.html.in.str4223 cups-1.5.4/doc/help/

AuthType

Examples

-@@ -2544,65 +2468,6 @@ purged.

+@@ -898,40 +792,6 @@ used.

+

The default is to not allow classification overrides.

+ + +-

CUPS 1.1.15ConfigFilePerm

+- +-

Examples

+- +-
+-ConfigFilePerm 0644
+-ConfigFilePerm 0640
+-
+- +-

Description

+- +-

The ConfigFilePerm directive specifies the permissions to use when the scheduler writes configuration and cache files, typically in response to IPP or HTTP requests. The default is @CUPS_CONFIG_FILE_PERM@.

+- +-
Note: +- +-

The permissions for the printers.conf file are always masked to only allow access from the scheduler user (typically root). This is done because printer device URIs sometimes contain sensitive authentication information that should not be generally known on the system. There is no way to disable this security feature.

+- +-
+- +- +-

DataDir

+- +-

Examples

+- +-
+-DataDir /usr/share/cups
+-
+- +-

Description

+- +-

The DataDir directive sets the directory to use +-for data files.

+- +- +

CUPS 1.2/Mac OS X 10.5DefaultAuthType

+ +

Examples

+@@ -1113,32 +973,6 @@ causes the update to occur as soon as po + milliseconds.

+ + +-

DocumentRoot

+- +-

Examples

+- +-
+-DocumentRoot /usr/share/doc/cups
+-DocumentRoot /foo/bar/doc/cups
+-
+- +-

Description

+- +-

The DocumentRoot directive specifies the location +-of web content for the HTTP server in CUPS. If an absolute path +-is not specified then it is assumed to be relative to the ServerRoot directory. The +-default directory is @CUPS_DOCROOT@.

+- +-

Documents are first looked up in a sub-directory for the +-primary language requested by the client (e.g. +-@CUPS_DOCROOT@/fr/...) and then directly under +-the DocumentRoot directory (e.g. +-@CUPS_DOCROOT@/...), so it is possible to +-localize the web content by providing subdirectories for each +-language needed.

+- +- +

Encryption

+ +

Examples

+@@ -1161,31 +995,6 @@ encryption settings for that location. T + IfRequested for all locations.

+ + +-

ErrorLog

+- +-

Examples

+- +-
+-ErrorLog /var/log/cups/error_log
+-ErrorLog /var/log/cups/error_log-%s
+-ErrorLog syslog
+-
+- +-

Description

+- +-

The ErrorLog directive sets the name of the error +-log file. If the filename is not absolute then it is assumed to +-be relative to the ServerRoot directory. The +-default error log file is @CUPS_LOGDIR@/error_log.

+- +-

The server name can be included in the filename by using +-%s in the name.

+- +-

The special name "syslog" can be used to send the error +-information to the system log instead of a plain file.

+- +- +

CUPS 1.3/Mac OS X 10.5ErrorPolicy

+ +

Examples

+@@ -1225,90 +1034,6 @@ printer.

+ + + +-

CUPS 1.4/Mac OS X 10.6FatalErrors

+- +-

Examples

+- +-
+-FatalErrors none
+-FatalErrors all
+-FatalErrors browse
+-FatalErrors config
+-FatalErrors listen
+-FatalErrors log
+-FatalErrors permissions
+-FatalErrors all -permissions
+-FatalErrors config permissions log
+-
+- +-

Description

+- +-

The FatalErrors directive determines whether certain kinds of +-errors are fatal. The following kinds of errors are currently recognized:

+- +-
    +- +-
  • none - No errors are fatal
  • +- +-
  • all - All of the errors below are fatal
  • +- +-
  • browse - Browsing initialization errors are fatal, +- for example failed binding to the CUPS browse port or failed connections +- to LDAP servers
  • +- +-
  • config - Configuration file syntax errors are +- fatal
  • +- +-
  • listen - Listen or Port errors are fatal, except for +- IPv6 failures on the loopback or "any" addresses
  • +- +-
  • log - Log file creation or write errors are fatal
  • +- +-
  • permissions - Bad startup file permissions are +- fatal, for example shared SSL certificate and key files with world- +- read permissions
  • +- +-
+- +-

Multiple errors can be listed, and the form "-kind" can be used with +-all to remove specific kinds of errors. The default setting is +-@CUPS_FATAL_ERRORS@.

+- +- +-

CUPS 1.1.18FileDevice

+- +-

Examples

+- +-
+-FileDevice Yes
+-FileDevice No
+-
+- +-

Description

+- +-

The FileDevice directive determines whether the +-scheduler allows new printers to be added using device URIs of +-the form file:/filename. File devices are most often +-used to test new printer drivers and do not support raw file +-printing.

+- +-

The default setting is No.

+- +-
Note: +- +-

File devices are managed by the scheduler. Since the +-scheduler normally runs as the root user, file devices +-can be used to overwrite system files and potentially +-gain unauthorized access to the system. If you must +-create printers using file devices, we recommend that +-you set the FileDevice directive to +-Yes for only as long as you need to add the +-printers to the system, and then reset the directive to +-No.

+- +-
+- +- +

CUPS 1.1.3FilterLimit

+ +

Examples

+@@ -1353,39 +1078,6 @@ value to assign to filter processes. The + is 0.

+ + +-

CUPS 1.1.3FontPath

+- +-

Examples

+- +-
+-FontPath /foo/bar/fonts
+-FontPath /usr/share/cups/fonts:/foo/bar/fonts
+-
+- +-

Description

+- +-

The FontPath directive specifies the font path to +-use when searching for fonts. The default font path is +-/usr/share/cups/fonts.

+- +- +-

Group

+- +-

Examples

+- +-
+-Group lp
+-Group nobody
+-
+- +-

Description

+- +-

The Group directive specifies the UNIX group that +-filter and CGI programs run as. The default group is +-system-specific but is usually lp or +-nobody.

+- +- +

CUPS 1.1.10HideImplicitMembers

+ +

Examples

+@@ -2030,22 +1722,6 @@ error occurs during printing. The defaul + disables debugging history entirely and is not recommended.

+ + +-

CUPS 1.1.15LogFilePerm

+- +-

Examples

+- +-
+-LogFilePerm 0644
+-LogFilePerm 0600
+-
+- +-

Description

+- +-

The LogFilePerm directive specifies the +-permissions to use when writing log files. The default +-is @CUPS_LOG_FILE_PERM@.

+- +- +

LogLevel

+ +

Examples

+@@ -2350,31 +2026,6 @@ HREF="#Location">LocationLimit section.

+ + +-

PageLog

+- +-

Examples

+- +-
+-PageLog /var/log/cups/page_log
+-PageLog /var/log/cups/page_log-%s
+-PageLog syslog
+-
+- +-

Description

+- +-

The PageLog directive sets the name of the page +-log file. If the filename is not absolute then it is assumed to +-be relative to the ServerRoot directory. The +-default page log file is @CUPS_LOGDIR@/page_log.

+- +-

The server name can be included in the filename by using +-%s in the name.

+- +-

The special name "syslog" can be used to send the page +-information to the system log instead of a plain file.

+- +- +

PageLogFormat

+ +

Examples

+@@ -2544,65 +2195,6 @@ purged.

files as soon as each job is completed, canceled, or aborted.

@@ -365,7 +701,7 @@ diff -up cups-1.5.4/doc/help/ref-cupsd-conf.html.in.str4223 cups-1.5.4/doc/help/

CUPS 1.1.21ReloadTimeout

Examples

-@@ -2619,42 +2484,6 @@ of seconds the scheduler will wait for a +@@ -2619,42 +2211,6 @@ of seconds the scheduler will wait for a before doing a restart. The default is 30 seconds.

@@ -408,7 +744,7 @@ diff -up cups-1.5.4/doc/help/ref-cupsd-conf.html.in.str4223 cups-1.5.4/doc/help/

CUPS 1.1.7Require

Examples

-@@ -2806,64 +2635,6 @@ alternate name with a ServerAlias direct +@@ -2806,64 +2362,6 @@ alternate name with a ServerAlias direct @@ -473,7 +809,7 @@ diff -up cups-1.5.4/doc/help/ref-cupsd-conf.html.in.str4223 cups-1.5.4/doc/help/

ServerName

Examples

-@@ -2880,23 +2651,6 @@ that is reported to clients. By default +@@ -2880,23 +2378,6 @@ that is reported to clients. By default hostname.

@@ -497,7 +833,7 @@ diff -up cups-1.5.4/doc/help/ref-cupsd-conf.html.in.str4223 cups-1.5.4/doc/help/

CUPS 1.1.21ServerTokens

Examples

-@@ -3075,53 +2829,6 @@ subscription values to make private. The +@@ -3075,53 +2556,6 @@ subscription values to make private. The HREF="#Policy">Policy section.

@@ -551,7 +887,7 @@ diff -up cups-1.5.4/doc/help/ref-cupsd-conf.html.in.str4223 cups-1.5.4/doc/help/

Timeout

Examples

-@@ -3160,31 +2867,6 @@ the same printer available from multiple +@@ -3160,31 +2594,6 @@ the same printer available from multiple

The default is @CUPS_USE_NETWORK_DEFAULT@.

@@ -586,7 +922,7 @@ diff -up cups-1.5.4/doc/help/ref-cupsd-conf.html.in.str4223 cups-1.5.4/doc/help/ diff -up cups-1.5.4/doc/help/ref-cups-files-conf.html.in.str4223 cups-1.5.4/doc/help/ref-cups-files-conf.html.in --- cups-1.5.4/doc/help/ref-cups-files-conf.html.in.str4223 2012-12-06 12:52:04.945832647 +0000 +++ cups-1.5.4/doc/help/ref-cups-files-conf.html.in 2012-12-06 12:52:04.945832647 +0000 -@@ -0,0 +1,531 @@ +@@ -0,0 +1,513 @@ + + + @@ -663,24 +999,6 @@ diff -up cups-1.5.4/doc/help/ref-cups-files-conf.html.in.str4223 cups-1.5.4/doc/ +for data files.

+ + -+

CUPS 1.2/OS X 10.5DefaultAuthType

-+ -+

Examples

-+ -+
-+DefaultAuthType Basic
-+DefaultAuthType BasicDigest
-+DefaultAuthType Digest
-+DefaultAuthType Negotiate
-+
-+ -+

Description

-+ -+

The DefaultAuthType directive specifies the type -+of authentication to use for IPP operations that require a -+username. The default is Basic.

-+ -+ +

DocumentRoot

+ +

Examples

@@ -1130,6 +1448,14 @@ diff -up cups-1.5.4/doc/Makefile.str4223 cups-1.5.4/doc/Makefile # Copyright 1997-2007 by Easy Software Products. # # These coded instructions, statements, and computer programs are the +@@ -105,6 +105,7 @@ HELPFILES = \ + help/ref-classes-conf.html \ + help/ref-client-conf.html \ + help/ref-cupsd-conf.html \ ++ help/ref-cups-files-conf.html \ + help/ref-error_log.html \ + help/ref-mailto-conf.html \ + help/ref-page_log.html \ diff -up cups-1.5.4/locale/cups_da.po.str4223 cups-1.5.4/locale/cups_da.po --- cups-1.5.4/locale/cups_da.po.str4223 2012-03-07 21:38:28.000000000 +0000 +++ cups-1.5.4/locale/cups_da.po 2012-12-06 12:52:23.562877028 +0000 @@ -1608,6 +1934,30 @@ diff -up cups-1.5.4/locale/cups_zh_TW.po.str4223 cups-1.5.4/locale/cups_zh_TW.po #~ msgid "Fuser temperature high!" #~ msgstr "加熱器溫度高!" +diff -up cups-1.5.4/man/cupsctl.man.str4223 cups-1.5.4/man/cupsctl.man +--- cups-1.5.4/man/cupsctl.man.str4223 2011-01-11 03:04:04.000000000 +0000 ++++ cups-1.5.4/man/cupsctl.man 2013-03-05 14:56:43.496345943 +0000 +@@ -12,7 +12,7 @@ + .\" which should have been included with this file. If this file is + .\" file is missing or damaged, see the license at "http://www.cups.org/". + .\" +-.TH cupsctl 8 "CUPS" "10 January 2011" "Apple Inc." ++.TH cupsctl 8 "CUPS" "12 December 2012" "Apple Inc." + .SH NAME + cupsctl \- configure cupsd.conf options + .SH SYNOPSIS +@@ -89,11 +89,6 @@ Disable printer sharing: + .nf + cupsctl --no-shared-printers + .fi +-.LP +-Enable printing using the file: pseudo-device: +-.nf +- cupsctl FileDevice=Yes +-.fi + .SH KNOWN ISSUES + You cannot set the Listen or Port directives using \fIcupsctl\fR. + .SH SEE ALSO diff -up cups-1.5.4/man/cupsd.conf.man.in.str4223 cups-1.5.4/man/cupsd.conf.man.in --- cups-1.5.4/man/cupsd.conf.man.in.str4223 2011-05-18 22:33:35.000000000 +0100 +++ cups-1.5.4/man/cupsd.conf.man.in 2012-12-06 12:52:04.946832650 +0000 @@ -2125,7 +2475,7 @@ diff -up cups-1.5.4/scheduler/client.c.str4223 cups-1.5.4/scheduler/client.c cups_file_t *in, /* Input file */ *out; /* Output file */ char buffer[16384]; /* Copy buffer */ -@@ -3843,13 +3839,8 @@ install_conf_file(cupsd_client_t *con) / +@@ -3843,19 +3839,14 @@ install_conf_file(cupsd_client_t *con) / * Open the new config file... */ @@ -2136,11 +2486,42 @@ diff -up cups-1.5.4/scheduler/client.c.str4223 cups-1.5.4/scheduler/client.c - mode = ConfigFilePerm; - - if ((out = cupsdCreateConfFile(filename, mode)) == NULL) -+ snprintf(filename, sizeof(filename), "%s/cupsd.conf", ServerRoot); -+ if ((out = cupsdCreateConfFile(filename, ConfigFilePerm)) == NULL) ++ if ((out = cupsdCreateConfFile(ConfigurationFile, ConfigFilePerm)) == NULL) { cupsFileClose(in); return (HTTP_SERVER_ERROR); + } + +- cupsdLogMessage(CUPSD_LOG_INFO, "Installing config file \"%s\"...", filename); ++ cupsdLogMessage(CUPSD_LOG_INFO, "Installing config file \"%s\"...", ++ ConfigurationFile); + + /* + * Copy from the request to the new config file... +@@ -3866,12 +3857,12 @@ install_conf_file(cupsd_client_t *con) / + { + cupsdLogMessage(CUPSD_LOG_ERROR, + "Unable to copy to config file \"%s\": %s", +- filename, strerror(errno)); ++ ConfigurationFile, strerror(errno)); + + cupsFileClose(in); + cupsFileClose(out); + +- snprintf(filename, sizeof(filename), "%s%s.N", ServerRoot, con->uri + 11); ++ snprintf(filename, sizeof(filename), "%s.N", ConfigurationFile); + cupsdRemoveFile(filename); + + return (HTTP_SERVER_ERROR); +@@ -3883,7 +3874,7 @@ install_conf_file(cupsd_client_t *con) / + + cupsFileClose(in); + +- if (cupsdCloseCreatedConfFile(out, filename)) ++ if (cupsdCloseCreatedConfFile(out, ConfigurationFile)) + return (HTTP_SERVER_ERROR); + + /* @@ -3894,14 +3885,10 @@ install_conf_file(cupsd_client_t *con) / cupsdClearString(&con->filename); @@ -2292,7 +2673,7 @@ diff -up cups-1.5.4/scheduler/conf.c.str4223 cups-1.5.4/scheduler/conf.c static int read_location(cups_file_t *fp, char *name, int linenum); static int read_policy(cups_file_t *fp, char *name, int linenum); static void set_policy_defaults(cupsd_policy_t *pol); -@@ -708,22 +716,48 @@ cupsdReadConfiguration(void) +@@ -708,21 +716,63 @@ cupsdReadConfiguration(void) cupsdInitEnv(); /* @@ -2307,14 +2688,22 @@ diff -up cups-1.5.4/scheduler/conf.c.str4223 cups-1.5.4/scheduler/conf.c + cupsFileClose(fp); + + if (!status) ++ { ++ if (TestConfigFile) ++ printf("%s contains errors\n", CupsFilesFile); ++ else ++ syslog(LOG_LPR, "Unable to read \"%s\" due to errors.", ++ CupsFilesFile); ++ + return (0); ++ } + } + else if (errno == ENOENT) + cupsdLogMessage(CUPSD_LOG_INFO, "No %s, using defaults.", CupsFilesFile); + else + { -+ cupsdLogMessage(CUPSD_LOG_CRIT, "Unable to open %s: %s", CupsFilesFile, -+ strerror(errno)); ++ syslog(LOG_LPR, "Unable to open \"%s\": %s", CupsFilesFile, ++ strerror(errno)); + return (0); + } + @@ -2327,8 +2716,8 @@ diff -up cups-1.5.4/scheduler/conf.c.str4223 cups-1.5.4/scheduler/conf.c if ((fp = cupsFileOpen(ConfigurationFile, "r")) == NULL) + { -+ cupsdLogMessage(CUPSD_LOG_CRIT, "Unable to open %s: %s", ConfigurationFile, -+ strerror(errno)); ++ syslog(LOG_LPR, "Unable to open \"%s\": %s", ConfigurationFile, ++ strerror(errno)); return (0); + } @@ -2338,15 +2727,22 @@ diff -up cups-1.5.4/scheduler/conf.c.str4223 cups-1.5.4/scheduler/conf.c cupsFileClose(fp); if (!status) - return (0); +- return (0); ++ { ++ if (TestConfigFile) ++ printf("%s contains errors.\n", ConfigurationFile); ++ else ++ syslog(LOG_LPR, "Unable to read \"%s\" due to errors.", ++ ConfigurationFile); - if (!ErrorLog) - cupsdSetString(&ErrorLog, CUPS_LOGDIR "/error_log"); -- ++ return (0); ++ } + RunUser = getuid(); - cupsdLogMessage(CUPSD_LOG_INFO, "Remote access is %s.", -@@ -842,6 +876,13 @@ cupsdReadConfiguration(void) +@@ -842,6 +892,13 @@ cupsdReadConfiguration(void) BrowseACL = cupsdFindLocation("CUPS_INTERNAL_BROWSE_ACL"); /* @@ -2360,7 +2756,18 @@ diff -up cups-1.5.4/scheduler/conf.c.str4223 cups-1.5.4/scheduler/conf.c * Open the system log for cupsd if necessary... */ -@@ -2512,13 +2553,174 @@ parse_protocols(const char *s) /* I - S +@@ -1002,7 +1059,9 @@ cupsdReadConfiguration(void) + Group, 1, 1) < 0 || + cupsdCheckPermissions(ServerRoot, "ssl", 0700, RunUser, + Group, 1, 0) < 0 || +- cupsdCheckPermissions(ServerRoot, "cupsd.conf", ConfigFilePerm, RunUser, ++ cupsdCheckPermissions(ConfigurationFile, NULL, ConfigFilePerm, RunUser, ++ Group, 0, 0) < 0 || ++ cupsdCheckPermissions(CupsFilesFile, NULL, ConfigFilePerm, RunUser, + Group, 0, 0) < 0 || + cupsdCheckPermissions(ServerRoot, "classes.conf", 0600, RunUser, + Group, 0, 0) < 0 || +@@ -2512,13 +2571,174 @@ parse_protocols(const char *s) /* I - S /* @@ -2538,7 +2945,7 @@ diff -up cups-1.5.4/scheduler/conf.c.str4223 cups-1.5.4/scheduler/conf.c int linenum; /* Current line number */ char line[HTTP_MAX_BUFFER], /* Line from file */ -@@ -2528,7 +2730,6 @@ read_configuration(cups_file_t *fp) /* I +@@ -2528,7 +2748,6 @@ read_configuration(cups_file_t *fp) /* I *value, /* Pointer to value */ *valueptr; /* Pointer into value */ int valuelen; /* Length of value */ @@ -2546,7 +2953,7 @@ diff -up cups-1.5.4/scheduler/conf.c.str4223 cups-1.5.4/scheduler/conf.c http_addrlist_t *addrlist, /* Address list */ *addr; /* Current address */ unsigned ip[4], /* Address value */ -@@ -2538,7 +2739,6 @@ read_configuration(cups_file_t *fp) /* I +@@ -2538,7 +2757,6 @@ read_configuration(cups_file_t *fp) /* I cupsd_location_t *location; /* Browse location */ cups_file_t *incfile; /* Include file */ char incname[1024]; /* Include filename */ @@ -2554,7 +2961,7 @@ diff -up cups-1.5.4/scheduler/conf.c.str4223 cups-1.5.4/scheduler/conf.c /* -@@ -2570,7 +2770,7 @@ read_configuration(cups_file_t *fp) /* I +@@ -2570,7 +2788,7 @@ read_configuration(cups_file_t *fp) /* I incname, strerror(errno)); else { @@ -2563,7 +2970,7 @@ diff -up cups-1.5.4/scheduler/conf.c.str4223 cups-1.5.4/scheduler/conf.c cupsFileClose(incfile); } } -@@ -2594,8 +2794,6 @@ read_configuration(cups_file_t *fp) /* I +@@ -2594,8 +2812,6 @@ read_configuration(cups_file_t *fp) /* I if (linenum == 0) return (0); } @@ -2572,7 +2979,7 @@ diff -up cups-1.5.4/scheduler/conf.c.str4223 cups-1.5.4/scheduler/conf.c else if (!_cups_strcasecmp(line, "FaxRetryInterval") && value) { JobRetryInterval = atoi(value); -@@ -3254,81 +3452,6 @@ read_configuration(cups_file_t *fp) /* I +@@ -3254,81 +3470,6 @@ read_configuration(cups_file_t *fp) /* I } } #endif /* HAVE_SSL */ @@ -2654,7 +3061,7 @@ diff -up cups-1.5.4/scheduler/conf.c.str4223 cups-1.5.4/scheduler/conf.c else if (!_cups_strcasecmp(line, "HostNameLookups") && value) { /* -@@ -3407,22 +3530,6 @@ read_configuration(cups_file_t *fp) /* I +@@ -3407,22 +3548,6 @@ read_configuration(cups_file_t *fp) /* I cupsdLogMessage(CUPSD_LOG_WARN, "Unknown LogTimeFormat %s on line %d.", value, linenum); } @@ -2677,7 +3084,7 @@ diff -up cups-1.5.4/scheduler/conf.c.str4223 cups-1.5.4/scheduler/conf.c else if (!_cups_strcasecmp(line, "ServerTokens") && value) { /* -@@ -3548,117 +3655,193 @@ read_configuration(cups_file_t *fp) /* I +@@ -3548,117 +3673,193 @@ read_configuration(cups_file_t *fp) /* I "line %d.", value, linenum); } #endif /* HAVE_SSL */ @@ -2990,6 +3397,67 @@ diff -up cups-1.5.4/scheduler/ipp.c.str4223 cups-1.5.4/scheduler/ipp.c ServerRoot); return; } +diff -up cups-1.5.4/scheduler/log.c.str4223 cups-1.5.4/scheduler/log.c +--- cups-1.5.4/scheduler/log.c.str4223 2013-03-05 14:56:43.374345442 +0000 ++++ cups-1.5.4/scheduler/log.c 2013-03-05 14:56:43.496345943 +0000 +@@ -44,6 +44,22 @@ + static int log_linesize = 0; /* Size of line for output file */ + static char *log_line = NULL; /* Line for output file */ + ++#ifdef HAVE_VSYSLOG ++static const int syslevels[] = /* SYSLOG levels... */ ++ { ++ 0, ++ LOG_EMERG, ++ LOG_ALERT, ++ LOG_CRIT, ++ LOG_ERR, ++ LOG_WARNING, ++ LOG_NOTICE, ++ LOG_INFO, ++ LOG_DEBUG, ++ LOG_DEBUG ++ }; ++#endif /* HAVE_VSYSLOG */ ++ + + /* + * Local functions... +@@ -548,8 +564,12 @@ cupsdLogMessage(int level, /* I - + if ((TestConfigFile || !ErrorLog) && level <= CUPSD_LOG_WARN) + { + va_start(ap, message); ++#ifdef HAVE_VSYSLOG ++ vsyslog(LOG_LPR | syslevels[level], message, ap); ++#else + vfprintf(stderr, message, ap); + putc('\n', stderr); ++#endif /* HAVE_VSYSLOG */ + va_end(ap); + + return (1); +@@ -985,21 +1005,6 @@ cupsdWriteErrorLog(int level, /* + 'D', + 'd' + }; +-#ifdef HAVE_VSYSLOG +- static const int syslevels[] = /* SYSLOG levels... */ +- { +- 0, +- LOG_EMERG, +- LOG_ALERT, +- LOG_CRIT, +- LOG_ERR, +- LOG_WARNING, +- LOG_NOTICE, +- LOG_INFO, +- LOG_DEBUG, +- LOG_DEBUG +- }; +-#endif /* HAVE_VSYSLOG */ + + + #ifdef HAVE_VSYSLOG diff -up cups-1.5.4/scheduler/main.c.str4223 cups-1.5.4/scheduler/main.c --- cups-1.5.4/scheduler/main.c.str4223 2012-12-06 12:52:04.925832587 +0000 +++ cups-1.5.4/scheduler/main.c 2012-12-06 12:52:04.951832665 +0000 @@ -3067,6 +3535,24 @@ diff -up cups-1.5.4/scheduler/main.c.str4223 cups-1.5.4/scheduler/main.c /* * If the user hasn't specified "-f", run in the background... */ +@@ -511,16 +562,10 @@ main(int argc, /* I - Number of comm + */ + + if (!cupsdReadConfiguration()) +- { +- if (TestConfigFile) +- printf("%s contains errors\n", ConfigurationFile); +- else +- syslog(LOG_LPR, "Unable to read configuration file \'%s\' - exiting!", +- ConfigurationFile); + return (1); +- } + else if (TestConfigFile) + { ++ printf("%s is OK\n", CupsFilesFile); + printf("%s is OK\n", ConfigurationFile); + return (0); + } diff -up cups-1.5.4/test/run-stp-tests.sh.str4223 cups-1.5.4/test/run-stp-tests.sh --- cups-1.5.4/test/run-stp-tests.sh.str4223 2012-05-15 15:04:18.000000000 +0100 +++ cups-1.5.4/test/run-stp-tests.sh 2012-12-06 12:52:04.951832665 +0000 diff --git a/cups.spec b/cups.spec index e54f180..11152ba 100644 --- a/cups.spec +++ b/cups.spec @@ -12,7 +12,7 @@ Summary: Common Unix Printing System Name: cups Version: 1.5.4 -Release: 25%{?dist} +Release: 26%{?dist} License: GPLv2 Group: System Environment/Daemons Source: http://ftp.easysw.com/pub/cups/%{version}/cups-%{version}-source.tar.bz2 @@ -763,6 +763,9 @@ rm -f %{cups_serverbin}/backend/smb %{_mandir}/man5/ipptoolfile.5.gz %changelog +* Tue Mar 5 2013 Tim Waugh 1:1.5.4-26 +- Documentation fixes from STR #4223 (bug #915981). + * Fri Feb 15 2013 Jiri Popelka 1:1.5.4-25 - Fixed STR #4232 fix (STR #4276). From 131a54ac1c30223ea487893490898360e3cca608 Mon Sep 17 00:00:00 2001 From: Tim Waugh Date: Tue, 23 Apr 2013 17:03:35 +0100 Subject: [PATCH 29/30] dnssd backend: don't crash if avahi gives a callback with no TXT record (bug #927040). --- cups-avahi-2-backend.patch | 26 ++++++++++++++------------ cups.spec | 6 +++++- 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/cups-avahi-2-backend.patch b/cups-avahi-2-backend.patch index 9fa3677..bdd4e6a 100644 --- a/cups-avahi-2-backend.patch +++ b/cups-avahi-2-backend.patch @@ -1,6 +1,6 @@ -diff -up cups-1.5.3/backend/dnssd.c.avahi-2-backend cups-1.5.3/backend/dnssd.c ---- cups-1.5.3/backend/dnssd.c.avahi-2-backend 2012-05-15 16:53:18.164774446 +0200 -+++ cups-1.5.3/backend/dnssd.c 2012-05-15 17:09:07.684155704 +0200 +diff -up cups-1.5.4/backend/dnssd.c.avahi-2-backend cups-1.5.4/backend/dnssd.c +--- cups-1.5.4/backend/dnssd.c.avahi-2-backend 2013-04-23 17:01:44.732854106 +0100 ++++ cups-1.5.4/backend/dnssd.c 2013-04-23 17:01:53.671894092 +0100 @@ -15,14 +15,21 @@ * * Contents: @@ -523,7 +523,7 @@ diff -up cups-1.5.3/backend/dnssd.c.avahi-2-backend cups-1.5.3/backend/dnssd.c fprintf(stderr, "DEBUG2: query_callback(sdRef=%p, flags=%x, " "interfaceIndex=%d, errorCode=%d, fullName=\"%s\", " -@@ -719,94 +986,233 @@ query_callback( +@@ -719,94 +986,235 @@ query_callback( if ((ptr = strstr(name, "._")) != NULL) *ptr = '\0'; @@ -592,7 +592,7 @@ diff -up cups-1.5.3/backend/dnssd.c.avahi-2-backend cups-1.5.3/backend/dnssd.c +{ + AvahiClient *client; + cups_device_t key, -+ *device; ++ *device = NULL; + char uqname[1024], + *ptr; + cups_txt_records_t txtr; @@ -623,11 +623,13 @@ diff -up cups-1.5.3/backend/dnssd.c.avahi-2-backend cups-1.5.3/backend/dnssd.c + key.type = device_type (type); + + /* -+ * Find the device and the the TXT information. ++ * Find the device and the TXT information. + */ + + txtr.txt = txt; -+ device = find_device ((cups_array_t *) context, &txtr, &key); ++ if (txt != NULL) ++ device = find_device ((cups_array_t *) context, &txtr, &key); ++ + if (device) + { + /* @@ -819,7 +821,7 @@ diff -up cups-1.5.3/backend/dnssd.c.avahi-2-backend cups-1.5.3/backend/dnssd.c { /* * Add USB device ID information... -@@ -861,6 +1267,10 @@ query_callback( +@@ -861,6 +1269,10 @@ query_callback( if (device->type == CUPS_DEVICE_PRINTER) device->sent = 1; } @@ -830,7 +832,7 @@ diff -up cups-1.5.3/backend/dnssd.c.avahi-2-backend cups-1.5.3/backend/dnssd.c } if (device->device_id) -@@ -917,11 +1327,9 @@ query_callback( +@@ -917,11 +1329,9 @@ query_callback( } } @@ -843,9 +845,9 @@ diff -up cups-1.5.3/backend/dnssd.c.avahi-2-backend cups-1.5.3/backend/dnssd.c /* * 'sigterm_handler()' - Handle termination signals... */ -diff -up cups-1.5.3/cups/http-support.c.avahi-2-backend cups-1.5.3/cups/http-support.c ---- cups-1.5.3/cups/http-support.c.avahi-2-backend 2012-02-15 02:06:12.000000000 +0100 -+++ cups-1.5.3/cups/http-support.c 2012-05-15 17:04:51.045944634 +0200 +diff -up cups-1.5.4/cups/http-support.c.avahi-2-backend cups-1.5.4/cups/http-support.c +--- cups-1.5.4/cups/http-support.c.avahi-2-backend 2012-02-15 01:06:12.000000000 +0000 ++++ cups-1.5.4/cups/http-support.c 2013-04-23 17:01:44.755854208 +0100 @@ -43,6 +43,10 @@ * http_copy_decode() - Copy and decode a URI. * http_copy_encode() - Copy and encode a URI. diff --git a/cups.spec b/cups.spec index 11152ba..e734893 100644 --- a/cups.spec +++ b/cups.spec @@ -12,7 +12,7 @@ Summary: Common Unix Printing System Name: cups Version: 1.5.4 -Release: 26%{?dist} +Release: 27%{?dist} License: GPLv2 Group: System Environment/Daemons Source: http://ftp.easysw.com/pub/cups/%{version}/cups-%{version}-source.tar.bz2 @@ -763,6 +763,10 @@ rm -f %{cups_serverbin}/backend/smb %{_mandir}/man5/ipptoolfile.5.gz %changelog +* Tue Apr 23 2013 Tim Waugh 1:1.5.4-27 +- dnssd backend: don't crash if avahi gives a callback with no TXT + record (bug #927040). + * Tue Mar 5 2013 Tim Waugh 1:1.5.4-26 - Documentation fixes from STR #4223 (bug #915981). From 1e7802c0b08f3abee4865eec57fc55c59afe4f4c Mon Sep 17 00:00:00 2001 From: Tim Waugh Date: Thu, 13 Jun 2013 11:58:55 +0100 Subject: [PATCH 30/30] Prevent stringpool damage leading to memory leaks (bug #974048). Resolves: rhbz#974048 --- cups-stringpool-setprinterattr.patch | 64 ++++++++++++++++++++++++++++ cups.spec | 9 +++- 2 files changed, 71 insertions(+), 2 deletions(-) create mode 100644 cups-stringpool-setprinterattr.patch diff --git a/cups-stringpool-setprinterattr.patch b/cups-stringpool-setprinterattr.patch new file mode 100644 index 0000000..ab3028a --- /dev/null +++ b/cups-stringpool-setprinterattr.patch @@ -0,0 +1,64 @@ +diff -up cups-1.5.4/scheduler/printers.c.stringpool-setprinterattr cups-1.5.4/scheduler/printers.c +--- cups-1.5.4/scheduler/printers.c.stringpool-setprinterattr 2013-06-13 10:40:43.607590350 +0100 ++++ cups-1.5.4/scheduler/printers.c 2013-06-13 10:53:31.134919727 +0100 +@@ -2053,6 +2053,7 @@ cupsdSetPrinterAttr( + ipp_attribute_t *attr; /* Attribute */ + int i, /* Looping var */ + count; /* Number of values */ ++ char *value_dup; /* Copy of attribute value string */ + char *ptr, /* Pointer into value */ + *start, /* Start of value */ + quote; /* Quote character */ +@@ -2121,16 +2122,24 @@ cupsdSetPrinterAttr( + return; + } + +- for (i = 0; i < count; i ++) ++ if ((value_dup = strdup(value)) == NULL) + { +- if ((ptr = strchr(value, ',')) != NULL) ++ cupsdLogMessage(CUPSD_LOG_ERROR, "Unable to copy attribute value."); ++ return; ++ } ++ ++ for (i = 0, start = value_dup; i < count; i ++) ++ { ++ if ((ptr = strchr(start, ',')) != NULL) + *ptr++ = '\0'; + +- attr->values[i].integer = strtol(value, NULL, 10); ++ attr->values[i].integer = strtol(start, NULL, 10); + + if (ptr) +- value = ptr; ++ start = ptr; + } ++ ++ free(value_dup); + } + else + { +@@ -2171,7 +2180,13 @@ cupsdSetPrinterAttr( + return; + } + +- for (i = 0, quote = '\0', ptr = value; i < count; i ++) ++ if ((value_dup = strdup(value)) == NULL) ++ { ++ cupsdLogMessage(CUPSD_LOG_ERROR, "Unable to copy attribute value."); ++ return; ++ } ++ ++ for (i = 0, quote = '\0', ptr = value_dup; i < count; i ++) + { + for (start = ptr; *ptr; ptr ++) + { +@@ -2199,6 +2214,8 @@ cupsdSetPrinterAttr( + + attr->values[i].string.text = _cupsStrAlloc(start); + } ++ ++ free(value_dup); + } + } + diff --git a/cups.spec b/cups.spec index e734893..1cf2be5 100644 --- a/cups.spec +++ b/cups.spec @@ -12,7 +12,7 @@ Summary: Common Unix Printing System Name: cups Version: 1.5.4 -Release: 27%{?dist} +Release: 28%{?dist} License: GPLv2 Group: System Environment/Daemons Source: http://ftp.easysw.com/pub/cups/%{version}/cups-%{version}-source.tar.bz2 @@ -79,13 +79,13 @@ Patch43: cups-str4194.patch Patch44: cups-r10638.patch Patch45: cups-r10642.patch Patch46: cups-str4190.patch - Patch47: cups-str4223.patch Patch48: cups-str4125.patch Patch49: cups-str4140.patch Patch50: cups-str4187.patch Patch51: cups-str4205.patch +Patch52: cups-stringpool-setprinterattr.patch Patch100: cups-lspp.patch @@ -346,6 +346,8 @@ Sends IPP requests to the specified URI and tests and/or displays the results. %patch50 -p1 -b .str4187 # Don't set auth-info-required all of the time (STR #4205) %patch51 -p1 -b .str4205 +# Prevent stringpool damage leading to memory leaks (bug #974048). +%patch52 -p1 -b .stringpool-setprinterattr %if %lspp # LSPP support. @@ -763,6 +765,9 @@ rm -f %{cups_serverbin}/backend/smb %{_mandir}/man5/ipptoolfile.5.gz %changelog +* Thu Jun 13 2013 Tim Waugh 1:1.5.4-28 +- Prevent stringpool damage leading to memory leaks (bug #974048). + * Tue Apr 23 2013 Tim Waugh 1:1.5.4-27 - dnssd backend: don't crash if avahi gives a callback with no TXT record (bug #927040).