New submission from tholl <p...@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 <rep...@bugs.python.org>
<https://bugs.python.org/issue38622>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to