From: Colin Watson Date: Fri, 29 Mar 2024 01:24:32 +0000 (+0000) Subject: Allow basic connectivity check via rrsync X-Git-Tag: v3.4.0~19 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1a95869dfcd966f3efef0aec07d1c787633ea638;p=thirdparty%2Frsync.git Allow basic connectivity check via rrsync rsbackup (https://github.com/ewxrjk/rsbackup) uses "ssh true" to check that the host in question is reachable. I like to configure my backed-up hosts to force the backup system to go via `rrsync`, but I always have to add a local tweak to allow `SSH_ORIGINAL_COMMAND=true` to work. I think this would be safe enough to include in rrsync. --- diff --git a/support/rrsync b/support/rrsync index 4b4b87c5..e8b0cc0d 100755 --- a/support/rrsync +++ b/support/rrsync @@ -156,6 +156,10 @@ def main(): command = os.environ.get('SSH_ORIGINAL_COMMAND', None) if not command: die("Not invoked via sshd") + if command == 'true': + # Allow checking connectivity with "ssh true". (For example, + # rsbackup uses this.) + sys.exit(0) command = command.split(' ', 2) if command[0:1] != ['rsync']: die("SSH_ORIGINAL_COMMAND does not run rsync")