mirror of https://git.kore.io/kore.git
let kore_python_seccomp_hook() take the hook name
This commit is contained in:
parent
8bbdaedf94
commit
11cc5d304f
|
@ -36,8 +36,8 @@ void kore_python_log_error(const char *);
|
|||
PyObject *kore_python_callable(PyObject *, const char *);
|
||||
|
||||
#if defined(__linux__)
|
||||
void kore_python_seccomp_hook(void);
|
||||
void kore_python_seccomp_cleanup(void);
|
||||
void kore_python_seccomp_hook(const char *);
|
||||
#endif
|
||||
|
||||
#if !defined(KORE_SINGLE_BINARY)
|
||||
|
|
|
@ -486,12 +486,12 @@ kore_python_proc_reap(void)
|
|||
|
||||
#if defined(__linux__)
|
||||
void
|
||||
kore_python_seccomp_hook(void)
|
||||
kore_python_seccomp_hook(const char *method)
|
||||
{
|
||||
struct kore_runtime *rt;
|
||||
PyObject *func, *result;
|
||||
|
||||
if ((func = kore_module_getsym("koreapp.seccomp", &rt)) == NULL)
|
||||
if ((func = kore_module_getsym(hook, &rt)) == NULL)
|
||||
return;
|
||||
|
||||
if (rt->type != KORE_RUNTIME_PYTHON)
|
||||
|
@ -506,7 +506,7 @@ kore_python_seccomp_hook(void)
|
|||
|
||||
result = PyObject_CallFunctionObjArgs(func,
|
||||
(PyObject *)py_seccomp, NULL);
|
||||
kore_python_log_error("koreapp.seccomp");
|
||||
kore_python_log_error(hook);
|
||||
|
||||
kore_seccomp_filter("koreapp", py_seccomp->filters, py_seccomp->elm);
|
||||
|
||||
|
|
|
@ -202,7 +202,7 @@ kore_seccomp_enable(void)
|
|||
|
||||
#if defined(KORE_USE_PYTHON)
|
||||
ufilter = TAILQ_FIRST(&filters);
|
||||
kore_python_seccomp_hook();
|
||||
kore_python_seccomp_hook("koreapp.seccomp");
|
||||
ufilter = NULL;
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Reference in New Issue