summaryrefslogtreecommitdiff
path: root/namespace_checker.sh
diff options
context:
space:
mode:
Diffstat (limited to 'namespace_checker.sh')
-rwxr-xr-xnamespace_checker.sh21
1 files changed, 21 insertions, 0 deletions
diff --git a/namespace_checker.sh b/namespace_checker.sh
new file mode 100755
index 0000000..801ab81
--- /dev/null
+++ b/namespace_checker.sh
@@ -0,0 +1,21 @@
+#!/bin/bash
+
+VALUE=$(cat /boot/config-$(uname -r) | grep CONFIG_USER_NS)
+
+if [[ -z "$VALUE" ]]
+then
+ echo 'You do not have namespacing in the kernel. You will need to enable the SUID sandbox or upgrade your kernel.'
+ echo 'See https://chromium.googlesource.com/chromium/src/+/master/docs/linux_suid_sandbox_development.md'
+ exit 1
+fi
+
+USER_NS_AVAILABLE="${VALUE: -1}"
+
+if [[ "$USER_NS_AVAILABLE" == "y" ]]
+then
+ exit 0
+else
+ echo 'You do not have namespacing in the kernel. You will need to enable the SUID sandbox or upgrade your kernel.'
+ echo 'See https://chromium.googlesource.com/chromium/src/+/master/docs/linux_suid_sandbox_development.md'
+ exit 1
+fi \ No newline at end of file