plugins/python: use separate python interpreter for each plugin

On each plugin initialization we create a separate python interpreter
which gets stored in the plugin_ctx. The main interpreter is
stored in py_ctx and is used for creating more interpreters (if more plugins
get loaded) and final python deinitialization.

The "traceback" module import and the ImportBlocker initialization was
moved, because it has to happen inside the plugin specific interpreters.
This commit is contained in:
Robert Manner
2020-01-24 13:52:48 +01:00
committed by Todd C. Miller
parent 99f8394182
commit 22c64f58c0
7 changed files with 57 additions and 15 deletions

View File

@@ -43,8 +43,7 @@ struct PythonContext
sudo_printf_t sudo_log;
sudo_conv_t sudo_conv;
int open_plugin_count;
PyObject *py_traceback_module;
PyThreadState *py_main_interpreter;
};
extern struct PythonContext py_ctx;