less: introduce withSecure flag

`--with-secure` is a hardening compile flag to disable potentially
dangerous commands within less(1).

References:

* https://man7.org/linux/man-pages/man1/less.1.html#SECURITY
* https://seclists.org/fulldisclosure/2014/Nov/74
This commit is contained in:
Tom Fitzhenry 2024-05-15 21:49:40 +10:00 committed by tomf
parent 2ab53fad62
commit 39cb4bd48b

View File

@ -4,6 +4,7 @@
, fetchpatch
, ncurses
, pcre2
, withSecure ? false
}:
stdenv.mkDerivation (finalAttrs: {
@ -37,7 +38,7 @@ stdenv.mkDerivation (finalAttrs: {
# Look for 'sysless' in /etc.
"--sysconfdir=/etc"
"--with-regex=pcre2"
];
] ++ lib.optional withSecure "--with-secure";
meta = {
homepage = "https://www.greenwoodsoftware.com/less/";