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
5b514ce3
Unverified
Commit
5b514ce3
authored
Jan 28, 2021
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
attach: coding style fixes
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
0fa84a8c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
7 deletions
+4
-7
attach.c
src/lxc/attach.c
+4
-7
No files found.
src/lxc/attach.c
View file @
5b514ce3
...
@@ -653,6 +653,7 @@ __noreturn static void do_attach(struct attach_clone_payload *payload)
...
@@ -653,6 +653,7 @@ __noreturn static void do_attach(struct attach_clone_payload *payload)
gid_t
ns_root_gid
=
0
;
gid_t
ns_root_gid
=
0
;
lxc_attach_options_t
*
options
=
payload
->
options
;
lxc_attach_options_t
*
options
=
payload
->
options
;
struct
lxc_proc_context_info
*
init_ctx
=
payload
->
init_ctx
;
struct
lxc_proc_context_info
*
init_ctx
=
payload
->
init_ctx
;
struct
lxc_conf
*
conf
=
init_ctx
->
container
->
lxc_conf
;
bool
needs_lsm
=
(
options
->
namespaces
&
CLONE_NEWNS
)
&&
bool
needs_lsm
=
(
options
->
namespaces
&
CLONE_NEWNS
)
&&
(
options
->
attach_flags
&
LXC_ATTACH_LSM
)
&&
(
options
->
attach_flags
&
LXC_ATTACH_LSM
)
&&
init_ctx
->
lsm_label
;
init_ctx
->
lsm_label
;
...
@@ -672,7 +673,7 @@ __noreturn static void do_attach(struct attach_clone_payload *payload)
...
@@ -672,7 +673,7 @@ __noreturn static void do_attach(struct attach_clone_payload *payload)
TRACE
(
"Remounted
\"
/proc
\"
and
\"
/sys
\"
"
);
TRACE
(
"Remounted
\"
/proc
\"
and
\"
/sys
\"
"
);
}
}
/* Now perform additional attachments. */
/* Now perform additional attachments. */
#if HAVE_SYS_PERSONALITY_H
#if HAVE_SYS_PERSONALITY_H
if
(
options
->
attach_flags
&
LXC_ATTACH_SET_PERSONALITY
)
{
if
(
options
->
attach_flags
&
LXC_ATTACH_SET_PERSONALITY
)
{
long
new_personality
;
long
new_personality
;
...
@@ -791,8 +792,7 @@ __noreturn static void do_attach(struct attach_clone_payload *payload)
...
@@ -791,8 +792,7 @@ __noreturn static void do_attach(struct attach_clone_payload *payload)
TRACE
(
"Set %s LSM label to
\"
%s
\"
"
,
init_ctx
->
lsm_ops
->
name
,
init_ctx
->
lsm_label
);
TRACE
(
"Set %s LSM label to
\"
%s
\"
"
,
init_ctx
->
lsm_ops
->
name
,
init_ctx
->
lsm_label
);
}
}
if
((
init_ctx
->
container
&&
init_ctx
->
container
->
lxc_conf
&&
if
((
init_ctx
->
container
&&
conf
&&
conf
->
no_new_privs
)
||
init_ctx
->
container
->
lxc_conf
->
no_new_privs
)
||
(
options
->
attach_flags
&
LXC_ATTACH_NO_NEW_PRIVS
))
{
(
options
->
attach_flags
&
LXC_ATTACH_NO_NEW_PRIVS
))
{
ret
=
prctl
(
PR_SET_NO_NEW_PRIVS
,
prctl_arg
(
1
),
prctl_arg
(
0
),
ret
=
prctl
(
PR_SET_NO_NEW_PRIVS
,
prctl_arg
(
1
),
prctl_arg
(
0
),
prctl_arg
(
0
),
prctl_arg
(
0
));
prctl_arg
(
0
),
prctl_arg
(
0
));
...
@@ -802,10 +802,7 @@ __noreturn static void do_attach(struct attach_clone_payload *payload)
...
@@ -802,10 +802,7 @@ __noreturn static void do_attach(struct attach_clone_payload *payload)
TRACE
(
"Set PR_SET_NO_NEW_PRIVS"
);
TRACE
(
"Set PR_SET_NO_NEW_PRIVS"
);
}
}
if
(
init_ctx
->
container
&&
init_ctx
->
container
->
lxc_conf
&&
if
(
init_ctx
->
container
&&
conf
&&
conf
->
seccomp
.
seccomp
)
{
init_ctx
->
container
->
lxc_conf
->
seccomp
.
seccomp
)
{
struct
lxc_conf
*
conf
=
init_ctx
->
container
->
lxc_conf
;
ret
=
lxc_seccomp_load
(
conf
);
ret
=
lxc_seccomp_load
(
conf
);
if
(
ret
<
0
)
if
(
ret
<
0
)
goto
on_error
;
goto
on_error
;
...
...
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