Package: less
Version: 551-2
Severity: normal
Tags: patch

Dear Maintainer,


   * What led up to the situation?

I wanted to add support for another binary format and ended up looking
at the lesspipe script in the process.


   * What exactly did you do (or not do) that was effective (or
     ineffective)?

This is a pure code review.


   * What was the outcome of this action?

I can offer a patch to the maintainer.


   * What outcome did you expect instead?

Not have to provide a patch... :-)


   * What should we really do?

The patch here fixes the potential bug where one user ends up deleting
the temporary file of another user. (This may only really happen for
root deleting another user's file).

However, as mentioned in this old bug report:

    https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=205702

There is actually a lesspipe project that could be used to maintain that
file.

The old project was on sourceforge (referenced in old bug report), the
current version is available on github:

    https://github.com/wofr06/lesspipe

And was last updated today.

In an ideal world, lesspipe would be a separate package suggested by the
less package (and probably installed by default on a Debian distro since
people are already used to that functionality), but even "stealing" the
lesspipe.sh script from that project to replace your existing very old
(1998) script would probably already do wonders (although we need to not
lose the ability to add a user defined script! I did not check to see
whether they still have a check of "~/.lessfilter").

--- a/debian/lesspipe	2020-07-05 13:01:10.000000000 -0700
+++ b/debian/lesspipe	2021-12-21 13:40:49.361491135 -0800
@@ -284,6 +284,7 @@
 		if [ -n "$BASH" ]; then
 			if [ ! -O "$2" ]; then
 				echo "Error in deleting $2" > /dev/tty
+				exit 1
 			fi
 		fi
 

Reply via email to