Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Patch for v3.6.4 #15

Open
wants to merge 1 commit into
base: origin-v3.6.4-1733767870
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 6 additions & 12 deletions src/commands/rsync
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,6 @@ BUNDLE SUPPORT

(2) Add 'rsync' to the ENABLE list in the rc file


GENERIC RSYNC SUPPORT

TBD

=cut

=for usage
Expand All @@ -43,17 +38,16 @@ 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
cd repo
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

Expand All @@ -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
Expand All @@ -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();

# ----------------------------------------------------------------------
Expand Down