add an entry in nsswitch.conf and remove on purge for the sudo-ldap package
[debian/sudo] / debian / sudo-ldap.postinst
index c242be1f9c2076d88c5ba364c575d62605e24e98..f07b331764834672b7c377bc05b39b3a15854f58 100644 (file)
@@ -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