From 1b240119b4d57859a57428ea449b9fde4e9771c0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20R=C4=99korajski?= Date: Sun, 5 Feb 2012 13:01:09 +0000 Subject: [PATCH] - 1.5.1 - numerous bugs fixed Changed files: cups-auth.patch -> 1.3 cups-avahi-2-backend.patch -> 1.2 cups-avahi-5-services.patch -> 1.2 cups-ssl-segfault.patch -> 1.3 cups-verbose-compilation.patch -> 1.3 cups.spec -> 1.314 --- cups-auth.patch | 72 ------------------ cups-avahi-2-backend.patch | 2 +- cups-avahi-5-services.patch | 129 ++++++++++----------------------- cups-ssl-segfault.patch | 37 ---------- cups-verbose-compilation.patch | 2 +- cups.spec | 10 +-- 6 files changed, 42 insertions(+), 210 deletions(-) delete mode 100644 cups-auth.patch delete mode 100644 cups-ssl-segfault.patch diff --git a/cups-auth.patch b/cups-auth.patch deleted file mode 100644 index f78830f..0000000 --- a/cups-auth.patch +++ /dev/null @@ -1,72 +0,0 @@ -Index: cups/request.c -=================================================================== ---- cups/request.c (revision 9973) -+++ cups/request.c (revision 9974) -@@ -248,16 +248,9 @@ - - while ((bytes = (int)read(infile, buffer, sizeof(buffer))) > 0) - { -- if (httpCheck(http)) -- { -- _httpUpdate(http, &status); -- -- if (status >= HTTP_MULTIPLE_CHOICES) -- break; -- } -- -- if (httpWrite2(http, buffer, bytes) < bytes) -- break; -+ if ((status = cupsWriteRequestData(http, buffer, bytes)) -+ != HTTP_CONTINUE) -+ break; - } - } - -@@ -265,13 +258,11 @@ - * Get the server's response... - */ - -- if (status == HTTP_CONTINUE || status == HTTP_OK) -+ if (status != HTTP_ERROR) - { - response = cupsGetResponse(http, resource); -- status = http->status; -+ status = httpGetStatus(http); - } -- else -- httpFlush(http); - - DEBUG_printf(("2cupsDoIORequest: status=%d", status)); - -@@ -785,7 +776,17 @@ - */ - - if (status >= HTTP_MULTIPLE_CHOICES) -+ { -+ _cupsSetHTTPError(status); -+ -+ do -+ { -+ status = httpUpdate(http); -+ } -+ while (status != HTTP_ERROR && http->state == HTTP_POST_RECV); -+ - httpFlush(http); -+ } - - switch (status) - { -@@ -922,6 +923,13 @@ - if (status >= HTTP_MULTIPLE_CHOICES) - { - _cupsSetHTTPError(status); -+ -+ do -+ { -+ status = httpUpdate(http); -+ } -+ while (status != HTTP_ERROR && http->state == HTTP_POST_RECV); -+ - httpFlush(http); - } - diff --git a/cups-avahi-2-backend.patch b/cups-avahi-2-backend.patch index eabad7d..a9aece5 100644 --- a/cups-avahi-2-backend.patch +++ b/cups-avahi-2-backend.patch @@ -779,7 +779,7 @@ diff -up cups-1.5.0/backend/dnssd.c.avahi-2-backend cups-1.5.0/backend/dnssd.c - - datalen = *data++; - -- if (!datalen || (data + datalen) >= dataend) +- if (!datalen || (data + datalen) > dataend) - break; - - datanext = data + datalen; diff --git a/cups-avahi-5-services.patch b/cups-avahi-5-services.patch index 2756318..0032880 100644 --- a/cups-avahi-5-services.patch +++ b/cups-avahi-5-services.patch @@ -1,37 +1,3 @@ -diff --git a/cgi-bin/admin.c b/cgi-bin/admin.c -index 99b8e7b..2688eff 100644 ---- a/cgi-bin/admin.c -+++ b/cgi-bin/admin.c -@@ -1643,7 +1643,7 @@ do_config_server(http_t *http) /* I - HTTP connection */ - else - local_protocols[0] = '\0'; - --#ifdef HAVE_DNSSD -+#if defined(HAVE_DNSSD) || defined(HAVE_AVAHI) - if (cgiGetVariable("BROWSE_LOCAL_DNSSD")) - { - if (local_protocols[0]) -@@ -1651,7 +1651,7 @@ do_config_server(http_t *http) /* I - HTTP connection */ - else - strcat(local_protocols, "dnssd"); - } --#endif /* HAVE_DNSSD */ -+#endif /* defined(HAVE_DNSSD) || defined(HAVE_AVAHI) */ - - #ifdef HAVE_LDAP - if (cgiGetVariable("BROWSE_LOCAL_LDAP")) -@@ -2718,9 +2718,9 @@ do_menu(http_t *http) /* I - HTTP connection */ - #endif /* HAVE_GSSAPI */ - cgiSetVariable("KERBEROS", ""); - --#ifdef HAVE_DNSSD -+#if defined(HAVE_DNSSD) || defined(HAVE_AVAHI) - cgiSetVariable("HAVE_DNSSD", "1"); --#endif /* HAVE_DNSSD */ -+#endif /* defined(HAVE_DNSSD) || defined(HAVE_AVAHI) */ - - #ifdef HAVE_LDAP - cgiSetVariable("HAVE_LDAP", "1"); diff --git a/scheduler/client.c b/scheduler/client.c index e4c9b01..984dcc5 100644 --- a/scheduler/client.c @@ -72,22 +38,22 @@ index eb3c862..48dcef9 100644 --- a/scheduler/dirsvc.c +++ b/scheduler/dirsvc.c @@ -27,6 +27,7 @@ - * ldap_connect() - Start new LDAP connection - * ldap_reconnect() - Reconnect to LDAP Server - * ldap_disconnect() - Disconnect from LDAP Server + * remote printers. + * cupsdRegisterPrinter() - Start sending broadcast information for a + * printer or update the broadcast contents. + * cupsdStartAvahiClient() - Start an Avahi client if needed - * cupsdStartBrowsing() - Start sending and receiving broadcast - * information. - * cupsdStartPolling() - Start polling servers as needed. + * cupsdStartBrowsing() - Start sending and receiving broadcast + * information. + * cupsdStopBrowsing() - Stop sending and receiving broadcast @@ -45,6 +46,8 @@ - * printer. - * dnssdPackTxtRecord() - Pack an array of key/value pairs into the TXT - * record format. + * printer. + * dnssdPackTxtRecord() - Pack an array of key/value pairs into the TXT + * record format. + * avahiPackTxtRecord() - Pack an array of key/value pairs into an + * AvahiStringList. - * dnssdRegisterCallback() - DNSServiceRegister callback. - * dnssdRegisterPrinter() - Start sending broadcast information for a - * printer or update the broadcast contents. + * dnssdRegisterCallback() - DNSServiceRegister callback. + * dnssdRegisterPrinter() - Start sending broadcast information for a + * printer or update the broadcast contents. @@ -83,6 +86,7 @@ */ @@ -114,7 +80,7 @@ index eb3c862..48dcef9 100644 /* -@@ -159,27 +174,39 @@ static void update_polling(void); +@@ -159,26 +174,39 @@ static void update_polling(void); static void update_smb(int onoff); @@ -134,7 +100,6 @@ index eb3c862..48dcef9 100644 # endif /* HAVE_COREFOUNDATION */ -static char *dnssdBuildTxtRecord(int *txt_len, cupsd_printer_t *p, - int for_lpd); --static int dnssdComparePrinters(cupsd_printer_t *a, cupsd_printer_t *b); -static void dnssdDeregisterPrinter(cupsd_printer_t *p); -static char *dnssdPackTxtRecord(int *txt_len, char *keyvalue[][2], - int count); @@ -159,9 +124,9 @@ index eb3c862..48dcef9 100644 + void *userdata); +#endif /* HAVE_AVAHI */ + - #ifdef HAVE_LDAP - static const char * const ldap_attrs[] =/* CUPS LDAP attributes */ - { + + /* + * 'cupsdDeregisterPrinter()' - Stop sending broadcast information for a @@ -283,10 +310,10 @@ cupsdDeregisterPrinter( ldap_dereg_printer(p); #endif /* HAVE_LDAP */ @@ -224,7 +189,7 @@ index eb3c862..48dcef9 100644 -#ifdef HAVE_DNSSD +#if defined(HAVE_DNSSD) || defined(HAVE_AVAHI) - if ((BrowseLocalProtocols | BrowseRemoteProtocols) & BROWSE_DNSSD) + if (BrowseLocalProtocols & BROWSE_DNSSD) { +#ifdef HAVE_DNSSD DNSServiceErrorType error; /* Error from service creation */ @@ -260,8 +225,8 @@ index eb3c862..48dcef9 100644 + } +#endif /* defined(HAVE_DNSSD) || defined(HAVE_AVAHI) */ - #ifdef HAVE_LIBSLP - if ((BrowseLocalProtocols | BrowseRemoteProtocols) & BROWSE_SLP) + /* + * Enable LPD and SMB printer sharing as needed through external programs... @@ -1834,10 +1893,10 @@ cupsdStopBrowsing(void) BrowseSocket = -1; } @@ -399,24 +364,6 @@ index eb3c862..48dcef9 100644 } -@@ -2474,7 +2588,16 @@ static int /* O - Result of comparison */ - dnssdComparePrinters(cupsd_printer_t *a,/* I - First printer */ - cupsd_printer_t *b)/* I - Second printer */ - { -- return (_cups_strcasecmp(a->reg_name, b->reg_name)); -+ if (!a->reg_name) -+ if (!b->reg_name) -+ return 0; -+ else -+ return -1; -+ else -+ if (!b->reg_name) -+ return 1; -+ else -+ return (_cups_strcasecmp(a->reg_name, b->reg_name)); - } - - @@ -2489,6 +2612,10 @@ dnssdDeregisterPrinter( { cupsdLogMessage(CUPSD_LOG_DEBUG2, "dnssdDeregisterPrinter(%s)", p->name); @@ -966,8 +913,8 @@ index 99079bd..d53a179 100644 --- a/scheduler/dirsvc.h +++ b/scheduler/dirsvc.h @@ -31,6 +31,10 @@ - # endif /* HAVE_LDAP_SSL_H */ - #endif /* HAVE_LDAP */ + * file is missing or damaged, see the license at "http://www.cups.org/". + */ +#ifdef HAVE_AVAHI +# include @@ -977,9 +924,9 @@ index 99079bd..d53a179 100644 * Browse protocols... */ @@ -131,19 +135,22 @@ VAR int PollPipe VALUE(0); - VAR cupsd_statbuf_t *PollStatusBuffer VALUE(NULL); - /* Status buffer for pollers */ - + BrowseLocalProtocols + VALUE(BROWSE_ALL); + /* Protocols to support for local printers */ -#ifdef HAVE_DNSSD +#if defined(HAVE_DNSSD) || defined(HAVE_AVAHI) VAR char *DNSSDComputerName VALUE(NULL), @@ -1001,7 +948,7 @@ index 99079bd..d53a179 100644 + /* List of dynamic ServerAlias's */ VAR DNSServiceRef DNSSDRef VALUE(NULL), /* Master DNS-SD service reference */ - WebIFRef VALUE(NULL), + WebIFRef VALUE(NULL); @@ -152,6 +159,17 @@ VAR DNSServiceRef DNSSDRef VALUE(NULL), /* Remote printer browse reference */ #endif /* HAVE_DNSSD */ @@ -1017,26 +964,24 @@ index 99079bd..d53a179 100644 + /* Web interface entry group */ +#endif /* HAVE_AVAHI */ + - #ifdef HAVE_LIBSLP - VAR SLPHandle BrowseSLPHandle VALUE(NULL); - /* SLP API handle */ -@@ -195,13 +213,14 @@ extern void cupsdRegisterPrinter(cupsd_printer_t *p); - extern void cupsdRestartPolling(void); - extern void cupsdSaveRemoteCache(void); - extern void cupsdSendBrowseList(void); + VAR char *LPDConfigFile VALUE(NULL), + /* LPD configuration file */ + *SMBConfigFile VALUE(NULL); +@@ -195,11 +213,12 @@ extern void cupsdRegisterPrinter(cupsd_printer_t *p); + + extern void cupsdDeregisterPrinter(cupsd_printer_t *p, int removeit); + extern void cupsdRegisterPrinter(cupsd_printer_t *p); +extern void cupsdStartAvahiClient(void); extern void cupsdStartBrowsing(void); - extern void cupsdStartPolling(void); extern void cupsdStopBrowsing(void); - extern void cupsdStopPolling(void); -#ifdef HAVE_DNSSD +#if defined(HAVE_DNSSD) || defined(HAVE_AVAHI) extern void cupsdUpdateDNSSDName(void); -#endif /* HAVE_DNSSD */ +#endif /* defined(HAVE_DNSSD) || defined(HAVE_AVAHI) */ - #ifdef HAVE_LDAP - extern void cupsdUpdateLDAPBrowse(void); - #endif /* HAVE_LDAP */ + + + /* diff --git a/scheduler/ipp.c b/scheduler/ipp.c index a048baa..9a3ab11 100644 --- a/scheduler/ipp.c @@ -1071,9 +1016,9 @@ index 1e60572..6c210e6 100644 + avahi_client_time, /* Time for next Avahi client + check */ +#endif /* HAVE_AVAHI */ - browse_time, /* Next browse send time */ senddoc_time, /* Send-Document time */ expire_time, /* Subscription expire time */ + report_time, /* Malloc/client/job report time */ @@ -662,6 +666,9 @@ main(int argc, /* I - Number of command-line args */ */ @@ -1081,9 +1026,9 @@ index 1e60572..6c210e6 100644 +#ifdef HAVE_AVAHI + avahi_client_time = current_time; +#endif /* HAVE_AVAHI */ - browse_time = current_time; event_time = current_time; expire_time = current_time; + fds = 1; @@ -884,6 +891,16 @@ main(int argc, /* I - Number of command-line args */ tmo = cupsdNextTimeout (&tmo_delay); if (tmo && tmo_delay == 0) diff --git a/cups-ssl-segfault.patch b/cups-ssl-segfault.patch deleted file mode 100644 index 0d42d33..0000000 --- a/cups-ssl-segfault.patch +++ /dev/null @@ -1,37 +0,0 @@ -Index: cups/http.c -=================================================================== ---- cups/http.c (revision 9908) -+++ cups/http.c (revision 9909) -@@ -3807,6 +3807,8 @@ - any_root = cg->any_root; - - # ifdef HAVE_LIBSSL -+ (void)any_root; -+ - context = SSL_CTX_new(SSLv23_client_method()); - - SSL_CTX_set_options(context, SSL_OP_NO_SSLv2); /* Only use SSLv3 or TLS */ -@@ -3815,7 +3817,7 @@ - BIO_ctrl(bio, BIO_C_SET_FILE_PTR, 0, (char *)http); - - http->tls = SSL_new(context); -- SSL_set_bio(http->tls_credentials, bio, bio); -+ SSL_set_bio(http->tls, bio, bio); - - if (SSL_connect(http->tls) != 1) - { -@@ -4200,11 +4202,11 @@ - # ifdef HAVE_LIBSSL - SSL_CTX *context; /* Context for encryption */ - -- context = SSL_get_SSL_CTX(http->tls_credentials); -+ context = SSL_get_SSL_CTX(http->tls); - -- SSL_shutdown(http->tls_credentials); -+ SSL_shutdown(http->tls); - SSL_CTX_free(context); -- SSL_free(http->tls_credentials); -+ SSL_free(http->tls); - - # elif defined(HAVE_GNUTLS) - gnutls_certificate_client_credentials *credentials; diff --git a/cups-verbose-compilation.patch b/cups-verbose-compilation.patch index 1566ee0..fc68a4b 100644 --- a/cups-verbose-compilation.patch +++ b/cups-verbose-compilation.patch @@ -6,7 +6,7 @@ -.SILENT: +#.SILENT: - .SUFFIXES: .1 .1.gz .1m .1m.gz .3 .3.gz .5 .5.gz .7 .7.gz .8 .8.gz .a .c .cxx .h .man .o .32.o .64.o .gz + .SUFFIXES: .1 .1.gz .1m .1m.gz .3 .3.gz .5 .5.gz .7 .7.gz .8 .8.gz .a .c .cxx .h .man .o .gz .c.o: diff --git a/cups.spec b/cups.spec index 5720ec9..e91ea56 100644 --- a/cups.spec +++ b/cups.spec @@ -16,13 +16,13 @@ Summary(pl.UTF-8): Ogólny system druku dla Uniksa Summary(pt_BR.UTF-8): Sistema Unix de Impressão Name: cups -Version: 1.5.0 -Release: 10 +Version: 1.5.1 +Release: 0.1 Epoch: 1 License: LGPL v2 (libraries), GPL v2 (the rest) + openssl exception Group: Applications/Printing Source0: http://ftp.easysw.com/pub/cups/%{version}/%{name}-%{version}-source.tar.bz2 -# Source0-md5: e54ed09ede2340fc3014913333520fe4 +# Source0-md5: 7e7026f5b6392deae46f889129b196a7 Source1: %{name}.init Source2: %{name}.pamd Source3: %{name}.logrotate @@ -43,8 +43,6 @@ Patch9: %{name}-verbose-compilation.patch Patch10: %{name}-peercred.patch Patch11: %{name}-usb.patch Patch12: %{name}-desktop.patch -Patch13: %{name}-ssl-segfault.patch -Patch14: %{name}-auth.patch # avahi patches from fedora Patch100: %{name}-avahi-1-config.patch Patch101: %{name}-avahi-2-backend.patch @@ -321,8 +319,6 @@ Wsparcie dla LPD w serwerze wydruków CUPS. # why it hasn't been merged for so long (and why no other distro uses it) #%patch11 -p1 %patch12 -p1 -%patch13 -p0 -%patch14 -p0 %patch100 -p1 %patch101 -p1 -- 2.44.0