servername/version=1.1 does not work from client.conf #4291

Closed
michaelrsweet opened this Issue Mar 12, 2013 · 3 comments

Comments

Projects
None yet
1 participant
Collaborator

michaelrsweet commented Mar 12, 2013

Version: 1.6-current
CUPS.org User: mike

Followup to STR #4231, when reading server names of the form "servername/version=1.1" from client.conf, we aren't stripping the /version=1.1 from the end. We need to call cupsSetServer to take care of that logic consistently.

Collaborator

michaelrsweet commented Mar 12, 2013

CUPS.org User: mike

Fixed in Subversion repository.

Collaborator

michaelrsweet commented Mar 12, 2013

"str4291.patch":

Index: cups/usersys.c

--- cups/usersys.c (revision 10901)
+++ cups/usersys.c (working copy)
@@ -1031,37 +1031,8 @@
}

if ((!cg->server[0] || !cg->ipp_port) && cups_server)

  • {
  • if (!cg->server[0])
  • {
  • /*
    
  •  \* Copy server name...
    
  •  */
    
  • cupsSetServer(cups_server);

- 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);
    

- }

if (!cg->server[0])
{
#ifdef CUPS_DEFAULT_DOMAINSOCKET

Collaborator

michaelrsweet commented Mar 12, 2013

"str4291-1.6.patch":

Index: cups/usersys.c

--- cups/usersys.c (revision 10901)
+++ cups/usersys.c (working copy)
@@ -3,7 +3,7 @@
*

  • User, system, and password routines for CUPS.
  • * Copyright 2007-2012 by Apple Inc.
  • * Copyright 2007-2013 by Apple Inc.
  • Copyright 1997-2006 by Easy Software Products.
  • These coded instructions, statements, and computer programs are the
    @@ -951,37 +951,8 @@
    }

if ((!cg->server[0] || !cg->ipp_port) && cups_server)

  • {
  • if (!cg->server[0])
  • {
  • /*
    
  •  \* Copy server name...
    
  •  */
    
  • cupsSetServer(cups_server);

- 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] == '/')
    
  • strcpy(cg->servername, "localhost");
  •  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);
    

- }

if (!cg->server[0])
{
#ifdef CUPS_DEFAULT_DOMAINSOCKET

Index: CHANGES.txt

--- CHANGES.txt (revision 10901)
+++ CHANGES.txt (working copy)
@@ -1,4 +1,4 @@
-CHANGES.txt - 1.6.2 - 2013-03-11
+CHANGES.txt - 1.6.2 - 2013-03-12


@@ -49,7 +49,7 @@
- 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

michaelrsweet added this to the Stable milestone Mar 17, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment