Skip to content

Commit

Permalink
Use actual executable test instead of mount|grep noexec
Browse files Browse the repository at this point in the history
  • Loading branch information
gnosek committed Feb 20, 2017
1 parent 152fdc2 commit f86ec38
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Expand Up @@ -4,6 +4,8 @@

[Full Changelog](https://github.com/rvm/rvm/compare/1.29.1...HEAD)

#### Bug fixes:
* Use actual executable test instead of mount|grep noexec for robust noexec detection [\#3832](https://github.com/rvm/rvm/issues/3832)

## [1.29.1](https://github.com/rvm/rvm/tag/1.29.1)

Expand Down
9 changes: 7 additions & 2 deletions binscripts/rvm-installer
Expand Up @@ -783,7 +783,7 @@ follow this link for details how to fix:

rvm_install_validate_volume_mount_mode()
{
\typeset path partition
\typeset path partition test_exec

path=$rvm_path

Expand All @@ -793,17 +793,22 @@ rvm_install_validate_volume_mount_mode()
do
if [[ -d $path ]]
then
test_exec=$(mktemp $path/rvm-exec-test.XXXXXX)
echo '#!/bin/sh' > "$test_exec"
chmod +x "$test_exec"
partition=`df -P $path | awk 'END{print $1}'`

if mount | grep "$partition .*noexec.*" >/dev/null 2>&1
if ! "$test_exec"
then
rm -f "$test_exec"
printf "%b" "
It looks that partition holding RVM destination location ${rvm_path}
is mounted in *noexec* mode, which prevents RVM from working correctly.
Please re-mount partition ${partition} without the noexec option."
exit 2
fi

rm -f "$test_exec"
break
fi

Expand Down

0 comments on commit f86ec38

Please sign in to comment.