[cups-devel] [UNKN] STR #4491: CUPS mis-categorizes v1.::127.0.0.1 as not being localhost

Didier Raboud noreply at cups.org
Thu Oct 2 05:52:38 PDT 2014


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

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

[STR New]

Hi,

While investigating the problems we're having with starting cupsd from
systemd sockets, I've finally (see https://bugs.debian.org/747073 for some
history) nailed our problem down.

As I understand the problem (and feel free to correct flaws in my
reasoning), when systemd reserves the socket on localhost on IPv6 and IPv4,
it will bind the two addresses with an AF_INET6 socket, which it then hands
to cupsd. cupsd then gets "127.0.0.1" over an AF_INET6 socket and
mis-caracterizes it as a [v1.::127.0.0.1] IPv6 address which will finally
fail the httpAddrLocalhost check, thereby handing the user a 'Forbidden' or
'Bad Request' when accessing http://localhost:631/ .

One way to circumvent this is to patch the httpAddrLocalhost function to
take this special-case into account, but I suspect the correct fix should
probably happen higher in the pile.

Thanks in advance for your review and happy CUPS birthday (15 years and a
CUPS 2.0.0, congrats!) !

Cheers, OdyX

Link: https://www.cups.org/str.php?L4491
Version: 1.7.5
Attachment: https://www.cups.org/strfiles.php/3390/cupsd-accept-inet6-on-ipv4-localhost.patch
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.14 (GNU/Linux)
Comment: GPGTools - https://gpgtools.org

iQIcBAEBCgAGBQJULUqWAAoJENujp6sI12Ijp/sQAIASfICGGp6Wjc6ZWmhEB1t6
JLKGQy7/Pvqf0skoi/xZ8z5KyAmiCj8QqdAApwID8eMukMI+iUbyr5g/s8e6CvP3
6am0HUNf7s/p3+oio9h8F/ynaWQzIfqvPB/MCTHpSakQINm/nB33RpJYVoEsbBO1
kSQyYKkxpc04Bocl7LtDmMMevA42hVz1hMTpr2qil2e5EBCyCAtwYxFvv57wJ7Du
Lr6cLYvudNDx7jeidtpT9SGWVmYz1xBhe+JUCPQCi1VtPbnfsk8qV6/4A+7l9sQY
a4fqm+EOVTccA5fhxbB9MK2yg3wmnqAboYijx1ym5bF1ge8yYoXyP0ZDte059Adl
Nacwp8RzE1riagwe/7jiJhBRGP0nPSMj+GSgMnRaYLgsTJYztE+RsXtohu/fW8u3
uIn1trBesZ3X2kaO9yHLqOQ3tXLb5pBImGbSwvqu9Kk5rEm6OaNZsJBMlsOzgy6x
YvkI10wYKKIRcasWzq48mtfppGkn94G1a2RzwKPN8beDA1PA7qxkLXLg83Q6k7Zd
/xQCIVEv3+ju3RjzjtB69Yd2qQdUM3om6+71leZ66baCeuCsLbuJWaJBOoPMiHeF
zLGW7VltnTnEJeqKhYrfdAV8sUA5tb+lNADsVP2QBOSnCdXb5oWip0OfJDYWZIXM
qaDS39fi8vkyznDDsd7z
=EOfx
-----END PGP SIGNATURE-----




More information about the cups-devel mailing list