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
b3365b93
Unverified
Commit
b3365b93
authored
May 24, 2018
by
Stéphane Graber
Committed by
GitHub
May 24, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2347 from brauner/2018-05-24/seccomp_cleanups
seccomp: cleanup
parents
a055735a
47f6d547
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
27 additions
and
21 deletions
+27
-21
lxccontainer.c
src/lxc/lxccontainer.c
+4
-11
lxcseccomp.h
src/lxc/lxcseccomp.h
+11
-10
seccomp.c
src/lxc/seccomp.c
+0
-0
utils.c
src/lxc/utils.c
+11
-0
utils.h
src/lxc/utils.h
+1
-0
No files found.
src/lxc/lxccontainer.c
View file @
b3365b93
...
@@ -2684,15 +2684,6 @@ out:
...
@@ -2684,15 +2684,6 @@ out:
return
bret
;
return
bret
;
}
}
static
void
strip_newline
(
char
*
p
)
{
size_t
len
=
strlen
(
p
);
if
(
len
<
1
)
return
;
if
(
p
[
len
-
1
]
==
'\n'
)
p
[
len
-
1
]
=
'\0'
;
}
void
mod_all_rdeps
(
struct
lxc_container
*
c
,
bool
inc
)
void
mod_all_rdeps
(
struct
lxc_container
*
c
,
bool
inc
)
{
{
struct
lxc_container
*
p
;
struct
lxc_container
*
p
;
...
@@ -2715,8 +2706,10 @@ void mod_all_rdeps(struct lxc_container *c, bool inc)
...
@@ -2715,8 +2706,10 @@ void mod_all_rdeps(struct lxc_container *c, bool inc)
ERROR
(
"badly formatted file %s"
,
path
);
ERROR
(
"badly formatted file %s"
,
path
);
goto
out
;
goto
out
;
}
}
strip_newline
(
lxcpath
);
strip_newline
(
lxcname
);
remove_trailing_newlines
(
lxcpath
);
remove_trailing_newlines
(
lxcname
);
if
((
p
=
lxc_container_new
(
lxcname
,
lxcpath
))
==
NULL
)
{
if
((
p
=
lxc_container_new
(
lxcname
,
lxcpath
))
==
NULL
)
{
ERROR
(
"Unable to find dependent container %s:%s"
,
ERROR
(
"Unable to find dependent container %s:%s"
,
lxcpath
,
lxcname
);
lxcpath
,
lxcname
);
...
...
src/lxc/lxcseccomp.h
View file @
b3365b93
...
@@ -27,23 +27,24 @@
...
@@ -27,23 +27,24 @@
#include "conf.h"
#include "conf.h"
#ifdef HAVE_SECCOMP
#ifdef HAVE_SECCOMP
int
lxc_seccomp_load
(
struct
lxc_conf
*
conf
);
extern
int
lxc_seccomp_load
(
struct
lxc_conf
*
conf
);
int
lxc_read_seccomp_config
(
struct
lxc_conf
*
conf
);
extern
int
lxc_read_seccomp_config
(
struct
lxc_conf
*
conf
);
void
lxc_seccomp_free
(
struct
lxc_conf
*
conf
);
extern
void
lxc_seccomp_free
(
struct
lxc_conf
*
conf
);
#else
#else
static
inline
int
lxc_seccomp_load
(
struct
lxc_conf
*
conf
)
{
static
inline
int
lxc_seccomp_load
(
struct
lxc_conf
*
conf
)
{
return
0
;
return
0
;
}
}
static
inline
int
lxc_read_seccomp_config
(
struct
lxc_conf
*
conf
)
{
static
inline
int
lxc_read_seccomp_config
(
struct
lxc_conf
*
conf
)
{
return
0
;
return
0
;
}
}
static
inline
void
lxc_seccomp_free
(
struct
lxc_conf
*
conf
)
{
static
inline
void
lxc_seccomp_free
(
struct
lxc_conf
*
conf
)
if
(
conf
->
seccomp
)
{
{
free
(
conf
->
seccomp
);
free
(
conf
->
seccomp
);
conf
->
seccomp
=
NULL
;
conf
->
seccomp
=
NULL
;
}
}
}
#endif
#endif
...
...
src/lxc/seccomp.c
View file @
b3365b93
This diff is collapsed.
Click to expand it.
src/lxc/utils.c
View file @
b3365b93
...
@@ -2533,3 +2533,14 @@ int lxc_set_death_signal(int signal)
...
@@ -2533,3 +2533,14 @@ int lxc_set_death_signal(int signal)
return
0
;
return
0
;
}
}
void
remove_trailing_newlines
(
char
*
l
)
{
char
*
p
=
l
;
while
(
*
p
)
p
++
;
while
(
--
p
>=
l
&&
*
p
==
'\n'
)
*
p
=
'\0'
;
}
src/lxc/utils.h
View file @
b3365b93
...
@@ -453,6 +453,7 @@ extern void lxc_free_array(void **array, lxc_free_fn element_free_fn);
...
@@ -453,6 +453,7 @@ extern void lxc_free_array(void **array, lxc_free_fn element_free_fn);
extern
size_t
lxc_array_len
(
void
**
array
);
extern
size_t
lxc_array_len
(
void
**
array
);
extern
void
**
lxc_append_null_to_array
(
void
**
array
,
size_t
count
);
extern
void
**
lxc_append_null_to_array
(
void
**
array
,
size_t
count
);
extern
void
remove_trailing_newlines
(
char
*
l
);
/* initialize rand with urandom */
/* initialize rand with urandom */
extern
int
randseed
(
bool
);
extern
int
randseed
(
bool
);
...
...
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