git://git.iain.cx/iain
/
profile.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Don't override SCREENDIR when screen is setuid.
[profile.git]
/
.profile.d
/
variables.bashrc
diff --git
a/.profile.d/variables.bashrc
b/.profile.d/variables.bashrc
index
8fa34ab
..
616be4e
100644
(file)
--- a/
.profile.d/variables.bashrc
+++ b/
.profile.d/variables.bashrc
@@
-25,5
+25,13
@@
elif [ $colours -gt 88 ]; then
else
export GREP_COLORS='cx=31:sl=:mt=33:fn=36:ln=34:bn=33:se=31'
fi
else
export GREP_COLORS='cx=31:sl=:mt=33:fn=36:ln=34:bn=33:se=31'
fi
-export SCREENDIR="$HOME/.screen/$HOSTNAME"
+
+# Override SCREENDIR iff screen is not setuid.
+screen=$(which screen 2>/dev/null)
+if [ ! -z "$screen" ]; then
+ if ! ls -l "$screen" | cut -d ' ' -f 1 | grep s >/dev/null; then
+ export SCREENDIR="$HOME/.screen/$HOSTNAME"
+ fi
+fi
+unset screen
#mkdir -p "$SCREENDIR"
#mkdir -p "$SCREENDIR"