From 1eaaada4994ab26ce5f0c591996344b330066cce Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Fri, 25 Aug 2023 22:49:41 -0700 Subject: [PATCH] [Perf] `nvm_check_file_permissions`: do not traverse into symlinks --- nvm.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nvm.sh b/nvm.sh index 626e4f7c78..f3f65765f6 100644 --- a/nvm.sh +++ b/nvm.sh @@ -2784,7 +2784,7 @@ nvm_check_file_permissions() { if [ -n "${NVM_DEBUG-}" ]; then nvm_err "${FILE}" fi - if ! nvm_check_file_permissions "${FILE}"; then + if [ ! -L "${FILE}" ] && ! nvm_check_file_permissions "${FILE}"; then return 2 fi elif [ -e "$FILE" ] && [ ! -w "$FILE" ] && [ ! -O "$FILE" ]; then