diff options
author | Didier Raboud <odyx@debian.org> | 2014-07-24 22:02:16 +0200 |
---|---|---|
committer | Didier Raboud <odyx@debian.org> | 2014-07-24 22:02:16 +0200 |
commit | 12a1e3786b3746339cc671054e2fcc99e9a0ef88 (patch) | |
tree | ab5306bc6c5ba3492bfa0a87a151d5968f78dda1 | |
parent | 0f861b0b853c6211c0722e9e9f9c66db0151d8ec (diff) | |
download | cups-12a1e3786b3746339cc671054e2fcc99e9a0ef88.tar.gz |
Correct default listening address used under systemd for new installations; also correct the discrepancy on upgrades
Closes: #755807
-rw-r--r-- | debian/cups-daemon.preinst | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/debian/cups-daemon.preinst b/debian/cups-daemon.preinst index 0d0a711a..63087f06 100644 --- a/debian/cups-daemon.preinst +++ b/debian/cups-daemon.preinst @@ -10,10 +10,12 @@ install|upgrade) mv /etc/cups/cupsd.conf /etc/cups/cupsd.conf.conffile-bak fi - # If file doesn't exist or if it has two conflicting stanzas + # If file doesn't exist, has two conflicting stanzas or has a "listen-to-all" while cupsd.conf says it should 'listen-to-localhost' if [ ! -f /etc/cups/cupsd-systemd-listen.conf ] || \ ( grep -q '^ListenStream=0.0.0.0:' /etc/cups/cupsd-systemd-listen.conf 2>/dev/null && \ - grep -q '^ListenStream=127.0.0.1:' /etc/cups/cupsd-systemd-listen.conf 2>/dev/null ) ;\ + grep -q '^ListenStream=127.0.0.1:' /etc/cups/cupsd-systemd-listen.conf 2>/dev/null ) || + ( grep -q '^ListenStream=0.0.0.0:' /etc/cups/cupsd-systemd-listen.conf 2>/dev/null && \ + grep -q '^\s*Listen localhost:' /etc/cups/cupsd.conf 2>/dev/null );\ then mkdir -p /etc/cups cat >/etc/cups/cupsd-systemd-listen.conf <<EOF @@ -43,8 +45,8 @@ EOF else cat >>/etc/cups/cupsd-systemd-listen.conf <<EOF # Matches the default 'Listen localhost:631' from cupsd.conf.default -ListenStream=0.0.0.0:631 -ListenStream=[::]:631 +ListenStream=127.0.0.1:631 +ListenStream=[::1]:631 EOF fi fi |