From: Lennart Poettering Date: Fri, 19 May 2023 12:50:15 +0000 (+0200) Subject: namespace-util: use inode_same_at() instead of FORMAT_PROC_FD_PATH() X-Git-Tag: v254-rc1~435^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3530fd8913c03c74af4705dd46d2fd6a7e2e52bf;p=thirdparty%2Fsystemd.git namespace-util: use inode_same_at() instead of FORMAT_PROC_FD_PATH() Doesn't matter much, but this makes it leas magic and independent of /proc/ mounts. (Well, it actually doesn't, since the right-hand path is also in /proc/, but still... --- diff --git a/src/basic/namespace-util.c b/src/basic/namespace-util.c index 27c760c3ef0..0a0de85aada 100644 --- a/src/basic/namespace-util.c +++ b/src/basic/namespace-util.c @@ -109,7 +109,7 @@ int namespace_enter(int pidns_fd, int mntns_fd, int netns_fd, int userns_fd, int /* Can't setns to your own userns, since then you could escalate from non-root to root in * your own namespace, so check if namespaces are equal before attempting to enter. */ - r = inode_same(FORMAT_PROC_FD_PATH(userns_fd), "/proc/self/ns/user", 0); + r = inode_same_at(userns_fd, "", AT_FDCWD, "/proc/self/ns/user", AT_EMPTY_PATH); if (r < 0) return r; if (r)