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
bdd2b34c
Unverified
Commit
bdd2b34c
authored
Aug 01, 2017
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
conf: mount_entry_on_absolute_rootfs()
non-functional changes Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
19b5d755
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
16 deletions
+12
-16
conf.c
src/lxc/conf.c
+12
-16
No files found.
src/lxc/conf.c
View file @
bdd2b34c
...
@@ -1927,21 +1927,21 @@ static int mount_entry_on_absolute_rootfs(struct mntent *mntent,
...
@@ -1927,21 +1927,21 @@ static int mount_entry_on_absolute_rootfs(struct mntent *mntent,
const
char
*
lxc_name
,
const
char
*
lxc_name
,
const
char
*
lxc_path
)
const
char
*
lxc_path
)
{
{
int
offset
;
char
*
aux
;
char
*
aux
;
char
path
[
MAXPATHLEN
];
int
r
,
ret
=
0
,
offset
;
const
char
*
lxcpath
;
const
char
*
lxcpath
;
char
path
[
MAXPATHLEN
];
int
ret
=
0
;
lxcpath
=
lxc_global_config_value
(
"lxc.lxcpath"
);
lxcpath
=
lxc_global_config_value
(
"lxc.lxcpath"
);
if
(
!
lxcpath
)
{
if
(
!
lxcpath
)
ERROR
(
"Out of memory"
);
return
-
1
;
return
-
1
;
}
/* if rootfs->path is a blockdev path, allow container fstab to
/* If rootfs->path is a blockdev path, allow container fstab to use
* use $lxcpath/CN/rootfs as the target prefix */
* <lxcpath>/<name>/rootfs" as the target prefix.
r
=
snprintf
(
path
,
MAXPATHLEN
,
"%s/%s/rootfs"
,
lxcpath
,
lxc_name
);
*/
if
(
r
<
0
||
r
>=
MAXPATHLEN
)
ret
=
snprintf
(
path
,
MAXPATHLEN
,
"%s/%s/rootfs"
,
lxcpath
,
lxc_name
);
if
(
ret
<
0
||
ret
>=
MAXPATHLEN
)
goto
skipvarlib
;
goto
skipvarlib
;
aux
=
strstr
(
mntent
->
mnt_dir
,
path
);
aux
=
strstr
(
mntent
->
mnt_dir
,
path
);
...
@@ -1953,19 +1953,15 @@ static int mount_entry_on_absolute_rootfs(struct mntent *mntent,
...
@@ -1953,19 +1953,15 @@ static int mount_entry_on_absolute_rootfs(struct mntent *mntent,
skipvarlib:
skipvarlib:
aux
=
strstr
(
mntent
->
mnt_dir
,
rootfs
->
path
);
aux
=
strstr
(
mntent
->
mnt_dir
,
rootfs
->
path
);
if
(
!
aux
)
{
if
(
!
aux
)
{
WARN
(
"
ignoring mount point '%s'
"
,
mntent
->
mnt_dir
);
WARN
(
"
Ignoring mount point
\"
%s
\"
"
,
mntent
->
mnt_dir
);
return
ret
;
return
ret
;
}
}
offset
=
strlen
(
rootfs
->
path
);
offset
=
strlen
(
rootfs
->
path
);
skipabs:
skipabs:
ret
=
snprintf
(
path
,
MAXPATHLEN
,
"%s/%s"
,
rootfs
->
mount
,
aux
+
offset
);
r
=
snprintf
(
path
,
MAXPATHLEN
,
"%s/%s"
,
rootfs
->
mount
,
if
(
ret
<
0
||
ret
>=
MAXPATHLEN
)
aux
+
offset
);
if
(
r
<
0
||
r
>=
MAXPATHLEN
)
{
WARN
(
"pathnme too long for '%s'"
,
mntent
->
mnt_dir
);
return
-
1
;
return
-
1
;
}
return
mount_entry_on_generic
(
mntent
,
path
,
rootfs
,
lxc_name
,
lxc_path
);
return
mount_entry_on_generic
(
mntent
,
path
,
rootfs
,
lxc_name
,
lxc_path
);
}
}
...
...
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