commit b20083a930f766939f47dddc66d089c9fee5d38a Author: Ruediger Oertel Date: Thu Oct 10 15:28:04 2019 +0200 check if variables can be set before modifying them to avoid warnings on login with a restricted shell (bsc#1138869) diff --git a/files/etc/bash.bashrc b/files/etc/bash.bashrc index 85be9f6..36f7db5 100644 --- a/files/etc/bash.bashrc +++ b/files/etc/bash.bashrc @@ -8,9 +8,14 @@ # # Check which shell is reading this file -# -noprofile=false -restricted=false +# check if variables are read-only before setting them +# for example in a restricted shell +if unset noprofile 2>/dev/null ; then + noprofile=false +fi +if unset restricted 2>/dev/null ; then + restricted=false +fi : ${_is_save:=unset} if test -z "$is" ; then if test -f /proc/mounts ; then