From de97bb6bf4c0a65918869f4d035b32c659aa586d Mon Sep 17 00:00:00 2001 From: mattia Date: Tue, 16 Aug 2022 14:18:25 +0200 Subject: [PATCH] bashrc: Merge-in new system file --- bashrc | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/bashrc b/bashrc index e16eda8..7b1aa2f 100644 --- a/bashrc +++ b/bashrc @@ -16,7 +16,7 @@ if [ -z "$BASHRCSOURCED" ]; then if [ "$PS1" ]; then if [ -z "$PROMPT_COMMAND" ]; then case $TERM in - xterm*|vte*) + xterm*) if [ -e /etc/sysconfig/bash-prompt-xterm ]; then PROMPT_COMMAND=/etc/sysconfig/bash-prompt-xterm else @@ -64,15 +64,8 @@ if [ -z "$BASHRCSOURCED" ]; then esac } - # By default, we want umask to get set. This sets it for non-login shell. - # Current threshold for system reserved uid/gids is 200 - # You could check uidgid reservation validity in - # /usr/share/doc/setup-*/uidgid file - if [ $UID -gt 199 ] && [ "`/usr/bin/id -gn`" = "`/usr/bin/id -un`" ]; then - umask 002 - else - umask 022 - fi + # Set default umask for non-login shell only if it is set to 0 + [ `umask` -eq 0 ] && umask 022 SHELL=/bin/bash # Only display echos from profile.d scripts if we are no login shell