From: Tobias Stoeckmann Date: Mon, 2 Feb 2026 19:23:45 +0000 (+0100) Subject: lib/pager: Do not resolve directories with PATH X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5aa38c36f80cdb7ae7bfbb1922b6fb133bad9fe6;p=thirdparty%2Futil-linux.git lib/pager: Do not resolve directories with PATH If PAGER contains any slash in program part, avoid resolving it with PATH environment variable. Even if it is found there (in a subdirectory), sh -c won't execute it. Signed-off-by: Tobias Stoeckmann --- diff --git a/lib/pager.c b/lib/pager.c index 9cbf6383f..aec94e2d0 100644 --- a/lib/pager.c +++ b/lib/pager.c @@ -136,7 +136,7 @@ static int has_command(const char *cmd) if (!b) goto cleanup; - if (*b == '/') { + if (strchr(b, '/')) { rc = access(b, X_OK) == 0; goto cleanup; }