Revert "s4-netlogon: fixed breakage of dcesrv_netr_GetAnyDCName in sites patch"
authorMatthias Dieter Wallnöfer <mdw@samba.org>
Tue, 27 Apr 2010 06:07:19 +0000 (08:07 +0200)
committerMatthias Dieter Wallnöfer <mdw@samba.org>
Tue, 27 Apr 2010 06:07:19 +0000 (08:07 +0200)
This reverts commit e88a54a87e185b44e2d216bd853e6a87bf950be6.

This isn't the correct behaviour. See MS-NRPC documentation under the
"GetAnyDCName" section.

source4/rpc_server/netlogon/dcerpc_netlogon.c

index 8681e680d39cd065fe1f4db389782a3f1913858e..856d26e964a0a7b447ee5f6468996a7481901034 100644 (file)
@@ -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);