Skip to content

Commit d6d78a3

Browse files
authored
Merge pull request #780 from giuseppe/idmapped-mounts
linux: new mount option "idmap"
2 parents 0f36c6e + 827b873 commit d6d78a3

File tree

8 files changed

+295
-43
lines changed

8 files changed

+295
-43
lines changed

crun.1

+6
Original file line numberDiff line numberDiff line change
@@ -638,6 +638,12 @@ itself.
638638
.PP
639639
If the \fB\fCrro\fR option is specified then the mount is made recursively read-only.
640640

641+
.SH idmap mount options
642+
.PP
643+
If the \fB\fCidmap\fR option is specified then the mount is ID mapped using the container
644+
target user namespace. This is an experimental feature and can change at any time
645+
without notice.
646+
641647
.SH Automatically create user namespace
642648
.PP
643649
When running as user different than root, an user namespace is

crun.1.md

+6
Original file line numberDiff line numberDiff line change
@@ -507,6 +507,12 @@ itself.
507507

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

510+
## idmap mount options
511+
512+
If the `idmap` option is specified then the mount is ID mapped using the container
513+
target user namespace. This is an experimental feature and can change at any time
514+
without notice.
515+
510516
## Automatically create user namespace
511517

512518
When running as user different than root, an user namespace is

src/libcrun/container.c

+4
Original file line numberDiff line numberDiff line change
@@ -543,8 +543,12 @@ libcrun_container_free (libcrun_container_t *ctr)
543543
if (ctr == NULL)
544544
return;
545545

546+
if (ctr->cleanup_private_data)
547+
ctr->cleanup_private_data (ctr->private_data);
548+
546549
if (ctr->container_def)
547550
free_runtime_spec_schema_config_schema (ctr->container_def);
551+
548552
free (ctr);
549553
}
550554

src/libcrun/container.h

+1
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ struct libcrun_container_s
7474
bool use_intermediate_userns;
7575

7676
void *private_data;
77+
void (*cleanup_private_data) (void *private_data);
7778
struct libcrun_context_s *context;
7879
};
7980

0 commit comments

Comments
 (0)