setup/0018-csh.login-set-PATH-again-if-empty-to-prevent-interpr.patch

60 lines
1.5 KiB
Diff
Raw Normal View History

2019-12-25 16:07:25 +08:00
From ead65179f83ba4359795055cde76c4f46417951d Mon Sep 17 00:00:00 2001
From: Martin Osvald <mosvald@redhat.com>
Date: Thu, 29 Aug 2019 09:31:31 +0200
Subject: [PATCH 18/23] csh.login: set PATH again (if empty) to prevent
interpreter error (#1744106)
---
csh.login | 36 ++++++++++++++++++++++--------------
1 file changed, 22 insertions(+), 14 deletions(-)
diff --git a/csh.login b/csh.login
index 51902e8..e4b1990 100644
--- a/csh.login
+++ b/csh.login
@@ -2,20 +2,28 @@
# System wide environment and startup programs, for login setup
-#add sbin directories to the path
-foreach p ( /usr/local/sbin /usr/sbin )
- switch (":${PATH}:")
- case "*:${p}:*":
- breaksw
- default:
- if ( $uid == 0 ) then
- set path = ( ${p} ${path:q} )
- else
- set path = ( ${path:q} ${p} )
- endif
- breaksw
- endsw
-end
+if ( ! ${?PATH} ) then
+ if ( $uid == 0 ) then
+ setenv PATH "/usr/local/sbin:/usr/sbin:/usr/local/bin:/usr/bin"
+ else
+ setenv PATH "/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin"
+ endif
+else
+ #add sbin directories to the path
+ foreach p ( /usr/local/sbin /usr/sbin )
+ switch (":${PATH}:")
+ case "*:${p}:*":
+ breaksw
+ default:
+ if ( $uid == 0 ) then
+ set path = ( ${p} ${path:q} )
+ else
+ set path = ( ${path:q} ${p} )
+ endif
+ breaksw
+ endsw
+ end
+endif
setenv HOSTNAME `/usr/bin/hostname`
set history=1000
--
1.8.3.1