From 00bff935cb14b56a6c268ba149ef16a9f2d8015e Mon Sep 17 00:00:00 2001 From: happysalada Date: Mon, 4 Dec 2023 07:23:39 +0900 Subject: [PATCH] nikto: 2.2.0 -> 2.5.0 --- pkgs/tools/networking/nikto/default.nix | 16 +++++++------ ...rapper-fix.patch => nix-wrapper-fix.patch} | 24 +++++++++---------- 2 files changed, 21 insertions(+), 19 deletions(-) rename pkgs/tools/networking/nikto/{NIKTODIR-nix-wrapper-fix.patch => nix-wrapper-fix.patch} (53%) diff --git a/pkgs/tools/networking/nikto/default.nix b/pkgs/tools/networking/nikto/default.nix index e1abcb6c140d..df03cc8c3ce7 100644 --- a/pkgs/tools/networking/nikto/default.nix +++ b/pkgs/tools/networking/nikto/default.nix @@ -6,20 +6,23 @@ , installShellFiles }: +let + version = "2.5.0"; +in stdenv.mkDerivation rec { pname = "nikto"; - version = "2.2.0"; + inherit version; src = fetchFromGitHub { owner = "sullo"; repo = "nikto"; - rev = "c83d0461edd75c02677dea53da2896644f35ecab"; - sha256 = "0vwq2zdxir67cn78ls11qf1smd54nppy266v7ajm5rqdc47q7fy2"; + rev = version; + sha256 = "sha256-lWiDbWc2BWAUgyaIm0tvZytja02WogYRoc7na4sHiNM="; }; # Nikto searches its configuration file based on its current path # This fixes the current path regex for the wrapped executable. - patches = [ ./NIKTODIR-nix-wrapper-fix.patch ]; + patches = [ ./nix-wrapper-fix.patch ]; postPatch = '' # EXECDIR needs to be changed to the path where we copy the programs stuff @@ -31,10 +34,9 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ makeWrapper installShellFiles ]; - propagatedBuildInputs = [ perlPackages.NetSSLeay ]; - buildInputs = [ perlPackages.perl + perlPackages.NetSSLeay ]; installPhase = '' @@ -44,7 +46,6 @@ stdenv.mkDerivation rec { install -Dm 755 "program/nikto.pl" "$out/bin/nikto" install -Dm 644 program/nikto.conf.default "$out/etc/nikto.conf" installManPage documentation/nikto.1 - install -Dm 644 program/docs/nikto_manual.html "$out/share/doc/${pname}/manual.html" install -Dm 644 README.md "$out/share/doc/${pname}/README" runHook postInstall ''; @@ -58,6 +59,7 @@ stdenv.mkDerivation rec { description = "Web server scanner"; license = licenses.gpl2Plus; homepage = "https://cirt.net/Nikto2"; + changelog = "https://github.com/sullo/nikto/releases/tag/${version}"; maintainers = with maintainers; [ shamilton ]; platforms = platforms.unix; }; diff --git a/pkgs/tools/networking/nikto/NIKTODIR-nix-wrapper-fix.patch b/pkgs/tools/networking/nikto/nix-wrapper-fix.patch similarity index 53% rename from pkgs/tools/networking/nikto/NIKTODIR-nix-wrapper-fix.patch rename to pkgs/tools/networking/nikto/nix-wrapper-fix.patch index d3caea1b26fd..bc05d774577e 100644 --- a/pkgs/tools/networking/nikto/NIKTODIR-nix-wrapper-fix.patch +++ b/pkgs/tools/networking/nikto/nix-wrapper-fix.patch @@ -1,26 +1,26 @@ -diff --color -ur a/program/nikto.pl b/program/nikto.pl ---- a/program/nikto.pl 2021-01-30 12:05:54.915072538 +0100 -+++ b/program/nikto.pl 2021-01-30 12:36:42.877729231 +0100 -@@ -223,7 +223,8 @@ +diff --git a/program/nikto.pl b/program/nikto.pl +index 2cb07f9..323e666 100755 +--- a/program/nikto.pl ++++ b/program/nikto.pl +@@ -243,7 +243,7 @@ sub config_init { # Guess Nikto current directory my $NIKTODIR = abs_path($0); chomp($NIKTODIR); - $NIKTODIR =~ s#[\\/]nikto.pl$##; + $NIKTODIR =~ s#[\\/]bin[\\/]\.nikto-wrapped$##; -+ # Guess user's home directory -- to support Windows foreach my $var (split(/ /, "HOME USERPROFILE")) { -@@ -231,10 +232,10 @@ +@@ -251,10 +251,10 @@ sub config_init { } # Read the conf files in order (previous values are over-written with each, if multiple found) -- push(@CF,"$NIKTODIR/nikto.conf.default"); +- push(@CF, "$NIKTODIR/nikto.conf.default"); + push(@CF,"$NIKTODIR/etc/nikto.conf.default"); - push(@CF,"/etc/nikto.conf"); - push(@CF,"$home/nikto.conf"); -- push(@CF,"$NIKTODIR/nikto.conf"); + push(@CF, "/etc/nikto.conf"); + push(@CF, "$home/nikto.conf"); +- push(@CF, "$NIKTODIR/nikto.conf"); + push(@CF,"$NIKTODIR/etc/nikto.conf"); - push(@CF,"nikto.conf"); - push(@CF,"$VARIABLES{'configfile'}"); + push(@CF, "nikto.conf"); + push(@CF, "$VARIABLES{'configfile'}");