From 2bde5d1df19532478bf90a599e3c1b2a91eb32c0 Mon Sep 17 00:00:00 2001 From: deajan Date: Fri, 21 Jun 2013 18:20:03 +0200 Subject: [PATCH] Replaced rsync with $RSYNC_EXECUTABLE providing additionnal security layer --- obackup.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/obackup.sh b/obackup.sh index 8bf63dc..6eb5ec2 100755 --- a/obackup.sh +++ b/obackup.sh @@ -357,10 +357,10 @@ function SetSudoOptions { if [ "$SUDO_EXEC" == "yes" ] then - RSYNC_PATH="sudo $(which rsync)" + RSYNC_PATH="sudo $(which $RSYNC_EXECUTABLE)" COMMAND_SUDO="sudo" else - RSYNC_PATH="$(which rsync)" + RSYNC_PATH="$(which $RSYNC_EXECUTABLE)" COMMAND_SUDO="" fi } @@ -753,9 +753,9 @@ function Rsync LogError "Connectivity test failed. Stopping current task." exit 1 fi - rsync_cmd="$(which rsync) $RSYNC_ARGS --delete $RSYNC_EXCLUDE --rsync-path=\"$RSYNC_PATH\" -e \"$(which ssh) $SSH_COMP -i $SSH_RSA_PRIVATE_KEY -p $REMOTE_PORT\" \"$REMOTE_USER@$REMOTE_HOST:$1\" \"$local_file_storage_path\" > /dev/shm/obackup_rsync_output_$SCRIPT_PID 2>&1" + rsync_cmd="$(which $RSYNC_EXECUTABLE) $RSYNC_ARGS --delete $RSYNC_EXCLUDE --rsync-path=\"$RSYNC_PATH\" -e \"$(which ssh) $SSH_COMP -i $SSH_RSA_PRIVATE_KEY -p $REMOTE_PORT\" \"$REMOTE_USER@$REMOTE_HOST:$1\" \"$local_file_storage_path\" > /dev/shm/obackup_rsync_output_$SCRIPT_PID 2>&1" else - rsync_cmd="$(which rsync) $RSYNC_ARGS --delete $RSYNC_EXCLUDE --rsync-path=\"$RSYNC_PATH\" \"$1\" \"$local_file_storage_path\" > /dev/shm/obackup_rsync_output_$SCRIPT_PID 2>&1" + rsync_cmd="$(which $RSYNC_EXECUTABLE) $RSYNC_ARGS --delete $RSYNC_EXCLUDE --rsync-path=\"$RSYNC_PATH\" \"$1\" \"$local_file_storage_path\" > /dev/shm/obackup_rsync_output_$SCRIPT_PID 2>&1" fi #### Eval is used so the full command is processed without bash adding single quotes round variables if [ "$DEBUG" == "yes" ]