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
14da4d1f
Commit
14da4d1f
authored
Oct 29, 2016
by
Christian Brauner
Committed by
Stéphane Graber
Nov 21, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
utils: use lxc_safe_int()
Signed-off-by:
Christian Brauner
<
christian.brauner@canonical.com
>
parent
16ba55ae
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
utils.c
src/lxc/utils.c
+4
-2
No files found.
src/lxc/utils.c
View file @
14da4d1f
...
@@ -1766,7 +1766,7 @@ int mount_proc_if_needed(const char *rootfs)
...
@@ -1766,7 +1766,7 @@ int mount_proc_if_needed(const char *rootfs)
{
{
char
path
[
MAXPATHLEN
];
char
path
[
MAXPATHLEN
];
char
link
[
20
];
char
link
[
20
];
int
linklen
,
ret
;
int
link
_to_pid
,
link
len
,
ret
;
int
mypid
;
int
mypid
;
ret
=
snprintf
(
path
,
MAXPATHLEN
,
"%s/proc/self"
,
rootfs
);
ret
=
snprintf
(
path
,
MAXPATHLEN
,
"%s/proc/self"
,
rootfs
);
...
@@ -1785,7 +1785,9 @@ int mount_proc_if_needed(const char *rootfs)
...
@@ -1785,7 +1785,9 @@ int mount_proc_if_needed(const char *rootfs)
}
}
if
(
linklen
<
0
)
/* /proc not mounted */
if
(
linklen
<
0
)
/* /proc not mounted */
goto
domount
;
goto
domount
;
if
(
atoi
(
link
)
!=
mypid
)
{
if
(
lxc_safe_int
(
link
,
&
link_to_pid
)
<
0
)
return
-
1
;
if
(
link_to_pid
!=
mypid
)
{
/* wrong /procs mounted */
/* wrong /procs mounted */
umount2
(
path
,
MNT_DETACH
);
/* ignore failure */
umount2
(
path
,
MNT_DETACH
);
/* ignore failure */
goto
domount
;
goto
domount
;
...
...
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