Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/libcrun/linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -4462,6 +4462,17 @@ prepare_and_send_mount_mounts (libcrun_container_t *container, pid_t pid, int sy

mount_fds = make_libcrun_fd_map (def->mounts_len);

/* If the container is already running in a user namespace, apply the same logic as if a new
user namespace was created as part of the container itself. */
if (! has_userns)
{
int is_in_userns = check_running_in_user_namespace (err);
if (UNLIKELY (is_in_userns < 0))
return is_in_userns;

has_userns = is_in_userns > 0;
}

for (i = 0; i < def->mounts_len; i++)
{
bool recursive = false;
Expand Down