From: mike Date: Tue, 12 Mar 2013 14:22:34 +0000 (+0000) Subject: Fix servername/version=1.1 in client.conf (STR #4291) X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=969d6a6db41d52497b81fd6bf5951a2064d42a8b;p=thirdparty%2Fcups.git Fix servername/version=1.1 in client.conf (STR #4291) git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@10902 7a7537e8-13f0-0310-91df-b6672ffda945 --- diff --git a/CHANGES-1.6.txt b/CHANGES-1.6.txt index d88e40450f..f9efbb2bc2 100644 --- a/CHANGES-1.6.txt +++ b/CHANGES-1.6.txt @@ -48,7 +48,7 @@ CHANGES IN CUPS V1.6.2 - The scheduler incorrectly advertised auth-info-required for local queues needing local authentication (STR #4205) - CUPS 1.6 clients using the ServerName directive in client.conf did not - work with CUPS 1.3.x or older servers (STR #4231) + work with CUPS 1.3.x or older servers (STR #4231, STR #4291) - The SNMP backend now tries to work around broken printers that use a newline to separate key/value pairs. - The IPP backend did not send a cancel request to printers when a job diff --git a/cups/usersys.c b/cups/usersys.c index 82077b5e03..1bcfe6423e 100644 --- a/cups/usersys.c +++ b/cups/usersys.c @@ -1031,36 +1031,7 @@ cups_read_client_conf( } if ((!cg->server[0] || !cg->ipp_port) && cups_server) - { - if (!cg->server[0]) - { - /* - * Copy server name... - */ - - strlcpy(cg->server, cups_server, sizeof(cg->server)); - - if (cg->server[0] != '/' && (value = strrchr(cg->server, ':')) != NULL && - !strchr(value, ']') && isdigit(value[1] & 255)) - *value++ = '\0'; - else - value = NULL; - - if (cg->server[0] == '/') - strlcpy(cg->servername, "localhost", sizeof(cg->servername)); - else - strlcpy(cg->servername, cg->server, sizeof(cg->servername)); - } - else if (cups_server[0] != '/' && - (value = strrchr(cups_server, ':')) != NULL && - !strchr(value, ']') && isdigit(value[1] & 255)) - value ++; - else - value = NULL; - - if (!cg->ipp_port && value) - cg->ipp_port = atoi(value); - } + cupsSetServer(cups_server); if (!cg->server[0]) {