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
cfc0a48e
Unverified
Commit
cfc0a48e
authored
Apr 06, 2021
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
conf: fix setups where /dev is outside of LXC's control
Fixes: #3770 Suggested-by:
Ruben Jenster
<
r.jenster@drachenfels.de
>
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
448462dd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
6 deletions
+5
-6
conf.c
src/lxc/conf.c
+5
-6
No files found.
src/lxc/conf.c
View file @
cfc0a48e
...
@@ -3457,12 +3457,6 @@ int lxc_setup(struct lxc_handler *handler)
...
@@ -3457,12 +3457,6 @@ int lxc_setup(struct lxc_handler *handler)
return
log_error
(
-
1
,
"Failed to mount
\"
/dev
\"
"
);
return
log_error
(
-
1
,
"Failed to mount
\"
/dev
\"
"
);
}
}
lxc_conf
->
rootfs
.
dfd_dev
=
open_at
(
lxc_conf
->
rootfs
.
dfd_mnt
,
"dev"
,
PROTECT_OPATH_DIRECTORY
,
PROTECT_LOOKUP_BENEATH_XDEV
,
0
);
if
(
lxc_conf
->
rootfs
.
dfd_dev
<
0
&&
errno
!=
ENOENT
)
return
log_error_errno
(
-
errno
,
errno
,
"Failed to open
\"
/dev
\"
"
);
/* Do automatic mounts (mainly /proc and /sys), but exclude those that
/* Do automatic mounts (mainly /proc and /sys), but exclude those that
* need to wait until other stuff has finished.
* need to wait until other stuff has finished.
*/
*/
...
@@ -3481,6 +3475,11 @@ int lxc_setup(struct lxc_handler *handler)
...
@@ -3481,6 +3475,11 @@ int lxc_setup(struct lxc_handler *handler)
return
log_error
(
-
1
,
"Failed to setup mount entries"
);
return
log_error
(
-
1
,
"Failed to setup mount entries"
);
}
}
lxc_conf
->
rootfs
.
dfd_dev
=
open_at
(
lxc_conf
->
rootfs
.
dfd_mnt
,
"dev"
,
PROTECT_OPATH_DIRECTORY
,
PROTECT_LOOKUP_BENEATH_XDEV
,
0
);
if
(
lxc_conf
->
rootfs
.
dfd_dev
<
0
&&
errno
!=
ENOENT
)
return
log_error_errno
(
-
errno
,
errno
,
"Failed to open
\"
/dev
\"
"
);
if
(
lxc_conf
->
is_execute
)
{
if
(
lxc_conf
->
is_execute
)
{
if
(
execveat_supported
())
{
if
(
execveat_supported
())
{
int
fd
;
int
fd
;
...
...
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