ssh commands filter update

This commit is contained in:
deajan 2013-06-23 13:53:22 +02:00
parent 02774aeb4f
commit 9741cd3b9e
2 changed files with 19 additions and 10 deletions

View File

@ -1,5 +1,7 @@
## Latest changelog ## Latest changelog
- 23/06/2013 v 1.84 RC1 approaching
- Added ssh commands filter, updated documentation
- Rewrote local space check function - Rewrote local space check function
- Added ability to run another executable than rsync (see documentation on sudo execution) - Added ability to run another executable than rsync (see documentation on sudo execution)
- Added some Rsync argument parameters (preserve ACL, Xattr, and stream compression) - Added some Rsync argument parameters (preserve ACL, Xattr, and stream compression)

View File

@ -2,7 +2,9 @@
##### Obackup ssh command filter ##### Obackup ssh command filter
## Paranoia option. Only change this if you read the documentation and know what you're doing ## If enabled, execution of "sudo" command will be allowed.
SUDO_EXEC=yes
## Paranoia option. Don't change this unless you read the documentation and still feel concerned about security issues.
RSYNC_EXECUTABLE=rsync RSYNC_EXECUTABLE=rsync
function Go function Go
@ -20,17 +22,22 @@ case ${SSH_ORIGINAL_COMMAND%% *} in
"du") "du")
Go ;; Go ;;
"sudo") "sudo")
if [[ "$SSH_ORIGINAL_COMMAND" == "sudo $RSYNC_EXECUTABLE"* ]] if [ "$SUDO_EXEC" == "yes" ]
then then
Go if [[ "$SSH_ORIGINAL_COMMAND" == "sudo $RSYNC_EXECUTABLE"* ]]
elif [[ "$SSH_ORIGINAL_COMMAND" == "sudo du"* ]] then
then Go
Go elif [[ "$SSH_ORIGINAL_COMMAND" == "sudo du"* ]]
elif [[ "$SSH_ORIGINAL_COMMAND" == "sudo find"* ]] then
then Go
Go elif [[ "$SSH_ORIGINAL_COMMAND" == "sudo find"* ]]
then
Go
else
echo "Sudo command not allowed."
fi
else else
echo "Sudo command not allowed." echo "Sudo command not enabled."
fi fi
;; ;;
*) *)