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
d7d2d2d9
Unverified
Commit
d7d2d2d9
authored
Jun 11, 2019
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
seccomp: s/HAVE_DECL_SECCOMP_NOTIF_GET_FD/HAVE_DECL_SECCOMP_NOTIFY_FD/g
Align with upstream libseccomp. Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
99656206
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
19 deletions
+19
-19
lxcseccomp.h
src/lxc/lxcseccomp.h
+6
-6
seccomp.c
src/lxc/seccomp.c
+13
-13
No files found.
src/lxc/lxcseccomp.h
View file @
d7d2d2d9
...
...
@@ -32,7 +32,7 @@
#include <linux/seccomp.h>
#include <seccomp.h>
#endif
#if HAVE_DECL_SECCOMP_NOTIF
_GET
_FD
#if HAVE_DECL_SECCOMP_NOTIF
Y
_FD
#include <sys/socket.h>
#include <sys/un.h>
#endif
...
...
@@ -48,7 +48,7 @@ struct lxc_handler;
#ifdef HAVE_SECCOMP
#if HAVE_DECL_SECCOMP_NOTIF
_GET
_FD
#if HAVE_DECL_SECCOMP_NOTIF
Y
_FD
struct
seccomp_notify_proxy_msg
{
uint32_t
version
;
...
...
@@ -69,7 +69,7 @@ struct seccomp_notify {
#define HAVE_SECCOMP_NOTIFY 1
#endif
/* HAVE_DECL_SECCOMP_NOTIF
_GET
_FD */
#endif
/* HAVE_DECL_SECCOMP_NOTIF
Y
_FD */
struct
lxc_seccomp
{
char
*
seccomp
;
...
...
@@ -78,9 +78,9 @@ struct lxc_seccomp {
scmp_filter_ctx
seccomp_ctx
;
#endif
/* HAVE_SCMP_FILTER_CTX */
#if HAVE_DECL_SECCOMP_NOTIF
_GET
_FD
#if HAVE_DECL_SECCOMP_NOTIF
Y
_FD
struct
seccomp_notify
notifier
;
#endif
/* HAVE_DECL_SECCOMP_NOTIF
_GET
_FD */
#endif
/* HAVE_DECL_SECCOMP_NOTIF
Y
_FD */
};
extern
int
lxc_seccomp_load
(
struct
lxc_conf
*
conf
);
...
...
@@ -100,7 +100,7 @@ extern int lxc_seccomp_add_notifier(const char *name, const char *lxcpath,
struct
lxc_seccomp
*
seccomp
);
static
inline
int
lxc_seccomp_get_notify_fd
(
struct
lxc_seccomp
*
seccomp
)
{
#if HAVE_DECL_SECCOMP_NOTIF
_GET
_FD
#if HAVE_DECL_SECCOMP_NOTIF
Y
_FD
return
seccomp
->
notifier
.
notify_fd
;
#else
errno
=
ENOSYS
;
...
...
src/lxc/seccomp.c
View file @
d7d2d2d9
...
...
@@ -92,7 +92,7 @@ static const char *get_action_name(uint32_t action)
return
"trap"
;
case
SCMP_ACT_ERRNO
(
0
):
return
"errno"
;
#if HAVE_DECL_SECCOMP_NOTIF
_GET
_FD
#if HAVE_DECL_SECCOMP_NOTIF
Y
_FD
case
SCMP_ACT_NOTIFY
:
return
"notify"
;
#endif
...
...
@@ -125,7 +125,7 @@ static uint32_t get_v2_default_action(char *line)
ret_action
=
SCMP_ACT_ALLOW
;
}
else
if
(
strncmp
(
line
,
"trap"
,
4
)
==
0
)
{
ret_action
=
SCMP_ACT_TRAP
;
#if HAVE_DECL_SECCOMP_NOTIF
_GET
_FD
#if HAVE_DECL_SECCOMP_NOTIF
Y
_FD
}
else
if
(
strncmp
(
line
,
"notify"
,
6
)
==
0
)
{
ret_action
=
SCMP_ACT_NOTIFY
;
#endif
...
...
@@ -941,7 +941,7 @@ static int parse_config_v2(FILE *f, char *line, size_t *line_bufsz, struct lxc_c
goto
bad_rule
;
}
#if HAVE_DECL_SECCOMP_NOTIF
_GET
_FD
#if HAVE_DECL_SECCOMP_NOTIF
Y
_FD
if
((
rule
.
action
==
SCMP_ACT_NOTIFY
)
&&
!
conf
->
seccomp
.
notifier
.
wants_supervision
)
{
ret
=
seccomp_attr_set
(
conf
->
seccomp
.
seccomp_ctx
,
...
...
@@ -1256,7 +1256,7 @@ int lxc_seccomp_load(struct lxc_conf *conf)
}
#endif
#if HAVE_DECL_SECCOMP_NOTIF
_GET
_FD
#if HAVE_DECL_SECCOMP_NOTIF
Y
_FD
if
(
conf
->
seccomp
.
notifier
.
wants_supervision
)
{
ret
=
seccomp_notify_fd
(
conf
->
seccomp
.
seccomp_ctx
);
if
(
ret
<
0
)
{
...
...
@@ -1283,7 +1283,7 @@ void lxc_seccomp_free(struct lxc_seccomp *seccomp)
}
#endif
#if HAVE_DECL_SECCOMP_NOTIF
_GET
_FD
#if HAVE_DECL_SECCOMP_NOTIF
Y
_FD
close_prot_errno_disarm
(
seccomp
->
notifier
.
notify_fd
);
close_prot_errno_disarm
(
seccomp
->
notifier
.
proxy_fd
);
seccomp_notify_free
(
seccomp
->
notifier
.
req_buf
,
seccomp
->
notifier
.
rsp_buf
);
...
...
@@ -1292,7 +1292,7 @@ void lxc_seccomp_free(struct lxc_seccomp *seccomp)
#endif
}
#if HAVE_DECL_SECCOMP_NOTIF
_GET
_FD
#if HAVE_DECL_SECCOMP_NOTIF
Y
_FD
static
int
seccomp_notify_reconnect
(
struct
lxc_handler
*
handler
)
{
__do_close_prot_errno
int
notify_fd
=
-
EBADF
;
...
...
@@ -1315,7 +1315,7 @@ static int seccomp_notify_reconnect(struct lxc_handler *handler)
}
#endif
#if HAVE_DECL_SECCOMP_NOTIF
_GET
_FD
#if HAVE_DECL_SECCOMP_NOTIF
Y
_FD
static
int
seccomp_notify_default_answer
(
int
fd
,
struct
seccomp_notif
*
req
,
struct
seccomp_notif_resp
*
resp
,
struct
lxc_handler
*
handler
)
...
...
@@ -1334,7 +1334,7 @@ int seccomp_notify_handler(int fd, uint32_t events, void *data,
struct
lxc_epoll_descr
*
descr
)
{
#if HAVE_DECL_SECCOMP_NOTIF
_GET
_FD
#if HAVE_DECL_SECCOMP_NOTIF
Y
_FD
__do_close_prot_errno
int
fd_mem
=
-
EBADF
;
int
reconnect_count
,
ret
;
ssize_t
bytes
;
...
...
@@ -1425,7 +1425,7 @@ void seccomp_conf_init(struct lxc_conf *conf)
conf
->
seccomp
.
allow_nesting
=
0
;
memset
(
&
conf
->
seccomp
.
seccomp_ctx
,
0
,
sizeof
(
conf
->
seccomp
.
seccomp_ctx
));
#endif
/* HAVE_SCMP_FILTER_CTX */
#if HAVE_DECL_SECCOMP_NOTIF
_GET
_FD
#if HAVE_DECL_SECCOMP_NOTIF
Y
_FD
conf
->
seccomp
.
notifier
.
wants_supervision
=
false
;
conf
->
seccomp
.
notifier
.
notify_fd
=
-
EBADF
;
conf
->
seccomp
.
notifier
.
proxy_fd
=
-
EBADF
;
...
...
@@ -1440,7 +1440,7 @@ int lxc_seccomp_setup_proxy(struct lxc_seccomp *seccomp,
struct
lxc_epoll_descr
*
descr
,
struct
lxc_handler
*
handler
)
{
#if HAVE_DECL_SECCOMP_NOTIF
_GET
_FD
#if HAVE_DECL_SECCOMP_NOTIF
Y
_FD
if
(
seccomp
->
notifier
.
wants_supervision
&&
seccomp
->
notifier
.
proxy_addr
.
sun_path
[
1
]
!=
'\0'
)
{
__do_close_prot_errno
int
notify_fd
=
-
EBADF
;
...
...
@@ -1484,7 +1484,7 @@ int lxc_seccomp_setup_proxy(struct lxc_seccomp *seccomp,
int
lxc_seccomp_send_notifier_fd
(
struct
lxc_seccomp
*
seccomp
,
int
socket_fd
)
{
#if HAVE_DECL_SECCOMP_NOTIF
_GET
_FD
#if HAVE_DECL_SECCOMP_NOTIF
Y
_FD
if
(
seccomp
->
notifier
.
wants_supervision
)
{
if
(
lxc_abstract_unix_send_fds
(
socket_fd
,
&
seccomp
->
notifier
.
notify_fd
,
1
,
...
...
@@ -1498,7 +1498,7 @@ int lxc_seccomp_send_notifier_fd(struct lxc_seccomp *seccomp, int socket_fd)
int
lxc_seccomp_recv_notifier_fd
(
struct
lxc_seccomp
*
seccomp
,
int
socket_fd
)
{
#if HAVE_DECL_SECCOMP_NOTIF
_GET
_FD
#if HAVE_DECL_SECCOMP_NOTIF
Y
_FD
if
(
seccomp
->
notifier
.
wants_supervision
)
{
int
ret
;
...
...
@@ -1516,7 +1516,7 @@ int lxc_seccomp_add_notifier(const char *name, const char *lxcpath,
struct
lxc_seccomp
*
seccomp
)
{
#if HAVE_DECL_SECCOMP_NOTIF
_GET
_FD
#if HAVE_DECL_SECCOMP_NOTIF
Y
_FD
if
(
seccomp
->
notifier
.
wants_supervision
)
{
int
ret
;
...
...
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