1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-08-08 17:42:12 +03:00

test-container: EPERM from unshare is UNSUPPORTED

For example, the security policy on the Fedora build daemons results in
this EPERM error.
This commit is contained in:
Florian Weimer
2018-08-28 14:02:47 +02:00
parent 745664bd79
commit d6c44c3d0c
2 changed files with 8 additions and 2 deletions

View File

@@ -1,3 +1,8 @@
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> 2018-08-28 Florian Weimer <fweimer@redhat.com>
[BZ #23520] [BZ #23520]

View File

@@ -871,8 +871,9 @@ main (int argc, char **argv)
/* The unshare here gives us our own spaces and capabilities. */ /* The unshare here gives us our own spaces and capabilities. */
if (unshare (CLONE_NEWUSER | CLONE_NEWPID | CLONE_NEWNS) < 0) if (unshare (CLONE_NEWUSER | CLONE_NEWPID | CLONE_NEWNS) < 0)
{ {
/* Older kernels may not support all the options. */ /* Older kernels may not support all the options, or security
if (errno == EINVAL) policy may block this call. */
if (errno == EINVAL || errno == EPERM)
FAIL_UNSUPPORTED ("unable to unshare user/fs: %s", strerror (errno)); FAIL_UNSUPPORTED ("unable to unshare user/fs: %s", strerror (errno));
else else
FAIL_EXIT1 ("unable to unshare user/fs: %s", strerror (errno)); FAIL_EXIT1 ("unable to unshare user/fs: %s", strerror (errno));