[SCM] Samba Shared Repository - branch master updated

Matthias Dieter Wallnöfer mdw at samba.org
Tue Apr 27 00:09:55 MDT 2010


The branch, master has been updated
       via  2f339f7... s4:wb_cmd_getdcname.c - fix s4 winbind up regarding the new correct "GetAnyDCName" behaviour
       via  2654e34... s4:netr_DsRAddressToSitenames[Ex]W calls - implement them correctly with the client site information
       via  bb91afe... Revert "s4:netr_DsRAddressToSitenames[Ex]W calls - implement them correctly with the client site information"
       via  581f86b... Revert "s4-netlogon: fixed breakage of dcesrv_netr_GetAnyDCName in sites patch"
      from  280d06f... s4-libnet: cope with an empty client site name from CLDAP

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


- Log -----------------------------------------------------------------
commit 2f339f71bd40484959a7008982b243cef0b06bea
Author: Matthias Dieter Wallnöfer <mdw at samba.org>
Date:   Mon Apr 26 20:19:36 2010 +0200

    s4:wb_cmd_getdcname.c - fix s4 winbind up regarding the new correct "GetAnyDCName" behaviour
    
    We get back "NO_SUCH_DOMAIN" when we query the PDC. This is fine and therefore
    we use the "logon_server" variable as "dcname".

commit 2654e34cf092f1ec49e1462b67a10c681da4d3df
Author: Matthias Dieter Wallnöfer <mdw at samba.org>
Date:   Tue Apr 13 22:49:48 2010 +0200

    s4:netr_DsRAddressToSitenames[Ex]W calls - implement them correctly with the client site information
    
    This behaviour should be similar to the one of Windows Server (in my case 2008)

commit bb91afe50c2fb1ab8dc102ddef339bd7d46ff84a
Author: Matthias Dieter Wallnöfer <mdw at samba.org>
Date:   Tue Apr 27 08:08:42 2010 +0200

    Revert "s4:netr_DsRAddressToSitenames[Ex]W calls - implement them correctly with the client site information"
    
    This reverts commit 908d982980846257b65ab576d31131e8793e9399.
    
    I need to merge the improved version of this commit.

commit 581f86ba73b773f08996d473aaf0fad3e94ae2f3
Author: Matthias Dieter Wallnöfer <mdw at samba.org>
Date:   Tue Apr 27 08:07:19 2010 +0200

    Revert "s4-netlogon: fixed breakage of dcesrv_netr_GetAnyDCName in sites patch"
    
    This reverts commit e88a54a87e185b44e2d216bd853e6a87bf950be6.
    
    This isn't the correct behaviour. See MS-NRPC documentation under the
    "GetAnyDCName" section.

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

Summary of changes:
 source4/rpc_server/netlogon/dcerpc_netlogon.c |   17 ++++++++++++++---
 source4/winbind/wb_cmd_getdcname.c            |    5 +++++
 2 files changed, 19 insertions(+), 3 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/rpc_server/netlogon/dcerpc_netlogon.c b/source4/rpc_server/netlogon/dcerpc_netlogon.c
index 8681e68..a62a2ac 100644
--- a/source4/rpc_server/netlogon/dcerpc_netlogon.c
+++ b/source4/rpc_server/netlogon/dcerpc_netlogon.c
@@ -1019,6 +1019,12 @@ static WERROR dcesrv_netr_GetAnyDCName(struct dcesrv_call_state *dce_call, TALLO
 	}
 
 	if (strcasecmp(r->in.domainname, lp_workgroup(lp_ctx)) == 0) {
+		/* well we asked for a DC of our own domain */
+		if (samdb_is_pdc(sam_ctx)) {
+			/* we are the PDC of the specified domain */
+			return WERR_NO_SUCH_DOMAIN;
+		}
+
 		*r->out.dcname = talloc_asprintf(mem_ctx, "\\%s",
 						lp_netbios_name(lp_ctx));
 		W_ERROR_HAVE_NO_MEMORY(*r->out.dcname);
@@ -1665,8 +1671,12 @@ static WERROR dcesrv_netr_DsRAddressToSitenamesExW(struct dcesrv_call_state *dce
 	struct loadparm_context *lp_ctx = dce_call->conn->dce_ctx->lp_ctx;
 	uint16_t sin_family;
 	struct sockaddr_in *addr;
+#ifdef HAVE_IPV6
 	struct sockaddr_in6 *addr6;
 	char addr_str[INET6_ADDRSTRLEN];
+#else
+	char addr_str[INET_ADDRSTRLEN];
+#endif
 	char *subnet_name;
 	const char *res;
 	uint32_t i;
@@ -1706,6 +1716,7 @@ static WERROR dcesrv_netr_DsRAddressToSitenamesExW(struct dcesrv_call_state *dce
 			res = inet_ntop(AF_INET, &addr->sin_addr,
 					addr_str, sizeof(addr_str));
 			break;
+#ifdef HAVE_IPV6
 		case AF_INET6:
 			if (r->in.addresses[i].size < sizeof(struct sockaddr_in6)) {
 				continue;
@@ -1714,9 +1725,9 @@ static WERROR dcesrv_netr_DsRAddressToSitenamesExW(struct dcesrv_call_state *dce
 			res = inet_ntop(AF_INET6, &addr6->sin6_addr,
 					addr_str, sizeof(addr_str));
 			break;
+#endif
 		default:
 			continue;
-		break;
 		}
 
 		if (res == NULL) {
@@ -1755,8 +1766,6 @@ static WERROR dcesrv_netr_DsRAddressToSitenamesW(struct dcesrv_call_state *dce_c
 	r2.out.ctr = talloc(mem_ctx, struct netr_DsRAddressToSitenamesExWCtr *);
 	W_ERROR_HAVE_NO_MEMORY(r2.out.ctr);
 
-	werr = dcesrv_netr_DsRAddressToSitenamesExW(dce_call, mem_ctx, &r2);
-
 	ctr = talloc(mem_ctx, struct netr_DsRAddressToSitenamesWCtr);
 	W_ERROR_HAVE_NO_MEMORY(ctr);
 
@@ -1766,6 +1775,8 @@ static WERROR dcesrv_netr_DsRAddressToSitenamesW(struct dcesrv_call_state *dce_c
 	ctr->sitename = talloc_array(ctr, struct lsa_String, ctr->count);
 	W_ERROR_HAVE_NO_MEMORY(ctr->sitename);
 
+	werr = dcesrv_netr_DsRAddressToSitenamesExW(dce_call, mem_ctx, &r2);
+
 	for (i=0; i<ctr->count; i++) {
 		ctr->sitename[i].string   = (*r2.out.ctr)->sitename[i].string;
 	}
diff --git a/source4/winbind/wb_cmd_getdcname.c b/source4/winbind/wb_cmd_getdcname.c
index f1398cd..f3c2482 100644
--- a/source4/winbind/wb_cmd_getdcname.c
+++ b/source4/winbind/wb_cmd_getdcname.c
@@ -114,6 +114,11 @@ NTSTATUS wb_cmd_getdcname_recv(struct composite_context *c,
 	struct cmd_getdcname_state *state =
 		talloc_get_type(c->private_data, struct cmd_getdcname_state);
 	NTSTATUS status = composite_wait(c);
+	if (NT_STATUS_EQUAL(status, NT_STATUS_NO_SUCH_DOMAIN)) {
+		/* special case: queried DC is PDC */
+		state->g.out.dcname = &state->g.in.logon_server;
+		status = NT_STATUS_OK;
+	}
 	if (NT_STATUS_IS_OK(status)) {
 		const char *p = *(state->g.out.dcname);
 		if (*p == '\\') p += 1;


-- 
Samba Shared Repository


More information about the samba-cvs mailing list