mirror of
https://github.com/RsyncProject/rsync.git
synced 2026-10-20 21:04:15 -04:00
Abort if the cd fails.
This commit is contained in:
1 parent
58663df432
commit
8bcd6a4aff
1 file changed
+4
-2
+4
-2
@@ -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