ソースを参照

rehash: fix race condition in landlock writability check (#3483)

pull/2966/merge
Yo Takezawa 2週間前
committed by GitHub
コミット
3974647f0f
この署名に対応する既知のキーがデータベースに存在しません GPGキーID: B5690EEEBB952194
1個のファイルの変更3行の追加1行の削除
  1. +3
    -1
      libexec/pyenv-rehash

+ 3
- 1
libexec/pyenv-rehash ファイルの表示

@ -28,7 +28,9 @@ 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" ) \
# if lots of (50+) rehashes run concurrently, 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
set +o noclobber

読み込み中…
キャンセル
保存