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
a45cba87
Unverified
Commit
a45cba87
authored
Mar 18, 2021
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
attach: use correct lxc_namespace_t type
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
d07d0091
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
attach.c
src/lxc/attach.c
+7
-7
No files found.
src/lxc/attach.c
View file @
a45cba87
...
@@ -194,7 +194,7 @@ static struct attach_context *alloc_attach_context(void)
...
@@ -194,7 +194,7 @@ static struct attach_context *alloc_attach_context(void)
ctx
->
target_host_uid
=
LXC_INVALID_UID
;
ctx
->
target_host_uid
=
LXC_INVALID_UID
;
ctx
->
target_host_gid
=
LXC_INVALID_GID
;
ctx
->
target_host_gid
=
LXC_INVALID_GID
;
for
(
in
t
i
=
0
;
i
<
LXC_NS_MAX
;
i
++
)
for
(
lxc_namespace_
t
i
=
0
;
i
<
LXC_NS_MAX
;
i
++
)
ctx
->
ns_fd
[
i
]
=
-
EBADF
;
ctx
->
ns_fd
[
i
]
=
-
EBADF
;
return
ctx
;
return
ctx
;
...
@@ -438,7 +438,7 @@ static int get_attach_context(struct attach_context *ctx,
...
@@ -438,7 +438,7 @@ static int get_attach_context(struct attach_context *ctx,
if
(
options
->
namespaces
==
-
1
)
if
(
options
->
namespaces
==
-
1
)
return
log_error_errno
(
-
EINVAL
,
EINVAL
,
"Failed to automatically determine the namespaces which the container uses"
);
return
log_error_errno
(
-
EINVAL
,
EINVAL
,
"Failed to automatically determine the namespaces which the container uses"
);
for
(
in
t
i
=
0
;
i
<
LXC_NS_MAX
;
i
++
)
{
for
(
lxc_namespace_
t
i
=
0
;
i
<
LXC_NS_MAX
;
i
++
)
{
if
(
ns_info
[
i
].
clone_flag
&
CLONE_NEWCGROUP
)
if
(
ns_info
[
i
].
clone_flag
&
CLONE_NEWCGROUP
)
if
(
!
(
options
->
attach_flags
&
LXC_ATTACH_MOVE_TO_CGROUP
)
||
if
(
!
(
options
->
attach_flags
&
LXC_ATTACH_MOVE_TO_CGROUP
)
||
!
cgns_supported
())
!
cgns_supported
())
...
@@ -533,7 +533,7 @@ static int same_ns(int dfd_pid1, int dfd_pid2, const char *ns_path)
...
@@ -533,7 +533,7 @@ static int same_ns(int dfd_pid1, int dfd_pid2, const char *ns_path)
static
int
__prepare_namespaces_pidfd
(
struct
attach_context
*
ctx
)
static
int
__prepare_namespaces_pidfd
(
struct
attach_context
*
ctx
)
{
{
for
(
in
t
i
=
0
;
i
<
LXC_NS_MAX
;
i
++
)
{
for
(
lxc_namespace_
t
i
=
0
;
i
<
LXC_NS_MAX
;
i
++
)
{
int
ret
;
int
ret
;
ret
=
same_nsfd
(
ctx
->
dfd_self_pid
,
ret
=
same_nsfd
(
ctx
->
dfd_self_pid
,
...
@@ -561,8 +561,8 @@ static int __prepare_namespaces_pidfd(struct attach_context *ctx)
...
@@ -561,8 +561,8 @@ static int __prepare_namespaces_pidfd(struct attach_context *ctx)
static
int
__prepare_namespaces_nsfd
(
struct
attach_context
*
ctx
,
static
int
__prepare_namespaces_nsfd
(
struct
attach_context
*
ctx
,
lxc_attach_options_t
*
options
)
lxc_attach_options_t
*
options
)
{
{
for
(
in
t
i
=
0
;
i
<
LXC_NS_MAX
;
i
++
)
{
for
(
lxc_namespace_
t
i
=
0
;
i
<
LXC_NS_MAX
;
i
++
)
{
in
t
j
;
lxc_namespace_
t
j
;
if
(
options
->
namespaces
&
ns_info
[
i
].
clone_flag
)
if
(
options
->
namespaces
&
ns_info
[
i
].
clone_flag
)
ctx
->
ns_fd
[
i
]
=
open_at
(
ctx
->
dfd_init_pid
,
ctx
->
ns_fd
[
i
]
=
open_at
(
ctx
->
dfd_init_pid
,
...
@@ -644,7 +644,7 @@ static int __attach_namespaces_nsfd(struct attach_context *ctx,
...
@@ -644,7 +644,7 @@ static int __attach_namespaces_nsfd(struct attach_context *ctx,
{
{
int
fret
=
0
;
int
fret
=
0
;
for
(
in
t
i
=
0
;
i
<
LXC_NS_MAX
;
i
++
)
{
for
(
lxc_namespace_
t
i
=
0
;
i
<
LXC_NS_MAX
;
i
++
)
{
int
ret
;
int
ret
;
if
(
ctx
->
ns_fd
[
i
]
<
0
)
if
(
ctx
->
ns_fd
[
i
]
<
0
)
...
@@ -672,7 +672,7 @@ static int attach_namespaces(struct attach_context *ctx,
...
@@ -672,7 +672,7 @@ static int attach_namespaces(struct attach_context *ctx,
lxc_attach_options_t
*
options
)
lxc_attach_options_t
*
options
)
{
{
if
(
lxc_log_trace
())
{
if
(
lxc_log_trace
())
{
for
(
in
t
i
=
0
;
i
<
LXC_NS_MAX
;
i
++
)
{
for
(
lxc_namespace_
t
i
=
0
;
i
<
LXC_NS_MAX
;
i
++
)
{
if
(
ns_info
[
i
].
clone_flag
&
options
->
namespaces
)
{
if
(
ns_info
[
i
].
clone_flag
&
options
->
namespaces
)
{
TRACE
(
"Attaching to %s namespace"
,
ns_info
[
i
].
proc_name
);
TRACE
(
"Attaching to %s namespace"
,
ns_info
[
i
].
proc_name
);
continue
;
continue
;
...
...
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