diff options
author | Robin H. Johnson <robbat2@gentoo.org> | 2020-06-16 15:34:43 -0700 |
---|---|---|
committer | Robin H. Johnson <robbat2@gentoo.org> | 2020-06-16 15:34:43 -0700 |
commit | 002d2bc2a7da529d1ecf6f7bd73948e29190ce1d (patch) | |
tree | 63e22199f720d53a3db0503a21f4605dd4d0b851 /src/commands/rsync | |
parent | Merge tag 'v3.6.10' (diff) | |
parent | v3.6.11 (diff) | |
download | gitolite-gentoo-002d2bc2a7da529d1ecf6f7bd73948e29190ce1d.tar.gz gitolite-gentoo-002d2bc2a7da529d1ecf6f7bd73948e29190ce1d.tar.bz2 gitolite-gentoo-002d2bc2a7da529d1ecf6f7bd73948e29190ce1d.zip |
Merge tag 'v3.6.11'gitolite-gentoo-3.6.11
v3.6.11
Diffstat (limited to 'src/commands/rsync')
-rwxr-xr-x | src/commands/rsync | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/src/commands/rsync b/src/commands/rsync index 1109ac4..c7b25d1 100755 --- a/src/commands/rsync +++ b/src/commands/rsync @@ -28,11 +28,6 @@ BUNDLE SUPPORT (2) Add 'rsync' to the ENABLE list in the rc file - -GENERIC RSYNC SUPPORT - - TBD - =cut =for usage @@ -43,7 +38,7 @@ BUNDLE SUPPORT Admins: see src/commands/rsync for setup instructions Users: - rsync -P git@host:repo.bundle . + rsync git@host:repo.bundle . # downloads a file called "<basename of repo>.bundle"; repeat as # needed till the whole thing is downloaded git clone repo.bundle repo @@ -51,9 +46,8 @@ BUNDLE SUPPORT git remote set-url origin git@host:repo git fetch origin # and maybe git pull, etc. to freshen the clone -GENERIC RSYNC SUPPORT - - TBD + NOTE on options to the rsync command: you are only allowed to use the + "-v", "-n", "-q", and "-P" options. =cut @@ -62,9 +56,9 @@ usage() if not @ARGV or $ARGV[0] eq '-h'; # rsync driver program. Several things can be done later, but for now it # drives just the 'bundle' transfer. -if ( $ENV{SSH_ORIGINAL_COMMAND} =~ /^rsync --server --sender (-[-\w=.]+ )+\. (\S+)\.bundle$/ ) { +if ( $ENV{SSH_ORIGINAL_COMMAND} =~ /^rsync --server --sender (?:-[vn]*(?:e\d*\.\w*)? )?\. (\S+)\.bundle$/ ) { - my $repo = $2; + my $repo = $1; $repo =~ s/\.git$//; # all errors have the same message to avoid leaking info @@ -81,7 +75,7 @@ if ( $ENV{SSH_ORIGINAL_COMMAND} =~ /^rsync --server --sender (-[-\w=.]+ )+\. (\S exit 0; } -_warn "invalid rsync command '$ENV{SSH_ORIGINAL_COMMAND}'"; +_warn "Sorry, you are only allowed to use the '-v', '-n', '-q', and '-P' options."; usage(); # ---------------------------------------------------------------------- |