aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2013-08-07 18:57:57 +1200
committerTom Ryder <tom@sanctum.geek.nz>2013-08-07 18:57:57 +1200
commite6bd376bfe882c753c5ce806453d72190a40dbd4 (patch)
treecc97e99bb25d35640abd68337b8c6cd09ab23687
parentMove dir creation to beneath option parsing (diff)
downloadpsshd-e6bd376bfe882c753c5ce806453d72190a40dbd4.tar.gz
psshd-e6bd376bfe882c753c5ce806453d72190a40dbd4.zip
Check return value of lockdir creation
-rwxr-xr-xpsshd5
1 files changed, 4 insertions, 1 deletions
diff --git a/psshd b/psshd
index fc8e868..c21e3bf 100755
--- a/psshd
+++ b/psshd
@@ -58,7 +58,10 @@ fi
# Set up a PID dir
dir="${TMPDIR:-/tmp}/psshd-${UID}"
-mkdir -p "$dir"
+if ! mkdir -p "$dir"; then
+ printf "Couldn't create directory ${dir} for PID file" >&2
+ exit 1
+fi
# Export the two settings autossh absolutely needs
AUTOSSH_PIDFILE="${dir}/psshd-port-${port}.pid"