From 9cf3a8c027a3972749679f5570b19dde32c5c863 Mon Sep 17 00:00:00 2001 From: Andrew Dorney Date: Mon, 30 Sep 2013 13:42:37 -0500 Subject: [PATCH] Add ptrace_scope check to dependency checking. --- df-lnp-installer.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/df-lnp-installer.sh b/df-lnp-installer.sh index bbeedf6..e7f994f 100755 --- a/df-lnp-installer.sh +++ b/df-lnp-installer.sh @@ -223,6 +223,14 @@ check_install_dir_is_empty () { fi } +check_ptrace_protection () { + local PTRACE_PROTECTION="$(cat /proc/sys/kernel/yama/ptrace_scope)" + + if [ "$PTRACE_PROTECTION" = "1" ]; then + exit_with_error "Your kernel has ptrace protection enabled. DwarfTherapist will not operate properly. Either run 'echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope' or use --skip-deps to override." + fi +} + checksum_all () { # Check for file validity. sha1sum -c sha1sums @@ -881,6 +889,7 @@ fi if [ "$SKIP_DEPS" = "0" ]; then check_dependencies + check_ptrace_protection fi ask_for_preferred_install_dir