summaryrefslogtreecommitdiff
path: root/namespace_checker.sh
blob: 801ab81d10051b1cc1de9bdd3fe3cda59d99b9b2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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