From 735327d5cb7c19b69d49cce5f9dd467396207b54 Mon Sep 17 00:00:00 2001 From: WF Date: Sun, 10 Nov 2024 16:18:43 +0100 Subject: [PATCH] prepare for version 2.16 --- ChangeLog | 1 + README.md | 4 +++- lesscomplete | 12 +++++++++++- lesspipe.sh | 2 +- packaging/lesspipe.spec | 2 ++ 5 files changed, 18 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 937feca..ad9d7af 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,7 @@ **************************************************************************** # ChangeLog for lesspipe.sh # **************************************************************************** +Version 2.16 Nov 10 2024 - security fix: check file name if used with ar - add --ansi to mdcat (fixes #48) - improved recognition of appimage files diff --git a/README.md b/README.md index f4c0039..f1af8f5 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # lesspipe.sh, a preprocessor for less -Version: 2.15 +Version: 2.16 Author : Wolfgang Friebel [wp.friebel@gmail.com](mailto://wp.friebel@gmail.com) License: GPL @@ -127,6 +127,8 @@ the author by email. eval "$(lesspipe.sh)" # (bash) or lesspipe.sh | source /dev/stdin # (zsh) ``` +Several Linux distributions do now set **LESSOPEN** by default and if the contents of the variable is not referring to this lesspipe.sh version, it has to be redefined to get the functionality described here. + As `lesspipe.sh` is accepting only a single argument, a hierarchical list of file names has to be separated by a non-blank character. A colon is rarely found in file names, therefore it has been chosen as the separator character. If a diff --git a/lesscomplete b/lesscomplete index 6abe950..a826485 100755 --- a/lesscomplete +++ b/lesscomplete @@ -1,6 +1,6 @@ #!/usr/bin/env bash # lesscomplete, a helper script for the _less completion script -# synced with lesspipe 2.15 +# synced with lesspipe 2.16 # Author: Wolfgang Friebel (wp.friebel AT gmail.com) has_cmd () { @@ -229,6 +229,11 @@ get_unpack_cmd () { { has_cmd 7za && prog=7za; } ;; esac fi + if [[ "$prog" = ar && "$2" = *@* ]]; then + t=$(nexttmp) + cat "$2" > "$t" + set "$2" "$t" + fi [[ -n $prog ]] && cmd=(isarchive "$prog" "$2" "$file2") if [[ -n ${cmd[*]} ]]; then [[ -n "$file2" ]] && file2= && return @@ -333,6 +338,11 @@ isdeb () { bsdtar xOf "$1" "$data" | bsdtar xOf - "$2" fi else + if [[ "$1" = *@* ]]; then + t=$(nexttmp) + cat "$1" > "$t" + set "$1" "$t" + fi data=$(ar t "$1"|grep data) ft=$(ar p "$1" "$data" | filetype -) get_unpack_cmd "$ft" - diff --git a/lesspipe.sh b/lesspipe.sh index 256daea..3ad4f97 100755 --- a/lesspipe.sh +++ b/lesspipe.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash # lesspipe.sh, a preprocessor for less -lesspipe_version=2.15 +lesspipe_version=2.16 # Author: Wolfgang Friebel (wp.friebel AT gmail.com) has_cmd () { diff --git a/packaging/lesspipe.spec b/packaging/lesspipe.spec index 01588af..9192dc7 100644 --- a/packaging/lesspipe.spec +++ b/packaging/lesspipe.spec @@ -89,6 +89,8 @@ cd $RPM_BUILD_DIR %docdir %{prefix}/share/man/man1 %changelog +* Sun Nov 10 2024 2.16-1 - wp.friebel@gmail.com +- file name checks for ar * Thu Oct 03 2024 2.15-1 - wp.friebel@gmail.com - display all certificates in pem files * Fri Aug 16 2024 2.14-1 - wp.friebel@gmail.com