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
cca66e06
Unverified
Commit
cca66e06
authored
Mar 09, 2020
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
attach: use cleanup macros and logging helpers when fetching seccomp
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
a5d657d3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
12 deletions
+6
-12
attach.c
src/lxc/attach.c
+6
-12
No files found.
src/lxc/attach.c
View file @
cca66e06
...
@@ -566,8 +566,7 @@ static bool fetch_seccomp(struct lxc_container *c, lxc_attach_options_t *options
...
@@ -566,8 +566,7 @@ static bool fetch_seccomp(struct lxc_container *c, lxc_attach_options_t *options
if
(
!
(
options
->
namespaces
&
CLONE_NEWNS
)
||
if
(
!
(
options
->
namespaces
&
CLONE_NEWNS
)
||
!
(
options
->
attach_flags
&
LXC_ATTACH_LSM
))
{
!
(
options
->
attach_flags
&
LXC_ATTACH_LSM
))
{
free
(
c
->
lxc_conf
->
seccomp
.
seccomp
);
free_disarm
(
c
->
lxc_conf
->
seccomp
.
seccomp
);
c
->
lxc_conf
->
seccomp
.
seccomp
=
NULL
;
return
true
;
return
true
;
}
}
...
@@ -582,10 +581,8 @@ static bool fetch_seccomp(struct lxc_container *c, lxc_attach_options_t *options
...
@@ -582,10 +581,8 @@ static bool fetch_seccomp(struct lxc_container *c, lxc_attach_options_t *options
INFO
(
"Failed to retrieve lxc.seccomp.profile"
);
INFO
(
"Failed to retrieve lxc.seccomp.profile"
);
path
=
c
->
get_running_config_item
(
c
,
"lxc.seccomp"
);
path
=
c
->
get_running_config_item
(
c
,
"lxc.seccomp"
);
if
(
!
path
)
{
if
(
!
path
)
INFO
(
"Failed to retrieve lxc.seccomp"
);
return
log_info
(
true
,
"Failed to retrieve lxc.seccomp"
);
return
true
;
}
}
}
/* Copy the value into the new lxc_conf. */
/* Copy the value into the new lxc_conf. */
...
@@ -595,13 +592,10 @@ static bool fetch_seccomp(struct lxc_container *c, lxc_attach_options_t *options
...
@@ -595,13 +592,10 @@ static bool fetch_seccomp(struct lxc_container *c, lxc_attach_options_t *options
/* Attempt to parse the resulting config. */
/* Attempt to parse the resulting config. */
ret
=
lxc_read_seccomp_config
(
c
->
lxc_conf
);
ret
=
lxc_read_seccomp_config
(
c
->
lxc_conf
);
if
(
ret
<
0
)
{
if
(
ret
<
0
)
ERROR
(
"Failed to retrieve seccomp policy"
);
return
log_error
(
false
,
"Failed to retrieve seccomp policy"
);
return
false
;
}
INFO
(
"Retrieved seccomp policy"
);
return
log_info
(
true
,
"Retrieved seccomp policy"
);
return
true
;
}
}
static
bool
no_new_privs
(
struct
lxc_container
*
c
,
lxc_attach_options_t
*
options
)
static
bool
no_new_privs
(
struct
lxc_container
*
c
,
lxc_attach_options_t
*
options
)
...
...
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