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
dea31fe2
Unverified
Commit
dea31fe2
authored
Jan 28, 2019
by
Stéphane Graber
Committed by
GitHub
Jan 28, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2807 from brauner/2019-01-27/mount_entries
conf: check for successful mount entry parse
parents
91046ccd
dc691e34
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
7 deletions
+11
-7
conf.c
src/lxc/conf.c
+11
-7
No files found.
src/lxc/conf.c
View file @
dea31fe2
...
...
@@ -2336,11 +2336,12 @@ static int mount_file_entries(const struct lxc_conf *conf,
const
struct
lxc_rootfs
*
rootfs
,
FILE
*
file
,
const
char
*
lxc_name
,
const
char
*
lxc_path
)
{
char
buf
[
4096
];
char
buf
[
PATH_MAX
];
struct
mntent
mntent
;
int
ret
=
-
1
;
while
(
getmntent_r
(
file
,
&
mntent
,
buf
,
sizeof
(
buf
)))
{
int
ret
;
if
(
!
rootfs
->
path
)
ret
=
mount_entry_on_systemfs
(
&
mntent
);
else
if
(
mntent
.
mnt_dir
[
0
]
!=
'/'
)
...
...
@@ -2352,10 +2353,13 @@ static int mount_file_entries(const struct lxc_conf *conf,
if
(
ret
<
0
)
return
-
1
;
}
ret
=
0
;
INFO
(
"Finished setting up mounts"
);
return
ret
;
if
(
!
feof
(
file
)
||
ferror
(
file
))
{
ERROR
(
"Failed to parse mount entries"
);
return
-
1
;
}
return
0
;
}
static
int
setup_mount
(
const
struct
lxc_conf
*
conf
,
...
...
@@ -2393,8 +2397,8 @@ static int setup_mount(const struct lxc_conf *conf,
* access them as a side effect without explicitly allowing it.
*/
static
const
char
nesting_helpers
[]
=
"proc dev/.lxc/proc proc create=dir,optional
\n
"
"sys dev/.lxc/sys sysfs create=dir,optional
\n
"
;
"proc dev/.lxc/proc proc create=dir,optional
0 0
\n
"
"sys dev/.lxc/sys sysfs create=dir,optional
0 0
\n
"
;
FILE
*
make_anonymous_mount_file
(
struct
lxc_list
*
mount
,
bool
include_nesting_helpers
)
...
...
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