wok diff sudo/receipt @ rev 18730
Quote root dir in post_install
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Sun Dec 20 15:13:45 2015 +0100 (2015-12-20) |
parents | 66940c68d29e |
children | d6ca18366f41 |
line diff
1.1 --- a/sudo/receipt Tue Apr 01 08:27:12 2014 +0000 1.2 +++ b/sudo/receipt Sun Dec 20 15:13:45 2015 +0100 1.3 @@ -39,21 +39,19 @@ 1.4 pre_install() 1.5 { 1.6 echo "Processing pre-install commands..." 1.7 - if [ -f $root/etc/sudoers.bak ]; then 1.8 - cp $root/etc/sudoers $root/etc/sudoers.bak 1.9 + if [ -f "$1/etc/sudoers.bak" ]; then 1.10 + cp "$1/etc/sudoers" "$1/etc/sudoers.bak" 1.11 fi 1.12 } 1.13 1.14 post_install() 1.15 { 1.16 - local root 1.17 - root=$1 1.18 echo "Processing post-install commands..." 1.19 - if [ -f $root/etc/sudoers.bak ]; then 1.20 - mv $root/etc/sudoers $root/etc/sudoers-dist 1.21 - mv $root/etc/sudoers.bak $root/etc/sudoers 1.22 + if [ -f "$1/etc/sudoers.bak" ]; then 1.23 + mv "$1/etc/sudoers" "$1/etc/sudoers-dist" 1.24 + mv "$1/etc/sudoers.bak" "$1/etc/sudoers" 1.25 else 1.26 - chown root.root $root/etc/sudoers 1.27 - chmod 0440 $root/etc/sudoers 1.28 + chown root.root "$1/etc/sudoers" 1.29 + chmod 0440 "$1/etc/sudoers" 1.30 fi 1.31 }