[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#878148: marked as done (cups: Default ServerName wrong/not in sync with manual)



Your message dated Thu, 12 Oct 2017 20:19:24 +0200
with message-id <2486291.79f8Y2u3JB@odyx.org>
and subject line Re: Bug#878148: cups: Default ServerName wrong/not in sync with manual
has caused the Debian Bug report #878148,
regarding cups: Default ServerName wrong/not in sync with manual
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
878148: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=878148
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: cups
Version: 2.2.4-7
Severity: normal

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

- From cups.d(5):

       ServerName hostname
            Specifies the fully-qualified hostname of the server.  The default is the value reported by the hostname(1) command.

This is plain wrong in itself, because hostname(1) does not return the
FQDN (except when run with -f). Consequently, CUPS does not listen to
requests to its FQDN by default.

- -- System Information:
Debian Release: buster/sid
  APT prefers unstable-debug
  APT policy: (500, 'unstable-debug'), (500, 'unstable'), (1, 'experimental-debug')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.12.0-2-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8), LANGUAGE=en (charmap=UTF-8)
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages cups depends on:
ii  cups-client         2.2.4-7
ii  cups-common         2.2.4-7
ii  cups-core-drivers   2.2.4-7
ii  cups-daemon         2.2.4-7
ii  cups-filters        1.16.4-1+b2
ii  cups-ppdc           2.2.4-7
ii  cups-server-common  2.2.4-7
ii  debconf             1.5.63
ii  ghostscript         9.21~dfsg-1
ii  libavahi-client3    0.7-3
ii  libavahi-common3    0.7-3
ii  libc-bin            2.24-17
ii  libc6               2.24-17
ii  libcups2            2.2.4-7
ii  libcupscgi1         2.2.4-7
ii  libcupsimage2       2.2.4-7
ii  libcupsmime1        2.2.4-7
ii  libcupsppdc1        2.2.4-7
ii  libgcc1             1:7.2.0-7
ii  libstdc++6          7.2.0-7
ii  libusb-1.0-0        2:1.0.21-2
ii  poppler-utils       0.57.0-2
ii  procps              2:3.3.12-3

Versions of packages cups recommends:
ii  avahi-daemon                     0.7-3
ii  colord                           1.3.3-2
ii  cups-filters [ghostscript-cups]  1.16.4-1+b2
ii  printer-driver-gutenprint        5.2.13-1

Versions of packages cups suggests:
ii  cups-bsd                                   2.2.4-7
pn  cups-pdf                                   <none>
ii  foomatic-db-compressed-ppds [foomatic-db]  20170723-1
ii  hplip                                      3.17.7+repack0-3
ii  printer-driver-hpcups                      3.17.7+repack0-3
ii  smbclient                                  2:4.6.7+dfsg-2
ii  udev                                       234-3

- -- debconf information excluded

-----BEGIN PGP SIGNATURE-----

iQJ4BAEBCABiFiEEPJ1UpHV1wCb7F/0mt5o8FqDE8pYFAlncx+kxGmh0dHBzOi8v
d3d3LmRvbWluaWstZ2VvcmdlLmRlL2dwZy1wb2xpY3kudHh0LmFzYxIcbmlrQG5h
dHVyYWxuZXQuZGUACgkQt5o8FqDE8pY2bBAAxGfO/4wB0jH966NSw/rC74I7+6Le
DMZfeQGVz1KSJAcTla7Ttm4Na672X1q1/twcL5Db/jzHHHDgpy4iHqNGrr4HIodS
TV7SlzK50My9KdijiEXMIU+CUvbqOWktNwD6TIvYEt+3unXthXJ/3gd46SKOHYvc
XV210i/etitom+95zw7hW0nLmSR+lzgDh9RH8e39rjJGq3T0fnPlE7FBuByjSsRq
3PDF5MABzGgSrCRxIroc9yoXxkM6AIrbkQz/IGR1NZWO52Dbn1MZdvSkhe5N7TRS
tJaSz3XaZa21RpX+JJrwxXyjnHaF4QU/6W7h2JvFq5CiLcWPXPdWYBpoVxMOJKVX
glXMKHD3K1rjP7GhcHJHogAe1azuYIhob7KqMfGy9bHkEcRVcVyzE8UGSHh0IXMP
z1k+WZjDII4DN/kxCGiJuzL5sSFAgl1DpNgLUEOxEw1lfty7jWD6SL8lU0jX5PiU
9mFKK1KSEeQ1LPTMBtZHwjlX0ABGVRrthbMjge79UWjdd1zG7H6ImP30o4xU7teH
IobNWEtYnZUFNVzdzNSjGIOZcmDou2k4FHvjfbjwrYRBqji1SJ7G6CNvm3TRwPJM
9Bt0t/JqSsooT7/Ui45p7bXLWqmhQcbomwGFIPUhP4jbxnZOiqFOQrOK2Io06vfw
JLVI1qwZXGqzG4o=
=4EIV
-----END PGP SIGNATURE-----

--- End Message ---
--- Begin Message ---
Control: tags -1 +wontfix

Le jeudi, 12 octobre 2017, 19.03:33 h CEST Dominik George a écrit :
> > … ServerName is set from gethostname(2), which, by their manpages, return
> > the same value as hostname(1), aka uname(2)'s nodename, which you can
> > retrieve from $ uname -n.
> 
> Right. Now read the man page:
> 
>       ServerName hostname
>             Specifies the fully-qualified hostname of the server.  The
> default is the value reported by the hostname(1) command.
> 
> Neither gethopstname(2) nor hostname(1) nor uname(2) return the
> *fully-qualified hostname of the server*.

That's right. If I phrase differently what the manpage says: "ServerName is 
the configuration stanza you _can_ use in cupsd.conf if you want to specify the 
fully-qualified hostname of the server. If you don't, the default will be the 
value reported by the hostname(1) command."

> So the default used is NOT the FQDN, while ServerName shall be set to the
> FQDN.

Exactly. The default is (and I think both the code and the documentation agree 
here), whatever hostname(1) outputs.

> So: The code should be changed…

I disagree. You happen to disagree what the ServerName default should be and 
that's fine. I, as maintainer, think it's a fine default.

> > ServerName is set around these lines and there are various heuristics
> > which
> > add ServerAliases to that configuration. All these are logged at the
> > 'debug' level. I've added a patch to log the ServerName cups takes:
> > 
> > --- a/scheduler/conf.c
> > +++ b/scheduler/conf.c
> > @@ -891,6 +891,7 @@ cupsdReadConfiguration(void)
> > 
> >      }
> >      
> >      cupsdSetString(&ServerName, temp);
> > 
> > +    cupsdLogMessage(CUPSD_LOG_DEBUG, "Set ServerName %s", temp);
> 
> …especially as these heuristics try to generate the base host name by
> stripping the domain part from the ServerName, expecting it to be the
> FQDN.

Well. No, they don't. Read the code again. Whatever is outputted by 
gethostname(2) goes to temp which is then _set_ to ServerName. ServerAliases 
is filled by other heuristics.

> > What is it that you get?
> 
> $ hostname
> foo
> $ hostname -f
> foo.example.com
> 
> Still, CUPS only responds to foo, not foo.example.com.

I think you're misreading the 'ServerName' documentation. The documentation 
doesn't say that ServerName will have as default the system's FQDN, it says 
that _if_ you don't define it, it will use the output of hostname(2). 
hostname(2) says it uses gethostname(1) which itself says it will return the 
output of uname -n.

The code does what the documentation says it does.

> (Please mind that your system seems to be misconfigured and does not
> return the FQDN with hostname -f!)

(I don't want my system to have a FQDN as it's not routeable anyway.)

> > And do you still think there's discrepancy between
> > code and documentation? If so, which one do you think is wrong?
> 
> The code is wrong. It should use the FQDN, like reported by hostname -f,
> as default for ServerName, probably by resolving the name it got from
> gethostbyname() twice (like hostname -f does).

I disagree. In my reading of the code and documentation, they _do_ agree. If 
you don't like the default (uname -n), `ServerName` is there for you; you can 
specify a specific FQDN. Finally, I think ServerName defaulting to _not_ being 
the FQDN is in line with CUPS listening on localhost by default only. You will 
need to add both `Listen` _and_ `ServerName` stanzas to cupsd.conf if you want 
it to listen to its FQDN, and I don't see a problem with that.

I'm hereby closing this bug, and tagging it as wontfix too. As I am _not_ going 
to diverge from upstream on that, please feel free to bring your arguments to 
upstream on their bugtracker (but don't hold your breath; this code is in CUPS 
since 2009):
	https://github.com/apple/cups/issues

With my best regards,
    OdyX

--- End Message ---

Reply to: