diff options
author | Paweł Krupa <pawel@krupa.net.pl> | 2019-01-30 10:57:37 +0100 |
---|---|---|
committer | Chris Akritidis <43294513+cakrit@users.noreply.github.com> | 2019-01-30 11:57:37 +0200 |
commit | ec90b63ffddf04289d340bacbb39865fffec9ac4 (patch) | |
tree | fa2ed9eb8424e2db37d1658bbb8d501261785568 | |
parent | 2538fcccbc786f5cc6570f4738b9649ac3dace1c (diff) |
kickstart: noexec detection (#5293)
-rw-r--r-- | packaging/installer/README.md | 2 | ||||
-rwxr-xr-x | packaging/installer/kickstart.sh | 9 |
2 files changed, 9 insertions, 2 deletions
diff --git a/packaging/installer/README.md b/packaging/installer/README.md index 74e5519910..eb507a5fc9 100644 --- a/packaging/installer/README.md +++ b/packaging/installer/README.md @@ -41,7 +41,7 @@ bash <(curl -Ss https://my-netdata.io/kickstart.sh) Verify the integrity of the script with this: ```bash -[ "f16d433f3fc86264fa2e05808369c54b" = "$(curl -Ss https://my-netdata.io/kickstart.sh | md5sum | cut -d ' ' -f 1)" ] && echo "OK, VALID" || echo "FAILED, INVALID" +[ "b4632ca6c651de0f667e6d4f6e1015fe" = "$(curl -Ss https://my-netdata.io/kickstart.sh | md5sum | cut -d ' ' -f 1)" ] && echo "OK, VALID" || echo "FAILED, INVALID" ``` *It should print `OK, VALID` if the script is the one we ship.* diff --git a/packaging/installer/kickstart.sh b/packaging/installer/kickstart.sh index 451271713d..2a5c874da1 100755 --- a/packaging/installer/kickstart.sh +++ b/packaging/installer/kickstart.sh @@ -216,7 +216,14 @@ Machine : ${MACHINE} BASH major version: ${BASH_MAJOR_VERSION} EOF -tmpdir="$(mktemp -d /tmp/netdata-kickstart-XXXXXX)" +# Check if tmp is mounted as noexec +if grep -Eq '^[^ ]+ /tmp [^ ]+ ([^ ]*,)?noexec[, ]' /proc/mounts; then + pattern="/opt/netdata-kickstart-XXXXXX" +else + pattern="/tmp/netdata-kickstart-XXXXXX" +fi + +tmpdir="$(mktemp -d $pattern)" cd "${tmpdir}" || : if [ "${OS}" != "GNU/Linux" ] && [ "${SYSTEM}" != "Linux" ]; then |