From 8b907c287e3a5ac470b07530eb2bacf3c287de82 Mon Sep 17 00:00:00 2001 From: Bdale Garbee Date: Wed, 11 Jan 2012 14:57:50 -0700 Subject: [PATCH] be more direct --- debian/sudo-ldap.postinst | 5 ++--- debian/sudo-ldap.postrm | 7 +++---- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/debian/sudo-ldap.postinst b/debian/sudo-ldap.postinst index f07b331..da4a83c 100644 --- a/debian/sudo-ldap.postinst +++ b/debian/sudo-ldap.postinst @@ -12,10 +12,9 @@ if [ ! -f /etc/sudoers ];then fi # modify nsswitch.conf if needed -NSSWITCH="/etc/nsswitch.conf" -if [ -z "`grep \"^sudoers:\" $NSSWITCH`" ] +if [ -z "`grep \"^sudoers:\" /etc/nsswitch.conf`" ] then - echo "sudoers: files ldap" >> $NSSWITCH + echo "sudoers: files ldap" >> /etc/nsswitch.conf fi # handle state directory transition from /var/run/sudo to /var/lib/sudo, diff --git a/debian/sudo-ldap.postrm b/debian/sudo-ldap.postrm index 15c155b..246f99d 100644 --- a/debian/sudo-ldap.postrm +++ b/debian/sudo-ldap.postrm @@ -22,10 +22,9 @@ case "$1" in ;; esac -# modify nsswitch.conf -NSSWITCH="/etc/nsswitch.conf" -if [ -w $NSSWITCH ] ; then - sed -i /^sudoers:/d $NSSWITCH +# remove sudoers entries, if any, from nsswitch.conf +if [ -w /etc/nsswitch.conf ] ; then + sed -i /^sudoers:/d /etc/nsswitch.conf fi #DEBHELPER# -- 2.47.2