]> git.immae.eu Git - perso/Immae/Config/Nix.git/blame - pkgs/rrsync_sudo/sudo.patch
Upgrade syden peertube to flake
[perso/Immae/Config/Nix.git] / pkgs / rrsync_sudo / sudo.patch
CommitLineData
8bf83d7a
IB
1--- a/support/rrsync 2015-09-14 01:23:54.000000000 +0200
2+++ b/support/rrsync 2020-02-08 13:55:14.302163313 +0100
3@@ -48,7 +48,7 @@
4
5 my $command = $ENV{SSH_ORIGINAL_COMMAND};
6 die "$0: Not invoked via sshd\n$Usage" unless defined $command;
7-die "$0: SSH_ORIGINAL_COMMAND='$command' is not rsync\n" unless $command =~ s/^rsync\s+//;
8+die "$0: SSH_ORIGINAL_COMMAND='$command' is not rsync\n" unless $command =~ s/^sudo rsync\s+//;
9 die "$0: --server option is not first\n" unless $command =~ /^--server\s/;
10 our $am_sender = $command =~ /^--server\s+--sender\s/; # Restrictive on purpose!
11 die "$0 sending to read-only server not allowed\n" if $only eq 'r' && !$am_sender;
12@@ -227,7 +227,7 @@
13 }
14
15 # Note: This assumes that the rsync protocol will not be maliciously hijacked.
16-exec(RSYNC, @opts, @args) or die "exec(rsync @opts @args) failed: $? $!";
17+exec("/usr/bin/sudo", RSYNC, @opts, @args) or die "exec(sudo rsync @opts @args) failed: $? $!";
18
19 sub check_arg
20 {