diff mbox series

test-container: EPERM from unshare is UNSUPPORTED

Message ID 20180828120314.EA92540E22B36@oldenburg.str.redhat.com
State New
Headers show
Series test-container: EPERM from unshare is UNSUPPORTED | expand

Commit Message

Florian Weimer Aug. 28, 2018, 12:03 p.m. UTC
For example, the security policy on the Fedora build daemons results in
this EPERM error.

2018-08-28  Florian Weimer  <fweimer@redhat.com>

	* support/test-container.c (main): Treat unshare failure with
	EPERM as an unsupported test.
diff mbox series

Patch

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));