Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/etc/root If /rescue is at the head of $PATH (which is how it...



details:   https://anonhg.NetBSD.org/src/rev/1e4960ee7692
branches:  trunk
changeset: 368391:1e4960ee7692
user:      kre <kre%NetBSD.org@localhost>
date:      Sat Jul 09 09:43:51 2022 +0000

description:
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.

diffstat:

 etc/root/dot.profile |  10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diffs (18 lines):

diff -r a9679ff3db1f -r 1e4960ee7692 etc/root/dot.profile
--- a/etc/root/dot.profile      Sat Jul 09 08:27:35 2022 +0000
+++ b/etc/root/dot.profile      Sat Jul 09 09:43:51 2022 +0000
@@ -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)



Home | Main Index | Thread Index | Old Index