2
0
mirror of https://github.com/sudo-project/sudo.git synced 2025-08-25 19:37:46 +00:00

7 Commits

Author SHA1 Message Date
Todd C. Miller
aa7f77edd8 Merge sudo_module_register_loghandler and sudo_module_set_default_loghandler.
We now create the LogHandler class for each interpreter in
python_plugin_init() instead of just once in sudo_module_init().
This fixes the crash seen in Py_EndInterpreter() with Python 3.12
and significantly reduces the number of leaked objects tracked by
MemorySanitizer.

--HG--
branch : 1.9
2023-07-24 11:07:45 -06:00
Todd C. Miller
32ac7d4d63 sudo_module_register_loghandler: clear sudo_type_LogHandler on error
Also add comments about PyModule_AddObject stealing a ref on success.

--HG--
branch : 1.9
2023-07-22 08:33:04 -06:00
Todd C. Miller
2b0643f6a2 Work around a crash with Python 3.12.
In sudo_module_set_default_loghandler() if we don't leak the reference
to py_loghandler we get a crash in Py_EndInterpreter() with Python
3.12.  This probably indicates a reference counting bug elsewhere.

--HG--
branch : 1.9
2023-07-21 12:20:18 -06:00
Todd C. Miller
28b05ea8f9 Use PyObject_CallNoArgs() where possible.
--HG--
branch : 1.9
2023-07-21 10:47:28 -06:00
Todd C. Miller
1143431421 Make sudo_type_ConvMessage and sudo_type_LogHandler static.
They are not used outside their respective compilation units.

--HG--
branch : 1.9
2023-07-21 10:46:16 -06:00
Todd C. Miller
84e6e6ccf9 Update copyright year on some files where it was out of date. 2020-08-31 14:09:36 -06:00
Robert Manner
c039a99c10 plugins/python/sudo_module: add sudo.LogHandler
so python log system can be used with sudo logsystem.
Loggers use it by default (the handler is set on the root logger).
If that is not the intent, it can be overridden explicitly.
2020-02-28 05:46:54 -07:00