mirror of
https://github.com/RsyncProject/rsync.git
synced 2026-05-24 06:45:27 -04:00
Abort if the cd fails.
This commit is contained in:
@@ -24,10 +24,12 @@ if [ "$user" ]; then
|
||||
prefix=''
|
||||
if [ $do_cd = y ]; then
|
||||
home=`perl -e "print((getpwnam('$user'))[7])"`
|
||||
prefix="cd '$home' ;"
|
||||
prefix="cd '$home' &&"
|
||||
fi
|
||||
sudo -H -u "$user" sh -c "$prefix $*"
|
||||
else
|
||||
[ $do_cd = y ] && cd
|
||||
if [ $do_cd = y ]; then
|
||||
cd || exit 1
|
||||
fi
|
||||
eval "${@}"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user