[Pkg-zsh-devel] Bug#969305: zsh: safe-rm needs to be added to the default path of interactive shells to work

Francois Marier francois at debian.org
Mon Aug 31 03:50:10 BST 2020


Package: zsh
Version: 5.8-5
Severity: normal

This isn't really a bug in zsh, but rather I'd like to figure out how to
best enable the safe-rm package for zsh users.

For bash, we ship a config file in /etc/profile.d/ which adds
/usr/share/safe-rm/bin in front of /bin:

  https://salsa.debian.org/debian/safe-rm/-/blob/master/debian/safe-rm.sh

As far as I can tell, the equivalent to protect zsh users who choose to
install safe-rm would be to add the following to /etc/zhs/zshrc:

  if [[ -d "/usr/share/safe-rm/bin" ]]
  then
    PATH="/usr/share/safe-rm/bin:$PATH"
    export PATH
  fi

However, I don't see a way for packages to do this. So I guess there would
be two ways to make this possible:

1. The main /etc/zsh/zshrc script could source all .sh files in a new
   /etc/zsh/zshrc.d/ directory.
2. The /etc/zsh/zshrc that ships in Debian could include the above.

Are either of these something you'd be willing to consider? Or is there
another way to do this that I haven't seen?

I would really like to make it easy for zsh users to be as protected as
bash/dash users (i.e. "apt install safe-rm" and you're done).

Francois

-- 
https://fmarier.org/



More information about the Pkg-zsh-devel mailing list