namespace-util: add in_same_namespace()

Add a helper for the canonical way to determine whether two namespaces
are identical.
This commit is contained in:
Christian Brauner
2022-10-04 18:51:28 +02:00
parent 241b15779b
commit 2fe299a320
2 changed files with 25 additions and 0 deletions
+1
View File
@@ -45,3 +45,4 @@ static inline bool userns_shift_range_valid(uid_t shift, uid_t range) {
}
int userns_acquire(const char *uid_map, const char *gid_map);
int in_same_namespace(pid_t pid1, pid_t pid2, NamespaceType type);