Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > 91a37dac34abf6bb76864322a901553d > scriptlet

sudo-1.7.2p1-29.el5_10.x86_64.rpm

POSTIN

/bin/sh
/bin/chmod 0440 /etc/sudoers || :

#
# rhbz#846631: fix permissions on nsswitch.conf
#
if [ "$(stat -c '%a' "/etc/nsswitch.conf")" = "600" ]; then
	chmod 0644 "/etc/nsswitch.conf" || :
fi

#
# rhbz#841070: remove the old line, the new one won't be matched
#              by the old regexp and won't be deleted on upgrade
#
if grep -q '^sudoers: files ldap$' "/etc/nsswitch.conf"; then
   sed -c -i '/^sudoers: files ldap/ d' "/etc/nsswitch.conf"
   restorecon "/etc/nsswitch.conf"
fi

if ! grep -q '^[[:space:]]*sudoers:' "/etc/nsswitch.conf"; then
   # No "sudoers:" line in nsswitch.conf, add a default one
   echo 'sudoers:  files ldap' >> "/etc/nsswitch.conf"
   restorecon "/etc/nsswitch.conf"
fi

POSTUN

/bin/sh
# Remove the "sudoers:" line from nsswitch.conf if it's not modified
# and only when we are erasing (not upgrading) the package!
if [ $1 = 0 ] && grep -q '^sudoers:  files ldap$' "/etc/nsswitch.conf"; then
   sed -c -i '/^sudoers:  files ldap$/ d' "/etc/nsswitch.conf"
   restorecon "/etc/nsswitch.conf"
fi