diff options
author | Lennart Poettering <lennart@poettering.net> | 2025-01-07 10:53:01 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2025-01-07 23:51:28 +0100 |
commit | adcc8059292edc0b3bcb5b87a387e5d85cedee32 (patch) | |
tree | 0a6bda77636f5f72e78089a1b2a4f82173223296 /src/test | |
parent | Bump minimum kernel baseline to 5.4, recommended version to 5.7 (diff) | |
download | systemd-adcc8059292edc0b3bcb5b87a387e5d85cedee32.tar.xz systemd-adcc8059292edc0b3bcb5b87a387e5d85cedee32.zip |
namespace-util: return recognizable error if namespace_open_by_type() fails because ns type not supported
This makes sure the the codepath that derives an nsfd from a pid works
the same for the pidfd case and the non-pidfd case: if we can verify
that /proc/ is mounted but the /proc/$PID/ns/ files are missing, we can
assume the ns type is not supported by the kernel. Hence return the same
ENOPKG error in this case as we already do in the pidfd ioctl based
codepath.
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/test-namespace.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/test/test-namespace.c b/src/test/test-namespace.c index d646306acf..6a0459e1fa 100644 --- a/src/test/test-namespace.c +++ b/src/test/test-namespace.c @@ -172,7 +172,7 @@ TEST(fd_is_namespace) { ASSERT_OK_ZERO(fd_is_namespace(STDERR_FILENO, NAMESPACE_NET)); fd = namespace_open_by_type(NAMESPACE_MOUNT); - if (IN_SET(fd, -ENOSYS, -ENOENT)) { + if (IN_SET(fd, -ENOSYS, -ENOPKG)) { log_notice("Path %s not found, skipping test", "/proc/self/ns/mnt"); return; } |