1
0
mirror of https://github.com/deajan/obackup.git synced 2024-12-04 20:53:41 +01:00

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
- 23/06/2013 v 1.84 RC1 approaching
- Added ssh commands filter, updated documentation
- Rewrote local space check function
- Added ability to run another executable than rsync (see documentation on sudo execution)
- Added some Rsync argument parameters (preserve ACL, Xattr, and stream compression)

View File

@ -2,7 +2,9 @@
##### 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
function Go
@ -20,17 +22,22 @@ case ${SSH_ORIGINAL_COMMAND%% *} in
"du")
Go ;;
"sudo")
if [[ "$SSH_ORIGINAL_COMMAND" == "sudo $RSYNC_EXECUTABLE"* ]]
if [ "$SUDO_EXEC" == "yes" ]
then
Go
elif [[ "$SSH_ORIGINAL_COMMAND" == "sudo du"* ]]
then
Go
elif [[ "$SSH_ORIGINAL_COMMAND" == "sudo find"* ]]
then
Go
if [[ "$SSH_ORIGINAL_COMMAND" == "sudo $RSYNC_EXECUTABLE"* ]]
then
Go
elif [[ "$SSH_ORIGINAL_COMMAND" == "sudo du"* ]]
then
Go
elif [[ "$SSH_ORIGINAL_COMMAND" == "sudo find"* ]]
then
Go
else
echo "Sudo command not allowed."
fi
else
echo "Sudo command not allowed."
echo "Sudo command not enabled."
fi
;;
*)