let kore_python_seccomp_hook() take the hook name

This commit is contained in:
Joris Vink 2019-10-04 11:28:14 +02:00
parent 8bbdaedf94
commit 11cc5d304f
3 changed files with 5 additions and 5 deletions

View File

@ -36,8 +36,8 @@ void kore_python_log_error(const char *);
PyObject *kore_python_callable(PyObject *, const char *); PyObject *kore_python_callable(PyObject *, const char *);
#if defined(__linux__) #if defined(__linux__)
void kore_python_seccomp_hook(void);
void kore_python_seccomp_cleanup(void); void kore_python_seccomp_cleanup(void);
void kore_python_seccomp_hook(const char *);
#endif #endif
#if !defined(KORE_SINGLE_BINARY) #if !defined(KORE_SINGLE_BINARY)

View File

@ -486,12 +486,12 @@ kore_python_proc_reap(void)
#if defined(__linux__) #if defined(__linux__)
void void
kore_python_seccomp_hook(void) kore_python_seccomp_hook(const char *method)
{ {
struct kore_runtime *rt; struct kore_runtime *rt;
PyObject *func, *result; PyObject *func, *result;
if ((func = kore_module_getsym("koreapp.seccomp", &rt)) == NULL) if ((func = kore_module_getsym(hook, &rt)) == NULL)
return; return;
if (rt->type != KORE_RUNTIME_PYTHON) if (rt->type != KORE_RUNTIME_PYTHON)
@ -506,7 +506,7 @@ kore_python_seccomp_hook(void)
result = PyObject_CallFunctionObjArgs(func, result = PyObject_CallFunctionObjArgs(func,
(PyObject *)py_seccomp, NULL); (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); kore_seccomp_filter("koreapp", py_seccomp->filters, py_seccomp->elm);

View File

@ -202,7 +202,7 @@ kore_seccomp_enable(void)
#if defined(KORE_USE_PYTHON) #if defined(KORE_USE_PYTHON)
ufilter = TAILQ_FIRST(&filters); ufilter = TAILQ_FIRST(&filters);
kore_python_seccomp_hook(); kore_python_seccomp_hook("koreapp.seccomp");
ufilter = NULL; ufilter = NULL;
#endif #endif