r23380: netr_getdcname returns WERROR not NTSTATUS.
authorGünther Deschner <gd@samba.org>
Fri, 8 Jun 2007 10:29:46 +0000 (10:29 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 17:23:12 +0000 (12:23 -0500)
Guenther
(This used to be commit 5e75ea7f2b568d76c8ced5f43171741532cc97c2)

source3/include/rpc_netlogon.h
source3/rpc_client/cli_netlogon.c
source3/rpc_parse/parse_net.c
source3/rpcclient/cmd_netlogon.c

index 163b18a266b5289a96583759d1a8e370b078cd4b..940709346f1bd4aa60b536f30cc4d05cb055a372 100644 (file)
@@ -442,7 +442,7 @@ typedef struct net_q_getdcname {
 typedef struct net_r_getdcname {
        uint32  ptr_dcname;
        UNISTR2 uni_dcname;
-       NTSTATUS status;
+       WERROR status;
 } NET_R_GETDCNAME;
 
 /* NET_Q_TRUST_DOM_LIST - LSA Query Trusted Domains */
index 1123daaeec26bbd23bd00b60b1469b119809f74e..e6695f647ebec42455f2fc8ad23d927a8bb44fed 100644 (file)
@@ -420,14 +420,14 @@ WERROR rpccli_netlogon_getanydcname(struct rpc_pipe_client *cli,
 
 /* GetDCName */
 
-NTSTATUS rpccli_netlogon_getdcname(struct rpc_pipe_client *cli,
-                                  TALLOC_CTX *mem_ctx, const char *mydcname,
-                                  const char *domainname, fstring newdcname)
+WERROR rpccli_netlogon_getdcname(struct rpc_pipe_client *cli,
+                                TALLOC_CTX *mem_ctx, const char *mydcname,
+                                const char *domainname, fstring newdcname)
 {
        prs_struct qbuf, rbuf;
        NET_Q_GETDCNAME q;
        NET_R_GETDCNAME r;
-       NTSTATUS result;
+       WERROR result;
        fstring mydcname_slash;
 
        ZERO_STRUCT(q);
@@ -440,16 +440,16 @@ NTSTATUS rpccli_netlogon_getdcname(struct rpc_pipe_client *cli,
 
        /* Marshall data and send request */
 
-       CLI_DO_RPC(cli, mem_ctx, PI_NETLOGON, NET_GETDCNAME,
+       CLI_DO_RPC_WERR(cli, mem_ctx, PI_NETLOGON, NET_GETDCNAME,
                q, r,
                qbuf, rbuf,
                net_io_q_getdcname,
                net_io_r_getdcname,
-               NT_STATUS_UNSUCCESSFUL);
+               WERR_GENERAL_FAILURE);
 
        result = r.status;
 
-       if (NT_STATUS_IS_OK(result)) {
+       if (W_ERROR_IS_OK(result)) {
                rpcstr_pull_unistr2_fstring(newdcname, &r.uni_dcname);
        }
 
index 20e4dea23c9df31dedbf6ea7b86a748bc4c37757..15bf2b3283d4bf50e1e38beb610b2093d3b0e583 100644 (file)
@@ -644,7 +644,7 @@ BOOL net_io_r_getdcname(const char *desc, NET_R_GETDCNAME *r_t, prs_struct *ps,
        if (!prs_align(ps))
                return False;
 
-       if (!prs_ntstatus("status", ps, depth, &r_t->status))
+       if (!prs_werror("status", ps, depth, &r_t->status))
                return False;
 
        return True;
index 77f01e8885316f241e8eedb9f8c543c135b5770b..93b900e25ee8ee5d9dc12ebae56992f4b376846c 100644 (file)
@@ -76,17 +76,17 @@ static WERROR cmd_netlogon_getanydcname(struct rpc_pipe_client *cli,
        return result;
 }
 
-static NTSTATUS cmd_netlogon_getdcname(struct rpc_pipe_client *cli, 
-                                      TALLOC_CTX *mem_ctx, int argc, 
-                                      const char **argv)
+static WERROR cmd_netlogon_getdcname(struct rpc_pipe_client *cli, 
+                                    TALLOC_CTX *mem_ctx, int argc, 
+                                    const char **argv)
 {
        fstring dcname;
-       NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
+       WERROR result = WERR_GENERAL_FAILURE;
        int old_timeout;
 
        if (argc != 2) {
                fprintf(stderr, "Usage: %s domainname\n", argv[0]);
-               return NT_STATUS_OK;
+               return WERR_OK;
        }
 
        /* Make sure to wait for our DC's reply */
@@ -96,7 +96,7 @@ static NTSTATUS cmd_netlogon_getdcname(struct rpc_pipe_client *cli,
 
        cli_set_timeout(cli->cli, old_timeout);
 
-       if (!NT_STATUS_IS_OK(result))
+       if (!W_ERROR_IS_OK(result))
                goto done;
 
        /* Display results */
@@ -580,7 +580,7 @@ struct cmd_set netlogon_commands[] = {
 
        { "logonctrl2", RPC_RTYPE_NTSTATUS, cmd_netlogon_logon_ctrl2, NULL, PI_NETLOGON, NULL, "Logon Control 2",     "" },
        { "getanydcname", RPC_RTYPE_WERROR, NULL, cmd_netlogon_getanydcname, PI_NETLOGON, NULL, "Get trusted DC name",     "" },
-       { "getdcname", RPC_RTYPE_NTSTATUS, cmd_netlogon_getdcname, NULL, PI_NETLOGON, NULL, "Get trusted PDC name",     "" },
+       { "getdcname", RPC_RTYPE_WERROR, NULL, cmd_netlogon_getdcname, PI_NETLOGON, NULL, "Get trusted PDC name",     "" },
        { "dsr_getdcname", RPC_RTYPE_WERROR, NULL, cmd_netlogon_dsr_getdcname, PI_NETLOGON, NULL, "Get trusted DC name",     "" },
        { "dsr_getdcnameex", RPC_RTYPE_WERROR, NULL, cmd_netlogon_dsr_getdcnameex, PI_NETLOGON, NULL, "Get trusted DC name",     "" },
        { "dsr_getdcnameex2", RPC_RTYPE_WERROR, NULL, cmd_netlogon_dsr_getdcnameex2, PI_NETLOGON, NULL, "Get trusted DC name",     "" },