Merge pull request #2211 from unsatcore/master

tests: more robust check for user namespaces availability (canUseSand…
This commit is contained in:
Eelco Dolstra
2018-06-11 11:10:02 +02:00
committed by GitHub
2 changed files with 4 additions and 6 deletions
+1 -1
View File
@@ -57,7 +57,7 @@ rec {
git
mercurial
]
++ lib.optional stdenv.isLinux libseccomp
++ lib.optionals stdenv.isLinux [libseccomp utillinux]
++ lib.optional (stdenv.isLinux || stdenv.isDarwin) libsodium
++ lib.optional (stdenv.isLinux || stdenv.isDarwin)
(aws-sdk-cpp.override {
+3 -5
View File
@@ -94,11 +94,9 @@ canUseSandbox() {
return 1
fi
if [ -e /proc/sys/kernel/unprivileged_userns_clone ]; then
if [ "$(cat /proc/sys/kernel/unprivileged_userns_clone)" != 1 ]; then
echo "Unprivileged user namespaces disabled by sysctl, skipping this test..."
return 1
fi
if ! unshare --user true ; then
echo "Unprivileged user namespaces disabled by sysctl, skipping this test..."
return 1
fi
return 0