From 57b283facd8594a48757d04be79ef882d84ad9e8 Mon Sep 17 00:00:00 2001 From: Sorin Ionescu Date: Fri, 3 Jan 2014 14:20:32 -0500 Subject: [PATCH] [Fix #514] Use /tmp when $TMPDIR is undefined --- modules/gpg/init.zsh | 2 +- modules/pacman/functions/pacman-list-disowned | 2 +- modules/ssh/init.zsh | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/gpg/init.zsh b/modules/gpg/init.zsh index 2e4c4ea..48f1715 100644 --- a/modules/gpg/init.zsh +++ b/modules/gpg/init.zsh @@ -12,7 +12,7 @@ fi # Set the default paths to gpg-agent files. _gpg_agent_conf="$HOME/.gnupg/gpg-agent.conf" -_gpg_agent_env="$TMPDIR/gpg-agent.env" +_gpg_agent_env="${TMPDIR:-/tmp}/gpg-agent.env" # Start gpg-agent if not started. if ! ps -U "$USER" -o ucomm | grep -q gpg-agent; then diff --git a/modules/pacman/functions/pacman-list-disowned b/modules/pacman/functions/pacman-list-disowned index 2cd8a92..d6b6f28 100644 --- a/modules/pacman/functions/pacman-list-disowned +++ b/modules/pacman/functions/pacman-list-disowned @@ -6,7 +6,7 @@ # Sorin Ionescu # -local tmp="$TMPDIR/pacman-disowned-$UID-$$" +local tmp="${TMPDIR:-/tmp}/pacman-disowned-$UID-$$" local db="$tmp/db" local fs="$tmp/fs" diff --git a/modules/ssh/init.zsh b/modules/ssh/init.zsh index daa4372..608e34e 100644 --- a/modules/ssh/init.zsh +++ b/modules/ssh/init.zsh @@ -14,10 +14,10 @@ fi _ssh_dir="$HOME/.ssh" # Set the path to the environment file if not set by another module. -_ssh_agent_env="${_ssh_agent_env:-$TMPDIR/ssh-agent.env}" +_ssh_agent_env="${_ssh_agent_env:-${TMPDIR:-/tmp}/ssh-agent.env}" # Set the path to the persistent authentication socket. -_ssh_agent_sock="$TMPDIR/ssh-agent.sock" +_ssh_agent_sock="${TMPDIR:-/tmp}/ssh-agent.sock" # Start ssh-agent if not started. if [[ ! -S "$SSH_AUTH_SOCK" ]]; then