Can rsyncd be set to require compression?

Wayne Davison wayned at samba.org
Sat Jul 31 17:15:19 MDT 2010


On Thu, Jul 15, 2010 at 10:03 AM, David F. Skoll <dfs at roaringpenguin.com>wrote:

> I'd like a way for it to require compression


You could try using a "pre-xfer exec" script, which lets you look over the
users options in the environment variables.  For instance, there's a z in
here, even when -s (--protect-args) is used:

RSYNC_ARG3=-vogDtprIze31.12iLs

If you make a script that scans the arg variables and exits with an error
code when z is not found, rsync will refuse the transfer.  Just be careful
not to look for letters in an arg value.

A simple perl script that works:

#!/usr/bin/perl
use strict;
# arg 0 is the rsyncd script, so start with arg 1
for (my $j = 1; $j < 1024; $j++) {
    my $var = "RSYNC_ARG$j";
    my $val = $ENV{$var};
    exit 1 unless defined $val;
    # These single-char letters that have no arg were filched from
support/rrsync script:
    exit 0 if $val =~ /^-[ACDEHIKLORSWXbcdgklmnoprstuvx]*z/;
}
exit 1;

..wayne..
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.samba.org/pipermail/rsync/attachments/20100731/354781ef/attachment.html>


More information about the rsync mailing list