s4:wb_cmd_getdcname.c - fix s4 winbind up regarding the new correct "GetAnyDCName...
authorMatthias Dieter Wallnöfer <mdw@samba.org>
Mon, 26 Apr 2010 18:19:36 +0000 (20:19 +0200)
committerMatthias Dieter Wallnöfer <mdw@samba.org>
Tue, 27 Apr 2010 06:09:13 +0000 (08:09 +0200)
We get back "NO_SUCH_DOMAIN" when we query the PDC. This is fine and therefore
we use the "logon_server" variable as "dcname".

source4/winbind/wb_cmd_getdcname.c

index f1398cd3c701fdf25794a142ddec0398d4044284..f3c24825799470ff55d7497203a62d007df21655 100644 (file)
@@ -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;