The Samba-Bugzilla – Attachment 11428 Details for
Bug 11513
Modified rrsync to support write-only usage
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Proposed patch to add -wo option to rrsync that is mutex with existing -ro option
rrsync.patch (text/plain), 1.85 KB, created by
Jason A. Pfeil
on 2015-09-10 22:06:41 UTC
(
hide
)
Description:
Proposed patch to add -wo option to rrsync that is mutex with existing -ro option
Filename:
MIME Type:
Creator:
Jason A. Pfeil
Created:
2015-09-10 22:06:41 UTC
Size:
1.85 KB
patch
obsolete
>--- rrsync.orig 2015-09-11 01:01:55.056068188 +0300 >+++ rrsync 2015-09-11 01:02:15.296068836 +0300 >@@ -3,6 +3,9 @@ > # Purpose: Restricts rsync to subdirectory declared in .ssh/authorized_keys > # Author: Joe Smith <js-cgi@inwap.com> 30-Sep-2004 > # Modified by: Wayne Davison <wayned@samba.org> >+# Modified by: Jason A. Pfeil <jason.pfeil@gmail.com> 10 Sep 15 >+# -- added -wo option to allow only sending files to the remote machine >+# -- and not pulling any files from the remote machine > use strict; > > use Socket; >@@ -15,11 +18,13 @@ > use constant LOGFILE => 'rrsync.log'; > > my $Usage = <<EOM; >-Use 'command="$0 [-ro] SUBDIR"' >+Use 'command="$0 [-ro|-wo] SUBDIR"' > in front of lines in $ENV{HOME}/.ssh/authorized_keys > EOM > > our $ro = (@ARGV && $ARGV[0] eq '-ro') ? shift : ''; # -ro = Read-Only >+our $wo = (@ARGV && $ARGV[0] eq '-wo') ? shift : ''; # -wo = Write-Only >+die "$0: Cannot specify BOTH -ro AND -wo!\n" if ($ro ne '' && $wo ne ''); > our $subdir = shift; > die "$0: No subdirectory specified\n$Usage" unless defined $subdir; > $subdir = abs_path($subdir); >@@ -30,6 +35,7 @@ > # For example: > # command="rrsync logs/client" ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAIEAzGhEeNlPr... > # command="rrsync -ro results" ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAIEAmkHG1WCjC... >+# command="rrsync -wo results" ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAIEAmkHG1WCjC... > # > # Format of the environment variables set by sshd: > # SSH_ORIGINAL_COMMAND=rsync --server -vlogDtpr --partial . ARG # push >@@ -42,6 +48,7 @@ > die "$0: --server option is not first\n" unless $command =~ /^--server\s/; > our $am_sender = $command =~ /^--server\s+--sender\s/; # Restrictive on purpose! > die "$0 -ro: sending to read-only server not allowed\n" if $ro && !$am_sender; >+die "$0 -wo: reading from write-only server not allowed\n" if $wo && $am_sender; > > ### START of options data produced by the cull_options script. ### >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 11513
: 11428