[SCM] Samba Shared Repository - branch master updated

Matthias Dieter Wallnöfer mdw at samba.org
Mon Apr 12 10:50:27 MDT 2010


The branch, master has been updated
       via  1a27343... s3/s4:netlogon IDL - fix up "struct netr_SamInfo6" regarding the "forest" attribute
       via  1bd4735... s4:auth/auth_sam_reply.c - fix counter types
       via  98ce053... s4:prefer "samdb_*_dn" basedn calls over the "ldb_get_*_dn" functions
       via  978a2d2... s4:torture/ldap/ldap_sort.c - There should be used the "base_dn" not the "root_dn" for the sort test
      from  9db207d... selftest: Cope with strict.

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 1a2734336655a8d4256c8cce039ada66650b70a9
Author: Matthias Dieter Wallnöfer <mwallnoefer at yahoo.de>
Date:   Mon Apr 12 14:49:14 2010 +0200

    s3/s4:netlogon IDL - fix up "struct netr_SamInfo6" regarding the "forest" attribute
    
    According to MS-NRPC 2.2.1.4.13 this should be the DNS domainname, not the
    forest one.

commit 1bd4735d8727baa55e3fd251b0f1d5efef4d1385
Author: Matthias Dieter Wallnöfer <mwallnoefer at yahoo.de>
Date:   Mon Apr 12 14:34:28 2010 +0200

    s4:auth/auth_sam_reply.c - fix counter types

commit 98ce053efdf8f28aa0480663c0094fc9ca8939e1
Author: Matthias Dieter Wallnöfer <mwallnoefer at yahoo.de>
Date:   Mon Apr 12 13:43:43 2010 +0200

    s4:prefer "samdb_*_dn" basedn calls over the "ldb_get_*_dn" functions
    
    Purely cosmetic change.

commit 978a2d26b4fa38873ed822b8642737e3352e5f21
Author: Matthias Dieter Wallnöfer <mwallnoefer at yahoo.de>
Date:   Mon Apr 12 13:40:44 2010 +0200

    s4:torture/ldap/ldap_sort.c - There should be used the "base_dn" not the "root_dn" for the sort test
    
    The (forest) "root_dn" hasn't always to be the same as the (domain) "base_dn"!

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

Summary of changes:
 librpc/gen_ndr/ndr_netlogon.c                 |   10 +++++-----
 librpc/gen_ndr/netlogon.h                     |    2 +-
 librpc/idl/netlogon.idl                       |    2 +-
 source3/auth/server_info.c                    |    6 +++---
 source4/auth/auth_sam_reply.c                 |    6 +++---
 source4/cldap_server/netlogon.c               |    2 +-
 source4/dsdb/samdb/cracknames.c               |    2 +-
 source4/rpc_server/lsa/lsa_init.c             |    2 +-
 source4/rpc_server/netlogon/dcerpc_netlogon.c |    6 +++---
 source4/torture/ldap/ldap_sort.c              |    4 ++--
 10 files changed, 21 insertions(+), 21 deletions(-)


Changeset truncated at 500 lines:

diff --git a/librpc/gen_ndr/ndr_netlogon.c b/librpc/gen_ndr/ndr_netlogon.c
index aad5bac..7b05155 100644
--- a/librpc/gen_ndr/ndr_netlogon.c
+++ b/librpc/gen_ndr/ndr_netlogon.c
@@ -1485,7 +1485,7 @@ static enum ndr_err_code ndr_push_netr_SamInfo6(struct ndr_push *ndr, int ndr_fl
 		NDR_CHECK(ndr_push_netr_SamBaseInfo(ndr, NDR_SCALARS, &r->base));
 		NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sidcount));
 		NDR_CHECK(ndr_push_unique_ptr(ndr, r->sids));
-		NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->forest));
+		NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->dns_domainname));
 		NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->principle));
 		for (cntr_unknown4_0 = 0; cntr_unknown4_0 < 20; cntr_unknown4_0++) {
 			NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown4[cntr_unknown4_0]));
@@ -1503,7 +1503,7 @@ static enum ndr_err_code ndr_push_netr_SamInfo6(struct ndr_push *ndr, int ndr_fl
 				NDR_CHECK(ndr_push_netr_SidAttr(ndr, NDR_BUFFERS, &r->sids[cntr_sids_1]));
 			}
 		}
-		NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->forest));
+		NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->dns_domainname));
 		NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->principle));
 	}
 	return NDR_ERR_SUCCESS;
@@ -1526,7 +1526,7 @@ static enum ndr_err_code ndr_pull_netr_SamInfo6(struct ndr_pull *ndr, int ndr_fl
 		} else {
 			r->sids = NULL;
 		}
-		NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->forest));
+		NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->dns_domainname));
 		NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->principle));
 		for (cntr_unknown4_0 = 0; cntr_unknown4_0 < 20; cntr_unknown4_0++) {
 			NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown4[cntr_unknown4_0]));
@@ -1551,7 +1551,7 @@ static enum ndr_err_code ndr_pull_netr_SamInfo6(struct ndr_pull *ndr, int ndr_fl
 			NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sids_1, 0);
 			NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sids_0, 0);
 		}
-		NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->forest));
+		NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->dns_domainname));
 		NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->principle));
 		if (r->sids) {
 			NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->sids, r->sidcount));
@@ -1583,7 +1583,7 @@ _PUBLIC_ void ndr_print_netr_SamInfo6(struct ndr_print *ndr, const char *name, c
 		ndr->depth--;
 	}
 	ndr->depth--;
-	ndr_print_lsa_String(ndr, "forest", &r->forest);
+	ndr_print_lsa_String(ndr, "dns_domainname", &r->dns_domainname);
 	ndr_print_lsa_String(ndr, "principle", &r->principle);
 	ndr->print(ndr, "%s: ARRAY(%d)", "unknown4", (int)20);
 	ndr->depth++;
diff --git a/librpc/gen_ndr/netlogon.h b/librpc/gen_ndr/netlogon.h
index a069dc5..b55597c 100644
--- a/librpc/gen_ndr/netlogon.h
+++ b/librpc/gen_ndr/netlogon.h
@@ -203,7 +203,7 @@ struct netr_SamInfo6 {
 	struct netr_SamBaseInfo base;
 	uint32_t sidcount;
 	struct netr_SidAttr *sids;/* [unique,size_is(sidcount)] */
-	struct lsa_String forest;
+	struct lsa_String dns_domainname;
 	struct lsa_String principle;
 	uint32_t unknown4[20];
 };
diff --git a/librpc/idl/netlogon.idl b/librpc/idl/netlogon.idl
index 6b10f8b..d66b219 100644
--- a/librpc/idl/netlogon.idl
+++ b/librpc/idl/netlogon.idl
@@ -251,7 +251,7 @@ interface netlogon
 		netr_SamBaseInfo base;
 		uint32 sidcount;
 		[size_is(sidcount)] netr_SidAttr *sids;
-		lsa_String forest;
+		lsa_String dns_domainname;
 		lsa_String principle;
 		uint32 unknown4[20];
 	} netr_SamInfo6;
diff --git a/source3/auth/server_info.c b/source3/auth/server_info.c
index fc6c85f..b968c1d 100644
--- a/source3/auth/server_info.c
+++ b/source3/auth/server_info.c
@@ -326,14 +326,14 @@ NTSTATUS serverinfo_to_SamInfo6(struct auth_serversupplied_info *server_info,
 	sam6->sidcount		= 0;
 	sam6->sids		= NULL;
 
-	sam6->forest.string	= talloc_strdup(sam6, dominfo->dns_forest);
-	if (sam6->forest.string == NULL) {
+	sam6->dns_domainname.string = talloc_strdup(sam6, dominfo->dns_domain);
+	if (sam6->dns_domainname.string == NULL) {
 		return NT_STATUS_NO_MEMORY;
 	}
 
 	sam6->principle.string	= talloc_asprintf(sam6, "%s@%s",
 						  pdb_get_username(server_info->sam_account),
-						  dominfo->dns_domain);
+						  sam6->dns_domainname.string);
 	if (sam6->principle.string == NULL) {
 		return NT_STATUS_NO_MEMORY;
 	}
diff --git a/source4/auth/auth_sam_reply.c b/source4/auth/auth_sam_reply.c
index 88eb857..6cca5e6 100644
--- a/source4/auth/auth_sam_reply.c
+++ b/source4/auth/auth_sam_reply.c
@@ -60,7 +60,7 @@ NTSTATUS auth_convert_server_info_sambaseinfo(TALLOC_CTX *mem_ctx,
 	sam->groups.rids = NULL;
 
 	if (server_info->n_domain_groups > 0) {
-		int i;
+		size_t i;
 		sam->groups.rids = talloc_array(sam, struct samr_RidWithAttribute,
 						server_info->n_domain_groups);
 
@@ -112,7 +112,7 @@ NTSTATUS auth_convert_server_info_saminfo3(TALLOC_CTX *mem_ctx,
 	struct netr_SamBaseInfo *sam;
 	struct netr_SamInfo3 *sam3 = talloc_zero(mem_ctx, struct netr_SamInfo3);
 	NTSTATUS status;
-	int i;
+	size_t i;
 	NT_STATUS_HAVE_NO_MEMORY(sam3);
 
 	status = auth_convert_server_info_sambaseinfo(mem_ctx, server_info, &sam);
@@ -158,7 +158,7 @@ NTSTATUS make_server_info_netlogon_validation(TALLOC_CTX *mem_ctx,
 {
 	struct auth_serversupplied_info *server_info;
 	struct netr_SamBaseInfo *base = NULL;
-	int i;
+	uint32_t i;
 
 	switch (validation_level) {
 	case 2:
diff --git a/source4/cldap_server/netlogon.c b/source4/cldap_server/netlogon.c
index e6a4ab3..95fff1a 100644
--- a/source4/cldap_server/netlogon.c
+++ b/source4/cldap_server/netlogon.c
@@ -233,7 +233,7 @@ NTSTATUS fill_netlogon_samlogon_response(struct ldb_context *sam_ctx,
 
 #if 0
 	/* w2k8-r2 as a sole DC does not claim this */
-	if (ldb_dn_compare(ldb_get_root_basedn(sam_ctx), ldb_get_default_basedn(sam_ctx)) == 0) {
+	if (ldb_dn_compare(samdb_root_dn(sam_ctx), samdb_base_dn(sam_ctx)) == 0) {
 		server_type |= DS_DNS_FOREST_ROOT;
 	}
 #endif
diff --git a/source4/dsdb/samdb/cracknames.c b/source4/dsdb/samdb/cracknames.c
index 9430ce0..bce00bd 100644
--- a/source4/dsdb/samdb/cracknames.c
+++ b/source4/dsdb/samdb/cracknames.c
@@ -817,7 +817,7 @@ static WERROR DsCrackNameOneFilter(struct ldb_context *sam_ctx, TALLOC_CTX *mem_
 			search_dn = samdb_result_dn(sam_ctx, mem_ctx, domain_res->msgs[0], "ncName", NULL);
 		} else {
 			dsdb_flags = DSDB_SEARCH_SEARCH_ALL_PARTITIONS;
-			search_dn = ldb_get_root_basedn(sam_ctx);
+			search_dn = samdb_root_dn(sam_ctx);
 		}
 
 		/* search with the 'phantom root' flag */
diff --git a/source4/rpc_server/lsa/lsa_init.c b/source4/rpc_server/lsa/lsa_init.c
index 8125746..1fadee0 100644
--- a/source4/rpc_server/lsa/lsa_init.c
+++ b/source4/rpc_server/lsa/lsa_init.c
@@ -56,7 +56,7 @@ NTSTATUS dcesrv_lsa_get_policy_state(struct dcesrv_call_state *dce_call, TALLOC_
 
 	/* work out the domain_dn - useful for so many calls its worth
 	   fetching here */
-	state->domain_dn = ldb_get_default_basedn(state->sam_ldb);
+	state->domain_dn = samdb_base_dn(state->sam_ldb);
 	if (!state->domain_dn) {
 		return NT_STATUS_NO_MEMORY;		
 	}
diff --git a/source4/rpc_server/netlogon/dcerpc_netlogon.c b/source4/rpc_server/netlogon/dcerpc_netlogon.c
index cdc9967..bb9d6b8 100644
--- a/source4/rpc_server/netlogon/dcerpc_netlogon.c
+++ b/source4/rpc_server/netlogon/dcerpc_netlogon.c
@@ -657,9 +657,9 @@ static NTSTATUS dcesrv_netr_LogonSamLogon_base(struct dcesrv_call_state *dce_cal
 		sam6->sidcount = sam3->sidcount;
 		sam6->sids = sam3->sids;
 
-		sam6->forest.string = lp_dnsdomain(dce_call->conn->dce_ctx->lp_ctx);
+		sam6->dns_domainname.string = lp_dnsdomain(dce_call->conn->dce_ctx->lp_ctx);
 		sam6->principle.string = talloc_asprintf(mem_ctx, "%s@%s",
-							 sam->account_name.string, sam6->forest.string);
+							 sam->account_name.string, sam6->dns_domainname.string);
 		NT_STATUS_HAVE_NO_MEMORY(sam6->principle.string);
 		/* And put into the talloc tree */
 		talloc_steal(sam6, sam3);
@@ -1124,7 +1124,7 @@ static NTSTATUS fill_one_domain_info(TALLOC_CTX *mem_ctx,
 	} else {
 		char *p;
 		/* TODO: we need a common function for pulling the forest */
-		info->dns_forestname.string = ldb_dn_canonical_string(info, ldb_get_root_basedn(sam_ctx));
+		info->dns_forestname.string = ldb_dn_canonical_string(info, samdb_root_dn(sam_ctx));
 		if (!info->dns_forestname.string) {
 			return NT_STATUS_NO_SUCH_DOMAIN;
 		}
diff --git a/source4/torture/ldap/ldap_sort.c b/source4/torture/ldap/ldap_sort.c
index 4c8145c..aab590f 100644
--- a/source4/torture/ldap/ldap_sort.c
+++ b/source4/torture/ldap/ldap_sort.c
@@ -30,9 +30,9 @@
 #include "torture/smbtorture.h"
 #include "torture/local/proto.h"
 #include <ctype.h>
+
 bool torture_ldap_sort(struct torture_context *torture)
 {
-
 	struct ldb_context *ldb;
 
 	bool ret = false;
@@ -74,7 +74,7 @@ bool torture_ldap_sort(struct torture_context *torture)
 	control[0]->reverse = 0;
 	control[1] = NULL;
 
-	dn = ldb_get_root_basedn(ldb);
+	dn = ldb_get_default_basedn(ldb);
 	ldb_dn_add_child_fmt(dn, "cn=users");
 	ret = ldb_build_search_req(&req, ldb, ctx,
 				   dn,


-- 
Samba Shared Repository


More information about the samba-cvs mailing list