summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2012-10-24 16:41:52 +1100
committerAndrew Bartlett <abartlet@samba.org>2012-10-25 04:43:25 +0200
commit9dbb64563c35003311d3f3d47e6c4ef0f546ffab (patch)
tree1efb29c40585cd612f33d6b9591c26a484fdc064
parenta9a38415e52e3f341da4dd3bf1be6c56bd8ad6ef (diff)
downloadsamba-9dbb64563c35003311d3f3d47e6c4ef0f546ffab.tar.gz
samba-9dbb64563c35003311d3f3d47e6c4ef0f546ffab.tar.bz2
samba-9dbb64563c35003311d3f3d47e6c4ef0f546ffab.zip
dsdb-cracknames: Return DRSUAPI_DS_NAME_STATUS_NO_MAPPING when there is no SID
If there is no SID for an object being mapped, then there is no NT4 name. We need to return DRSUAPI_DS_NAME_STATUS_NO_MAPPING rather than error out with anything other than WERR_OK as the return value. Andrew Bartlett Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Thu Oct 25 04:43:25 CEST 2012 on sn-devel-104
-rw-r--r--source4/dsdb/samdb/cracknames.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/source4/dsdb/samdb/cracknames.c b/source4/dsdb/samdb/cracknames.c
index 6ad802687e..8b52aa3199 100644
--- a/source4/dsdb/samdb/cracknames.c
+++ b/source4/dsdb/samdb/cracknames.c
@@ -1067,9 +1067,13 @@ static WERROR DsCrackNameOneFilter(struct ldb_context *sam_ctx, TALLOC_CTX *mem_
const struct dom_sid *sid = samdb_result_dom_sid(mem_ctx, result, "objectSid");
const char *_acc = "", *_dom = "";
-
- if (samdb_find_attribute(sam_ctx, result, "objectClass", "domain")) {
-
+ if (sid == NULL) {
+ info1->status = DRSUAPI_DS_NAME_STATUS_NO_MAPPING;
+ return WERR_OK;
+ } else if (samdb_find_attribute(sam_ctx, result, "objectClass", "domain")) {
+ /* This can also find a DomainDNSZones entry,
+ * but it won't have the SID we just
+ * checked. */
ldb_ret = ldb_search(sam_ctx, mem_ctx, &domain_res,
partitions_basedn,
LDB_SCOPE_ONELEVEL,