Robert Scott 41a38db165 rsync: add patch for CVE-2020-14387
(cherry picked from commit a08ee2292caa8a676332c695d7d46bd38c235931)
2021-08-19 19:24:10 +01:00

35 lines
780 B
Nix

{ lib, stdenv, fetchurl, perl, rsync, fetchpatch }:
let
base = import ./base.nix { inherit lib fetchurl fetchpatch; };
in
stdenv.mkDerivation {
name = "rrsync-${base.version}";
src = base.src;
buildInputs = [ rsync perl ];
# Skip configure and build phases.
# We just want something from the support directory
dontConfigure = true;
dontBuild = true;
patches = base.extraPatches;
postPatch = ''
substituteInPlace support/rrsync --replace /usr/bin/rsync ${rsync}/bin/rsync
'';
installPhase = ''
mkdir -p $out/bin
cp support/rrsync $out/bin
chmod a+x $out/bin/rrsync
'';
meta = base.meta // {
description = "A helper to run rsync-only environments from ssh-logins";
maintainers = [ lib.maintainers.kampfschlaefer ];
};
}