nsresource: add constants for the only supported UID range size allocations

As requested: https://github.com/systemd/systemd/pull/39322#discussion_r2447366728
This commit is contained in:
Lennart Poettering
2025-10-21 23:09:50 +02:00
parent b3e5e00d45
commit bcafa70974
3 changed files with 7 additions and 3 deletions
+1 -1
View File
@@ -2302,7 +2302,7 @@ static int run(int argc, char *argv[]) {
/* Don't run things in private userns, if the mount shall be attached to the host */
if (!IN_SET(arg_action, ACTION_MOUNT, ACTION_WITH)) {
userns_fd = nsresource_allocate_userns(/* name= */ NULL, UINT64_C(0x10000)); /* allocate 64K users by default */
userns_fd = nsresource_allocate_userns(/* name= */ NULL, NSRESOURCE_UIDS_64K); /* allocate 64K users by default */
if (userns_fd < 0)
return log_error_errno(userns_fd, "Failed to allocate user namespace with 64K users: %m");
}