From 3f556400e70a8003a484836b5c5d4a384468d1ca Mon Sep 17 00:00:00 2001 From: Kaleb Elwert Date: Fri, 28 Jul 2017 10:24:45 -0700 Subject: [PATCH] Avoid setting TMPDIR and make sure all modules handle that properly Fixes #1206 --- modules/gpg/init.zsh | 2 +- runcoms/zprofile | 13 ------------- runcoms/zshenv | 2 +- 3 files changed, 2 insertions(+), 15 deletions(-) diff --git a/modules/gpg/init.zsh b/modules/gpg/init.zsh index f21c8cf..3d80a46 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="${GNUPGHOME:-$HOME/.gnupg}/gpg-agent.conf" -_gpg_agent_env="${TMPDIR:-/tmp}/gpg-agent.env" +_gpg_agent_env="${TMPDIR:-/tmp}/gpg-agent.env.$UID" # Start gpg-agent if not started. if [[ -z "$GPG_AGENT_INFO" && ! -S "${GNUPGHOME:-$HOME/.gnupg}/S.gpg-agent" ]]; then diff --git a/runcoms/zprofile b/runcoms/zprofile index 04742d1..b5eac2e 100644 --- a/runcoms/zprofile +++ b/runcoms/zprofile @@ -61,16 +61,3 @@ export LESS='-F -g -i -M -R -S -w -X -z-4' if (( $#commands[(i)lesspipe(|.sh)] )); then export LESSOPEN="| /usr/bin/env $commands[(i)lesspipe(|.sh)] %s 2>&-" fi - -# -# Temporary Files -# -# -# Set TMPDIR if the variable is not set/empty or the directory doesn't exist -if [[ -z "${TMPDIR}" ]]; then - export TMPDIR="/tmp/zsh-${UID}" -fi - -if [[ ! -d "${TMPDIR}" ]]; then - mkdir -m 700 "${TMPDIR}" -fi diff --git a/runcoms/zshenv b/runcoms/zshenv index eb16f5d..2dbf12a 100644 --- a/runcoms/zshenv +++ b/runcoms/zshenv @@ -6,6 +6,6 @@ # # Ensure that a non-login, non-interactive shell has a defined environment. -if [[ ( "$SHLVL" -eq 1 && ! -o LOGIN || -z "${TMPDIR}" ) && -s "${ZDOTDIR:-$HOME}/.zprofile" ]]; then +if [[ ( "$SHLVL" -eq 1 && ! -o LOGIN ) && -s "${ZDOTDIR:-$HOME}/.zprofile" ]]; then source "${ZDOTDIR:-$HOME}/.zprofile" fi