[issue38622] _ctypes.dlsym (py_dl_sym) does not trigger audit hooks
tholl
report at bugs.python.org
Mon Oct 28 14:18:57 EDT 2019
New submission from tholl <py at any.tholl.xyz>:
The dlsym operation generally (e.g. when done through a ctypes.CDLL object) triggers the "ctypes.dlsym" audit event. However, using _ctypes.dlsym directly does not trigger this event. This appears to be an oversight, given that _ctypes.dlopen *does* trigger the "ctypes.dlopen" audit event.
A (very minimal) patch is attached.
I was not entirely sure what format the DLL handle should take when it is passed to the audit function, so for now it just turns it back into a number via PyLong_FromVoidPtr (i.e. into the same format in which it is passed into _ctypes.dlsym in the first place).
----------
components: Extension Modules
files: audit.patch
keywords: patch
messages: 355583
nosy: tholl
priority: normal
severity: normal
status: open
title: _ctypes.dlsym (py_dl_sym) does not trigger audit hooks
versions: Python 3.8, Python 3.9
Added file: https://bugs.python.org/file48684/audit.patch
_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue38622>
_______________________________________
More information about the Python-bugs-list
mailing list