Check inode number to see if we are in init namespace (#35306)
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 25 Nov 2024 13:13:36 +0000 (14:13 +0100)
committerGitHub <noreply@github.com>
Mon, 25 Nov 2024 13:13:36 +0000 (14:13 +0100)
commitd293fade24b34ccc2f5716b0ff5513e9533cf0c4
treea687676488a82c29e770961fd0464d66929dc727
parent4a346b779ad973f742ae0131c59217a761618887
parent4b4af14a98b6c695e29014ec14275d2009590170
Check inode number to see if we are in init namespace (#35306)

This is a more comprehensive fix compared to #35273. Also adds a minimal
test only.

Based on Luca's #35273 but generalizes the code a bit.

In v258 we really should get rid of the old heuristics around userns and
cgroupns detection, but given we are late in the v257 cycle this keeps
them in.
src/basic/namespace-util.c