3
0
Fork 0
forked from mirrors/nixpkgs

Merge pull request from vcunat/p/cpio-patches

cpio: add two subsequent upstream patches
This commit is contained in:
Luke Granger-Brown 2021-09-25 19:32:52 +01:00 committed by GitHub
commit 6ad44fc9df
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,27 +1,32 @@
{ lib, stdenv, fetchurl, fetchpatch }:
let
stdenv.mkDerivation rec {
pname = "cpio";
version = "2.13";
name = "cpio-${version}";
in stdenv.mkDerivation {
inherit name;
src = fetchurl {
url = "mirror://gnu/cpio/${name}.tar.bz2";
url = "mirror://gnu/cpio/cpio-${version}.tar.bz2";
sha256 = "0vbgnhkawdllgnkdn6zn1f56fczwk0518krakz2qbwhxmv2vvdga";
};
patches = [
(fetchpatch {
name = "CVE-2021-38185.patch";
url = "https://git.savannah.gnu.org/cgit/cpio.git/patch/?id=dd96882877721703e19272fe25034560b794061b";
sha256 = "0vmr0qjwj2ldnzsvccl105ckwgx3ssvn9mp3f27ss0kiyigrzz32";
})
patches = let
fp = suffix: rev: sha256: fetchpatch {
name = "CVE-2021-38185-${suffix}.patch";
url = "https://git.savannah.gnu.org/cgit/cpio.git/patch/?id=${rev}";
inherit sha256;
};
in [
(fp "1" "dd96882877721703e19272fe25034560b794061b"
"0vmr0qjwj2ldnzsvccl105ckwgx3ssvn9mp3f27ss0kiyigrzz32")
(fp "2" "dfc801c44a93bed7b3951905b188823d6a0432c8"
"1qkrhi3lbxk6hflp6w3h4sgssc0wblv8r0qgxqzbjrm36pqwxiwh")
(fp "3" "236684f6deb3178043fe72a8e2faca538fa2aae1"
"0pidkbxalpj5yz4fr95x8h0rizgjij0xgvjgirfkjk460giawwg6")
];
preConfigure = if stdenv.isCygwin then ''
preConfigure = lib.optionalString stdenv.isCygwin ''
sed -i gnu/fpending.h -e 's,include <stdio_ext.h>,,'
'' else null;
'';
enableParallelBuilding = true;