diff options
author | Andrew Bartlett <abartlet@samba.org> | 2016-08-30 10:22:47 +1200 |
---|---|---|
committer | Garming Sam <garming@samba.org> | 2016-09-01 05:49:15 +0200 |
commit | 240038979d748b830b788753b38c3cd576eafe30 (patch) | |
tree | ecbca1badf6dc68fcba35a39e66f53f545595bb4 /source4/dsdb/pydsdb.c | |
parent | 55b9b9a969b0e7ef6590710fda85265fc3146159 (diff) | |
download | samba-240038979d748b830b788753b38c3cd576eafe30.tar.gz |
dsdb: Expose ldb error string to dsdb_garbage_collect_tombstones() callers
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Diffstat (limited to 'source4/dsdb/pydsdb.c')
-rw-r--r-- | source4/dsdb/pydsdb.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/source4/dsdb/pydsdb.c b/source4/dsdb/pydsdb.c index 0df52ad5f24..e53a24531de 100644 --- a/source4/dsdb/pydsdb.c +++ b/source4/dsdb/pydsdb.c @@ -1092,6 +1092,7 @@ static PyObject *py_dsdb_garbage_collect_tombstones(PyObject *self, PyObject *ar NTSTATUS status; unsigned int num_objects_removed = 0; unsigned int num_links_removed = 0; + char *error_string = NULL; if (!PyArg_ParseTuple(args, "OOL|L", &py_ldb, &py_list_dn, &_current_time, &_tombstone_lifetime)) { @@ -1156,10 +1157,16 @@ static PyObject *py_dsdb_garbage_collect_tombstones(PyObject *self, PyObject *ar part, current_time, tombstone_lifetime, &num_objects_removed, - &num_links_removed); + &num_links_removed, + &error_string); if (!NT_STATUS_IS_OK(status)) { - PyErr_SetNTSTATUS(status); + if (error_string) { + PyErr_Format(PyExc_RuntimeError, "%s", error_string); + } else { + PyErr_SetNTSTATUS(status); + } + TALLOC_FREE(mem_ctx); return NULL; } |