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
591f6f44
Unverified
Commit
591f6f44
authored
Mar 25, 2020
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lxc_init: add missing O_CLOEXEC
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
ed586164
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
lxc_init.c
src/lxc/cmd/lxc_init.c
+3
-3
No files found.
src/lxc/cmd/lxc_init.c
View file @
591f6f44
...
@@ -87,7 +87,8 @@ static void prevent_forking(void)
...
@@ -87,7 +87,8 @@ static void prevent_forking(void)
return
;
return
;
while
(
getline
(
&
line
,
&
len
,
f
)
!=
-
1
)
{
while
(
getline
(
&
line
,
&
len
,
f
)
!=
-
1
)
{
int
fd
,
ret
;
__do_close
int
fd
=
-
EBADF
;
int
ret
;
char
*
p
,
*
p2
;
char
*
p
,
*
p2
;
p
=
strchr
(
line
,
':'
);
p
=
strchr
(
line
,
':'
);
...
@@ -118,7 +119,7 @@ static void prevent_forking(void)
...
@@ -118,7 +119,7 @@ static void prevent_forking(void)
return
;
return
;
}
}
fd
=
open
(
path
,
O_WRONLY
);
fd
=
open
(
path
,
O_WRONLY
|
O_CLOEXEC
);
if
(
fd
<
0
)
{
if
(
fd
<
0
)
{
if
(
my_args
.
quiet
)
if
(
my_args
.
quiet
)
fprintf
(
stderr
,
"Failed to open
\"
%s
\"\n
"
,
path
);
fprintf
(
stderr
,
"Failed to open
\"
%s
\"\n
"
,
path
);
...
@@ -129,7 +130,6 @@ static void prevent_forking(void)
...
@@ -129,7 +130,6 @@ static void prevent_forking(void)
if
(
ret
!=
1
&&
!
my_args
.
quiet
)
if
(
ret
!=
1
&&
!
my_args
.
quiet
)
fprintf
(
stderr
,
"Failed to write to
\"
%s
\"\n
"
,
path
);
fprintf
(
stderr
,
"Failed to write to
\"
%s
\"\n
"
,
path
);
close
(
fd
);
return
;
return
;
}
}
}
}
...
...
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