[Pkg-samba-maint] [samba] 01/01: Check testparm explicitly instead of ignoring all errors

Steve Langasek vorlon at alioth.debian.org
Tue Oct 15 04:08:40 UTC 2013


This is an automated email from the git hooks/post-receive script.

vorlon pushed a commit to branch samba_4.0
in repository samba.

commit 2fa5c80df6bc2055c59253ae86106f224895cb44
Author: Steve Langasek <vorlon at debian.org>
Date:   Mon Oct 14 21:07:34 2013 -0700

    Check testparm explicitly instead of ignoring all errors
    
    Revert change that drops set -e.  The script is written with set -e handling
    in mind (failing at the first error), making the script set +e entirely
    changes the semantics.  Instead, just ignore errors from testparm, which is
    what we actually want here.
---
 debian/changelog  |    5 ++++-
 debian/samba.init |    6 ++++--
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index fd6a8d7..804b1f7 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -5,11 +5,14 @@ samba (2:4.0.10+dfsg-3) UNRELEASED; urgency=low
     samba4 merge. Closes: #726183
   * Remove unused alternatives links on upgrade in samba-common-bin.prerm.
   * Add support for 'status' in samba-ad-dc init script.
-  * Don't fail on errors in samba init script. Closes: #726326
   * Fix umask in make_shlibs to avoid lintian error
     control-file-has-bad-permissions.
   * Enable verbose build log.
 
+  [ Steve Langasek ]
+  * Don't fail on errors from testparm in the samba init script.
+    Closes: #726326
+
  -- Ivo De Decker <ivo.dedecker at ugent.be>  Mon, 14 Oct 2013 19:33:04 +0200
 
 samba (2:4.0.10+dfsg-2) unstable; urgency=low
diff --git a/debian/samba.init b/debian/samba.init
index 345bfec..a0594c5 100644
--- a/debian/samba.init
+++ b/debian/samba.init
@@ -9,6 +9,8 @@
 # Short-Description: ensure Samba daemons are started (nmbd and smbd)
 ### END INIT INFO
 
+set -e
+
 # start nmbd, smbd and samba-ad-dc unconditionally
 # the init scripts themselves check if they are needed or not
 case $1 in
@@ -32,8 +34,8 @@ case $1 in
 		;;
 	status)
 		status=0
-		NMBD_DISABLED=`testparm -s --parameter-name='disable netbios' 2>/dev/null`
-		SERVER_ROLE=`samba-tool testparm --parameter-name="server role"  2>/dev/null | tail -1`
+		NMBD_DISABLED=`testparm -s --parameter-name='disable netbios' 2>/dev/null || true`
+		SERVER_ROLE=`samba-tool testparm --parameter-name="server role"  2>/dev/null | tail -1 || true`
 		if [ "$SERVER_ROLE" != "active directory domain controller" ]; then
 			if [ "$NMBD_DISABLED" != "Yes" ]; then
 				/etc/init.d/nmbd status || status=$?

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-samba/samba.git




More information about the Pkg-samba-maint mailing list