be more direct
authorBdale Garbee <bdale@gag.com>
Wed, 11 Jan 2012 21:57:50 +0000 (14:57 -0700)
committerBdale Garbee <bdale@gag.com>
Wed, 11 Jan 2012 21:57:50 +0000 (14:57 -0700)
debian/sudo-ldap.postinst
debian/sudo-ldap.postrm

index f07b331764834672b7c377bc05b39b3a15854f58..da4a83c326330e435bcaada3808b05b99f9302cc 100644 (file)
@@ -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,
index 15c155bb3190739708b2dec2f4d95b448c2bbc35..246f99dddf93905ace025ee07840e356d63756de 100644 (file)
@@ -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#