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
75022b57
Unverified
Commit
75022b57
authored
May 10, 2017
by
Christian Brauner
Committed by
Stéphane Graber
May 10, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
conf: non-functional changes
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
2ff023b7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
10 deletions
+21
-10
conf.c
src/lxc/conf.c
+21
-10
No files found.
src/lxc/conf.c
View file @
75022b57
...
...
@@ -1228,23 +1228,23 @@ int prepare_ramfs_root(char *root)
char
*
p2
;
if
(
realpath
(
root
,
nroot
)
==
NULL
)
return
-
1
;
return
-
errno
;
if
(
chdir
(
"/"
)
==
-
1
)
return
-
1
;
return
-
errno
;
/*
* We could use here MS_MOVE, but in userns this mount is
* locked and can't be moved.
*/
if
(
mount
(
root
,
"/"
,
NULL
,
MS_REC
|
MS_BIND
,
NULL
))
{
if
(
mount
(
root
,
"/"
,
NULL
,
MS_REC
|
MS_BIND
,
NULL
)
<
0
)
{
SYSERROR
(
"Failed to move %s into /"
,
root
);
return
-
1
;
return
-
errno
;
}
if
(
mount
(
NULL
,
"/"
,
NULL
,
MS_REC
|
MS_PRIVATE
,
NULL
))
{
if
(
mount
(
NULL
,
"/"
,
NULL
,
MS_REC
|
MS_PRIVATE
,
NULL
)
<
0
)
{
SYSERROR
(
"Failed to make . rprivate"
);
return
-
1
;
return
-
errno
;
}
/*
...
...
@@ -1310,17 +1310,28 @@ int prepare_ramfs_root(char *root)
static
int
setup_pivot_root
(
const
struct
lxc_rootfs
*
rootfs
)
{
if
(
!
rootfs
->
path
)
if
(
!
rootfs
->
path
)
{
DEBUG
(
"container does not have a rootfs, so not doing pivot root"
);
return
0
;
}
if
(
detect_ramfs_rootfs
())
{
if
(
prepare_ramfs_root
(
rootfs
->
mount
))
DEBUG
(
"detected that container is on ramfs"
);
if
(
prepare_ramfs_root
(
rootfs
->
mount
))
{
ERROR
(
"failed to prepare minimal ramfs root"
);
return
-
1
;
}
else
if
(
setup_rootfs_pivot_root
(
rootfs
->
mount
))
{
ERROR
(
"failed to setup pivot root"
);
}
DEBUG
(
"prepared ramfs root for container"
);
return
0
;
}
if
(
setup_rootfs_pivot_root
(
rootfs
->
mount
)
<
0
)
{
ERROR
(
"failed to pivot root"
);
return
-
1
;
}
DEBUG
(
"finished pivot root"
);
return
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