summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2010-02-19 11:14:15 +1100
committerAndrew Bartlett <abartlet@samba.org>2010-02-19 11:18:27 +1100
commitaf4a7c0f4be4bb94d6299e93f22d26e2f8340e69 (patch)
tree6ad36815d368b7ed2d1f59c03bbe4fd242f7d3a5
parent91a4db635802a391a560b739c996b5599a3df1a4 (diff)
downloadsamba-af4a7c0f4be4bb94d6299e93f22d26e2f8340e69.tar.gz
samba-af4a7c0f4be4bb94d6299e93f22d26e2f8340e69.tar.bz2
samba-af4a7c0f4be4bb94d6299e93f22d26e2f8340e69.zip
s4:winbind Make the 'no SID found' message even more detailed
Now we give the user a clue as to what may be wrong, and the file path that we could not find the domain SID in. Andrew Bartlett
-rw-r--r--source4/param/secrets.c10
-rw-r--r--source4/winbind/wb_server.c21
2 files changed, 26 insertions, 5 deletions
diff --git a/source4/param/secrets.c b/source4/param/secrets.c
index 18a0800779..407e27ff67 100644
--- a/source4/param/secrets.c
+++ b/source4/param/secrets.c
@@ -165,12 +165,15 @@ struct dom_sid *secrets_get_domain_sid(TALLOC_CTX *mem_ctx,
attrs, 0, SECRETS_PRIMARY_DOMAIN_FILTER, domain);
if (ldb_ret != LDB_SUCCESS) {
- *errstring = talloc_asprintf(mem_ctx, "Failed to find record for %s in secrets.ldb: %s: %s", domain, ldb_strerror(ldb_ret), ldb_errstring(ldb));
+ *errstring = talloc_asprintf(mem_ctx, "Failed to find record for %s in %s: %s: %s",
+ domain, ldb_get_opaque(ldb, "ldb_url"),
+ ldb_strerror(ldb_ret), ldb_errstring(ldb));
return NULL;
}
v = ldb_msg_find_ldb_val(msg, "objectSid");
if (v == NULL) {
- *errstring = talloc_asprintf(mem_ctx, "Failed to find a SID on record for %s in secrets.ldb", domain);
+ *errstring = talloc_asprintf(mem_ctx, "Failed to find a SID on record for %s in %s",
+ domain, ldb_get_opaque(ldb, "ldb_url"));
return NULL;
}
result = talloc(mem_ctx, struct dom_sid);
@@ -182,7 +185,8 @@ struct dom_sid *secrets_get_domain_sid(TALLOC_CTX *mem_ctx,
ndr_err = ndr_pull_struct_blob(v, result, NULL, result,
(ndr_pull_flags_fn_t)ndr_pull_dom_sid);
if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
- *errstring = talloc_asprintf(mem_ctx, "Failed to parse SID on record for %s in secrets.ldb", domain);
+ *errstring = talloc_asprintf(mem_ctx, "Failed to parse SID on record for %s in %s",
+ domain, ldb_get_opaque(ldb, "ldb_url"));
talloc_free(result);
talloc_free(ldb);
return NULL;
diff --git a/source4/winbind/wb_server.c b/source4/winbind/wb_server.c
index 03a443ac16..306c8e2add 100644
--- a/source4/winbind/wb_server.c
+++ b/source4/winbind/wb_server.c
@@ -241,19 +241,36 @@ static void winbind_task_init(struct task_server *task)
service->task->lp_ctx,
lp_netbios_name(service->task->lp_ctx), &errstring);
if (!primary_sid) {
- char *message = talloc_asprintf(task, "Cannot start Winbind (standalone configuration): %s", errstring);
+ char *message = talloc_asprintf(task,
+ "Cannot start Winbind (standalone configuration): %s: "
+ "Have you provisioned this server (%s) or changed it's name?",
+ errstring, lp_netbios_name(service->task->lp_ctx));
task_server_terminate(task, message, true);
return;
}
break;
case ROLE_DOMAIN_MEMBER:
+ primary_sid = secrets_get_domain_sid(service,
+ service->task->event_ctx,
+ service->task->lp_ctx,
+ lp_workgroup(service->task->lp_ctx), &errstring);
+ if (!primary_sid) {
+ char *message = talloc_asprintf(task, "Cannot start Winbind (domain member): %s: "
+ "Have you joined the %s domain?",
+ errstring, lp_workgroup(service->task->lp_ctx));
+ task_server_terminate(task, message, true);
+ return;
+ }
+ break;
case ROLE_DOMAIN_CONTROLLER:
primary_sid = secrets_get_domain_sid(service,
service->task->event_ctx,
service->task->lp_ctx,
lp_workgroup(service->task->lp_ctx), &errstring);
if (!primary_sid) {
- char *message = talloc_asprintf(task, "Cannot start Winbind (domain configuration): %s", errstring);
+ char *message = talloc_asprintf(task, "Cannot start Winbind (domain controller): %s: "
+ "Have you provisioned the %s domain?",
+ errstring, lp_workgroup(service->task->lp_ctx));
task_server_terminate(task, message, true);
return;
}