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
8183f09e
Unverified
Commit
8183f09e
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
b28aae04
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
11 deletions
+11
-11
conf.c
src/lxc/conf.c
+11
-11
No files found.
src/lxc/conf.c
View file @
8183f09e
...
@@ -2109,22 +2109,22 @@ static inline int mount_entry_on_generic(struct mntent *mntent,
...
@@ -2109,22 +2109,22 @@ static inline int mount_entry_on_generic(struct mntent *mntent,
return
ret
;
return
ret
;
}
}
static
inline
int
mount_entry_on_systemfs
(
struct
mntent
*
mntent
)
static
inline
int
mount_entry_on_systemfs
(
struct
lxc_rootfs
*
rootfs
,
struct
mntent
*
mntent
)
{
{
int
ret
;
int
ret
;
char
path
[
PATH_MAX
];
/* For containers created without a rootfs all mounts are treated as
/* For containers created without a rootfs all mounts are treated as
* absolute paths starting at / on the host.
* absolute paths starting at / on the host.
*/
*/
if
(
mntent
->
mnt_dir
[
0
]
!=
'/'
)
if
(
mntent
->
mnt_dir
[
0
]
!=
'/'
)
ret
=
snprintf
(
path
,
sizeof
(
path
),
"/%s"
,
mntent
->
mnt_dir
);
ret
=
snprintf
(
rootfs
->
buf
,
sizeof
(
rootfs
->
buf
),
"/%s"
,
mntent
->
mnt_dir
);
else
else
ret
=
snprintf
(
path
,
sizeof
(
path
),
"%s"
,
mntent
->
mnt_dir
);
ret
=
snprintf
(
rootfs
->
buf
,
sizeof
(
rootfs
->
buf
),
"%s"
,
mntent
->
mnt_dir
);
if
(
ret
<
0
||
ret
>=
sizeof
(
path
))
if
(
ret
<
0
||
ret
>=
sizeof
(
rootfs
->
buf
))
return
-
1
;
return
-
1
;
return
mount_entry_on_generic
(
mntent
,
path
,
NULL
,
NULL
,
NULL
);
return
mount_entry_on_generic
(
mntent
,
rootfs
->
buf
,
NULL
,
NULL
,
NULL
);
}
}
static
int
mount_entry_on_absolute_rootfs
(
struct
mntent
*
mntent
,
static
int
mount_entry_on_absolute_rootfs
(
struct
mntent
*
mntent
,
...
@@ -2185,7 +2185,7 @@ static int mount_entry_on_relative_rootfs(struct mntent *mntent,
...
@@ -2185,7 +2185,7 @@ static int mount_entry_on_relative_rootfs(struct mntent *mntent,
return
mount_entry_on_generic
(
mntent
,
path
,
rootfs
,
lxc_name
,
lxc_path
);
return
mount_entry_on_generic
(
mntent
,
path
,
rootfs
,
lxc_name
,
lxc_path
);
}
}
static
int
mount_file_entries
(
const
struct
lxc_rootfs
*
rootfs
,
FILE
*
file
,
static
int
mount_file_entries
(
struct
lxc_rootfs
*
rootfs
,
FILE
*
file
,
const
char
*
lxc_name
,
const
char
*
lxc_path
)
const
char
*
lxc_name
,
const
char
*
lxc_path
)
{
{
char
buf
[
PATH_MAX
];
char
buf
[
PATH_MAX
];
...
@@ -2195,7 +2195,7 @@ static int mount_file_entries(const struct lxc_rootfs *rootfs, FILE *file,
...
@@ -2195,7 +2195,7 @@ static int mount_file_entries(const struct lxc_rootfs *rootfs, FILE *file,
int
ret
;
int
ret
;
if
(
!
rootfs
->
path
)
if
(
!
rootfs
->
path
)
ret
=
mount_entry_on_systemfs
(
&
mntent
);
ret
=
mount_entry_on_systemfs
(
rootfs
,
&
mntent
);
else
if
(
mntent
.
mnt_dir
[
0
]
!=
'/'
)
else
if
(
mntent
.
mnt_dir
[
0
]
!=
'/'
)
ret
=
mount_entry_on_relative_rootfs
(
&
mntent
,
rootfs
,
ret
=
mount_entry_on_relative_rootfs
(
&
mntent
,
rootfs
,
lxc_name
,
lxc_path
);
lxc_name
,
lxc_path
);
...
@@ -2221,8 +2221,8 @@ static inline void __auto_endmntent__(FILE **f)
...
@@ -2221,8 +2221,8 @@ static inline void __auto_endmntent__(FILE **f)
#define __do_endmntent __attribute__((__cleanup__(__auto_endmntent__)))
#define __do_endmntent __attribute__((__cleanup__(__auto_endmntent__)))
static
int
setup_mount_fstab
(
const
struct
lxc_conf
*
conf
,
static
int
setup_mount_fstab
(
const
struct
lxc_conf
*
conf
,
const
struct
lxc_rootfs
*
rootfs
,
const
char
*
fstab
,
struct
lxc_rootfs
*
rootfs
,
const
char
*
fstab
,
const
char
*
lxc_name
,
const
char
*
lxc_path
)
const
char
*
lxc_name
,
const
char
*
lxc_path
)
{
{
__do_endmntent
FILE
*
f
=
NULL
;
__do_endmntent
FILE
*
f
=
NULL
;
int
ret
;
int
ret
;
...
@@ -2311,7 +2311,7 @@ FILE *make_anonymous_mount_file(struct lxc_list *mount,
...
@@ -2311,7 +2311,7 @@ FILE *make_anonymous_mount_file(struct lxc_list *mount,
}
}
static
int
setup_mount_entries
(
const
struct
lxc_conf
*
conf
,
static
int
setup_mount_entries
(
const
struct
lxc_conf
*
conf
,
const
struct
lxc_rootfs
*
rootfs
,
struct
lxc_rootfs
*
rootfs
,
struct
lxc_list
*
mount
,
const
char
*
lxc_name
,
struct
lxc_list
*
mount
,
const
char
*
lxc_name
,
const
char
*
lxc_path
)
const
char
*
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