File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -1016,10 +1016,22 @@ else
10161016 TMP=" ${TMPDIR%/ } "
10171017fi
10181018
1019- if [ ! -w " $TMP " ] || [ ! -x " $TMP " ]; then
1019+ # Check if TMPDIR is accessible and can hold executables.
1020+ tmp_executable=" ${TMP} /ruby-build-test.$$ "
1021+ noexec=" "
1022+ if mkdir -p " $TMP " && touch " $tmp_executable " 2> /dev/null; then
1023+ cat > " $tmp_executable " <<< " #!$BASH"
1024+ chmod +x " $tmp_executable "
1025+ else
10201026 echo " ruby-build: TMPDIR=$TMP is set to a non-accessible location" >&2
10211027 exit 1
10221028fi
1029+ " $tmp_executable " 2> /dev/null || noexec=1
1030+ rm -f " $tmp_executable "
1031+ if [ -n " $noexec " ]; then
1032+ echo " ruby-build: TMPDIR=$TMP cannot hold executables (partition possibly mounted with \` noexec\` )" >&2
1033+ exit 1
1034+ fi
10231035
10241036# Work around warnings building Ruby 2.0 on Clang 2.x:
10251037# pass -Wno-error=shorten-64-to-32 if the compiler accepts it.
You can’t perform that action at this time.
0 commit comments