[cups-devel] [UNKN] STR #4675: The -h option is overridden by _cupsSetDefaults settings when the IPP port is not given

Vincent Lefèvre noreply at cups.org
Thu Jul 16 04:39:05 PDT 2015


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR New]

The -h option (e.g. for lpstat) is ignored when the server name is not
followed by the port:

ypig:~> lpstat -h localhost -H -a
lipps.lip.ens-lyon.fr:443
[output: all remote printers]

ypig:~> lpstat -h localhost:631 -H -a
localhost:631
lpstat: No destinations added.

In latrace output, the first difference between the two invocations occurs
in cupsSetServer [/usr/lib/x86_64-linux-gnu/libcups.so.2], here in
cups/usersys.c:

    if (cg->server[0] != '/' && (port = strrchr(cg->server, ':')) != NULL
&&
        !strchr(port, ']') && isdigit(port[1] & 255))
    {
      *port++ = '\0';

      cg->ipp_port = atoi(port);
    }

This is expected. The next difference occurs here in ippPort() in
cups/ipp-support.c:

  if (!cg->ipp_port)
    _cupsSetDefaults();

_cupsSetDefaults() is called only when the port is *not* provided. This
means that by default, cg->ipp_port is 0. The default port should not be 0.
This makes no sense!

My Debian bug report:
  https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=711327
and the above explanation:
  https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=711327#40

Link: https://www.cups.org/str.php?L4675
Version: 2.0.3
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.14 (GNU/Linux)
Comment: GPGTools - https://gpgtools.org

iQIcBAEBCgAGBQJVp5fZAAoJENujp6sI12Ijd9UP/RZtmolFIThv+p4SsmIn+qAy
vCeJrwW8gzaqnfCRM3X6zAQcl1TexOhrE6KFKRX9CD4sUYi66yNeCOhIo1Mo5oRJ
5SVR2AW0eyekHZk0dCjSXkbSLS1O3HsoDVJ8VqgE4KNel2ljxJjQbzR1shmODv+0
H5Ohv65k4yM/dPV3ZKxY7F1f9pZDwMYOPbWuS908oQTQuAwVCcX1qauJzwSqMZVA
qAr7LtICVvRzpzIRzOJHKGLlJihLtm3Vh4vNeJ48WjAgzI2P58L7QuhWTF8LpfWn
zEYAy2QDHD8RT4u0vvRLnhMLqfud0Fz/zVBv9aNxtFhwos312oZFfFnlwq0/c678
qGQ7FJgqUwevX2m1Xn6FIa0GBUo0sMpTz+SEiJCSs//KBjJFq1zxCpSL8r7xPetM
puuK0vHVP3ehw2kC8bWJ7OrY9suWFcc/ob0M9mmpKpb9QDWSVlZM6Y2aQNwUiP5k
y3ExBwu9RQGQI7ksOV93AWf2UrK5YlIkoTU6odbIfDpGGxAmko8Vi6Kg4Bu/dc+n
U84PrnKAVB5++7oZ8asiGEelseXchk8piIRJmtHPH+YOFBQYA9OrIF1O01ydAGIg
sgkdCivOKju0PabBEKiRAURtl1Pn/gMpe4ES4r5W+G+OJExFhK/wfta4lFXfjZRy
kuqjlIK7ft7YCs1ufmRo
=VS2D
-----END PGP SIGNATURE-----




More information about the cups mailing list