]> git.ipfire.org Git - thirdparty/systemd.git/commit
namespace-util: return recognizable error if namespace_open_by_type() fails because...
authorLennart Poettering <lennart@poettering.net>
Tue, 7 Jan 2025 09:53:01 +0000 (10:53 +0100)
committerLennart Poettering <lennart@poettering.net>
Tue, 7 Jan 2025 22:51:28 +0000 (23:51 +0100)
commitadcc8059292edc0b3bcb5b87a387e5d85cedee32
tree0a6bda77636f5f72e78089a1b2a4f82173223296
parent16ac586e5a77942bf1147bc9eae684d544ded88f
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.
src/basic/namespace-util.c
src/test/test-namespace.c