Browse Source

fix: [rsync-backup-target] make target accept ``rsync`` client ``3.2.0``

Starting from ``3.2.0`` introduced ``Ivu`` server commands, these are
now accepted.
matomo
Valentin Lab 12 months ago
parent
commit
629df1d83c
  1. 4
      rsync-backup-target/build/src/usr/local/sbin/ssh-cmd-validate

4
rsync-backup-target/build/src/usr/local/sbin/ssh-cmd-validate

@ -45,7 +45,7 @@ if [[ "$SSH_ORIGINAL_COMMAND" =~ [\&\(\{\;\<\>\`\$\}] ]]; then
reject reject
fi fi
if [[ "$SSH_ORIGINAL_COMMAND" =~ ^"rsync --server -"[vnloHgDtpArRzCeiLsfx\.]+(" --"[a-z=%-]+|" --partial-dir .rsync-partial")*" . /var/mirror/$ident"$ ]]; then
if [[ "$SSH_ORIGINAL_COMMAND" =~ ^"rsync --server -"[vnloHgDtpArRzCeiLsfxIu\.]+(" --"[a-z=%-]+|" --partial-dir .rsync-partial")*" . /var/mirror/$ident"$ ]]; then
log "ACCEPTED BACKUP COMMAND: $SSH_ORIGINAL_COMMAND" log "ACCEPTED BACKUP COMMAND: $SSH_ORIGINAL_COMMAND"
## Interpret \ to allow passing spaces (want to avoid possible issue with \n) ## Interpret \ to allow passing spaces (want to avoid possible issue with \n)
@ -56,7 +56,7 @@ if [[ "$SSH_ORIGINAL_COMMAND" =~ ^"rsync --server -"[vnloHgDtpArRzCeiLsfx\.]+("
"--log-file=/var/log/rsync/target_$1_rsync.log" \ "--log-file=/var/log/rsync/target_$1_rsync.log" \
"--log-file-format=%i %o %f %l %b" \ "--log-file-format=%i %o %f %l %b" \
"${ssh_args[@]:3}" "${ssh_args[@]:3}"
elif [[ "$SSH_ORIGINAL_COMMAND" =~ ^"rsync --server --sender -"[vnloHgDtpArRzCeiLsfx\.]+(" --"[a-z=%-]+|" --partial-dir .rsync-partial")*" . /var/mirror/$ident"(|/.*)$ ]]; then
elif [[ "$SSH_ORIGINAL_COMMAND" =~ ^"rsync --server --sender -"[vnloHgDtpArRzCeiLsfxIu\.]+(" --"[a-z=%-]+|" --partial-dir .rsync-partial")*" . /var/mirror/$ident"(|/.*)$ ]]; then
## Interpret \ to allow passing spaces (want to avoid possible issue with \n) ## Interpret \ to allow passing spaces (want to avoid possible issue with \n)
#read -a ssh_args <<< "${SSH_ORIGINAL_COMMAND}" #read -a ssh_args <<< "${SSH_ORIGINAL_COMMAND}"

Loading…
Cancel
Save