diff -u cups-1.4.6/debian/changelog cups-1.4.6/debian/changelog --- cups-1.4.6/debian/changelog +++ cups-1.4.6/debian/changelog @@ -1,3 +1,28 @@ +cups (1.4.6-5ubuntu1.2) natty-proposed; urgency=low + + * debian/patches/cups-avahi.dpatch: Updated Avahi patch so that it does + not generate too long service names which Avahi does not accept. Printers + did not get advertized via DNS-SD then. (LP: #793265). + * debian/patches/cups-avahi.dpatch: Updated Avahi patch to add the text + field entry "URF=none" and the service subtype "_universal" so that + mDNS/Bonjour-advertized printers are recognized by AirPrint clients + (iPhone/iPad with iOS 4.2 or newer). (LP: #711779). + * debian/patches/cups-avahi.dpatch: In contrary to the libdns_sd API the + Avahi API requires port numbers in host order and not in network order. + This made the Avahi-based DNS-SD broadcasting of CUPS advertizing wronmg + port numbers. Updated the Avahi patch to fix it. Thanks to Tim Waugh + from Red Hat on confirming this (LP: #792309). + * debian/local/filters/pdf-filters/pdftopdf/P2PResources.cxx: Fixed + memory leak in pdftopdf filter which made the filter taking up several + gigabytes when processing certain PDF files. Thanks to upstream + author Koji Otani for the quick fix (LP: #790378). + * debian/local/pstopdf.convs, debian/local/pstopdf.types: Do not apply + the PDF printing workflow to PostScript input coming from the Adobe + Reader. If this PostScript comes from an encrypted (DRM) PDF, it cannot + be converted to PDF again by Ghostscript (LP: #782309). + + -- Till Kamppeter Mon, 5 Jun 2011 13:51:59 +0200 + cups (1.4.6-5ubuntu1.1) natty-proposed; urgency=low * debian/filters/pstopdf: Let pstopdf determine the page size via diff -u cups-1.4.6/debian/patches/cups-avahi.dpatch cups-1.4.6/debian/patches/cups-avahi.dpatch --- cups-1.4.6/debian/patches/cups-avahi.dpatch +++ cups-1.4.6/debian/patches/cups-avahi.dpatch @@ -9,7 +9,7 @@ @DPATCH@ diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' cups-1.4.6~/backend/dnssd.c cups-1.4.6/backend/dnssd.c --- cups-1.4.6~/backend/dnssd.c 2009-08-08 00:27:12.000000000 +0200 -+++ cups-1.4.6/backend/dnssd.c 2011-04-18 17:52:20.610467085 +0200 ++++ cups-1.4.6/backend/dnssd.c 2011-06-06 12:27:49.578717416 +0200 @@ -15,14 +15,21 @@ * * Contents: @@ -835,7 +835,7 @@ */ diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' cups-1.4.6~/config-scripts/cups-dnssd.m4 cups-1.4.6/config-scripts/cups-dnssd.m4 --- cups-1.4.6~/config-scripts/cups-dnssd.m4 2009-08-29 00:54:34.000000000 +0200 -+++ cups-1.4.6/config-scripts/cups-dnssd.m4 2011-04-18 17:51:50.460490783 +0200 ++++ cups-1.4.6/config-scripts/cups-dnssd.m4 2011-06-06 12:27:49.578717416 +0200 @@ -27,6 +27,21 @@ DNSSDLIBS="" DNSSD_BACKEND="" @@ -860,7 +860,7 @@ case "$uname" in diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' cups-1.4.6~/config.h.in cups-1.4.6/config.h.in --- cups-1.4.6~/config.h.in 2010-08-13 06:11:46.000000000 +0200 -+++ cups-1.4.6/config.h.in 2011-04-18 17:51:50.460490783 +0200 ++++ cups-1.4.6/config.h.in 2011-06-06 12:27:49.578717416 +0200 @@ -344,6 +344,13 @@ @@ -877,7 +877,7 @@ diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' cups-1.4.6~/cups/http-support.c cups-1.4.6/cups/http-support.c --- cups-1.4.6~/cups/http-support.c 2010-10-02 00:40:38.000000000 +0200 -+++ cups-1.4.6/cups/http-support.c 2011-04-18 17:52:20.610467085 +0200 ++++ cups-1.4.6/cups/http-support.c 2011-06-06 12:27:49.578717416 +0200 @@ -41,6 +41,10 @@ * http_copy_decode() - Copy and decode a URI. * http_copy_encode() - Copy and encode a URI. @@ -1147,7 +1147,7 @@ */ diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' cups-1.4.6~/scheduler/Makefile cups-1.4.6/scheduler/Makefile --- cups-1.4.6~/scheduler/Makefile 2010-04-23 20:56:34.000000000 +0200 -+++ cups-1.4.6/scheduler/Makefile 2011-04-18 17:53:22.510418065 +0200 ++++ cups-1.4.6/scheduler/Makefile 2011-06-06 12:27:49.578717416 +0200 @@ -17,6 +17,7 @@ CUPSDOBJS = \ @@ -1168,7 +1168,7 @@ mime.o \ diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' cups-1.4.6~/scheduler/avahi.c cups-1.4.6/scheduler/avahi.c --- cups-1.4.6~/scheduler/avahi.c 1970-01-01 01:00:00.000000000 +0100 -+++ cups-1.4.6/scheduler/avahi.c 2011-04-18 17:53:32.960409731 +0200 ++++ cups-1.4.6/scheduler/avahi.c 2011-06-06 12:27:49.578717416 +0200 @@ -0,0 +1,445 @@ +/* + * "$Id$" @@ -1617,7 +1617,7 @@ + */ diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' cups-1.4.6~/scheduler/avahi.h cups-1.4.6/scheduler/avahi.h --- cups-1.4.6~/scheduler/avahi.h 1970-01-01 01:00:00.000000000 +0100 -+++ cups-1.4.6/scheduler/avahi.h 2011-04-18 17:53:22.510418065 +0200 ++++ cups-1.4.6/scheduler/avahi.h 2011-06-06 12:27:49.578717416 +0200 @@ -0,0 +1,49 @@ +/* + * "$Id$" @@ -1670,7 +1670,7 @@ + */ diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' cups-1.4.6~/scheduler/cupsd.h cups-1.4.6/scheduler/cupsd.h --- cups-1.4.6~/scheduler/cupsd.h 2010-09-22 00:34:57.000000000 +0200 -+++ cups-1.4.6/scheduler/cupsd.h 2011-04-18 17:52:51.360442785 +0200 ++++ cups-1.4.6/scheduler/cupsd.h 2011-06-06 12:27:49.578717416 +0200 @@ -147,6 +147,15 @@ typedef void (*cupsd_selfunc_t)(void *data); @@ -1718,7 +1718,7 @@ diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' cups-1.4.6~/scheduler/dirsvc.c cups-1.4.6/scheduler/dirsvc.c --- cups-1.4.6~/scheduler/dirsvc.c 2010-04-23 20:56:34.000000000 +0200 -+++ cups-1.4.6/scheduler/dirsvc.c 2011-04-18 18:28:24.748310979 +0200 ++++ cups-1.4.6/scheduler/dirsvc.c 2011-06-06 12:28:12.688705346 +0200 @@ -27,6 +27,7 @@ * ldap_connect() - Start new LDAP connection * ldap_reconnect() - Reconnect to LDAP Server @@ -1727,9 +1727,13 @@ * cupsdStartBrowsing() - Start sending and receiving broadcast * information. * cupsdStartPolling() - Start polling servers as needed. -@@ -99,6 +100,13 @@ +@@ -97,7 +98,16 @@ + # endif /* HAVE_SYSTEMCONFIGURATION */ + # endif /* __APPLE__ */ #endif /* HAVE_DNSSD */ - ++#ifdef HAVE_AVAHI ++# include ++#endif /* HAVE_AVAHI */ +#ifdef HAVE_DNSSD +typedef char *cupsd_txt_record_t; @@ -1737,11 +1741,10 @@ +#ifdef HAVE_AVAHI +typedef AvahiStringList *cupsd_txt_record_t; +#endif /* HAVE_AVAHI */ -+ + /* * Local functions... - */ -@@ -159,15 +167,20 @@ +@@ -159,15 +169,20 @@ static void update_smb(int onoff); @@ -1766,7 +1769,7 @@ static char *dnssdPackTxtRecord(int *txt_len, char *keyvalue[][2], int count); static void dnssdRegisterCallback(DNSServiceRef sdRef, -@@ -175,11 +188,20 @@ +@@ -175,11 +190,20 @@ DNSServiceErrorType errorCode, const char *name, const char *regtype, const char *domain, void *context); @@ -1789,7 +1792,7 @@ #ifdef HAVE_LDAP static const char * const ldap_attrs[] =/* CUPS LDAP attributes */ { -@@ -283,10 +305,10 @@ +@@ -283,10 +307,10 @@ ldap_dereg_printer(p); #endif /* HAVE_LDAP */ @@ -1803,7 +1806,7 @@ } -@@ -694,10 +716,10 @@ +@@ -694,10 +718,10 @@ slpRegisterPrinter(p); */ #endif /* HAVE_LIBSLP */ @@ -1817,7 +1820,7 @@ } -@@ -1411,6 +1433,23 @@ +@@ -1411,6 +1435,23 @@ } #endif /* HAVE_LDAP */ @@ -1841,7 +1844,7 @@ /* * 'cupsdStartBrowsing()' - Start sending and receiving broadcast information. -@@ -1535,13 +1574,16 @@ +@@ -1535,13 +1576,16 @@ else BrowseSocket = -1; @@ -1859,7 +1862,7 @@ /* * First create a "master" connection for all registrations... */ -@@ -1566,6 +1608,7 @@ +@@ -1566,6 +1610,7 @@ fcntl(fd, F_SETFD, fcntl(fd, F_GETFD) | FD_CLOEXEC); cupsdAddSelect(fd, (cupsd_selfunc_t)dnssdUpdate, NULL, NULL); @@ -1867,7 +1870,7 @@ /* * Then get the port we use for registrations. If we are not listening -@@ -1607,9 +1650,16 @@ +@@ -1607,9 +1652,16 @@ */ cupsdUpdateDNSSDName(); @@ -1885,7 +1888,7 @@ #ifdef HAVE_LIBSLP if ((BrowseLocalProtocols | BrowseRemoteProtocols) & BROWSE_SLP) -@@ -1835,10 +1885,10 @@ +@@ -1835,10 +1887,10 @@ BrowseSocket = -1; } @@ -1899,7 +1902,7 @@ #ifdef HAVE_LIBSLP if (((BrowseLocalProtocols | BrowseRemoteProtocols) & BROWSE_SLP) && -@@ -1903,7 +1953,7 @@ +@@ -1903,7 +1955,7 @@ } @@ -1908,7 +1911,7 @@ /* * 'cupsdUpdateDNSSDName()' - Update the computer name we use for browsing... */ -@@ -1911,7 +1961,12 @@ +@@ -1911,7 +1963,12 @@ void cupsdUpdateDNSSDName(void) { @@ -1921,7 +1924,7 @@ char webif[1024]; /* Web interface share name */ #ifdef HAVE_COREFOUNDATION_H SCDynamicStoreRef sc; /* Context for dynamic store */ -@@ -2043,6 +2098,7 @@ +@@ -2043,6 +2100,7 @@ else strlcpy(webif, "CUPS Web Interface", sizeof(webif)); @@ -1929,7 +1932,7 @@ if (WebIFRef) DNSServiceRefDeallocate(WebIFRef); -@@ -2055,6 +2111,42 @@ +@@ -2055,6 +2113,42 @@ NULL)) != kDNSServiceErr_NoError) cupsdLogMessage(CUPSD_LOG_ERROR, "DNS-SD web interface registration failed: %d", error); @@ -1959,7 +1962,7 @@ + "_http._tcp", /* type */ + NULL, /* domain */ + NULL, /* host */ -+ htons(DNSSDPort), /* port */ ++ DNSSDPort, /* port */ + "path=/", NULL); + if (ret == 0) + ret = avahi_entry_group_commit (AvahiWebIFGroup); @@ -1972,7 +1975,7 @@ } } #endif /* HAVE_DNSSD */ -@@ -2300,162 +2392,7 @@ +@@ -2300,162 +2394,7 @@ } @@ -2136,7 +2139,7 @@ /* * 'dnssdComparePrinters()' - Compare the registered names of two printers. */ -@@ -2464,7 +2401,16 @@ +@@ -2464,7 +2403,16 @@ dnssdComparePrinters(cupsd_printer_t *a,/* I - First printer */ cupsd_printer_t *b)/* I - Second printer */ { @@ -2154,7 +2157,7 @@ } -@@ -2479,6 +2425,10 @@ +@@ -2479,6 +2427,10 @@ { cupsdLogMessage(CUPSD_LOG_DEBUG2, "dnssdDeregisterPrinter(%s)", p->name); @@ -2165,7 +2168,7 @@ /* * Closing the socket deregisters the service */ -@@ -2514,6 +2464,23 @@ +@@ -2514,6 +2466,23 @@ free(p->printer_txt); p->printer_txt = NULL; } @@ -2189,7 +2192,7 @@ /* * Remove the printer from the array of DNS-SD printers, then clear the -@@ -2526,110 +2493,6 @@ +@@ -2526,110 +2495,6 @@ /* @@ -2300,7 +2303,7 @@ * 'dnssdRegisterPrinter()' - Start sending broadcast information for a printer * or update the broadcast contents. */ -@@ -2637,19 +2500,36 @@ +@@ -2637,19 +2502,37 @@ static void dnssdRegisterPrinter(cupsd_printer_t *p)/* I - Printer */ { @@ -2320,6 +2323,7 @@ +#endif /* HAVE_AVAHI */ + char name[1024]; /* Service name */ const char *regtype; /* Registration type */ ++ char regsubtype[64]; /* Registration subtype */ +#ifdef HAVE_DNSSD @@ -2338,7 +2342,64 @@ /* * If per-printer sharing was just disabled make sure we're not * registered before returning. -@@ -2694,6 +2574,7 @@ +@@ -2668,14 +2551,53 @@ + if (p->info && strlen(p->info) > 0) + { + if (DNSSDComputerName) ++ { ++#ifdef HAVE_DNSSD + snprintf(name, sizeof(name), "%s @ %s", p->info, DNSSDComputerName); ++#endif /* HAVE_DNSSD */ ++#ifdef HAVE_AVAHI ++ strlcpy(name, p->info, AVAHI_LABEL_MAX); ++ snprintf(name + ++ (AVAHI_LABEL_MAX - 4 - strlen(DNSSDComputerName) <= ++ strlen(p->info) ++ ? AVAHI_LABEL_MAX - 4 - strlen(DNSSDComputerName) ++ : strlen(p->info)), ++ AVAHI_LABEL_MAX, " @ %s", DNSSDComputerName); ++#endif /* HAVE_AVAHI */ ++ } + else ++ { + strlcpy(name, p->info, sizeof(name)); ++#ifdef HAVE_AVAHI ++ name[AVAHI_LABEL_MAX - 1] = 0; ++#endif /* HAVE_AVAHI */ ++ } + } +- else if (DNSSDComputerName) +- snprintf(name, sizeof(name), "%s @ %s", p->name, DNSSDComputerName); + else +- strlcpy(name, p->name, sizeof(name)); ++ { ++ if (DNSSDComputerName) ++ { ++#ifdef HAVE_DNSSD ++ snprintf(name, sizeof(name), "%s @ %s", p->name, DNSSDComputerName); ++#endif /* HAVE_DNSSD */ ++#ifdef HAVE_AVAHI ++ strlcpy(name, p->name, AVAHI_LABEL_MAX); ++ snprintf(name + ++ (AVAHI_LABEL_MAX - 4 - strlen(DNSSDComputerName) <= ++ strlen(p->name) ++ ? AVAHI_LABEL_MAX - 4 - strlen(DNSSDComputerName) ++ : strlen(p->name)), ++ AVAHI_LABEL_MAX, " @ %s", DNSSDComputerName); ++#endif /* HAVE_AVAHI */ ++ } ++ else ++ { ++ strlcpy(name, p->name, sizeof(name)); ++#ifdef HAVE_AVAHI ++ name[AVAHI_LABEL_MAX - 1] = 0; ++#endif /* HAVE_AVAHI */ ++ } ++ } + + /* + * If an existing printer was renamed, unregister it and start over... +@@ -2694,6 +2616,7 @@ * Register IPP and (optionally) LPD... */ @@ -2346,7 +2407,7 @@ ipp_len = 0; /* anti-compiler-warning-code */ ipp_txt = dnssdBuildTxtRecord(&ipp_len, p, 0); -@@ -2860,6 +2741,146 @@ +@@ -2860,6 +2783,157 @@ if (printer_txt) free(printer_txt); } @@ -2361,6 +2422,7 @@ + ipp_txt = dnssdBuildTxtRecord(NULL, p, 0); + printer_txt = dnssdBuildTxtRecord(NULL, p, 1); + regtype = (p->type & CUPS_PRINTER_FAX) ? "_fax-ipp._tcp" : "_ipp._tcp"; ++ snprintf(regsubtype, sizeof(regsubtype), "_universal._sub.%s", regtype); + + if (p->avahi_group && p->ipp_txt && ipp_txt && + !avahi_string_list_equal (p->ipp_txt, ipp_txt)) @@ -2437,7 +2499,7 @@ + AVAHI_IF_UNSPEC, + AVAHI_PROTO_UNSPEC, + 0, name, regtype, NULL, NULL, -+ htons(DNSSDPort), ++ DNSSDPort, + ipp_txt); + if (ret < 0) + goto add_failed; @@ -2456,7 +2518,7 @@ + AVAHI_PROTO_UNSPEC, + 0, name, + "_printer._tcp", NULL, NULL, -+ htons(515), ++ 515, + printer_txt); + if (ret < 0) + goto add_failed; @@ -2465,6 +2527,16 @@ + printer_txt = NULL; + } + ++ ++ ret = avahi_entry_group_add_service_subtype(p->avahi_group, ++ AVAHI_IF_UNSPEC, ++ AVAHI_PROTO_UNSPEC, ++ 0, name, ++ regtype, NULL, ++ regsubtype); ++ if (ret < 0) ++ goto add_failed; ++ + ret = avahi_entry_group_commit (p->avahi_group); + + if (ret < 0) @@ -2493,7 +2565,7 @@ } -@@ -2872,6 +2893,10 @@ +@@ -2872,6 +2946,10 @@ { cupsd_printer_t *p; /* Current printer */ @@ -2504,7 +2576,7 @@ /* * De-register the individual printers -@@ -2882,6 +2907,7 @@ +@@ -2882,6 +2960,7 @@ p = (cupsd_printer_t *)cupsArrayNext(Printers)) dnssdDeregisterPrinter(p); @@ -2512,7 +2584,7 @@ /* * Shutdown the rest of the service refs... */ -@@ -2902,6 +2928,7 @@ +@@ -2902,6 +2981,7 @@ DNSServiceRefDeallocate(DNSSDRef); DNSSDRef = NULL; @@ -2520,7 +2592,7 @@ cupsArrayDelete(DNSSDPrinters); DNSSDPrinters = NULL; -@@ -2911,6 +2938,275 @@ +@@ -2911,6 +2991,278 @@ /* @@ -2629,6 +2701,9 @@ + keyvalue[i ][0] = "pdl"; + keyvalue[i++][1] = p->pdl ? p->pdl : "application/postscript"; + ++ keyvalue[i ][0] = "URF"; ++ keyvalue[i++][1] = "none"; ++ + if (get_auth_info_required(p, air_str, sizeof(air_str))) + { + keyvalue[i ][0] = "air"; @@ -2796,7 +2871,7 @@ * 'dnssdUpdate()' - Handle DNS-SD queries. */ -@@ -2931,6 +3227,146 @@ +@@ -2931,6 +3283,146 @@ #endif /* HAVE_DNSSD */ @@ -2945,7 +3020,7 @@ */ diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' cups-1.4.6~/scheduler/dirsvc.h cups-1.4.6/scheduler/dirsvc.h --- cups-1.4.6~/scheduler/dirsvc.h 2009-05-14 19:54:37.000000000 +0200 -+++ cups-1.4.6/scheduler/dirsvc.h 2011-04-18 18:28:14.428322284 +0200 ++++ cups-1.4.6/scheduler/dirsvc.h 2011-06-06 12:27:49.578717416 +0200 @@ -32,6 +32,10 @@ # endif /* HAVE_LDAP_SSL_H */ #endif /* HAVE_LDAP */ @@ -3019,9 +3094,9 @@ extern void cupsdUpdateLDAPBrowse(void); #endif /* HAVE_LDAP */ diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' cups-1.4.6~/scheduler/main.c cups-1.4.6/scheduler/main.c ---- cups-1.4.6~/scheduler/main.c 2010-09-22 00:34:57.000000000 +0200 -+++ cups-1.4.6/scheduler/main.c 2011-04-18 17:53:41.600402839 +0200 -@@ -135,6 +135,10 @@ +--- cups-1.4.6~/scheduler/main.c 2011-06-06 12:27:49.358717527 +0200 ++++ cups-1.4.6/scheduler/main.c 2011-06-06 12:27:49.578717416 +0200 +@@ -137,6 +137,10 @@ cupsd_listener_t *lis; /* Current listener */ time_t current_time, /* Current time */ activity, /* Client activity timer */ @@ -3032,7 +3107,7 @@ browse_time, /* Next browse send time */ senddoc_time, /* Send-Document time */ expire_time, /* Subscription expire time */ -@@ -161,6 +165,10 @@ +@@ -163,6 +167,10 @@ int launchd_idle_exit; /* Idle exit on select timeout? */ #endif /* HAVE_LAUNCHD */ @@ -3043,7 +3118,7 @@ #ifdef HAVE_GETEUID -@@ -551,6 +559,14 @@ +@@ -553,6 +561,14 @@ httpInitialize(); @@ -3058,7 +3133,7 @@ cupsdStartServer(); /* -@@ -676,6 +692,9 @@ +@@ -683,6 +699,9 @@ */ current_time = time(NULL); @@ -3068,7 +3143,7 @@ browse_time = current_time; event_time = current_time; expire_time = current_time; -@@ -890,6 +909,26 @@ +@@ -897,6 +916,26 @@ } #endif /* __APPLE__ */ @@ -3095,7 +3170,7 @@ #ifndef __APPLE__ /* * Update the network interfaces once a minute... -@@ -1915,6 +1954,10 @@ +@@ -1953,6 +1992,10 @@ cupsd_job_t *job; /* Job information */ cupsd_subscription_t *sub; /* Subscription information */ const char *why; /* Debugging aid */ @@ -3106,7 +3181,7 @@ /* -@@ -1957,6 +2000,19 @@ +@@ -1995,6 +2038,19 @@ } #endif /* __APPLE__ */ @@ -3128,7 +3203,7 @@ */ diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' cups-1.4.6~/scheduler/printers.c cups-1.4.6/scheduler/printers.c --- cups-1.4.6~/scheduler/printers.c 2010-09-22 20:35:07.000000000 +0200 -+++ cups-1.4.6/scheduler/printers.c 2011-04-18 17:53:41.600402839 +0200 ++++ cups-1.4.6/scheduler/printers.c 2011-06-06 12:27:49.578717416 +0200 @@ -928,10 +928,10 @@ cupsdClearString(&p->alert); cupsdClearString(&p->alert_description); @@ -3199,7 +3274,7 @@ p->type |= CUPS_PRINTER_REMOTE; diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' cups-1.4.6~/scheduler/printers.h cups-1.4.6/scheduler/printers.h --- cups-1.4.6~/scheduler/printers.h 2010-03-31 00:07:33.000000000 +0200 -+++ cups-1.4.6/scheduler/printers.h 2011-04-18 17:53:41.600402839 +0200 ++++ cups-1.4.6/scheduler/printers.h 2011-06-06 12:27:49.578717416 +0200 @@ -16,6 +16,9 @@ #ifdef HAVE_DNSSD # include @@ -3241,7 +3316,7 @@ diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' cups-1.4.6~/scheduler/timeout.c cups-1.4.6/scheduler/timeout.c --- cups-1.4.6~/scheduler/timeout.c 1970-01-01 01:00:00.000000000 +0100 -+++ cups-1.4.6/scheduler/timeout.c 2011-04-18 17:52:51.360442785 +0200 ++++ cups-1.4.6/scheduler/timeout.c 2011-06-06 12:27:49.578717416 +0200 @@ -0,0 +1,195 @@ +/* + * "$Id$" diff -u cups-1.4.6/debian/local/pstopdf.convs cups-1.4.6/debian/local/pstopdf.convs --- cups-1.4.6/debian/local/pstopdf.convs +++ cups-1.4.6/debian/local/pstopdf.convs @@ -1 +1,12 @@ +# Copyright (c) 2011, Till Kamppeter +# +# CUPS file conversion rules for PostScript input when we are working with +# the PDF printing workflow. General PostScript input should be converted to +# PDF, so that pdftopdf is doing the page management on PDF data and the +# renderer/driver part renders PDF. An exception is made for PostScript +# coming from the Adobe Reader. As this PostScript cannot be converted to PDF +# if it comes from an encrypted PDF file, we simply override pstopdf and the +# and the PDF workflow. + application/postscript application/pdf 22 pstopdf +application/vnd.adobe-reader-postscript application/vnd.cups-postscript 66 pstops diff -u cups-1.4.6/debian/local/filters/pdf-filters/pdftopdf/P2PResources.cxx cups-1.4.6/debian/local/filters/pdf-filters/pdftopdf/P2PResources.cxx --- cups-1.4.6/debian/local/filters/pdf-filters/pdftopdf/P2PResources.cxx +++ cups-1.4.6/debian/local/filters/pdf-filters/pdftopdf/P2PResources.cxx @@ -179,13 +179,24 @@ P2PForm *form; xobjDict->getVal(i,&xobj); - if (!xobj.isStream()) continue; + if (!xobj.isStream()) { + xobj.free(); + continue; + } strDict = xobj.streamGetDict(); strDict->lookupNF("Subtype",&obj); - if (!obj.isName() || strcmp("Form",obj.getName()) != 0) continue; + if (!obj.isName() || strcmp("Form",obj.getName()) != 0) { + obj.free(); + xobj.free(); + continue; + } obj.free(); strDict->lookupNF("Resources",&obj); - if (!obj.isNull()) continue; + if (!obj.isNull()) { + obj.free(); + xobj.free(); + continue; + } /* found a Form without Resource, replace it with a refrence to a P2PForm */ form = new P2PForm(&xobj,this,map); only in patch2: unchanged: --- cups-1.4.6.orig/debian/local/pstopdf.types +++ cups-1.4.6/debian/local/pstopdf.types @@ -0,0 +1,17 @@ +# Copyright (c) 2011, Till Kamppeter +# +# CUPS file detection rule for PostScript which is generated by the Adobe +# Reader. We distinguish PostScript from the Adobe reader here so that we +# can override pstopdf and the PDF workflow for these PostScript files as the +# conversion of them to PDF does not work if the original PDF file was +# encrypted. + +application/vnd.adobe-reader-postscript priority(150) contains(0,4096,"%%Creator: Adobe Acrobat") + \ + (ai eps ps string(0,%!) string(0,<04>%!) \ + contains(0,128,<1B>%-12345X) + \ + (contains(0,4096,"LANGUAGE=POSTSCRIPT") \ + contains(0,4096,"LANGUAGE = Postscript") \ + contains(0,4096,"LANGUAGE = PostScript") \ + contains(0,4096,"LANGUAGE = POSTSCRIPT") \ + (contains(0,4096,<0a>%!) + \ + !contains(0,4096,"ENTER LANGUAGE"))))