We get back "NO_SUCH_DOMAIN" when we query the PDC. This is fine and therefore
we use the "logon_server" variable as "dcname".
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;