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
bd7b4e28
Commit
bd7b4e28
authored
Dec 10, 2015
by
Stéphane Graber
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix seccomp profile on attach of undefined container
Signed-off-by:
Stéphane Graber
<
stgraber@ubuntu.com
>
Acked-by:
Serge Hallyn
<
serge.hallyn@canonical.com
>
parent
d86eb75c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
1 deletion
+20
-1
attach.c
src/lxc/attach.c
+20
-1
No files found.
src/lxc/attach.c
View file @
bd7b4e28
...
@@ -661,6 +661,7 @@ static bool fetch_seccomp(const char *name, const char *lxcpath,
...
@@ -661,6 +661,7 @@ static bool fetch_seccomp(const char *name, const char *lxcpath,
struct
lxc_proc_context_info
*
i
,
lxc_attach_options_t
*
options
)
struct
lxc_proc_context_info
*
i
,
lxc_attach_options_t
*
options
)
{
{
struct
lxc_container
*
c
;
struct
lxc_container
*
c
;
char
*
path
;
if
(
!
(
options
->
namespaces
&
CLONE_NEWNS
)
||
!
(
options
->
attach_flags
&
LXC_ATTACH_LSM
))
if
(
!
(
options
->
namespaces
&
CLONE_NEWNS
)
||
!
(
options
->
attach_flags
&
LXC_ATTACH_LSM
))
return
true
;
return
true
;
...
@@ -669,8 +670,26 @@ static bool fetch_seccomp(const char *name, const char *lxcpath,
...
@@ -669,8 +670,26 @@ static bool fetch_seccomp(const char *name, const char *lxcpath,
if
(
!
c
)
if
(
!
c
)
return
false
;
return
false
;
i
->
container
=
c
;
i
->
container
=
c
;
if
(
!
c
->
lxc_conf
)
/* Initialize an empty lxc_conf */
if
(
!
c
->
set_config_item
(
c
,
"lxc.seccomp"
,
""
))
{
return
false
;
return
false
;
}
/* Fetch the current profile path over the cmd interface */
path
=
c
->
get_running_config_item
(
c
,
"lxc.seccomp"
);
if
(
!
path
)
{
return
true
;
}
/* Copy the value into the new lxc_conf */
if
(
!
c
->
set_config_item
(
c
,
"lxc.seccomp"
,
path
))
{
free
(
path
);
return
false
;
}
free
(
path
);
/* Attempt to parse the resulting config */
if
(
lxc_read_seccomp_config
(
c
->
lxc_conf
)
<
0
)
{
if
(
lxc_read_seccomp_config
(
c
->
lxc_conf
)
<
0
)
{
ERROR
(
"Error reading seccomp policy"
);
ERROR
(
"Error reading seccomp policy"
);
return
false
;
return
false
;
...
...
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