Package: ddclient
Version: 3.8.2-2
Severity: critical
Tags: patch
Justification: breaks the whole system

Dear Maintainer,

As far as I can tell, this also impacts the unstable version (3.8.2-3)

What led up to the situation?

After installing ddclient on my Google Compute Engine hosted Debian/Jessie
VM
the VM failed to be usable after a reboot.  The VM was unable to route
packets
because it had failed to install the route to the network gateway or a
default
route.

What exactly did you do (or not do) that was effective (or ineffective)?

Determined that adding ddclient to a Debian/Jessie system on GCE rendered
the
VM unable to reboot properly.  Diagnosis indicated that routing was not
being
properly set up.  Neither was the hostname being set properly.  Both are
done
by other dhclient exit hooks in /etc/dhcp/dhclient-exit-hooks.d.  They were
not
being run.  They are run by /sbin/dhclient-script using run-part -list and
then
sourcing each hook file in turn.

The Problem:  When I looked at the ddclient hook, I noticed it was calling
exit(0),
which exited the entire dhclient-script prematurely.  This is very bad,
since none
of the other exits was given an opportuntity to run.  Exits must not call
exit!
Returning of error status should be through the "exit_status" shell variable
instead - as documented (poorly) in the manual page for dhclient-script(8).

I changed the ddclient exit hook to not call exit, but instead to return
control
to the dhclient-script as is the "API" for these hooks.

What was the outcome of this action?

The system now boots properly.  :-)

-Doug-


-- System Information:
Debian Release: 8.2
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 3.16.0-4-amd64 (SMP w/1 CPU core)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages ddclient depends on:
ii  debconf [debconf-2.0]  1.5.56
ii  initscripts            2.88dsf-59
ii  lsb-base               4.1+Debian13+nmu1
ii  perl [perl5]           5.20.2-3+deb8u1

Versions of packages ddclient recommends:
ii  libio-socket-ssl-perl  2.002-2+deb8u1

ddclient suggests no packages.

-- Configuration Files:
/etc/dhcp/dhclient-exit-hooks.d/ddclient changed:
run_ddclient() {
    [ -x /usr/sbin/ddclient ] || return
    [ -f /etc/default/ddclient ] || return
    . /etc/default/ddclient
    [ $run_dhclient = "true" ] || return
    case $reason in
        BOUND | RENEW | REBIND)
            /usr/bin/logger -t dhclient $reason, updating IP address with
ddclient
            /usr/sbin/ddclient -daemon=0 -syslog > /dev/null 2>&1
            ;;
        *)
            ;;
    esac
}
run_ddclient


-- debconf information:
* ddclient/protocol: dyndns2
  ddclient/blankhostslist:
  ddclient/run_daemon: true
* ddclient/server: dynamic.pairnic.com
* ddclient/names: google.randomnotes.org
* ddclient/service: other
* ddclient/username: pairnic
* ddclient/fetchhosts: Manually
  ddclient/daemon_interval: 300
* ddclient/password-mismatch:
  ddclient/hostslist:
  ddclient/run_ipup: false
  ddclient/run_dhclient: false
* ddclient/interface: lo1
* ddclient/checkip: false
  ddclient/modifiedconfig:



Suggested Patch:
*** ddclient.broken     2014-10-06 18:46:05.000000000 +0000
--- ddclient    2015-12-11 19:52:57.248086052 +0000
***************
*** 1,16 ****
  #!/bin/sh
  # /etc/dhcp/dhclient-exit-hooks.d/ddclient - exit hook for dhclient

! [ -x /usr/sbin/ddclient ] || exit 0
! [ -f /etc/default/ddclient ] || exit 0
! . /etc/default/ddclient
! [ $run_dhclient = "true" ] || exit 0

! case $reason in
!     BOUND | RENEW | REBIND)
!         /usr/bin/logger -t dhclient $reason, updating IP address with
ddclient
!         /usr/sbin/ddclient -daemon=0 -syslog > /dev/null 2>&1
!         ;;
!     *)
!         ;;
! esac
--- 1,20 ----
  #!/bin/sh
  # /etc/dhcp/dhclient-exit-hooks.d/ddclient - exit hook for dhclient

! run_ddclient() {
!     [ -x /usr/sbin/ddclient ] || return
!     [ -f /etc/default/ddclient ] || return
!     . /etc/default/ddclient
!     [ $run_dhclient = "true" ] || return

!     case $reason in
!       BOUND | RENEW | REBIND)
!             /usr/bin/logger -t dhclient $reason, updating IP address with
ddclient
!             /usr/sbin/ddclient -daemon=0 -syslog > /dev/null 2>&1
!             ;;
!       *)
!             ;;
!     esac
! }
!
! run_ddclient

Reply via email to