Package: samba-common
Version: 2:4.1.17+dfsg-4
Severity: normal
Tags: patch

Dear Maintainer,
On interface changes, I'm getting the following syslog message:

| $DATE $HOSTNAME root: /etc/dhcp/dhclient-enter-hooks.d/samba returned 
non-zero exit status 1

It seems #414841 wasn't fixed properly: the hook script ends with

|   # reload the samba server
|   # We don't necessarily have the samba package installed. #414841
|   [ -x /etc/init.d/smbd ] && /usr/sbin/invoke-rc.d smbd reload

, but this compound statement and thus the whole script will still
*fail* if /etc/init.d/smbd is not executable (i.e. samba is not
installed), because the exit code of the failed test propagates. You
want

|   [ ! -x /etc/init.d/smbd ] || /usr/sbin/invoke-rc.d smbd reload

instead. Patch attached.

This bug was until recently shadowed by #692846, which pevented
isc-dhcp-client < 4.3.3-5 from noticing the exit code. It now emits the
message and stops processing further hooks if one of them fails[1].

I'm reporting against testing's samba-common installed here, but
verified manually that experimental's 2:4.3.0+dfsg-2 still contains the
same code.

Thanks for maintaining samba.
    Jan

[1] According to the changelog; I didn't test the second part, and I
don't see how that's useful behaviour, tbh. In fact this is why I'm
reporting this as "normal" severity, for possibly preventing other hooks
from running, instead of barely minor for the error message.

-- System Information:
Debian Release: stretch/sid
  APT prefers testing
  APT policy: (800, 'testing'), (550, 'unstable'), (10, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 4.2.0-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=C.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: sysvinit (via /sbin/init)

Versions of packages samba-common depends on:
ii  debconf [debconf-2.0]  1.5.57
ii  dpkg                   1.18.3
ii  ucf                    3.0030

Versions of packages samba-common recommends:
pn  samba-common-bin  <none>

samba-common suggests no packages.

-- debconf information:
  samba-common/encrypt_passwords: true
  samba-common/dhcp: false
  samba-common/workgroup: WORKGROUP
  samba-common/title:
  samba-common/do_debconf: true
--- debian/samba-common.dhcp.orig	2015-09-26 21:36:02.000000000 +0200
+++ debian/samba-common.dhcp	2015-10-16 16:41:39.674299756 +0200
@@ -68,7 +68,7 @@
 
 	# reload the samba server
 	# We don't necessarily have the samba package installed. #414841
-	[ -x /etc/init.d/smbd ] && /usr/sbin/invoke-rc.d smbd reload
+	[ ! -x /etc/init.d/smbd ] || /usr/sbin/invoke-rc.d smbd reload
 
 }
 

Attachment: signature.asc
Description: PGP signature

Reply via email to