@cryptotaxi247 / netdata-1 / commits / ec90b63ff

kickstart: noexec detection (#5293)

Paweł Krupa committed Jan 30, 2019 at 10:57 UTC ec90b63ffddf04289d340bacbb39865fffec9ac4
2 files changed +9 -2
packaging/installer/README.md
+1 -1
@@ -41,7 +41,7 @@ bash <(curl -Ss https://my-netdata.io/kickstart.sh)
41 Verify the integrity of the script with this:
42
43 ```bash
44 -[ "f16d433f3fc86264fa2e05808369c54b" = "$(curl -Ss https://my-netdata.io/kickstart.sh | md5sum | cut -d ' ' -f 1)" ] && echo "OK, VALID" || echo "FAILED, INVALID"
44 +[ "b4632ca6c651de0f667e6d4f6e1015fe" = "$(curl -Ss https://my-netdata.io/kickstart.sh | md5sum | cut -d ' ' -f 1)" ] && echo "OK, VALID" || echo "FAILED, INVALID"
45 ```
46 *It should print `OK, VALID` if the script is the one we ship.*
47
packaging/installer/kickstart.sh
+8 -1
@@ -216,7 +216,14 @@ Machine : ${MACHINE}
216 BASH major version: ${BASH_MAJOR_VERSION}
217 EOF
218
219 -tmpdir="$(mktemp -d /tmp/netdata-kickstart-XXXXXX)"
219 +# Check if tmp is mounted as noexec
220 +if grep -Eq '^[^ ]+ /tmp [^ ]+ ([^ ]*,)?noexec[, ]' /proc/mounts; then
221 + pattern="/opt/netdata-kickstart-XXXXXX"
222 +else
223 + pattern="/tmp/netdata-kickstart-XXXXXX"
224 +fi
225 +
226 +tmpdir="$(mktemp -d $pattern)"
227 cd "${tmpdir}" || :
228
229 if [ "${OS}" != "GNU/Linux" ] && [ "${SYSTEM}" != "Linux" ]; then