Skip to content

Commit

Permalink
Merge pull request #780 from giuseppe/idmapped-mounts
Browse files Browse the repository at this point in the history
linux: new mount option "idmap"
  • Loading branch information
flouthoc authored Nov 16, 2021
2 parents 0f36c6e + 827b873 commit d6d78a3
Show file tree
Hide file tree
Showing 8 changed files with 295 additions and 43 deletions.
6 changes: 6 additions & 0 deletions crun.1
Original file line number Diff line number Diff line change
Expand Up @@ -638,6 +638,12 @@ itself.
.PP
If the \fB\fCrro\fR option is specified then the mount is made recursively read-only.

.SH idmap mount options
.PP
If the \fB\fCidmap\fR option is specified then the mount is ID mapped using the container
target user namespace. This is an experimental feature and can change at any time
without notice.

.SH Automatically create user namespace
.PP
When running as user different than root, an user namespace is
Expand Down
6 changes: 6 additions & 0 deletions crun.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,12 @@ itself.

If the `rro` option is specified then the mount is made recursively read-only.

## idmap mount options

If the `idmap` option is specified then the mount is ID mapped using the container
target user namespace. This is an experimental feature and can change at any time
without notice.

## Automatically create user namespace

When running as user different than root, an user namespace is
Expand Down
4 changes: 4 additions & 0 deletions src/libcrun/container.c
Original file line number Diff line number Diff line change
Expand Up @@ -543,8 +543,12 @@ libcrun_container_free (libcrun_container_t *ctr)
if (ctr == NULL)
return;

if (ctr->cleanup_private_data)
ctr->cleanup_private_data (ctr->private_data);

if (ctr->container_def)
free_runtime_spec_schema_config_schema (ctr->container_def);

free (ctr);
}

Expand Down
1 change: 1 addition & 0 deletions src/libcrun/container.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ struct libcrun_container_s
bool use_intermediate_userns;

void *private_data;
void (*cleanup_private_data) (void *private_data);
struct libcrun_context_s *context;
};

Expand Down
Loading

0 comments on commit d6d78a3

Please sign in to comment.