From: Bdale Garbee Date: Wed, 11 Jan 2012 21:42:26 +0000 (-0700) Subject: add an entry in nsswitch.conf and remove on purge for the sudo-ldap package X-Git-Tag: debian/1.8.3p1-3~8 X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=136984d9de9590f104988ad24fb5ec6618680f04;p=debian%2Fsudo add an entry in nsswitch.conf and remove on purge for the sudo-ldap package --- diff --git a/debian/sudo-ldap.postinst b/debian/sudo-ldap.postinst index c242be1..f07b331 100644 --- a/debian/sudo-ldap.postinst +++ b/debian/sudo-ldap.postinst @@ -11,6 +11,13 @@ if [ ! -f /etc/sudoers ];then echo "WARNING: /etc/sudoers not present!"; fi +# modify nsswitch.conf if needed +NSSWITCH="/etc/nsswitch.conf" +if [ -z "`grep \"^sudoers:\" $NSSWITCH`" ] +then + echo "sudoers: files ldap" >> $NSSWITCH +fi + # handle state directory transition from /var/run/sudo to /var/lib/sudo, # moving any existing content over to avoid re-lecturing existing users if [ -d "/var/run/sudo" ];then diff --git a/debian/sudo-ldap.postrm b/debian/sudo-ldap.postrm index 30fb1e8..15c155b 100644 --- a/debian/sudo-ldap.postrm +++ b/debian/sudo-ldap.postrm @@ -22,4 +22,10 @@ case "$1" in ;; esac +# modify nsswitch.conf +NSSWITCH="/etc/nsswitch.conf" +if [ -w $NSSWITCH ] ; then + sed -i /^sudoers:/d $NSSWITCH +fi + #DEBHELPER#