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
9c0fd29a
Unverified
Commit
9c0fd29a
authored
Feb 08, 2021
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
conf: kill PATH_MAX bytes
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
48e5dcc8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
9 deletions
+8
-9
conf.c
src/lxc/conf.c
+8
-9
No files found.
src/lxc/conf.c
View file @
9c0fd29a
...
@@ -2128,14 +2128,13 @@ static inline int mount_entry_on_systemfs(struct lxc_rootfs *rootfs,
...
@@ -2128,14 +2128,13 @@ static inline int mount_entry_on_systemfs(struct lxc_rootfs *rootfs,
}
}
static
int
mount_entry_on_absolute_rootfs
(
struct
mntent
*
mntent
,
static
int
mount_entry_on_absolute_rootfs
(
struct
mntent
*
mntent
,
const
struct
lxc_rootfs
*
rootfs
,
struct
lxc_rootfs
*
rootfs
,
const
char
*
lxc_name
,
const
char
*
lxc_name
,
const
char
*
lxc_path
)
const
char
*
lxc_path
)
{
{
int
offset
;
int
offset
;
char
*
aux
;
char
*
aux
;
const
char
*
lxcpath
;
const
char
*
lxcpath
;
char
path
[
PATH_MAX
];
int
ret
=
0
;
int
ret
=
0
;
lxcpath
=
lxc_global_config_value
(
"lxc.lxcpath"
);
lxcpath
=
lxc_global_config_value
(
"lxc.lxcpath"
);
...
@@ -2145,13 +2144,13 @@ static int mount_entry_on_absolute_rootfs(struct mntent *mntent,
...
@@ -2145,13 +2144,13 @@ static int mount_entry_on_absolute_rootfs(struct mntent *mntent,
/* If rootfs->path is a blockdev path, allow container fstab to use
/* If rootfs->path is a blockdev path, allow container fstab to use
* <lxcpath>/<name>/rootfs" as the target prefix.
* <lxcpath>/<name>/rootfs" as the target prefix.
*/
*/
ret
=
snprintf
(
path
,
PATH_MAX
,
"%s/%s/rootfs"
,
lxcpath
,
lxc_name
);
ret
=
snprintf
(
rootfs
->
buf
,
sizeof
(
rootfs
->
buf
)
,
"%s/%s/rootfs"
,
lxcpath
,
lxc_name
);
if
(
ret
<
0
||
ret
>=
PATH_MAX
)
if
(
ret
<
0
||
ret
>=
sizeof
(
rootfs
->
buf
)
)
goto
skipvarlib
;
goto
skipvarlib
;
aux
=
strstr
(
mntent
->
mnt_dir
,
path
);
aux
=
strstr
(
mntent
->
mnt_dir
,
rootfs
->
buf
);
if
(
aux
)
{
if
(
aux
)
{
offset
=
strlen
(
path
);
offset
=
strlen
(
rootfs
->
buf
);
goto
skipabs
;
goto
skipabs
;
}
}
...
@@ -2162,11 +2161,11 @@ skipvarlib:
...
@@ -2162,11 +2161,11 @@ skipvarlib:
offset
=
strlen
(
rootfs
->
path
);
offset
=
strlen
(
rootfs
->
path
);
skipabs:
skipabs:
ret
=
snprintf
(
path
,
PATH_MAX
,
"%s/%s"
,
rootfs
->
mount
,
aux
+
offset
);
ret
=
snprintf
(
rootfs
->
buf
,
sizeof
(
rootfs
->
buf
)
,
"%s/%s"
,
rootfs
->
mount
,
aux
+
offset
);
if
(
ret
<
0
||
ret
>=
PATH_MAX
)
if
(
ret
<
0
||
ret
>=
sizeof
(
rootfs
->
buf
)
)
return
-
1
;
return
-
1
;
return
mount_entry_on_generic
(
mntent
,
path
,
rootfs
,
lxc_name
,
lxc_path
);
return
mount_entry_on_generic
(
mntent
,
rootfs
->
buf
,
rootfs
,
lxc_name
,
lxc_path
);
}
}
static
int
mount_entry_on_relative_rootfs
(
struct
mntent
*
mntent
,
static
int
mount_entry_on_relative_rootfs
(
struct
mntent
*
mntent
,
...
...
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