basic: Move userns_supported() to namespace-util.h

This commit is contained in:
Daan De Meyer
2025-05-25 10:00:54 +02:00
parent 01655aec3b
commit 1aabcd7454
3 changed files with 5 additions and 4 deletions
+4
View File
@@ -644,6 +644,10 @@ int userns_enter_and_pin(int userns_fd, pid_t *ret_pid) {
return 0;
}
bool userns_supported(void) {
return access("/proc/self/uid_map", F_OK) >= 0;
}
int userns_get_base_uid(int userns_fd, uid_t *ret_uid, gid_t *ret_gid) {
_cleanup_(sigkill_waitp) pid_t pid = 0;
int r;