From 743b9c1eb46934cd0e7a002277f298322a11eb63 Mon Sep 17 00:00:00 2001 From: Ivan Pozdeev Date: Fri, 26 Jun 2026 20:52:16 +0300 Subject: [PATCH] + specter (critical knowledge not present in the code itself) --- libexec/pyenv-rehash | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libexec/pyenv-rehash b/libexec/pyenv-rehash index a3a6aca7..b184877d 100755 --- a/libexec/pyenv-rehash +++ b/libexec/pyenv-rehash @@ -28,6 +28,8 @@ 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 + # if lots of (50+) rehashes run concurrentlty, another concurrent rehash + # may delete the temporary file in remove_*_shims() before we do so ( t="$(TMPDIR="$SHIM_PATH" mktemp)" && rm -f "$t" ) \ && tested_for_other_write_errors=1 \ || { echo "pyenv: cannot rehash: $SHIM_PATH isn't writable" >&2