1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-02 09:47:23 +03:00

s4/param/provision: check samdb argument in provision_bare()

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
Douglas Bagnall 2018-04-24 12:40:32 +12:00 committed by Andrew Bartlett
parent 1f9ac9135c
commit b313a6aa9d

View File

@ -81,6 +81,7 @@ NTSTATUS provision_bare(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx,
{
const char *configfile;
PyObject *provision_mod, *provision_dict, *provision_fn, *py_result, *parameters, *py_lp_ctx;
struct ldb_context *samdb;
DEBUG(0,("Provision for Become-DC test using python\n"));
@ -189,8 +190,12 @@ NTSTATUS provision_bare(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx,
return NT_STATUS_UNSUCCESSFUL;
}
result->lp_ctx = lpcfg_from_py_object(mem_ctx, py_lp_ctx);
result->samdb = pyldb_Ldb_AsLdbContext(PyObject_GetAttrString(py_result, "samdb"));
samdb = pyldb_Ldb_AsLdbContext(PyObject_GetAttrString(py_result, "samdb"));
if (samdb == NULL) {
DEBUG(0, ("Missing 'samdb' attribute"));
return NT_STATUS_UNSUCCESSFUL;
}
result->samdb = samdb;
return NT_STATUS_OK;
}