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
30a9d137
Unverified
Commit
30a9d137
authored
Apr 13, 2019
by
Stéphane Graber
Committed by
GitHub
Apr 13, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2934 from brauner/2019-04-13/simplify_and_test
attach: use tighter scope for fd variable
parents
9810d191
427a8067
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
attach.c
src/lxc/attach.c
+4
-3
No files found.
src/lxc/attach.c
View file @
30a9d137
...
...
@@ -700,7 +700,7 @@ static void lxc_put_attach_clone_payload(struct attach_clone_payload *p)
static
int
attach_child_main
(
struct
attach_clone_payload
*
payload
)
{
int
fd
,
lsm_fd
,
ret
;
int
lsm_fd
,
ret
;
uid_t
new_uid
;
gid_t
new_gid
;
uid_t
ns_root_uid
=
0
;
...
...
@@ -893,10 +893,11 @@ static int attach_child_main(struct attach_clone_payload *payload)
if
(
options
->
stderr_fd
>
STDERR_FILENO
)
close
(
options
->
stderr_fd
);
/* Try to remove FD_CLOEXEC flag from stdin/stdout/stderr, but also
/*
* Try to remove FD_CLOEXEC flag from stdin/stdout/stderr, but also
* here, ignore errors.
*/
for
(
fd
=
STDIN_FILENO
;
fd
<=
STDERR_FILENO
;
fd
++
)
{
for
(
int
fd
=
STDIN_FILENO
;
fd
<=
STDERR_FILENO
;
fd
++
)
{
ret
=
fd_cloexec
(
fd
,
false
);
if
(
ret
<
0
)
{
SYSERROR
(
"Failed to clear FD_CLOEXEC from file descriptor %d"
,
fd
);
...
...
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