aboutsummaryrefslogtreecommitdiff
path: root/bash/bashrc
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2017-01-03 15:21:04 +1300
committerTom Ryder <tom@sanctum.geek.nz>2017-01-03 15:21:04 +1300
commit22d06452fbfbdd0a0deb8dfa7c3ca1645b847083 (patch)
tree7b11fe0c82da7ce7fdf378a62c6cb923b7e9e941 /bash/bashrc
parentUpdated GPG key (diff)
downloaddotfiles-22d06452fbfbdd0a0deb8dfa7c3ca1645b847083.tar.gz
dotfiles-22d06452fbfbdd0a0deb8dfa7c3ca1645b847083.zip
Short-circuit in rbash before even loading ENV
Diffstat (limited to 'bash/bashrc')
-rw-r--r--bash/bashrc7
1 files changed, 4 insertions, 3 deletions
diff --git a/bash/bashrc b/bash/bashrc
index 088182ef..4ca8b176 100644
--- a/bash/bashrc
+++ b/bash/bashrc
@@ -4,6 +4,10 @@ case $- in
*) return ;;
esac
+# Don't do anything if restricted, not even sourcing the ENV file
+# Testing $- for "r" doesn't work
+[ -n "$BASH_VERSINFO" ] && shopt -q restricted_shell && return
+
# If ENV is set, source it to get all the POSIX-compatible interactive stuff;
# we should be able to do this even if we're running a truly ancient Bash
[ -n "$ENV" ] && . "$ENV"
@@ -17,9 +21,6 @@ esac
((10#${BASH_VERSINFO[1]%%[!0-9]*} < 5)) &&
return
-# Don't do anything if running a restricted shell
-shopt -q restricted_shell && return
-
# Keep around 32K lines of history in file
HISTFILESIZE=$((1 << 15))