about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--support/test-container.c5
2 files changed, 8 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 3995e4b536..61b12adb9e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2018-08-28  Florian Weimer  <fweimer@redhat.com>
 
+	* support/test-container.c (main): Treat unshare failure with
+	EPERM as an unsupported test.
+
+2018-08-28  Florian Weimer  <fweimer@redhat.com>
+
 	[BZ #23520]
 	nscd: Fix use-after-free in addgetnetgrentX and its callers.
 	* nscd/netgroupcache.c
diff --git a/support/test-container.c b/support/test-container.c
index ce16e061e7..2e91bdf9ec 100644
--- a/support/test-container.c
+++ b/support/test-container.c
@@ -871,8 +871,9 @@ main (int argc, char **argv)
   /* The unshare here gives us our own spaces and capabilities.  */
   if (unshare (CLONE_NEWUSER | CLONE_NEWPID | CLONE_NEWNS) < 0)
     {
-      /* Older kernels may not support all the options.  */
-      if (errno == EINVAL)
+      /* Older kernels may not support all the options, or security
+	 policy may block this call.  */
+      if (errno == EINVAL || errno == EPERM)
 	FAIL_UNSUPPORTED ("unable to unshare user/fs: %s", strerror (errno));
       else
 	FAIL_EXIT1 ("unable to unshare user/fs: %s", strerror (errno));