From 5fc8fd25a354b653e909d3a10a946667e641dcc3 Mon Sep 17 00:00:00 2001 From: Sheile Date: Fri, 26 Jun 2026 15:21:40 +0900 Subject: [PATCH] Avoid race condition in rehash writable check --- libexec/pyenv-rehash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libexec/pyenv-rehash b/libexec/pyenv-rehash index 12fe09bf..a3a6aca7 100755 --- a/libexec/pyenv-rehash +++ b/libexec/pyenv-rehash @@ -28,7 +28,7 @@ acquire_lock() { # So check for writablity by trying to write to a different file, # in a way that taxes the usual use case as little as possible. if [[ -z $tested_for_other_write_errors ]]; then - ( t="$(TMPDIR="$SHIM_PATH" mktemp)" && rm "$t" ) \ + ( t="$(TMPDIR="$SHIM_PATH" mktemp)" && rm -f "$t" ) \ && tested_for_other_write_errors=1 \ || { echo "pyenv: cannot rehash: $SHIM_PATH isn't writable" >&2 set +o noclobber