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
74370367
Unverified
Commit
74370367
authored
Jul 12, 2018
by
Stéphane Graber
Committed by
GitHub
Jul 12, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2462 from brauner/2018-07-12/coverity
coverity
parents
99c42eaa
a0ee564f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
6 deletions
+7
-6
attach.c
src/lxc/attach.c
+3
-3
lxc_usernsexec.c
src/lxc/cmd/lxc_usernsexec.c
+4
-3
No files found.
src/lxc/attach.c
View file @
74370367
...
@@ -908,13 +908,13 @@ static int attach_child_main(struct attach_clone_payload *payload)
...
@@ -908,13 +908,13 @@ static int attach_child_main(struct attach_clone_payload *payload)
* may want to make sure the fds are closed, for example.
* may want to make sure the fds are closed, for example.
*/
*/
if
(
options
->
stdin_fd
>=
0
&&
options
->
stdin_fd
!=
STDIN_FILENO
)
if
(
options
->
stdin_fd
>=
0
&&
options
->
stdin_fd
!=
STDIN_FILENO
)
dup2
(
options
->
stdin_fd
,
STDIN_FILENO
);
(
void
)
dup2
(
options
->
stdin_fd
,
STDIN_FILENO
);
if
(
options
->
stdout_fd
>=
0
&&
options
->
stdout_fd
!=
STDOUT_FILENO
)
if
(
options
->
stdout_fd
>=
0
&&
options
->
stdout_fd
!=
STDOUT_FILENO
)
dup2
(
options
->
stdout_fd
,
STDOUT_FILENO
);
(
void
)
dup2
(
options
->
stdout_fd
,
STDOUT_FILENO
);
if
(
options
->
stderr_fd
>=
0
&&
options
->
stderr_fd
!=
STDERR_FILENO
)
if
(
options
->
stderr_fd
>=
0
&&
options
->
stderr_fd
!=
STDERR_FILENO
)
dup2
(
options
->
stderr_fd
,
STDERR_FILENO
);
(
void
)
dup2
(
options
->
stderr_fd
,
STDERR_FILENO
);
/* close the old fds */
/* close the old fds */
if
(
options
->
stdin_fd
>
STDERR_FILENO
)
if
(
options
->
stdin_fd
>
STDERR_FILENO
)
...
...
src/lxc/cmd/lxc_usernsexec.c
View file @
74370367
...
@@ -75,14 +75,15 @@ static void usage(const char *name)
...
@@ -75,14 +75,15 @@ static void usage(const char *name)
printf
(
" calling user permission to use the mapped ranges
\n
"
);
printf
(
" calling user permission to use the mapped ranges
\n
"
);
}
}
static
void
opentty
(
const
char
*
tty
,
int
which
)
{
static
void
opentty
(
const
char
*
tty
,
int
which
)
{
int
fd
,
flags
;
int
fd
,
flags
;
if
(
tty
[
0
]
==
'\0'
)
if
(
tty
[
0
]
==
'\0'
)
return
;
return
;
fd
=
open
(
tty
,
O_RDWR
|
O_NONBLOCK
);
fd
=
open
(
tty
,
O_RDWR
|
O_NONBLOCK
);
if
(
fd
==
-
1
)
{
if
(
fd
<
0
)
{
printf
(
"WARN: could not reopen tty: %s
\n
"
,
strerror
(
errno
));
printf
(
"WARN: could not reopen tty: %s
\n
"
,
strerror
(
errno
));
return
;
return
;
}
}
...
@@ -97,7 +98,7 @@ static void opentty(const char * tty, int which) {
...
@@ -97,7 +98,7 @@ static void opentty(const char * tty, int which) {
close
(
which
);
close
(
which
);
if
(
fd
!=
which
)
{
if
(
fd
!=
which
)
{
dup2
(
fd
,
which
);
(
void
)
dup2
(
fd
,
which
);
close
(
fd
);
close
(
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