1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

pyldb: Fix deleting an ldb.Message dn

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14845

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

[abartlet@samba.org backported from commit d7af772de8
 due to conflicts in knownfail.d/python-segfaults]
This commit is contained in:
Joseph Sutton 2021-09-25 11:12:16 +12:00 committed by Stefan Metzmacher
parent 805183c816
commit 2bb74e48c7
2 changed files with 6 additions and 1 deletions

View File

@ -3741,6 +3741,10 @@ static PyObject *py_ldb_msg_get_dn(PyLdbMessageObject *self, void *closure)
static int py_ldb_msg_set_dn(PyLdbMessageObject *self, PyObject *value, void *closure)
{
struct ldb_message *msg = pyldb_Message_AsMessage(self);
if (value == NULL) {
PyErr_SetString(PyExc_AttributeError, "cannot delete dn");
return -1;
}
if (!pyldb_Dn_Check(value)) {
PyErr_SetString(PyExc_TypeError, "expected dn");
return -1;

View File

@ -1,2 +1,3 @@
samba.tests.segfault.samba.tests.segfault.SegfaultTests.test_net_replicate_init__3
samba.tests.segfault.samba.tests.segfault.SegfaultTests.test_ldb_msg_del_dn
samba.tests.segfault.samba.tests.segfault.SegfaultTests.test_dnsp_string_list
samba.tests.segfault.samba.tests.segfault.SegfaultTests.test_dns_record