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
581b849a
Unverified
Commit
581b849a
authored
Jan 29, 2021
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
attach: init file descriptors to -EBADF
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
25c659d5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
3 deletions
+13
-3
attach.c
src/lxc/attach.c
+13
-3
No files found.
src/lxc/attach.c
View file @
581b849a
...
@@ -91,7 +91,19 @@ static inline bool sync_wait_fd(int fd, int *fd_recv)
...
@@ -91,7 +91,19 @@ static inline bool sync_wait_fd(int fd, int *fd_recv)
static
struct
attach_context
*
alloc_attach_context
(
void
)
static
struct
attach_context
*
alloc_attach_context
(
void
)
{
{
return
zalloc
(
sizeof
(
struct
attach_context
));
struct
attach_context
*
ctx
;
ctx
=
zalloc
(
sizeof
(
struct
attach_context
));
if
(
!
ctx
)
return
ret_set_errno
(
NULL
,
ENOMEM
);
ctx
->
dfd_self_pid
=
-
EBADF
;
ctx
->
dfd_init_pid
=
-
EBADF
;
for
(
int
i
=
0
;
i
<
LXC_NS_MAX
;
i
++
)
ctx
->
ns_fd
[
i
]
=
-
EBADF
;
return
ctx
;
}
}
static
int
get_personality
(
const
char
*
name
,
const
char
*
lxcpath
,
static
int
get_personality
(
const
char
*
name
,
const
char
*
lxcpath
,
...
@@ -174,8 +186,6 @@ static int get_attach_context(struct attach_context *ctx,
...
@@ -174,8 +186,6 @@ static int get_attach_context(struct attach_context *ctx,
/* Move to file descriptor-only lsm label retrieval. */
/* Move to file descriptor-only lsm label retrieval. */
ctx
->
lsm_label
=
ctx
->
lsm_ops
->
process_label_get
(
ctx
->
lsm_ops
,
ctx
->
init_pid
);
ctx
->
lsm_label
=
ctx
->
lsm_ops
->
process_label_get
(
ctx
->
lsm_ops
,
ctx
->
init_pid
);
ctx
->
ns_inherited
=
0
;
ctx
->
ns_inherited
=
0
;
for
(
int
i
=
0
;
i
<
LXC_NS_MAX
;
i
++
)
ctx
->
ns_fd
[
i
]
=
-
EBADF
;
ret
=
get_personality
(
container
->
name
,
container
->
config_path
,
&
ctx
->
personality
);
ret
=
get_personality
(
container
->
name
,
container
->
config_path
,
&
ctx
->
personality
);
if
(
ret
)
if
(
ret
)
...
...
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