mirror of
https://github.com/deajan/obackup.git
synced 2025-05-10 12:13:41 +02:00
Replaced rsync with $RSYNC_EXECUTABLE providing additionnal security layer
This commit is contained in:
parent
52e09dd5b3
commit
2bde5d1df1
@ -357,10 +357,10 @@ function SetSudoOptions
|
|||||||
{
|
{
|
||||||
if [ "$SUDO_EXEC" == "yes" ]
|
if [ "$SUDO_EXEC" == "yes" ]
|
||||||
then
|
then
|
||||||
RSYNC_PATH="sudo $(which rsync)"
|
RSYNC_PATH="sudo $(which $RSYNC_EXECUTABLE)"
|
||||||
COMMAND_SUDO="sudo"
|
COMMAND_SUDO="sudo"
|
||||||
else
|
else
|
||||||
RSYNC_PATH="$(which rsync)"
|
RSYNC_PATH="$(which $RSYNC_EXECUTABLE)"
|
||||||
COMMAND_SUDO=""
|
COMMAND_SUDO=""
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
@ -753,9 +753,9 @@ function Rsync
|
|||||||
LogError "Connectivity test failed. Stopping current task."
|
LogError "Connectivity test failed. Stopping current task."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
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
|
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
|
fi
|
||||||
#### Eval is used so the full command is processed without bash adding single quotes round variables
|
#### Eval is used so the full command is processed without bash adding single quotes round variables
|
||||||
if [ "$DEBUG" == "yes" ]
|
if [ "$DEBUG" == "yes" ]
|
||||||
|
Loading…
Reference in New Issue
Block a user