commit 11cc5d304f939cfd35ebccd3959a3f3d26392c38
parent 8bbdaedf947a1ae18d1a3ce29ddace6cf20f17eb
Author: Joris Vink <joris@coders.se>
Date:   Fri,  4 Oct 2019 11:28:14 +0200
let kore_python_seccomp_hook() take the hook name
Diffstat:
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/include/kore/python_api.h b/include/kore/python_api.h
@@ -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)
diff --git a/src/python.c b/src/python.c
@@ -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);
 
diff --git a/src/seccomp.c b/src/seccomp.c
@@ -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