Disallow --remove-sent-files with a read-only server.
authorWayne Davison <wayned@samba.org>
Sun, 20 Feb 2005 01:04:12 +0000 (01:04 +0000)
committerWayne Davison <wayned@samba.org>
Sun, 20 Feb 2005 01:04:12 +0000 (01:04 +0000)
support/rrsync

index 88bf4f9..b552002 100644 (file)
@@ -31,6 +31,8 @@ die "Not invoked via sshd\n$Usage"    unless defined $command;
 die "SSH_ORIGINAL_COMMAND='$command' is not rsync\n" unless $command =~ /^rsync\s/;
 die "$0 -ro: sending to read-only server not allowed\n"
        if $ro and $command !~ /^rsync --server --sender /;
+die "$0 -ro: use of --remove-sent-files with read-only server not allowed\n"
+       if $ro and $command =~ /\s--remove-sent-files/;
 
 my ($cmd,$dir) = $command =~ /^(rsync\s+(?:-[-a-zA-Z]+\s+)+\.) ?("[^"]*"|[^\s"]*)$/;
 die "$0: invalid rsync-command syntax or options\n" if !defined $cmd;