Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
lxc
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
lxc
Commits
88dff0a5
Unverified
Commit
88dff0a5
authored
Mar 17, 2021
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
start: documented idmapped mounts
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
fb9f0d84
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
1 deletion
+15
-1
start.c
src/lxc/start.c
+15
-1
No files found.
src/lxc/start.c
View file @
88dff0a5
...
@@ -2042,7 +2042,21 @@ int __lxc_start(struct lxc_handler *handler, struct lxc_operations *ops,
...
@@ -2042,7 +2042,21 @@ int __lxc_start(struct lxc_handler *handler, struct lxc_operations *ops,
}
}
if
(
geteuid
()
==
0
&&
!
lxc_list_empty
(
&
conf
->
id_map
))
{
if
(
geteuid
()
==
0
&&
!
lxc_list_empty
(
&
conf
->
id_map
))
{
/* If the backing store is a device, mount it here and now. */
/*
* This handles two cases: mounting real block devices and
* creating idmapped mounts. The block device case should be
* obivous, i.e. no real filesystem can currently be mounted
* from inside a user namespace.
*
* Idmapped mounts can currently only be created if the caller
* is privileged wrt to the user namespace in which the
* underlying block device has been mounted in. This basically
* (with few exceptions) means we need to be CAP_SYS_ADMIN in
* the initial user namespace since almost no interesting
* filesystems can be mounted inside of user namespaces. This
* is way we need to do the rootfs setup here. In the future
* this may change.
*/
if
(
idmapped_rootfs_mnt
(
&
conf
->
rootfs
)
||
rootfs_is_blockdev
(
conf
))
{
if
(
idmapped_rootfs_mnt
(
&
conf
->
rootfs
)
||
rootfs_is_blockdev
(
conf
))
{
ret
=
unshare
(
CLONE_NEWNS
);
ret
=
unshare
(
CLONE_NEWNS
);
if
(
ret
<
0
)
{
if
(
ret
<
0
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment