git://git.iain.cx/iain
/
profile.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d971afe
)
Don't override SCREENDIR when screen is setuid.
author
Iain Patterson
<me@iain.cx>
Fri, 27 Feb 2009 12:13:37 +0000
(12:13 +0000)
committer
Iain Patterson
<me@iain.cx>
Fri, 27 Feb 2009 12:13:37 +0000
(12:13 +0000)
git-svn-id: https://svn.cambridge.iain.cx/profile/trunk@179
6be0d1a5
-5cfe-0310-89b6-
964be062b18b
.profile.d/variables.bashrc
patch
|
blob
|
history
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
-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"