File git-51-fbf7ee9dc9cd970532a54eed6472d7f3b0e7f431.patch of Package aaa_base.37831

From fbf7ee9dc9cd970532a54eed6472d7f3b0e7f431 Mon Sep 17 00:00:00 2001
From: Werner Fink <werner@suse.de>
Date: Tue, 11 Mar 2025 14:46:03 +0100
Subject: [PATCH] Respect PROFILEREAD/CSHRCREAD at shell switch

If a user switches the login shell respect the already set
PATH environment (bsc#1235481)

Signed-off-by: Werner Fink <werner@suse.de>
---
 files/etc/csh.login | 56 +++++++++++++++++++++++----------------------
 files/etc/profile   |  2 +-
 2 files changed, 30 insertions(+), 28 deletions(-)

diff --git files/etc/csh.login files/etc/csh.login
index 1c30569..77d4507 100644
--- a/files/etc/csh.login
+++ b/files/etc/csh.login
@@ -105,25 +105,26 @@ set mail=$MAIL
 #     eval limit `limit -h memoryuse`
 # endif
 
+if (! ${?CSHRCREAD} && ! ${?PROFILEREAD}) then
 #
 # Make path more comfortable
 #
-unset noglob
+    unset noglob
 # save current path setting, we might want to restore it
-set orig_path=($path)
-set _hpath
-set _spath
-set _upath=( /usr/local/bin /usr/bin /bin )
-if ( "$HOME" != "/" ) then
-    foreach _d (${HOME}/bin/${CPU} ${HOME}/bin ${HOME}/.local/bin/${CPU} ${HOME}/.local/bin)
-	if ( -d $_d ) set _hpath=( $_d $_hpath )
-    end
-endif
-if ( "$uid" == "0" ) then
-    if ( -d /opt/kde3/sbin ) set _spath=( /opt/kde3/sbin )
-    set _spath=( /sbin /usr/sbin /usr/local/sbin $_spath )
-endif
-foreach _d (/usr/X11/bin \
+    set orig_path=($path)
+    set _hpath
+    set _spath
+    set _upath=( /usr/local/bin /usr/bin /bin )
+    if ( "$HOME" != "/" ) then
+	foreach _d (${HOME}/bin/${CPU} ${HOME}/bin ${HOME}/.local/bin/${CPU} ${HOME}/.local/bin)
+	    if ( -d $_d ) set _hpath=( $_d $_hpath )
+	end
+    endif
+    if ( "$uid" == "0" ) then
+	if ( -d /opt/kde3/sbin ) set _spath=( /opt/kde3/sbin )
+	set _spath=( /sbin /usr/sbin /usr/local/sbin $_spath )
+    endif
+    foreach _d (/usr/X11/bin \
 	    /usr/X11R6/bin \
 	    /var/lib/dosemu \
 	    /usr/games \
@@ -133,24 +134,25 @@ foreach _d (/usr/X11/bin \
 	    /opt/kde/bin \
 	    /usr/openwin/bin \
 	    /opt/cross/bin )
-    if ( -d $_d ) set _upath=( $_upath $_d )
-end
-unset _d
+	if ( -d $_d ) set _upath=( $_upath $_d )
+    end
+    unset _d
 
-if ( ${?OPENWINHOME} ) then
-    if ( -d $OPENWINHOME/bin ) then
-	set _upath=( $_upath $OPENWINHOME/bin )
+    if ( ${?OPENWINHOME} ) then
+	if ( -d $OPENWINHOME/bin ) then
+	    set _upath=( $_upath $OPENWINHOME/bin )
+	    endif
     endif
-endif
 
 #
 # Doing only one rehash
 #
-set -f path=( $_hpath $_spath $path $_upath )
-unset _upath
-unset _spath
-unset _hpath
-set noglob
+    set -f path=( $_hpath $_spath $path $_upath )
+    unset _upath
+    unset _spath
+    unset _hpath
+    set noglob
+endif
 
 #
 # Set some environment variables for TeX/LaTeX (Not used due luatex)
diff --git files/etc/profile files/etc/profile
index 24fbb7c..d3f4344 100644
--- a/files/etc/profile
+++ b/files/etc/profile
@@ -165,7 +165,7 @@ export MAIL HOST CPU HOSTNAME HOSTTYPE OSTYPE VENDOR MACHTYPE
 # save current path setting, we might want to restore it
 ORIG_PATH=$PATH
 #
-if test -z "$PROFILEREAD" ; then
+if test -z "$PROFILEREAD" -a -z "$CSHRCREAD" ; then
     PATH=/usr/local/bin:/usr/bin:/bin
     if test "$HOME" != "/" ; then
 	for dir in $HOME/bin/$CPU $HOME/bin $HOME/.local/bin/$CPU $HOME/.local/bin ; do
-- 
2.35.3

openSUSE Build Service is sponsored by