30 stdenv.mkDerivation rec {
34 src = fetchFromGitHub {
38 hash = "sha256-BWtchWXukIDSLJkFX8M/NZBvfi7vUE2j4yFfS0KEZDo=";
42 ./0001-attempt-to-modprobe-config-before-checking-kernel.patch
43 # Tool would sanitize the environment, removing the PATH set by our wrapper.
44 ./0002-don-t-sanatize-the-environment.patch
45 # Fix the exit code of debug_report command. Check if PR 226 was merged when upgrading version.
47 url = "https://github.com/slimm609/checksec.sh/commit/851ebff6972f122fde5507f1883e268bbff1f23d.patch";
48 hash = "sha256-DOcVF+oPGIR9VSbqE+EqWlcNANEvou1gV8qBvJLGLBE=";
58 path = lib.makeBinPath [
77 install checksec $out/bin
78 substituteInPlace $out/bin/checksec \
79 --replace "/bin/sed" "${gnused}/bin/sed" \
80 --replace "/usr/bin/id" "${coreutils}/bin/id" \
81 --replace "/lib/libc.so.6" "${glibc}/lib/libc.so.6"
82 wrapProgram $out/bin/checksec \
83 --prefix PATH : ${path}
87 version = testers.testVersion {
89 version = "v${version}";
91 debug-report = runCommand "debug-report" { buildInputs = [ checksec ]; } ''
92 checksec --debug_report || exit 1
99 description = "Tool for checking security bits on executables";
100 mainProgram = "checksec";
101 homepage = "https://www.trapkit.de/tools/checksec/";
102 license = licenses.bsd3;
103 platforms = platforms.linux;
104 maintainers = with maintainers; [ thoughtpolice globin ];