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
f6c5aab0
Unverified
Commit
f6c5aab0
authored
May 12, 2021
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
conf: don't unmount procfs and sysfs
Fixes: #3838 Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
89606dfb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
14 deletions
+26
-14
conf.c
src/lxc/conf.c
+26
-14
No files found.
src/lxc/conf.c
View file @
f6c5aab0
...
@@ -717,14 +717,20 @@ static int lxc_mount_auto_mounts(struct lxc_handler *handler, int flags)
...
@@ -717,14 +717,20 @@ static int lxc_mount_auto_mounts(struct lxc_handler *handler, int flags)
bool
has_cap_net_admin
;
bool
has_cap_net_admin
;
if
(
flags
&
LXC_AUTO_PROC_MASK
)
{
if
(
flags
&
LXC_AUTO_PROC_MASK
)
{
ret
=
strnprintf
(
rootfs
->
buf
,
sizeof
(
rootfs
->
buf
),
"%s/proc"
,
if
(
rootfs
->
path
)
{
rootfs
->
path
?
rootfs
->
mount
:
""
);
/*
if
(
ret
<
0
)
* Only unmount procfs if we have a separate rootfs so
return
ret_errno
(
EIO
);
* we can still access it in safe_mount() below.
*/
ret
=
strnprintf
(
rootfs
->
buf
,
sizeof
(
rootfs
->
buf
),
"%s/proc"
,
rootfs
->
path
?
rootfs
->
mount
:
""
);
if
(
ret
<
0
)
return
ret_errno
(
EIO
);
ret
=
umount2
(
rootfs
->
buf
,
MNT_DETACH
);
ret
=
umount2
(
rootfs
->
buf
,
MNT_DETACH
);
if
(
ret
)
if
(
ret
)
SYSDEBUG
(
"Tried to ensure procfs is unmounted"
);
SYSDEBUG
(
"Tried to ensure procfs is unmounted"
);
}
ret
=
mkdirat
(
rootfs
->
dfd_mnt
,
"proc"
,
S_IRWXU
|
S_IRGRP
|
S_IXGRP
|
S_IROTH
|
S_IXOTH
);
ret
=
mkdirat
(
rootfs
->
dfd_mnt
,
"proc"
,
S_IRWXU
|
S_IRGRP
|
S_IXGRP
|
S_IROTH
|
S_IXOTH
);
if
(
ret
<
0
&&
errno
!=
EEXIST
)
if
(
ret
<
0
&&
errno
!=
EEXIST
)
...
@@ -732,14 +738,20 @@ static int lxc_mount_auto_mounts(struct lxc_handler *handler, int flags)
...
@@ -732,14 +738,20 @@ static int lxc_mount_auto_mounts(struct lxc_handler *handler, int flags)
}
}
if
(
flags
&
LXC_AUTO_SYS_MASK
)
{
if
(
flags
&
LXC_AUTO_SYS_MASK
)
{
ret
=
strnprintf
(
rootfs
->
buf
,
sizeof
(
rootfs
->
buf
),
"%s/sys"
,
if
(
rootfs
->
path
)
{
rootfs
->
path
?
rootfs
->
mount
:
""
);
/*
if
(
ret
<
0
)
* Only unmount sysfs if we have a separate rootfs so
return
ret_errno
(
EIO
);
* we can still access it in safe_mount() below.
*/
ret
=
strnprintf
(
rootfs
->
buf
,
sizeof
(
rootfs
->
buf
),
"%s/sys"
,
rootfs
->
path
?
rootfs
->
mount
:
""
);
if
(
ret
<
0
)
return
ret_errno
(
EIO
);
ret
=
umount2
(
rootfs
->
buf
,
MNT_DETACH
);
ret
=
umount2
(
rootfs
->
buf
,
MNT_DETACH
);
if
(
ret
)
if
(
ret
)
SYSDEBUG
(
"Tried to ensure sysfs is unmounted"
);
SYSDEBUG
(
"Tried to ensure sysfs is unmounted"
);
}
ret
=
mkdirat
(
rootfs
->
dfd_mnt
,
"sys"
,
S_IRWXU
|
S_IRGRP
|
S_IXGRP
|
S_IROTH
|
S_IXOTH
);
ret
=
mkdirat
(
rootfs
->
dfd_mnt
,
"sys"
,
S_IRWXU
|
S_IRGRP
|
S_IXGRP
|
S_IROTH
|
S_IXOTH
);
if
(
ret
<
0
&&
errno
!=
EEXIST
)
if
(
ret
<
0
&&
errno
!=
EEXIST
)
...
...
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