Skip to content

Commit

Permalink
Allow basic connectivity check via rrsync
Browse files Browse the repository at this point in the history
rsbackup (https://github.com/ewxrjk/rsbackup) uses "ssh <host> 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.
  • Loading branch information
cjwatson authored and tridge committed Apr 5, 2024
1 parent a47ae6f commit 0d1efe7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions support/rrsync
Original file line number Diff line number Diff line change
Expand Up @@ -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 <host> 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")
Expand Down

0 comments on commit 0d1efe7

Please sign in to comment.