Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)

Merge pull request #54616 from Mic92/net_snmp

net_snmp: 5.7.3 -> 5.8

authored by

Jörg Thalheim and committed by
GitHub
d18052fe 0879595c

+22 -50
+7
pkgs/servers/monitoring/net-snmp/0002-autoconf-version.patch
··· 1 + diff --git a/dist/autoconf-version b/dist/autoconf-version 2 + index 264f2ce..5e1b8b0 100644 3 + --- a/dist/autoconf-version 4 + +++ b/dist/autoconf-version 5 + @@ -1 +1 @@ 6 + -2.68 7 + +2.69
-30
pkgs/servers/monitoring/net-snmp/CVE-2018-18065.patch
··· 1 - commit 7ffb8e25a0db851953155de91f0170e9bf8c457d 2 - Author: Robert Story <rstory@freesnmp.com> 3 - Date: Thu Oct 6 10:43:10 2016 -0400 4 - 5 - CHANGES: BUG: 2743: snmpd crashes when receiving a GetNext PDU with multiple Varbinds 6 - 7 - skip out-of-range varbinds when calling next handler 8 - 9 - diff --git a/agent/helpers/table.c b/agent/helpers/table.c 10 - index 32a08033a..2666638b5 100644 11 - --- a/agent/helpers/table.c 12 - +++ b/agent/helpers/table.c 13 - @@ -340,6 +340,8 @@ table_helper_handler(netsnmp_mib_handler *handler, 14 - else if (reqinfo->mode == MODE_GET) 15 - table_helper_cleanup(reqinfo, request, 16 - SNMP_NOSUCHOBJECT); 17 - + else 18 - + request->processed = 1; /* skip if next handler called */ 19 - continue; 20 - } 21 - 22 - @@ -409,6 +411,8 @@ table_helper_handler(netsnmp_mib_handler *handler, 23 - else if (reqinfo->mode == MODE_GET) 24 - table_helper_cleanup(reqinfo, request, 25 - SNMP_NOSUCHOBJECT); 26 - + else 27 - + request->processed = 1; /* skip if next handler called */ 28 - continue; 29 - } 30 - /*
+15 -20
pkgs/servers/monitoring/net-snmp/default.nix
··· 1 - { stdenv, fetchurl, fetchpatch, autoreconfHook, file, openssl, perl, unzip }: 1 + { stdenv, fetchurl, fetchpatch, autoreconfHook, file, openssl, perl, perlPackages, unzip, nettools, ncurses }: 2 2 3 3 stdenv.mkDerivation rec { 4 - name = "net-snmp-5.7.3"; 4 + name = "net-snmp-5.8"; 5 5 6 6 src = fetchurl { 7 - url = "mirror://sourceforge/net-snmp/${name}.zip"; 8 - sha256 = "0gkss3zclm23zwpqfhddca8278id7pk6qx1mydpimdrrcndwgpz8"; 7 + url = "mirror://sourceforge/net-snmp/${name}.tar.gz"; 8 + sha256 = "1pvajzj9gmj56dmwix0ywmkmy2pglh6nny646hkm7ghfhh03bz5j"; 9 9 }; 10 10 11 11 patches = ··· 14 14 inherit name sha256; 15 15 }; 16 16 in [ 17 - (fetchAlpinePatch "CVE-2015-5621.patch" "05098jyvd9ddr5q26z7scbbvk1bk6x4agpjm6pyprvpc1zpi0y09") 18 - (fetchAlpinePatch "fix-Makefile-PL.patch" "14ilnkj3cr6mpi242hrmmmv8nv4dj0fdgn42qfk9aa7scwsc0lc7") 19 17 (fetchAlpinePatch "fix-includes.patch" "0zpkbb6k366qpq4dax5wknwprhwnhighcp402mlm7950d39zfa3m") 20 18 (fetchAlpinePatch "netsnmp-swinst-crash.patch" "0gh164wy6zfiwiszh58fsvr25k0ns14r3099664qykgpmickkqid") 21 - (fetchAlpinePatch "remove-U64-typedef.patch" "1msxyhcqkvhqa03dwb50288g7f6nbrcd9cs036m9xc8jdgjb8k8j") 22 - ./CVE-2018-18065.patch 19 + ./0002-autoconf-version.patch 23 20 ]; 24 21 25 - preConfigure = 26 - '' 27 - perlarchname=$(perl -e 'use Config; print $Config{archname};') 28 - installFlags="INSTALLSITEARCH=$out/${perl.libPrefix}/${perl.version}/$perlarchname INSTALLSITEMAN3DIR=$out/share/man/man3" 29 - 30 - # http://article.gmane.org/gmane.network.net-snmp.user/32434 31 - substituteInPlace "man/Makefile.in" --replace 'grep -vE' '@EGREP@ -v' 32 - ''; 33 - 34 22 configureFlags = 35 23 [ "--with-default-snmp-version=3" 36 24 "--with-sys-location=Unknown" ··· 38 26 "--with-logfile=/var/log/net-snmpd.log" 39 27 "--with-persistent-directory=/var/lib/net-snmp" 40 28 "--with-openssl=${openssl.dev}" 29 + "--disable-embedded-perl" 30 + "--without-perl-modules" 41 31 ] ++ stdenv.lib.optional stdenv.isLinux "--with-mnttab=/proc/mounts"; 42 32 43 - nativeBuildInputs = [ autoreconfHook ]; 44 - buildInputs = [ file perl unzip openssl ]; 33 + postPatch = '' 34 + substituteInPlace testing/fulltests/support/simple_TESTCONF.sh --replace "/bin/netstat" "${nettools}/bin/netstat" 35 + ''; 36 + 37 + nativeBuildInputs = [ autoreconfHook nettools ]; 38 + buildInputs = [ file perl unzip openssl ncurses ]; 39 + propagatedBuildInputs = with perlPackages; [ perl JSON Tk TermReadKey ]; 45 40 46 41 enableParallelBuilding = true; 47 - doCheck = false; # fails 42 + doCheck = false; # tries to use networking 48 43 49 44 postInstall = '' 50 45 for f in "$out/lib/"*.la $out/bin/net-snmp-config $out/bin/net-snmp-create-v3-user; do