wok-next rev 1852

Fix: sudo, keep pr?vious sudoers file.
author Eric Joseph-Alexandre <erjo@slitaz.org>
date Sun Dec 14 11:08:31 2008 +0100 (2008-12-14)
parents f9c021d9b2fc
children 9bd092dc96da
files sudo/receipt
line diff
     1.1 --- a/sudo/receipt	Sun Dec 14 10:55:03 2008 +0100
     1.2 +++ b/sudo/receipt	Sun Dec 14 11:08:31 2008 +0100
     1.3 @@ -41,12 +41,24 @@
     1.4  	strip -s $fs/usr/lib/sudo_noexec.so
     1.5  }
     1.6  
     1.7 +pre_install()
     1.8 +{
     1.9 +	echo "Processing pre-install commands..."
    1.10 +	if [ -f $root/etc/sudoers.bak ]; then
    1.11 +		cp $root/etc/sudoers $root/etc/sudoers.bak
    1.12 +	fi
    1.13 +}
    1.14  
    1.15  post_install()
    1.16  {
    1.17  	local root
    1.18  	root=$1
    1.19  	echo "Processing post-install commands..."
    1.20 -	chown root.root $root/etc/sudoers
    1.21 -	chmod 0440 $root/etc/sudoers
    1.22 +	if [ -f $root/etc/sudoers.bak ]; then
    1.23 +		rm -f $root/etc/sudoers
    1.24 +		mv $root/etc/sudoers.bak $root/etc/sudoers
    1.25 +	else
    1.26 +		chown root.root $root/etc/sudoers
    1.27 +		chmod 0440 $root/etc/sudoers
    1.28 +	fi
    1.29  }