[cups-devel] [UNKN] STR #4618: Using host name in /etc/cups/cupsd.conf Listen directive could make cupsd listen on the wrong IP

Bogdan Szczurek noreply at cups.org
Fri Apr 10 14:56:55 PDT 2015


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

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

[STR New]

This is most likely caused by the way systemd org.cups.cupsd.service is
defined.

System: Arch Linux

Relevant packages' versions: systemd 218-2, cups 2.0.2-3


Description:

When cupsd is instructed in /etc/cups/cupsd.conf to listen only on some
selected interfaces (IPs), instead of listening on all available
(“Port” directive), it may happen, that the daemon ends up listening on
the wrong IP, if “Listen” directive was supplied with host name instead
of an explicit IP address and cupsd wasn't able to query DNS to supply
proper IP for the host name. It's most likely to happen, when the host
running cupsd relies on DHCP to configure its interfaces and cupsd is
started before relevant interfaces are brought up.

For example:

I'm booting my system. In /etc/cups/cupsd.conf (attached to this report)
I've got 3 “Listen” directives: one set to localhost, one to socket and
one to my host name (“gizmo:631”). When the host is up and running, I
can see (ss -tuln | grep -i 631) that cupsd listens on localhost
(127.0.0.1) and on 127.0.0.2, instead of the IP assigned to my host via
DHCP. Restarting cupsd service (I'm using systemd), of course, solves the
problem, but it's at least inconvenient to do so after each reboot.

Obviously setting IP to some explicit value would be, most of the time, a
feasible option, but that kind of hard-coding things may be dangerous too.

Maybe dependency on network would be in order in cupsd service?


Steps to reproduce:
* Make sure cupsd listens only on interfaces defined by “Listen”
directives in /etc/cups/cupsd.conf and at least one of these interfaces is
defined as a host name.
* Make sure that previously given host name's IP can be retrieved by DNS
query.
* Make sure org.cups.cupsd.service is enabled and relevant interface is
configured by DHCP.
* Boot the system.
* Check the IPs of the interfaces the cups daemon listens on.

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

iQIcBAEBCgAGBQJVKEcnAAoJENujp6sI12IjO98P/2jb09iTyLGUttcdxePgVhk8
hVkCmjdAcbmTtOHM22TmD1HwbtA/O7J7xFoBzelxzFY3nMBkvgX0zDeeHialXtfH
L81YmfoGBb8flSyn37Ku2caiyVkgoDEwKEYop51Weczv9q5jC4iCyxz4XKAcGPl5
eds/fxF4y49ogHeT4RPtieZtK1piYWpt2Jm452bZd3B05J4HZhQ9M036HLAeKFrr
GYtJgNajW3SdtWlO1j78s56Npo1rLiRN1gpmM6o2SjdopC4/PE/ZRPR1/8FIa+Gi
9Pf0kZh8lTT5fbX5piypH9kNFji7Fvz9XQUNlWQITH4BsJ/HznVaCzJHTtWU9G7q
8fhOD3eMkGLApttCXqpqxfBhdJl5X3+5GNT1HKEJTetETZhHkssbj7H+N7Iogi+5
+Yj4sswcHivLSjr2OBQ6hzfRGJCUPUWJtUJwxSdVz5Tftf8gP0hh7C1wt3BrYbgT
Czg3/Yd2rpbcw4J7Mqn9jDF82tVQFoXmHgF8BrmbV9vLxON/WJBIuZiMFl/XbXXv
qOTfUZmc5b/ocaezTKOMeUY+PKj7bwYaHujQZjHlySfFbPuk/7NZ/cNusVdNHVzh
h5Wm1cFz0lZDl2LRY55jnOjbJJ+niIGtRLaT7PMQGDXVO+G+CxaLmMT6hOHUaPNS
mYipy8pn8tUWCi1uveuO
=ITDe
-----END PGP SIGNATURE-----




More information about the cups-devel mailing list