summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2006-09-12 00:41:12 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:18:24 -0500
commit1be5dc983794fd46362fdf1e816bed0d27bc5ea3 (patch)
treed73447dce1765041055a143c657e3aeb94cc73b2 /source4
parent3a577a2a9d6b25d98bfbda3127f5b1fa337edfff (diff)
downloadsamba-1be5dc983794fd46362fdf1e816bed0d27bc5ea3.tar.gz
samba-1be5dc983794fd46362fdf1e816bed0d27bc5ea3.tar.bz2
samba-1be5dc983794fd46362fdf1e816bed0d27bc5ea3.zip
r18409: Make sure to print a DEBUG message if this LDB search fails.
Andrew Bartlett (This used to be commit 6419ef09b18b1105956211ae8774963f9cb30d2e)
Diffstat (limited to 'source4')
-rw-r--r--source4/rpc_server/samr/dcesrv_samr.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/source4/rpc_server/samr/dcesrv_samr.c b/source4/rpc_server/samr/dcesrv_samr.c
index f1a1134238..032e37c1dd 100644
--- a/source4/rpc_server/samr/dcesrv_samr.c
+++ b/source4/rpc_server/samr/dcesrv_samr.c
@@ -389,8 +389,12 @@ static NTSTATUS samr_OpenDomain(struct dcesrv_call_state *dce_call, TALLOC_CTX *
mem_ctx, NULL, &dom_msgs, dom_attrs,
"(&(objectSid=%s)(&(objectclass=domain)))",
ldap_encode_ndr_dom_sid(mem_ctx, r->in.sid));
- if (ret != 1) {
+ if (ret == 0) {
+ return NT_STATUS_NO_SUCH_DOMAIN;
+ } else if (ret > 1) {
return NT_STATUS_INTERNAL_DB_CORRUPTION;
+ } else if (ret == -1) {
+ DEBUG(1, ("Failed to open domain %s: %s\n", dom_sid_string(mem_ctx, r->in.sid), ldb_errstring(c_state->sam_ctx)));
} else {
ret = gendb_search(c_state->sam_ctx,
mem_ctx, partitions_basedn, &ref_msgs, ref_attrs,