diff options
-rw-r--r-- | source4/param/provision.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/source4/param/provision.c b/source4/param/provision.c index ee84cd021e1..48a471cf44d 100644 --- a/source4/param/provision.c +++ b/source4/param/provision.c @@ -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; } |