If /rescue is at the head of $PATH (which is how it starts out in /rescue/sh

unless changed by something - and has been since NetBSD 3) don't blindly
simply change it to a PATH that doesn't have /rescue in it at all.

This doesn't solve the "/rescue/tar execs /usr/bin/gzip" problem completely,
as if PATH is in the environment when /rescue/sh is started, that one will
override the shell's built in PATH, but this is better than nothing.
This commit is contained in:
kre 2022-07-09 09:43:51 +00:00
parent 63df21e1d6
commit 6c36afa3ab
1 changed files with 7 additions and 3 deletions

View File

@ -1,7 +1,11 @@
# $NetBSD: dot.profile,v 1.32 2020/08/24 12:46:57 nia Exp $
# $NetBSD: dot.profile,v 1.33 2022/07/09 09:43:51 kre Exp $
export PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/pkg/sbin:/usr/pkg/bin
export PATH=${PATH}:/usr/X11R7/bin:/usr/local/sbin:/usr/local/bin
case "${PATH}" in
/rescue:*) ;; # leave it alone, user can change manually (if required)
*) export PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/pkg/sbin:/usr/pkg/bin
export PATH=${PATH}:/usr/X11R7/bin:/usr/local/sbin:/usr/local/bin
;;
esac
# Uncomment the following line(s) to install binary packages
# from cdn.NetBSD.org via pkg_add. (See also pkg_install.conf)