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
6b7c60e1
Commit
6b7c60e1
authored
Feb 03, 2016
by
Serge Hallyn
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #800 from brauner/2016-02-03/no_rootfs_implies_abspath
no rootfs => mounts always relative to host's /
parents
e855f214
1433c9f9
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
2 deletions
+17
-2
conf.c
src/lxc/conf.c
+17
-2
No files found.
src/lxc/conf.c
View file @
6b7c60e1
...
@@ -1807,7 +1807,22 @@ static inline int mount_entry_on_generic(struct mntent *mntent,
...
@@ -1807,7 +1807,22 @@ static inline int mount_entry_on_generic(struct mntent *mntent,
static
inline
int
mount_entry_on_systemfs
(
struct
mntent
*
mntent
)
static
inline
int
mount_entry_on_systemfs
(
struct
mntent
*
mntent
)
{
{
return
mount_entry_on_generic
(
mntent
,
mntent
->
mnt_dir
,
NULL
,
NULL
,
NULL
);
char
path
[
MAXPATHLEN
];
int
ret
;
/* For containers created without a rootfs all mounts are treated as
* absolute paths starting at / on the host. */
if
(
mntent
->
mnt_dir
[
0
]
!=
'/'
)
ret
=
snprintf
(
path
,
sizeof
(
path
),
"/%s"
,
mntent
->
mnt_dir
);
else
ret
=
snprintf
(
path
,
sizeof
(
path
),
"%s"
,
mntent
->
mnt_dir
);
if
(
ret
<
0
||
ret
>=
sizeof
(
path
))
{
ERROR
(
"path name too long"
);
return
-
1
;
}
return
mount_entry_on_generic
(
mntent
,
path
,
NULL
,
NULL
,
NULL
);
}
}
static
int
mount_entry_on_absolute_rootfs
(
struct
mntent
*
mntent
,
static
int
mount_entry_on_absolute_rootfs
(
struct
mntent
*
mntent
,
...
@@ -1868,7 +1883,7 @@ static int mount_entry_on_relative_rootfs(struct mntent *mntent,
...
@@ -1868,7 +1883,7 @@ static int mount_entry_on_relative_rootfs(struct mntent *mntent,
/* relative to root mount point */
/* relative to root mount point */
ret
=
snprintf
(
path
,
sizeof
(
path
),
"%s/%s"
,
rootfs
->
mount
,
mntent
->
mnt_dir
);
ret
=
snprintf
(
path
,
sizeof
(
path
),
"%s/%s"
,
rootfs
->
mount
,
mntent
->
mnt_dir
);
if
(
ret
>=
sizeof
(
path
))
{
if
(
ret
<
0
||
ret
>=
sizeof
(
path
))
{
ERROR
(
"path name too long"
);
ERROR
(
"path name too long"
);
return
-
1
;
return
-
1
;
}
}
...
...
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