Module Name:    src
Committed By:   kre
Date:           Sat Jul  9 09:43:52 UTC 2022

Modified Files:
        src/etc/root: dot.profile

Log Message:
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.


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/etc/root/dot.profile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/etc/root/dot.profile
diff -u src/etc/root/dot.profile:1.32 src/etc/root/dot.profile:1.33
--- src/etc/root/dot.profile:1.32	Mon Aug 24 12:46:57 2020
+++ src/etc/root/dot.profile	Sat Jul  9 09:43:51 2022
@@ -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)

Reply via email to