Commit Graph

7 Commits

Author SHA1 Message Date
Todd C. Miller
0462a4ee8c sudo_module_register_loghandler: clear sudo_type_LogHandler on error
Also add comments about PyModule_AddObject stealing a ref on success.
2023-07-22 08:33:04 -06:00
Todd C. Miller
4e6254fea2 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.
2023-07-21 12:20:18 -06:00
Todd C. Miller
8c4cec148e Use PyObject_CallNoArgs() where possible. 2023-07-21 10:47:28 -06:00
Todd C. Miller
ba5ef624f2 Make sudo_type_ConvMessage and sudo_type_LogHandler static.
They are not used outside their respective compilation units.
2023-07-21 10:46:16 -06:00
Todd C. Miller
b926df1df2 Make the debug subsystem unsigned.
It was already unsigned in sudoers but not in the front-end or the
python plugin.  Making this consistent resolves a lot of -Wconversion
warnings.  Also clean up some other -Wconversion warnings in sudo_debug.c.
2023-07-01 16:14:50 -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