From: Iain Patterson Date: Fri, 27 Feb 2009 12:13:37 +0000 (+0000) Subject: Don't override SCREENDIR when screen is setuid. X-Git-Url: http://git.iain.cx/?a=commitdiff_plain;h=506b1084a423c7b3462495db47bc5762133197e5;p=profile.git Don't override SCREENDIR when screen is setuid. git-svn-id: https://svn.cambridge.iain.cx/profile/trunk@179 6be0d1a5-5cfe-0310-89b6-964be062b18b --- diff --git a/.profile.d/variables.bashrc b/.profile.d/variables.bashrc index 8fa34ab..616be4e 100644 --- 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"