Open elboulangero opened 1 year ago
Here's the patch (to apply on a system where scanner is installed at /usr/bin/scanner.pl
, like it is in Debian):
From fd25b09f47b6afa3fbab9e868e39f25ef5702e91 Mon Sep 17 00:00:00 2001
From: Arnaud Rebillout <arnaudr@kali.org>
Date: Wed, 8 Feb 2023 15:12:22 +0700
Subject: [PATCH] Allow random string after rsyncd version in banner
---
scanner | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git /usr/bin/scanner.pl /usr/bin/scanner.pl
index 3153eea..150a6d7 100755
--- /usr/bin/scanner.pl
+++ /usr/bin/scanner.pl
@@ -1202,7 +1202,7 @@ sub rsync_get_filelist
alarm 600;
sysread(S, $buf, 4096);
alarm 0;
- die("$identifier: protocol error [$buf]\n") if $buf !~ /^\@RSYNCD: ([\d.]+)\n/s;
+ die("$identifier: protocol error [$buf]\n") if $buf !~ /^\@RSYNCD: ([\d.]+).*\n/s;
$peer->{rsync_protocol} = $1;
$peer->{rsync_protocol} = 28 if $peer->{rsync_protocol} > 28;
swrite(*S, "$module\n");
In release 3.2.7, rsync changed the format of the banner sent by the daemon, cf. https://github.com/WayneD/rsync/commit/418e38a8789fd9b668961f945382c78806f2fb20. Before it was
@RSYNCD: <version>.<subprotocol>
and now it is@RSYNCD: <version>.<subprotocol> <digest1> <digestN>
.It breaks scanner, which is rather picky about what it expects, cf https://github.com/poeml/mirrorbrain/blob/master/tools/scanner.pl#L1230
In practice, here's what happens: