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
d4db3d14
Unverified
Commit
d4db3d14
authored
Jul 11, 2018
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
attach: cleanup fetch_seccomp()
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
3fa23ac3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
16 deletions
+17
-16
attach.c
src/lxc/attach.c
+17
-16
No files found.
src/lxc/attach.c
View file @
d4db3d14
...
...
@@ -643,9 +643,10 @@ static void lxc_attach_get_init_uidgid(uid_t *init_uid, gid_t *init_gid)
/* 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
(
struct
lxc_container
*
c
,
lxc_attach_options_t
*
options
)
static
bool
fetch_seccomp
(
struct
lxc_container
*
c
,
lxc_attach_options_t
*
options
)
{
int
ret
;
bool
bret
;
char
*
path
;
if
(
!
(
options
->
namespaces
&
CLONE_NEWNS
)
||
...
...
@@ -656,36 +657,36 @@ static bool fetch_seccomp(struct lxc_container *c,
}
/* Remove current setting. */
if
(
!
c
->
set_config_item
(
c
,
"lxc.seccomp"
,
""
)
&&
!
c
->
set_config_item
(
c
,
"lxc.seccomp
.profile
"
,
""
))
{
if
(
!
c
->
set_config_item
(
c
,
"lxc.seccomp
.profile
"
,
""
)
&&
!
c
->
set_config_item
(
c
,
"lxc.seccomp"
,
""
))
{
return
false
;
}
/* Fetch the current profile path over the cmd interface. */
path
=
c
->
get_running_config_item
(
c
,
"lxc.seccomp.profile"
);
if
(
!
path
)
{
INFO
(
"Failed to
get running config item for
lxc.seccomp.profile"
);
INFO
(
"Failed to
retrieve
lxc.seccomp.profile"
);
path
=
c
->
get_running_config_item
(
c
,
"lxc.seccomp"
);
}
if
(
!
path
)
{
INFO
(
"Failed to get running config item for lxc.seccomp"
)
;
return
true
;
if
(
!
path
)
{
INFO
(
"Failed to retrieve lxc.seccomp"
);
return
true
;
}
}
/* Copy the value into the new lxc_conf. */
if
(
!
c
->
set_config_item
(
c
,
"lxc.seccomp.profile"
,
path
))
{
free
(
path
);
return
false
;
}
bret
=
c
->
set_config_item
(
c
,
"lxc.seccomp.profile"
,
path
);
free
(
path
);
if
(
!
bret
)
return
false
;
/* Attempt to parse the resulting config. */
if
(
lxc_read_seccomp_config
(
c
->
lxc_conf
)
<
0
)
{
ERROR
(
"Error reading seccomp policy."
);
ret
=
lxc_read_seccomp_config
(
c
->
lxc_conf
);
if
(
ret
<
0
)
{
ERROR
(
"Failed to retrieve seccomp policy"
);
return
false
;
}
INFO
(
"Retrieved seccomp policy
.
"
);
INFO
(
"Retrieved seccomp policy"
);
return
true
;
}
...
...
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