diff options
author | Didier Raboud <odyx@debian.org> | 2014-04-10 21:44:04 +0200 |
---|---|---|
committer | Didier Raboud <odyx@debian.org> | 2014-04-10 21:51:38 +0200 |
commit | aa3da013981b24b15f4e3a248ef5ae89a019c793 (patch) | |
tree | 998a954fabc94022fc8a92cc6d1ed4a662d682ae | |
parent | bbee7faeb6699581c36bb8c013850cfd1e6fd3c5 (diff) | |
download | cups-aa3da013981b24b15f4e3a248ef5ae89a019c793.tar.gz |
Drop 10 backported or now solved differently from upstream:
- str4393-fix-memoryleak-in-rastertolabel
- fix-cupsdgetprivateattrs-function-missing-null-check
- fix-cupsenumdests-does-not-fill-in-is_default-field
- cupsenumdests-does-not-set-cb
- cupsd-support-avahi-daemon-restarting
- prevent-dnssd-backend-exiting-too-early
- fix-a-dbus-threading-issue-that-caused-the-scheduler-to-crash
- ipptool-doco-updates
- build-with-full-relro
- fix-template.c-typo
Git-Dch: Full
11 files changed, 1 insertions, 1343 deletions
diff --git a/debian/patches/build-with-full-relro.patch b/debian/patches/build-with-full-relro.patch deleted file mode 100644 index ff5fa1e8..00000000 --- a/debian/patches/build-with-full-relro.patch +++ /dev/null @@ -1,16 +0,0 @@ -Description: Build with full read-only relocations -Bug-RedHat: https://bugzilla.redhat.com/show_bug.cgi?id=996740 -Bug: https://cups.org/str.php?L4349 -Author: Tim Waugh <twaugh@redhat.com> -Last-Update: 2013-08-15 ---- a/config-scripts/cups-compiler.m4 -+++ b/config-scripts/cups-compiler.m4 -@@ -185,7 +185,7 @@ - # The -z relro option is provided by the Linux linker command to - # make relocatable data read-only. - if test x$enable_relro = xyes; then -- RELROFLAGS="-Wl,-z,relro" -+ RELROFLAGS="-Wl,-z,relro,-z,now" - fi - ;; - esac diff --git a/debian/patches/cupsd-support-avahi-daemon-restarting.patch b/debian/patches/cupsd-support-avahi-daemon-restarting.patch deleted file mode 100644 index 18356948..00000000 --- a/debian/patches/cupsd-support-avahi-daemon-restarting.patch +++ /dev/null @@ -1,907 +0,0 @@ -Description: Let cupsd cope with avahi daemon server restarts -Author: Michael Sweet <msweet@apple.com> -Bug: https://cups.org/str.php?L4373 -Last-Update: 2014-03-06 ---- a/scheduler/dirsvc.c -+++ b/scheduler/dirsvc.c -@@ -58,6 +58,15 @@ - - - /* -+ * Local globals... -+ */ -+ -+#ifdef HAVE_AVAHI -+static int avahi_running = 0; -+#endif /* HAVE_AVAHI */ -+ -+ -+/* - * Local functions... - */ - -@@ -78,11 +87,15 @@ - void *context); - # endif /* __APPLE__ */ - static cupsd_txt_t dnssdBuildTxtRecord(cupsd_printer_t *p, int for_lpd); --static void dnssdDeregisterInstance(cupsd_srv_t *srv); --static void dnssdDeregisterPrinter(cupsd_printer_t *p, -- int clear_name); -+# ifdef HAVE_AVAHI -+static void dnssdClientCallback(AvahiClient *c, AvahiClientState state, void *userdata); -+# endif /* HAVE_AVAHI */ -+static void dnssdDeregisterAllPrinters(int from_callback); -+static void dnssdDeregisterInstance(cupsd_srv_t *srv, int from_callback); -+static void dnssdDeregisterPrinter(cupsd_printer_t *p, int clear_name, int from_callback); - static const char *dnssdErrorString(int error); - static void dnssdFreeTxtRecord(cupsd_txt_t *txt); -+static void dnssdRegisterAllPrinters(int from_callback); - # ifdef HAVE_DNSSD - static void dnssdRegisterCallback(DNSServiceRef sdRef, - DNSServiceFlags flags, -@@ -96,16 +109,13 @@ - AvahiEntryGroupState state, - void *context); - # endif /* HAVE_DNSSD */ --static int dnssdRegisterInstance(cupsd_srv_t *srv, -- cupsd_printer_t *p, -- char *name, const char *type, -- const char *subtypes, int port, -- cupsd_txt_t *txt, int commit); --static void dnssdRegisterPrinter(cupsd_printer_t *p); -+static int dnssdRegisterInstance(cupsd_srv_t *srv, cupsd_printer_t *p, char *name, const char *type, const char *subtypes, int port, cupsd_txt_t *txt, int commit, int from_callback); -+static void dnssdRegisterPrinter(cupsd_printer_t *p, int from_callback); - static void dnssdStop(void); - # ifdef HAVE_DNSSD - static void dnssdUpdate(void); - # endif /* HAVE_DNSSD */ -+static void dnssdUpdateDNSSDName(int from_callback); - #endif /* HAVE_DNSSD || HAVE_AVAHI */ - - -@@ -138,7 +148,7 @@ - - #if defined(HAVE_DNSSD) || defined(HAVE_AVAHI) - if (removeit && (BrowseLocalProtocols & BROWSE_DNSSD) && DNSSDMaster) -- dnssdDeregisterPrinter(p, 1); -+ dnssdDeregisterPrinter(p, 1, 0); - #endif /* HAVE_DNSSD || HAVE_AVAHI */ - } - -@@ -160,7 +170,7 @@ - - #if defined(HAVE_DNSSD) || defined(HAVE_AVAHI) - if ((BrowseLocalProtocols & BROWSE_DNSSD) && DNSSDMaster) -- dnssdRegisterPrinter(p); -+ dnssdRegisterPrinter(p, 0); - #endif /* HAVE_DNSSD || HAVE_AVAHI */ - } - -@@ -172,16 +182,12 @@ - void - cupsdStartBrowsing(void) - { -- cupsd_printer_t *p; /* Current printer */ -- -- - if (!Browsing || !BrowseLocalProtocols) - return; - - #if defined(HAVE_DNSSD) || defined(HAVE_AVAHI) - if (BrowseLocalProtocols & BROWSE_DNSSD) - { -- cupsd_listener_t *lis; /* Current listening socket */ - # ifdef HAVE_DNSSD - DNSServiceErrorType error; /* Error from service creation */ - -@@ -211,6 +217,13 @@ - cupsdAddSelect(fd, (cupsd_selfunc_t)dnssdUpdate, NULL, NULL); - } - -+ /* -+ * Set the computer name and register the web interface... -+ */ -+ -+ DNSSDPort = 0; -+ cupsdUpdateDNSSDName(); -+ - # else /* HAVE_AVAHI */ - if ((DNSSDMaster = avahi_threaded_poll_new()) == NULL) - { -@@ -224,7 +237,7 @@ - int error; /* Error code, if any */ - - DNSSDClient = avahi_client_new(avahi_threaded_poll_get(DNSSDMaster), 0, -- NULL, NULL, &error); -+ dnssdClientCallback, NULL, &error); - - if (DNSSDClient == NULL) - { -@@ -242,31 +255,6 @@ - avahi_threaded_poll_start(DNSSDMaster); - } - # endif /* HAVE_DNSSD */ -- -- /* -- * Then get the port we use for registrations. If we are not listening -- * on any non-local ports, there is no sense sharing local printers via -- * Bonjour... -- */ -- -- DNSSDPort = 0; -- -- for (lis = (cupsd_listener_t *)cupsArrayFirst(Listeners); -- lis; -- lis = (cupsd_listener_t *)cupsArrayNext(Listeners)) -- { -- if (httpAddrLocalhost(&(lis->address))) -- continue; -- -- DNSSDPort = httpAddrPort(&(lis->address)); -- break; -- } -- -- /* -- * Set the computer name and register the web interface... -- */ -- -- cupsdUpdateDNSSDName(); - } - #endif /* HAVE_DNSSD || HAVE_AVAHI */ - -@@ -284,11 +272,7 @@ - * Register the individual printers - */ - -- for (p = (cupsd_printer_t *)cupsArrayFirst(Printers); -- p; -- p = (cupsd_printer_t *)cupsArrayNext(Printers)) -- if (!(p->type & (CUPS_PRINTER_REMOTE | CUPS_PRINTER_SCANNER))) -- cupsdRegisterPrinter(p); -+ dnssdRegisterAllPrinters(0); - } - - -@@ -299,9 +283,6 @@ - void - cupsdStopBrowsing(void) - { -- cupsd_printer_t *p; /* Current printer */ -- -- - if (!Browsing || !BrowseLocalProtocols) - return; - -@@ -309,11 +290,7 @@ - * De-register the individual printers - */ - -- for (p = (cupsd_printer_t *)cupsArrayFirst(Printers); -- p; -- p = (cupsd_printer_t *)cupsArrayNext(Printers)) -- if (!(p->type & (CUPS_PRINTER_REMOTE | CUPS_PRINTER_SCANNER))) -- cupsdDeregisterPrinter(p, 1); -+ dnssdDeregisterAllPrinters(0); - - /* - * Shut down browsing sockets... -@@ -344,161 +321,7 @@ - void - cupsdUpdateDNSSDName(void) - { -- char webif[1024]; /* Web interface share name */ --# ifdef __APPLE__ -- SCDynamicStoreRef sc; /* Context for dynamic store */ -- CFDictionaryRef btmm; /* Back-to-My-Mac domains */ -- CFStringEncoding nameEncoding; /* Encoding of computer name */ -- CFStringRef nameRef; /* Host name CFString */ -- char nameBuffer[1024]; /* C-string buffer */ --# endif /* __APPLE__ */ -- -- -- /* -- * Only share the web interface and printers when non-local listening is -- * enabled... -- */ -- -- if (!DNSSDPort) -- return; -- -- /* -- * Get the computer name as a c-string... -- */ -- --# ifdef __APPLE__ -- sc = SCDynamicStoreCreate(kCFAllocatorDefault, CFSTR("cupsd"), NULL, NULL); -- -- if (sc) -- { -- /* -- * Get the computer name from the dynamic store... -- */ -- -- cupsdClearString(&DNSSDComputerName); -- -- if ((nameRef = SCDynamicStoreCopyComputerName(sc, &nameEncoding)) != NULL) -- { -- if (CFStringGetCString(nameRef, nameBuffer, sizeof(nameBuffer), -- kCFStringEncodingUTF8)) -- { -- cupsdLogMessage(CUPSD_LOG_DEBUG, -- "Dynamic store computer name is \"%s\".", nameBuffer); -- cupsdSetString(&DNSSDComputerName, nameBuffer); -- } -- -- CFRelease(nameRef); -- } -- -- if (!DNSSDComputerName) -- { -- /* -- * Use the ServerName instead... -- */ -- -- cupsdLogMessage(CUPSD_LOG_DEBUG, -- "Using ServerName \"%s\" as computer name.", ServerName); -- cupsdSetString(&DNSSDComputerName, ServerName); -- } -- -- /* -- * Get the local hostname from the dynamic store... -- */ -- -- cupsdClearString(&DNSSDHostName); -- -- if ((nameRef = SCDynamicStoreCopyLocalHostName(sc)) != NULL) -- { -- if (CFStringGetCString(nameRef, nameBuffer, sizeof(nameBuffer), -- kCFStringEncodingUTF8)) -- { -- cupsdLogMessage(CUPSD_LOG_DEBUG, -- "Dynamic store host name is \"%s\".", nameBuffer); -- cupsdSetString(&DNSSDHostName, nameBuffer); -- } -- -- CFRelease(nameRef); -- } -- -- if (!DNSSDHostName) -- { -- /* -- * Use the ServerName instead... -- */ -- -- cupsdLogMessage(CUPSD_LOG_DEBUG, -- "Using ServerName \"%s\" as host name.", ServerName); -- cupsdSetString(&DNSSDHostName, ServerName); -- } -- -- /* -- * Get any Back-to-My-Mac domains and add them as aliases... -- */ -- -- cupsdFreeAliases(DNSSDAlias); -- DNSSDAlias = NULL; -- -- btmm = SCDynamicStoreCopyValue(sc, CFSTR("Setup:/Network/BackToMyMac")); -- if (btmm && CFGetTypeID(btmm) == CFDictionaryGetTypeID()) -- { -- cupsdLogMessage(CUPSD_LOG_DEBUG, "%d Back to My Mac aliases to add.", -- (int)CFDictionaryGetCount(btmm)); -- CFDictionaryApplyFunction(btmm, dnssdAddAlias, NULL); -- } -- else if (btmm) -- cupsdLogMessage(CUPSD_LOG_ERROR, -- "Bad Back to My Mac data in dynamic store!"); -- else -- cupsdLogMessage(CUPSD_LOG_DEBUG, "No Back to My Mac aliases to add."); -- -- if (btmm) -- CFRelease(btmm); -- -- CFRelease(sc); -- } -- else --# endif /* __APPLE__ */ --# ifdef HAVE_AVAHI -- if (DNSSDClient) -- { -- const char *host_name = avahi_client_get_host_name(DNSSDClient); -- const char *host_fqdn = avahi_client_get_host_name_fqdn(DNSSDClient); -- -- cupsdSetString(&DNSSDComputerName, host_name ? host_name : ServerName); -- -- if (host_fqdn) -- cupsdSetString(&DNSSDHostName, host_fqdn); -- else if (strchr(ServerName, '.')) -- cupsdSetString(&DNSSDHostName, ServerName); -- else -- cupsdSetStringf(&DNSSDHostName, "%s.local", ServerName); -- } -- else --# endif /* HAVE_AVAHI */ -- { -- cupsdSetString(&DNSSDComputerName, ServerName); -- -- if (strchr(ServerName, '.')) -- cupsdSetString(&DNSSDHostName, ServerName); -- else -- cupsdSetStringf(&DNSSDHostName, "%s.local", ServerName); -- } -- -- /* -- * Then (re)register the web interface if enabled... -- */ -- -- if (BrowseWebIF) -- { -- if (DNSSDComputerName) -- snprintf(webif, sizeof(webif), "CUPS @ %s", DNSSDComputerName); -- else -- strlcpy(webif, "CUPS", sizeof(webif)); -- -- dnssdDeregisterInstance(&WebIFSrv); -- dnssdRegisterInstance(&WebIFSrv, NULL, webif, "_http._tcp", "_printer", -- DNSSDPort, NULL, 1); -- } -+ dnssdUpdateDNSSDName(0); - } - - -@@ -733,24 +556,158 @@ - } - - -+# ifdef HAVE_AVAHI -+/* -+ * 'dnssdClientCallback()' - Client callback for Avahi. -+ * -+ * Called whenever the client or server state changes... -+ */ -+ -+static void -+dnssdClientCallback( -+ AvahiClient *c, /* I - Client */ -+ AvahiClientState state, /* I - Current state */ -+ void *userdata) /* I - User data (unused) */ -+{ -+ int error; /* Error code, if any */ -+ -+ -+ (void)userdata; -+ -+ if (!c) -+ return; -+ -+ /* -+ * Make sure DNSSDClient is already set also if this callback function is -+ * already running before avahi_client_new() in dnssdStartBrowsing() -+ * finishes. -+ */ -+ -+ if (!DNSSDClient) -+ DNSSDClient = c; -+ -+ switch (state) -+ { -+ case AVAHI_CLIENT_S_REGISTERING: -+ case AVAHI_CLIENT_S_RUNNING: -+ case AVAHI_CLIENT_S_COLLISION: -+ cupsdLogMessage(CUPSD_LOG_DEBUG, "Avahi server connection now available, registering printers for Bonjour broadcasting."); -+ -+ /* -+ * Mark that Avahi server is running... -+ */ -+ -+ avahi_running = 1; -+ -+ /* -+ * Set the computer name and register the web interface... -+ */ -+ -+ DNSSDPort = 0; -+ dnssdUpdateDNSSDName(1); -+ -+ /* -+ * Register the individual printers -+ */ -+ -+ dnssdRegisterAllPrinters(1); -+ break; -+ -+ case AVAHI_CLIENT_FAILURE: -+ if (avahi_client_errno(c) == AVAHI_ERR_DISCONNECTED) -+ { -+ cupsdLogMessage(CUPSD_LOG_DEBUG, "Avahi server disappeared, unregistering printers for Bonjour broadcasting."); -+ -+ /* -+ * Unregister everything and close the client... -+ */ -+ -+ dnssdDeregisterAllPrinters(1); -+ dnssdDeregisterInstance(&WebIFSrv, 1); -+ avahi_client_free(DNSSDClient); -+ DNSSDClient = NULL; -+ -+ /* -+ * Mark that Avahi server is not running... -+ */ -+ -+ avahi_running = 0; -+ -+ /* -+ * Renew Avahi client... -+ */ -+ -+ DNSSDClient = avahi_client_new(avahi_threaded_poll_get(DNSSDMaster), AVAHI_CLIENT_NO_FAIL, dnssdClientCallback, NULL, &error); -+ -+ if (!DNSSDClient) -+ { -+ cupsdLogMessage(CUPSD_LOG_ERROR, "Unable to communicate with avahi-daemon: %s", dnssdErrorString(error)); -+ if (FatalErrors & CUPSD_FATAL_BROWSE) -+ cupsdEndProcess(getpid(), 0); -+ } -+ } -+ else -+ { -+ cupsdLogMessage(CUPSD_LOG_ERROR, "Communication with avahi-daemon has failed: %s", avahi_strerror(avahi_client_errno(c))); -+ if (FatalErrors & CUPSD_FATAL_BROWSE) -+ cupsdEndProcess(getpid(), 0); -+ } -+ break; -+ -+ default: -+ break; -+ } -+} -+# endif /* HAVE_AVAHI */ -+ -+ -+/* -+ * 'dnssdDeregisterAllPrinters()' - Deregister all printers. -+ */ -+ -+static void -+dnssdDeregisterAllPrinters( -+ int from_callback) /* I - Deregistering because of callback? */ -+{ -+ cupsd_printer_t *p; /* Current printer */ -+ -+ -+ if (!DNSSDMaster) -+ return; -+ -+ for (p = (cupsd_printer_t *)cupsArrayFirst(Printers); -+ p; -+ p = (cupsd_printer_t *)cupsArrayNext(Printers)) -+ if (!(p->type & (CUPS_PRINTER_REMOTE | CUPS_PRINTER_SCANNER))) -+ dnssdDeregisterPrinter(p, 1, from_callback); -+} -+ -+ - /* - * 'dnssdDeregisterInstance()' - Deregister a DNS-SD service instance. - */ - - static void - dnssdDeregisterInstance( -- cupsd_srv_t *srv) /* I - Service */ -+ cupsd_srv_t *srv, /* I - Service */ -+ int from_callback) /* I - Called from callback? */ - { - if (!srv || !*srv) - return; - - # ifdef HAVE_DNSSD -+ (void)from_callback; -+ - DNSServiceRefDeallocate(*srv); - - # else /* HAVE_AVAHI */ -- avahi_threaded_poll_lock(DNSSDMaster); -+ if (!from_callback) -+ avahi_threaded_poll_lock(DNSSDMaster); -+ - avahi_entry_group_free(*srv); -- avahi_threaded_poll_unlock(DNSSDMaster); -+ -+ if (!from_callback) -+ avahi_threaded_poll_unlock(DNSSDMaster); - # endif /* HAVE_DNSSD */ - - *srv = NULL; -@@ -764,7 +721,8 @@ - static void - dnssdDeregisterPrinter( - cupsd_printer_t *p, /* I - Printer */ -- int clear_name) /* I - Clear the name? */ -+ int clear_name, /* I - Clear the name? */ -+ int from_callback) /* I - Called from callback? */ - - { - cupsdLogMessage(CUPSD_LOG_DEBUG2, -@@ -773,13 +731,13 @@ - - if (p->ipp_srv) - { -- dnssdDeregisterInstance(&p->ipp_srv); -+ dnssdDeregisterInstance(&p->ipp_srv, from_callback); - - # ifdef HAVE_DNSSD - # ifdef HAVE_SSL -- dnssdDeregisterInstance(&p->ipps_srv); -+ dnssdDeregisterInstance(&p->ipps_srv, from_callback); - # endif /* HAVE_SSL */ -- dnssdDeregisterInstance(&p->printer_srv); -+ dnssdDeregisterInstance(&p->printer_srv, from_callback); - # endif /* HAVE_DNSSD */ - } - -@@ -931,6 +889,27 @@ - - - /* -+ * 'dnssdRegisterAllPrinters()' - Register all printers. -+ */ -+ -+static void -+dnssdRegisterAllPrinters(int from_callback) /* I - Called from callback? */ -+{ -+ cupsd_printer_t *p; /* Current printer */ -+ -+ -+ if (!DNSSDMaster) -+ return; -+ -+ for (p = (cupsd_printer_t *)cupsArrayFirst(Printers); -+ p; -+ p = (cupsd_printer_t *)cupsArrayNext(Printers)) -+ if (!(p->type & (CUPS_PRINTER_REMOTE | CUPS_PRINTER_SCANNER))) -+ dnssdRegisterPrinter(p, from_callback); -+} -+ -+ -+/* - * 'dnssdRegisterCallback()' - DNSServiceRegister callback. - */ - -@@ -1010,15 +989,19 @@ - const char *subtypes, /* I - Subtypes to register or NULL */ - int port, /* I - Port number or 0 */ - cupsd_txt_t *txt, /* I - TXT record */ -- int commit) /* I - Commit registration? */ -+ int commit, /* I - Commit registration? */ -+ int from_callback) /* I - Called from callback? */ - { - char temp[256], /* Temporary string */ - *ptr; /* Pointer into string */ - int error; /* Any error */ - - -- cupsdLogMessage(CUPSD_LOG_DEBUG, -- "Registering \"%s\" with DNS-SD type \"%s\".", name, type); -+# ifdef HAVE_DNSSD -+ (void)from_callback; -+# endif /* HAVE_DNSSD */ -+ -+ cupsdLogMessage(CUPSD_LOG_DEBUG, "Registering \"%s\" with DNS-SD type \"%s\".", name, type); - - if (p && !srv) - { -@@ -1045,13 +1028,15 @@ - (void)commit; - - # else /* HAVE_AVAHI */ -- avahi_threaded_poll_lock(DNSSDMaster); -+ if (!from_callback) -+ avahi_threaded_poll_lock(DNSSDMaster); - - if (!*srv) - *srv = avahi_entry_group_new(DNSSDClient, dnssdRegisterCallback, NULL); - if (!*srv) - { -- avahi_threaded_poll_unlock(DNSSDMaster); -+ if (!from_callback) -+ avahi_threaded_poll_unlock(DNSSDMaster); - - cupsdLogMessage(CUPSD_LOG_WARN, "DNS-SD registration of \"%s\" failed: %s", - name, dnssdErrorString(avahi_client_errno(DNSSDClient))); -@@ -1168,7 +1153,8 @@ - name); - } - -- avahi_threaded_poll_unlock(DNSSDMaster); -+ if (!from_callback) -+ avahi_threaded_poll_unlock(DNSSDMaster); - # endif /* HAVE_DNSSD */ - - if (error) -@@ -1190,7 +1176,9 @@ - */ - - static void --dnssdRegisterPrinter(cupsd_printer_t *p)/* I - Printer */ -+dnssdRegisterPrinter( -+ cupsd_printer_t *p, /* I - Printer */ -+ int from_callback) /* I - Called from callback? */ - { - char name[256]; /* Service name */ - int printer_port; /* LPD port number */ -@@ -1198,15 +1186,21 @@ - cupsd_txt_t ipp_txt, /* IPP(S) TXT record */ - printer_txt; /* LPD TXT record */ - -+ - cupsdLogMessage(CUPSD_LOG_DEBUG2, "dnssdRegisterPrinter(%s) %s", p->name, - !p->ipp_srv ? "new" : "update"); - -+# ifdef HAVE_AVAHI -+ if (!avahi_running) -+ return; -+# endif /* HAVE_AVAHI */ -+ - /* - * Remove the current registrations if we have them and then return if - * per-printer sharing was just disabled... - */ - -- dnssdDeregisterPrinter(p, 0); -+ dnssdDeregisterPrinter(p, 0, from_callback); - - if (!p->shared) - return; -@@ -1249,13 +1243,11 @@ - else - printer_port = 0; - -- status = dnssdRegisterInstance(NULL, p, name, "_printer._tcp", NULL, -- printer_port, &printer_txt, 0); -+ status = dnssdRegisterInstance(NULL, p, name, "_printer._tcp", NULL, printer_port, &printer_txt, 0, from_callback); - - # ifdef HAVE_SSL - if (status) -- dnssdRegisterInstance(NULL, p, name, "_ipps._tcp", DNSSDSubTypes, -- DNSSDPort, &ipp_txt, 0); -+ dnssdRegisterInstance(NULL, p, name, "_ipps._tcp", DNSSDSubTypes, DNSSDPort, &ipp_txt, 0, from_callback); - # endif /* HAVE_SSL */ - - if (status) -@@ -1265,11 +1257,9 @@ - */ - - if (p->type & CUPS_PRINTER_FAX) -- status = dnssdRegisterInstance(NULL, p, name, "_fax-ipp._tcp", -- DNSSDSubTypes, DNSSDPort, &ipp_txt, 1); -+ status = dnssdRegisterInstance(NULL, p, name, "_fax-ipp._tcp", DNSSDSubTypes, DNSSDPort, &ipp_txt, 1, from_callback); - else -- status = dnssdRegisterInstance(NULL, p, name, "_ipp._tcp", DNSSDSubTypes, -- DNSSDPort, &ipp_txt, 1); -+ status = dnssdRegisterInstance(NULL, p, name, "_ipp._tcp", DNSSDSubTypes, DNSSDPort, &ipp_txt, 1, from_callback); - } - - dnssdFreeTxtRecord(&ipp_txt); -@@ -1291,13 +1281,13 @@ - * Registration failed for this printer... - */ - -- dnssdDeregisterInstance(&p->ipp_srv); -+ dnssdDeregisterInstance(&p->ipp_srv, from_callback); - - # ifdef HAVE_DNSSD - # ifdef HAVE_SSL -- dnssdDeregisterInstance(&p->ipps_srv); -+ dnssdDeregisterInstance(&p->ipps_srv, from_callback); - # endif /* HAVE_SSL */ -- dnssdDeregisterInstance(&p->printer_srv); -+ dnssdDeregisterInstance(&p->printer_srv, from_callback); - # endif /* HAVE_DNSSD */ - } - } -@@ -1320,13 +1310,13 @@ - for (p = (cupsd_printer_t *)cupsArrayFirst(Printers); - p; - p = (cupsd_printer_t *)cupsArrayNext(Printers)) -- dnssdDeregisterPrinter(p, 1); -+ dnssdDeregisterPrinter(p, 1, 0); - - /* - * Shutdown the rest of the service refs... - */ - -- dnssdDeregisterInstance(&WebIFSrv); -+ dnssdDeregisterInstance(&WebIFSrv, 0); - - # ifdef HAVE_DNSSD - cupsdRemoveSelect(DNSServiceRefSockFD(DNSSDMaster)); -@@ -1374,6 +1364,191 @@ - - - /* -+ * 'dnssdUpdateDNSSDName()' - Update the listen port, computer name, and web interface registration. -+ */ -+ -+static void -+dnssdUpdateDNSSDName(int from_callback) /* I - Called from callback? */ -+{ -+ char webif[1024]; /* Web interface share name */ -+# ifdef __APPLE__ -+ SCDynamicStoreRef sc; /* Context for dynamic store */ -+ CFDictionaryRef btmm; /* Back-to-My-Mac domains */ -+ CFStringEncoding nameEncoding; /* Encoding of computer name */ -+ CFStringRef nameRef; /* Host name CFString */ -+ char nameBuffer[1024]; /* C-string buffer */ -+# endif /* __APPLE__ */ -+ -+ -+ /* -+ * Only share the web interface and printers when non-local listening is -+ * enabled... -+ */ -+ -+ if (!DNSSDPort) -+ { -+ /* -+ * Get the port we use for registrations. If we are not listening on any -+ * non-local ports, there is no sense sharing local printers via Bonjour... -+ */ -+ -+ cupsd_listener_t *lis; /* Current listening socket */ -+ -+ for (lis = (cupsd_listener_t *)cupsArrayFirst(Listeners); -+ lis; -+ lis = (cupsd_listener_t *)cupsArrayNext(Listeners)) -+ { -+ if (httpAddrLocalhost(&(lis->address))) -+ continue; -+ -+ DNSSDPort = httpAddrPort(&(lis->address)); -+ break; -+ } -+ } -+ -+ if (!DNSSDPort) -+ return; -+ -+ /* -+ * Get the computer name as a c-string... -+ */ -+ -+# ifdef __APPLE__ -+ sc = SCDynamicStoreCreate(kCFAllocatorDefault, CFSTR("cupsd"), NULL, NULL); -+ -+ if (sc) -+ { -+ /* -+ * Get the computer name from the dynamic store... -+ */ -+ -+ cupsdClearString(&DNSSDComputerName); -+ -+ if ((nameRef = SCDynamicStoreCopyComputerName(sc, &nameEncoding)) != NULL) -+ { -+ if (CFStringGetCString(nameRef, nameBuffer, sizeof(nameBuffer), -+ kCFStringEncodingUTF8)) -+ { -+ cupsdLogMessage(CUPSD_LOG_DEBUG, -+ "Dynamic store computer name is \"%s\".", nameBuffer); -+ cupsdSetString(&DNSSDComputerName, nameBuffer); -+ } -+ -+ CFRelease(nameRef); -+ } -+ -+ if (!DNSSDComputerName) -+ { -+ /* -+ * Use the ServerName instead... -+ */ -+ -+ cupsdLogMessage(CUPSD_LOG_DEBUG, -+ "Using ServerName \"%s\" as computer name.", ServerName); -+ cupsdSetString(&DNSSDComputerName, ServerName); -+ } -+ -+ /* -+ * Get the local hostname from the dynamic store... -+ */ -+ -+ cupsdClearString(&DNSSDHostName); -+ -+ if ((nameRef = SCDynamicStoreCopyLocalHostName(sc)) != NULL) -+ { -+ if (CFStringGetCString(nameRef, nameBuffer, sizeof(nameBuffer), -+ kCFStringEncodingUTF8)) -+ { -+ cupsdLogMessage(CUPSD_LOG_DEBUG, -+ "Dynamic store host name is \"%s\".", nameBuffer); -+ cupsdSetString(&DNSSDHostName, nameBuffer); -+ } -+ -+ CFRelease(nameRef); -+ } -+ -+ if (!DNSSDHostName) -+ { -+ /* -+ * Use the ServerName instead... -+ */ -+ -+ cupsdLogMessage(CUPSD_LOG_DEBUG, -+ "Using ServerName \"%s\" as host name.", ServerName); -+ cupsdSetString(&DNSSDHostName, ServerName); -+ } -+ -+ /* -+ * Get any Back-to-My-Mac domains and add them as aliases... -+ */ -+ -+ cupsdFreeAliases(DNSSDAlias); -+ DNSSDAlias = NULL; -+ -+ btmm = SCDynamicStoreCopyValue(sc, CFSTR("Setup:/Network/BackToMyMac")); -+ if (btmm && CFGetTypeID(btmm) == CFDictionaryGetTypeID()) -+ { -+ cupsdLogMessage(CUPSD_LOG_DEBUG, "%d Back to My Mac aliases to add.", -+ (int)CFDictionaryGetCount(btmm)); -+ CFDictionaryApplyFunction(btmm, dnssdAddAlias, NULL); -+ } -+ else if (btmm) -+ cupsdLogMessage(CUPSD_LOG_ERROR, -+ "Bad Back to My Mac data in dynamic store!"); -+ else -+ cupsdLogMessage(CUPSD_LOG_DEBUG, "No Back to My Mac aliases to add."); -+ -+ if (btmm) -+ CFRelease(btmm); -+ -+ CFRelease(sc); -+ } -+ else -+# endif /* __APPLE__ */ -+# ifdef HAVE_AVAHI -+ if (DNSSDClient) -+ { -+ const char *host_name = avahi_client_get_host_name(DNSSDClient); -+ const char *host_fqdn = avahi_client_get_host_name_fqdn(DNSSDClient); -+ -+ cupsdSetString(&DNSSDComputerName, host_name ? host_name : ServerName); -+ -+ if (host_fqdn) -+ cupsdSetString(&DNSSDHostName, host_fqdn); -+ else if (strchr(ServerName, '.')) -+ cupsdSetString(&DNSSDHostName, ServerName); -+ else -+ cupsdSetStringf(&DNSSDHostName, "%s.local", ServerName); -+ } -+ else -+# endif /* HAVE_AVAHI */ -+ { -+ cupsdSetString(&DNSSDComputerName, ServerName); -+ -+ if (strchr(ServerName, '.')) -+ cupsdSetString(&DNSSDHostName, ServerName); -+ else -+ cupsdSetStringf(&DNSSDHostName, "%s.local", ServerName); -+ } -+ -+ /* -+ * Then (re)register the web interface if enabled... -+ */ -+ -+ if (BrowseWebIF) -+ { -+ if (DNSSDComputerName) -+ snprintf(webif, sizeof(webif), "CUPS @ %s", DNSSDComputerName); -+ else -+ strlcpy(webif, "CUPS", sizeof(webif)); -+ -+ dnssdDeregisterInstance(&WebIFSrv, from_callback); -+ dnssdRegisterInstance(&WebIFSrv, NULL, webif, "_http._tcp", "_printer", DNSSDPort, NULL, 1, from_callback); -+ } -+} -+ -+ -+/* - * 'get_auth_info_required()' - Get the auth-info-required value to advertise. - */ - diff --git a/debian/patches/cupsenumdests-does-not-set-cb.patch b/debian/patches/cupsenumdests-does-not-set-cb.patch deleted file mode 100644 index 27fc363a..00000000 --- a/debian/patches/cupsenumdests-does-not-set-cb.patch +++ /dev/null @@ -1,25 +0,0 @@ -Description: Let the cupsEnumDests() function correctly set "cb" and - "user_data" in the context data structure, to avoid crashes and hangs - of print dialogs -Author: Michael Sweet <msweet@apple.com> -Bug: https://cups.org/str.php?L4380 -Last-Update: 2014-03-05 ---- a/cups/dest.c -+++ b/cups/dest.c -@@ -982,11 +982,11 @@ - * Get Bonjour-shared printers... - */ - -- data.type = type; -- data.mask = mask; -- data.devices = cupsArrayNew3((cups_array_func_t)cups_dnssd_compare_devices, -- NULL, NULL, 0, NULL, -- (cups_afree_func_t)cups_dnssd_free_device); -+ data.type = type; -+ data.mask = mask; -+ data.cb = cb; -+ data.user_data = user_data; -+ data.devices = cupsArrayNew3((cups_array_func_t)cups_dnssd_compare_devices, NULL, NULL, 0, NULL, (cups_afree_func_t)cups_dnssd_free_device); - - # ifdef HAVE_DNSSD - if (DNSServiceCreateConnection(&data.main_ref) != kDNSServiceErr_NoError) diff --git a/debian/patches/fix-a-dbus-threading-issue-that-caused-the-scheduler-to-crash.patch b/debian/patches/fix-a-dbus-threading-issue-that-caused-the-scheduler-to-crash.patch deleted file mode 100644 index 73b47c41..00000000 --- a/debian/patches/fix-a-dbus-threading-issue-that-caused-the-scheduler-to-crash.patch +++ /dev/null @@ -1,84 +0,0 @@ -commit 0cf0c416ec73f65d4631ec8e2b6409f95462c76e -commit e7f455a5b39f6716835b083be5ba49a5cd795675 -Author: msweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be> -Date: Fri Mar 21 18:17:50 2014 +0000 - - Fix a D-BUS threading issue that caused the scheduler to crash (STR #4347) - - Apparently D-BUS is not thread-safe by default... - - - git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@11626 a1ca3aef-8c08-0410-bb20-df032aa958be - git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@11720 a1ca3aef-8c08-0410-bb20-df032aa958be - ---- a/config-scripts/cups-common.m4 -+++ b/config-scripts/cups-common.m4 -@@ -303,16 +303,11 @@ - LIBS="$SAVELIBS" - - dnl Check for DBUS support --if test -d /etc/dbus-1; then -- DBUSDIR="/etc/dbus-1" --else -- DBUSDIR="" --fi -- - AC_ARG_ENABLE(dbus, [ --disable-dbus build without DBUS support]) - AC_ARG_WITH(dbusdir, [ --with-dbusdir set DBUS configuration directory ], - DBUSDIR="$withval") - -+DBUSDIR="" - DBUS_NOTIFIER="" - DBUS_NOTIFIERLIBS="" - -@@ -329,7 +324,12 @@ - LIBS="$LIBS $DBUS_NOTIFIERLIBS" - AC_CHECK_FUNC(dbus_message_iter_init_append, - AC_DEFINE(HAVE_DBUS_MESSAGE_ITER_INIT_APPEND)) -+ AC_CHECK_FUNC(dbus_threads_init, -+ AC_DEFINE(HAVE_DBUS_THREADS_INIT)) - LIBS="$SAVELIBS" -+ if test -d /etc/dbus-1; then -+ DBUSDIR="/etc/dbus-1" -+ fi - else - AC_MSG_RESULT(no) - fi ---- a/config.h.in -+++ b/config.h.in -@@ -535,6 +535,7 @@ - - #undef HAVE_DBUS - #undef HAVE_DBUS_MESSAGE_ITER_INIT_APPEND -+#undef HAVE_DBUS_THREADS_INIT - - - /* ---- a/scheduler/main.c -+++ b/scheduler/main.c -@@ -70,6 +70,10 @@ - # include <notify.h> - #endif /* HAVE_NOTIFY_H */ - -+#ifdef HAVE_DBUS -+# include <dbus/dbus.h> -+#endif /* HAVE_DBUS */ -+ - #ifdef HAVE_SYS_PARAM_H - # include <sys/param.h> - #endif /* HAVE_SYS_PARAM_H */ -@@ -506,6 +510,14 @@ - setlocale(LC_TIME, ""); - #endif /* LC_TIME */ - -+#ifdef HAVE_DBUS_THREADS_INIT -+ /* -+ * Enable threading support for D-BUS... -+ */ -+ -+ dbus_threads_init_default(); -+#endif /* HAVE_DBUS_THREADS_INIT */ -+ - /* - * Set the maximum number of files... - */ diff --git a/debian/patches/fix-cupsdgetprivateattrs-function-missing-null-check.patch b/debian/patches/fix-cupsdgetprivateattrs-function-missing-null-check.patch deleted file mode 100644 index 2f1651d1..00000000 --- a/debian/patches/fix-cupsdgetprivateattrs-function-missing-null-check.patch +++ /dev/null @@ -1,19 +0,0 @@ -Description: cupsdGetPrivateAttrs() function in scheduler/policy.c is - missing NULL check for input parameters. -Author: Michael Sweet <msweet@apple.com> -Bug: http://www.cups.org/str.php?L4378 ---- a/scheduler/policy.c -+++ b/scheduler/policy.c -@@ -296,6 +296,12 @@ - con->http.fd, printer, printer ? printer->name : "", owner); - #endif /* DEBUG */ - -+ if (!policy) -+ { -+ cupsdLogMessage(CUPSD_LOG_CRIT, "cupsdGetPrivateAttrs: policy=%p, con=%p, printer=%p, owner=\"%s\", DefaultPolicyPtr=%p: This should never happen, please report a bug.", policy, con, printer, owner, DefaultPolicyPtr); -+ policy = DefaultPolicyPtr; -+ } -+ - /* - * Get the access and attributes lists that correspond to the request... - */ diff --git a/debian/patches/fix-cupsenumdests-does-not-fill-in-is_default-field.patch b/debian/patches/fix-cupsenumdests-does-not-fill-in-is_default-field.patch deleted file mode 100644 index 0c73229b..00000000 --- a/debian/patches/fix-cupsenumdests-does-not-fill-in-is_default-field.patch +++ /dev/null @@ -1,48 +0,0 @@ -Description: cupsEnumDests() doesn't fill in is_default field -Author: Michael Sweet <msweet@apple.com> -Bug: http://www.cups.org/str.php?L4332 ---- a/cups/dest.c -+++ b/cups/dest.c -@@ -891,6 +891,10 @@ - num_dests; /* Number of destinations */ - cups_dest_t *dests = NULL, /* Destinations */ - *dest; /* Current destination */ -+ const char *defprinter; /* Default printer */ -+ char name[1024], /* Copy of printer name */ -+ *instance, /* Pointer to instance name */ -+ *user_default; /* User default printer */ - #if defined(HAVE_DNSSD) || defined(HAVE_AVAHI) - int count, /* Number of queries started */ - remaining; /* Remainder of timeout */ -@@ -936,6 +940,31 @@ - num_dests = _cupsGetDests(CUPS_HTTP_DEFAULT, IPP_OP_CUPS_GET_PRINTERS, NULL, - &dests, type, mask); - -+ if ((user_default = _cupsUserDefault(name, sizeof(name))) != NULL) -+ defprinter = name; -+ else if ((defprinter = cupsGetDefault2(CUPS_HTTP_DEFAULT)) != NULL) -+ { -+ strlcpy(name, defprinter, sizeof(name)); -+ defprinter = name; -+ } -+ -+ if (defprinter) -+ { -+ /* -+ * Separate printer and instance name... -+ */ -+ -+ if ((instance = strchr(name, '/')) != NULL) -+ *instance++ = '\0'; -+ -+ /* -+ * Lookup the printer and instance and make it the default... -+ */ -+ -+ if ((dest = cupsGetDest(name, instance, num_dests, dests)) != NULL) -+ dest->is_default = 1; -+ } -+ - for (i = num_dests, dest = dests; - i > 0 && (!cancel || !*cancel); - i --, dest ++) diff --git a/debian/patches/fix-template.c-typo.patch b/debian/patches/fix-template.c-typo.patch deleted file mode 100644 index da193724..00000000 --- a/debian/patches/fix-template.c-typo.patch +++ /dev/null @@ -1,16 +0,0 @@ -Description: Fix expres{,s}ion typo -Author: Didier Raboud <odyx@debian.org> -Origin: vendor -Bug: https://cups.org/str.php?L4350 -Last-Update: 2014-01-04 ---- a/cgi-bin/template.c -+++ b/cgi-bin/template.c -@@ -553,7 +553,7 @@ - if (regcomp(&re, compare, REG_EXTENDED | REG_ICASE)) - { - fprintf(stderr, -- "ERROR: Unable to compile regular expresion \"%s\"!\n", -+ "ERROR: Unable to compile regular expression \"%s\"!\n", - compare); - result = 0; - } diff --git a/debian/patches/ipptool-doco-updates.patch b/debian/patches/ipptool-doco-updates.patch deleted file mode 100644 index fac2966a..00000000 --- a/debian/patches/ipptool-doco-updates.patch +++ /dev/null @@ -1,122 +0,0 @@ -commit 3a43047f18395b8322ddbef4af83bfadb320678f -Author: msweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be> -Date: Thu Feb 20 16:42:16 2014 +0000 - - ipptool doco updates (STR #3259, STR #4346) - - - git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@11629 a1ca3aef-8c08-0410-bb20-df032aa958be - ---- a/man/ipptool.man -+++ b/man/ipptool.man -@@ -1,17 +1,17 @@ - .\" - .\" "$Id: ipptool.man 11022 2013-06-06 22:14:09Z msweet $" - .\" --.\" ipptool man page for CUPS. -+.\" ipptool man page for CUPS. - .\" --.\" Copyright 2010-2013 by Apple Inc. -+.\" Copyright 2010-2014 by Apple Inc. - .\" --.\" 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/". -+.\" 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 ipptool 1 "CUPS" "13 May 2013" "Apple Inc." -+.TH ipptool 1 "CUPS" "20 February 2014" "Apple Inc." - .SH NAME - ipptool - perform internet printing protocol requests - .SH SYNOPSIS -@@ -42,8 +42,10 @@ - .TP 5 - --help - Shows program help. -+.TP 5 - --stop-after-include-error - Tells \fIipptool\fR to stop if an error occurs in an included file. Normally \fIipptool\fR will continue with subsequent tests after the INCLUDE directive. -+.TP 5 - --version - Shows the version of \fIipptool\fR being used. - .TP 5 -@@ -150,11 +152,15 @@ - validate-job.test - .fi - .SH SEE ALSO --\fIipptoolfile(5)\fR, -+\fIipptoolfile(5)\fR, RFC 2911, - .br - http://localhost:631/help -+.br -+http://www.iana.org/assignments/ipp-registrations -+.br -+http://www.pwg.org/ipp - .SH COPYRIGHT --Copyright 2007-2013 by Apple Inc. -+Copyright 2007-2014 by Apple Inc. - .\" - .\" End of "$Id: ipptool.man 11022 2013-06-06 22:14:09Z msweet $". - .\" ---- a/man/ipptoolfile.man -+++ b/man/ipptoolfile.man -@@ -1,17 +1,17 @@ - .\" - .\" "$Id: ipptoolfile.man 11022 2013-06-06 22:14:09Z msweet $" - .\" --.\" ipptoolfile man page for CUPS. -+.\" ipptoolfile man page for CUPS. - .\" --.\" Copyright 2010-2013 by Apple Inc. -+.\" Copyright 2010-2014 by Apple Inc. - .\" --.\" 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/". -+.\" 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 ipptoolfile 5 "CUPS" "13 May 2013" "Apple Inc." -+.TH ipptoolfile 5 "CUPS" "20 February 2014" "Apple Inc." - .SH NAME - ipptoolfile \- ipptool file format - -@@ -152,7 +152,7 @@ - .TP 5 - ATTR tag attribute-name value(s) - Adds an attribute to the test request. Values are separated by the comma (",") --character - escape commas using the "\" character. -+character - escape commas using the "\" character. Common attributes and values are listed in the IANA IPP registry - see references below. - .TP 5 - ATTR collection attribute-name { MEMBER tag member-name value(s) ... } [ ... { ... } ] - Adds a collection attribute to the test request. Member attributes follow the -@@ -614,12 +614,15 @@ - Inserts the username from the URI provided to \fIipptool\fR, if any. - - .SH SEE ALSO --\fIipptool(1)\fR, -+\fIipptool(1)\fR, RFC 2911, - .br - http://localhost:631/help -- -+.br -+http://www.iana.org/assignments/ipp-registrations -+.br -+http://www.pwg.org/ipp - .SH COPYRIGHT --Copyright 2007-2013 by Apple Inc. -+Copyright 2007-2014 by Apple Inc. - .\" - .\" End of "$Id: ipptoolfile.man 11022 2013-06-06 22:14:09Z msweet $". - .\" diff --git a/debian/patches/prevent-dnssd-backend-exiting-too-early.patch b/debian/patches/prevent-dnssd-backend-exiting-too-early.patch deleted file mode 100644 index 855daaf4..00000000 --- a/debian/patches/prevent-dnssd-backend-exiting-too-early.patch +++ /dev/null @@ -1,57 +0,0 @@ -commit 5353e5ee0063264ee4a557a98a19a9d0a7d2b053 -Author: msweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be> -Date: Wed Feb 19 20:15:53 2014 +0000 - - The dnssd backend did not always report all discovered printers using Avahi - (STR #4365) - - Keep track of active browsers, don't stop until Avahi gives up. - - - - git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@11622 a1ca3aef-8c08-0410-bb20-df032aa958be - ---- a/backend/dnssd.c -+++ b/backend/dnssd.c -@@ -95,6 +95,7 @@ - static AvahiSimplePoll *simple_poll = NULL; - /* Poll information */ - static int got_data = 0; /* Got data from poll? */ -+static int browsers = 0; /* Number of running browsers */ - #endif /* HAVE_AVAHI */ - - -@@ -345,6 +346,7 @@ - return (1); - } - -+ browsers = 6; - avahi_service_browser_new(client, AVAHI_IF_UNSPEC, - AVAHI_PROTO_UNSPEC, - "_fax-ipp._tcp", NULL, 0, -@@ -558,7 +560,11 @@ - - fprintf(stderr, "DEBUG: sent=%d, count=%d\n", sent, count); - -+#ifdef HAVE_AVAHI -+ if (sent == cupsArrayCount(devices) && browsers == 0) -+#else - if (sent == cupsArrayCount(devices)) -+#endif /* HAVE_AVAHI */ - break; - } - } -@@ -710,9 +716,12 @@ - break; - - case AVAHI_BROWSER_REMOVE: -- case AVAHI_BROWSER_ALL_FOR_NOW: - case AVAHI_BROWSER_CACHE_EXHAUSTED: - break; -+ -+ case AVAHI_BROWSER_ALL_FOR_NOW: -+ browsers--; -+ break; - } - } - diff --git a/debian/patches/series b/debian/patches/series index 7da8ba1a..33d77674 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1,19 +1,9 @@ -# patches accepted and committed upstream: -str4393-fix-memoryleak-in-rastertolabel.patch -fix-cupsdgetprivateattrs-function-missing-null-check.patch -fix-cupsenumdests-does-not-fill-in-is_default-field.patch -cupsenumdests-does-not-set-cb.patch -cupsd-support-avahi-daemon-restarting.patch -prevent-dnssd-backend-exiting-too-early.patch -fix-a-dbus-threading-issue-that-caused-the-scheduler-to-crash.patch -ipptool-doco-updates.patch +# patches accepted and committed upstream # patches sent upstream manpage-hyphen-minus.patch rootbackends-worldreadable.patch fixes-for-jobs-with-multiple-files-and-multiple-formats.patch -build-with-full-relro.patch -fix-template.c-typo.patch cupsd-idleexittimeout.patch cups-no-gcrypt.patch diff --git a/debian/patches/str4393-fix-memoryleak-in-rastertolabel.patch b/debian/patches/str4393-fix-memoryleak-in-rastertolabel.patch deleted file mode 100644 index 5a090daa..00000000 --- a/debian/patches/str4393-fix-memoryleak-in-rastertolabel.patch +++ /dev/null @@ -1,38 +0,0 @@ -Description: Make sure that all allocated buffers are freed regardless of driver -Author: Michael Sweet <msweet@apple.com> -Bug: https://www.cups.org/str.php?L4393 ---- a/filter/rastertolabel.c -+++ b/filter/rastertolabel.c -@@ -639,13 +639,6 @@ - - puts("^IDR:CUPS.GRF^FS"); - puts("^XZ"); -- -- /* -- * Free compression buffers... -- */ -- -- free(CompBuffer); -- free(LastBuffer); - break; - - case ZEBRA_CPCL : -@@ -714,6 +707,18 @@ - */ - - free(Buffer); -+ -+ if (CompBuffer) -+ { -+ free(CompBuffer); -+ CompBuffer = NULL; -+ } -+ -+ if (LastBuffer) -+ { -+ free(LastBuffer); -+ LastBuffer = NULL; -+ } - } - - |