From: Bdale Garbee Date: Sat, 12 Nov 2011 22:56:06 +0000 (-0700) Subject: and return only works from a function X-Git-Tag: debian/1.8.3p1-2~4 X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=2ba52fa36bd6e2bd0aae1675c88863b3bb1003d7;p=debian%2Fsudo and return only works from a function --- diff --git a/debian/sudo-ldap.preinst b/debian/sudo-ldap.preinst index 2befe58..1dfaa02 100644 --- a/debian/sudo-ldap.preinst +++ b/debian/sudo-ldap.preinst @@ -6,14 +6,13 @@ case "$1" in SUDOERS="/etc/sudoers" - [ -e "$SUDOERS" ] || return 0 - - md5sum="$(md5sum $SUDOERS | sed -e 's/ .*//')" - if [ "$md5sum" = "c5dab0f2771411ed7e67d6dab60a311f" ]; then - # move unchanged sudoers file to avoid conffile question - mv "$SUDOERS" "$SUDOERS.pre-conffile" + if [ -e "$SUDOERS" ]; then + md5sum="$(md5sum $SUDOERS | sed -e 's/ .*//')" + if [ "$md5sum" = "c5dab0f2771411ed7e67d6dab60a311f" ]; then + # move unchanged sudoers file to avoid conffile question + mv "$SUDOERS" "$SUDOERS.pre-conffile" + fi fi - fi ;; esac diff --git a/debian/sudo.preinst b/debian/sudo.preinst index 2befe58..1dfaa02 100644 --- a/debian/sudo.preinst +++ b/debian/sudo.preinst @@ -6,14 +6,13 @@ case "$1" in SUDOERS="/etc/sudoers" - [ -e "$SUDOERS" ] || return 0 - - md5sum="$(md5sum $SUDOERS | sed -e 's/ .*//')" - if [ "$md5sum" = "c5dab0f2771411ed7e67d6dab60a311f" ]; then - # move unchanged sudoers file to avoid conffile question - mv "$SUDOERS" "$SUDOERS.pre-conffile" + if [ -e "$SUDOERS" ]; then + md5sum="$(md5sum $SUDOERS | sed -e 's/ .*//')" + if [ "$md5sum" = "c5dab0f2771411ed7e67d6dab60a311f" ]; then + # move unchanged sudoers file to avoid conffile question + mv "$SUDOERS" "$SUDOERS.pre-conffile" + fi fi - fi ;; esac