summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source4/libnet/libnet_join.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/source4/libnet/libnet_join.c b/source4/libnet/libnet_join.c
index e8fdc28dbd..65e0006bbe 100644
--- a/source4/libnet/libnet_join.c
+++ b/source4/libnet/libnet_join.c
@@ -359,6 +359,12 @@ static NTSTATUS libnet_Join_primary_domain(struct libnet_context *ctx,
/* Local secrets are stored in secrets.ldb */
ldb = secrets_db_connect(mem_ctx);
+ if (!ldb) {
+ r->generic.out.error_string
+ = talloc_asprintf(mem_ctx,
+ "Could not open secrets database\n");
+ return NT_STATUS_CANT_ACCESS_DOMAIN_INFO;
+ }
/* join domain */
status = libnet_JoinDomain(ctx, mem_ctx, &r2);