ldb: Work around inconsistent behaviour in PyObject_AsMessageElement()
authorJoseph Sutton <josephsutton@catalyst.net.nz>
Thu, 6 Jul 2023 23:28:01 +0000 (11:28 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 8 Aug 2023 04:39:37 +0000 (04:39 +0000)
commit150d457b555f9cbe48181f5c33657a77fe083457
tree6d3f6b4ccb7ee0bb34bb2db0c19c3c827073b618
parentd278f97d5e9d4266f940e7f65229747906a3b759
ldb: Work around inconsistent behaviour in PyObject_AsMessageElement()

PyObject_AsMessageElement() has ‘flags’ and ‘attr_name’ parameters to
set properties of the returned MessageElement, but they apply only
*sometimes*.

‘attr_name’ not being set can result in cryptic and misleading error
messages from various ldb operations.

Changing the function’s behaviour to be more consistent could break
existing code, so we work around the issue instead.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
lib/ldb/pyldb.c