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
ff07d7bb
Unverified
Commit
ff07d7bb
authored
Sep 02, 2016
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
attach: call lxc_container_new() earlier
We will reuse the newly initialized container for PR_SET_NO_NEW_PRIVS. Signed-off-by:
Christian Brauner
<
christian.brauner@canonical.com
>
parent
1325da7e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
7 deletions
+8
-7
attach.c
src/lxc/attach.c
+8
-7
No files found.
src/lxc/attach.c
View file @
ff07d7bb
...
...
@@ -657,8 +657,8 @@ static int attach_child_main(void* data);
/* define default options if no options are supplied by the user */
static
lxc_attach_options_t
attach_static_default_options
=
LXC_ATTACH_OPTIONS_DEFAULT
;
static
bool
fetch_seccomp
(
const
char
*
name
,
const
char
*
lxcpath
,
struct
lxc_proc_context_info
*
i
,
lxc_attach_options_t
*
options
)
static
bool
fetch_seccomp
(
struct
lxc_proc_context_info
*
i
,
lxc_attach_options_t
*
options
)
{
struct
lxc_container
*
c
;
char
*
path
;
...
...
@@ -666,10 +666,7 @@ static bool fetch_seccomp(const char *name, const char *lxcpath,
if
(
!
(
options
->
namespaces
&
CLONE_NEWNS
)
||
!
(
options
->
attach_flags
&
LXC_ATTACH_LSM
))
return
true
;
c
=
lxc_container_new
(
name
,
lxcpath
);
if
(
!
c
)
return
false
;
i
->
container
=
c
;
c
=
i
->
container
;
/* Initialize an empty lxc_conf */
if
(
!
c
->
set_config_item
(
c
,
"lxc.seccomp"
,
""
))
{
...
...
@@ -744,7 +741,11 @@ int lxc_attach(const char* name, const char* lxcpath, lxc_attach_exec_t exec_fun
}
init_ctx
->
personality
=
personality
;
if
(
!
fetch_seccomp
(
name
,
lxcpath
,
init_ctx
,
options
))
init_ctx
->
container
=
lxc_container_new
(
name
,
lxcpath
);
if
(
!
init_ctx
->
container
)
return
-
1
;
if
(
!
fetch_seccomp
(
init_ctx
,
options
))
WARN
(
"Failed to get seccomp policy"
);
cwd
=
getcwd
(
NULL
,
0
);
...
...
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