[SCM] Samba Shared Repository - branch v4-0-test updated - release-4-0-0alpha2-1281-gdef46f6

Andrew Bartlett abartlet at samba.org
Thu Mar 13 03:14:56 GMT 2008


The branch, v4-0-test has been updated
       via  def46f6852075e1efe2bb7c5a7cffa5defdbb4ee (commit)
       via  7e85f318b571d1a909dffad0ecd661468ed497ca (commit)
       via  7c80cd18d5cd9cbf32dac15a4734f5a3c67cd0e7 (commit)
       via  52947fc0c019e57438a21e54953601b6cc08eb49 (commit)
      from  bda6a38b055fed2394e65cdc0b308a1442116402 (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v4-0-test


- Log -----------------------------------------------------------------
commit def46f6852075e1efe2bb7c5a7cffa5defdbb4ee
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Thu Mar 13 14:13:31 2008 +1100

    Report binding in libnet failure message.
    
    Andrew Bartlett

commit 7e85f318b571d1a909dffad0ecd661468ed497ca
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Thu Mar 13 14:12:50 2008 +1100

    Bail out, rather than segfault on no domain sid.
    
    Andrew Bartlett

commit 7c80cd18d5cd9cbf32dac15a4734f5a3c67cd0e7
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Thu Mar 13 14:12:18 2008 +1100

    Correctly normalise records against OpenLDAP.
    
    Fixing this simple typo allows more of the ldap.js test to pass.
    
    Andrew Bartlett

commit 52947fc0c019e57438a21e54953601b6cc08eb49
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Thu Mar 13 14:11:06 2008 +1100

    Don't search the whole tree for the domains's sid
    
    This change removes a dependency on objectclass=domainDNS, and avoids
    a subtree search when we really know exactly where this record is.
    
    Andrew Bartlett

-----------------------------------------------------------------------

Summary of changes:
 source/dsdb/common/util.c                   |   22 ++++++++++++++++++----
 source/dsdb/samdb/ldb_modules/normalise.c   |    2 +-
 source/dsdb/samdb/ldb_modules/objectclass.c |    5 +++--
 source/libnet/libnet_rpc.c                  |    5 ++++-
 4 files changed, 26 insertions(+), 8 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source/dsdb/common/util.c b/source/dsdb/common/util.c
index 3be60ac..807c028 100644
--- a/source/dsdb/common/util.c
+++ b/source/dsdb/common/util.c
@@ -1004,7 +1004,13 @@ struct ldb_dn *samdb_sites_dn(struct ldb_context *sam_ctx, TALLOC_CTX *mem_ctx)
 const struct dom_sid *samdb_domain_sid(struct ldb_context *ldb)
 {
 	TALLOC_CTX *tmp_ctx;
-	struct dom_sid *domain_sid;
+	const struct dom_sid *domain_sid;
+	const char *attrs[] = {
+		"objectSid",
+		NULL
+	};
+	struct ldb_result *res;
+	int ret;
 
 	/* see if we have a cached copy */
 	domain_sid = (struct dom_sid *)ldb_get_opaque(ldb, "cache.domain_sid");
@@ -1017,9 +1023,17 @@ const struct dom_sid *samdb_domain_sid(struct ldb_context *ldb)
 		goto failed;
 	}
 
-	/* find the domain_sid */
-	domain_sid = samdb_search_dom_sid(ldb, tmp_ctx, ldb_get_default_basedn(ldb),
-					  "objectSid", "objectClass=domainDNS");
+	ret = ldb_search_exp_fmt(ldb, tmp_ctx, &res, ldb_get_default_basedn(ldb), LDB_SCOPE_BASE, attrs, "objectSid=*");
+
+	if (ret != LDB_SUCCESS) {
+		goto failed;
+	}
+	
+	if (res->count != 1) {
+		goto failed;
+	}
+
+	domain_sid = samdb_result_dom_sid(tmp_ctx, res->msgs[0], "objectSid");
 	if (domain_sid == NULL) {
 		goto failed;
 	}
diff --git a/source/dsdb/samdb/ldb_modules/normalise.c b/source/dsdb/samdb/ldb_modules/normalise.c
index a0eff43..8de9e33 100644
--- a/source/dsdb/samdb/ldb_modules/normalise.c
+++ b/source/dsdb/samdb/ldb_modules/normalise.c
@@ -117,7 +117,7 @@ static int normalise_search_callback(struct ldb_context *ldb, void *context, str
 				talloc_free(mem_ctx);
 				return LDB_ERR_OPERATIONS_ERROR;
 			}
-			ret = fix_dn(ares->message->dn);
+			ret = fix_dn(dn);
 			if (ret != LDB_SUCCESS) {
 				talloc_free(mem_ctx);
 				return ret;
diff --git a/source/dsdb/samdb/ldb_modules/objectclass.c b/source/dsdb/samdb/ldb_modules/objectclass.c
index 537a560..4d4ef58 100644
--- a/source/dsdb/samdb/ldb_modules/objectclass.c
+++ b/source/dsdb/samdb/ldb_modules/objectclass.c
@@ -258,14 +258,15 @@ static DATA_BLOB *get_sd(struct ldb_module *module, TALLOC_CTX *mem_ctx,
 	struct auth_session_info *session_info
 		= ldb_get_opaque(module->ldb, "sessionInfo");
 	struct security_descriptor *sd;
+	struct dom_sid *domain_sid = samdb_domain_sid(module->ldb);
 
-	if (!objectclass->defaultSecurityDescriptor) {
+	if (!objectclass->defaultSecurityDescriptor || !domain_sid) {
 		return NULL;
 	}
 	
 	sd = sddl_decode(mem_ctx, 
 			 objectclass->defaultSecurityDescriptor,
-			 samdb_domain_sid(module->ldb));
+			 domain_sid);
 
 	if (!sd || !session_info || !session_info->security_token) {
 		return NULL;
diff --git a/source/libnet/libnet_rpc.c b/source/libnet/libnet_rpc.c
index 667f54c..50cc114 100644
--- a/source/libnet/libnet_rpc.c
+++ b/source/libnet/libnet_rpc.c
@@ -867,8 +867,11 @@ static NTSTATUS libnet_RpcConnectDCInfo_recv(struct composite_context *c, struct
 	} else {
 		if (s->r.out.error_string) {
 			r->out.error_string = talloc_steal(mem_ctx, s->r.out.error_string);
-		} else {
+		} else if (r->in.binding == NULL) {
 			r->out.error_string = talloc_asprintf(mem_ctx, "Connection to DC failed: %s", nt_errstr(status));
+		} else {
+			r->out.error_string = talloc_asprintf(mem_ctx, "Connection to DC %s failed: %s", 
+							      r->in.binding, nt_errstr(status));
 		}
 	}
 


-- 
Samba Shared Repository


More information about the samba-cvs mailing list