cli_netlogon: Return flags from rpccli_setup_netlogon_creds_locked
authorVolker Lendecke <vl@samba.org>
Mon, 18 Sep 2017 20:17:01 +0000 (13:17 -0700)
committerVolker Lendecke <vl@samba.org>
Mon, 25 Sep 2017 07:43:13 +0000 (09:43 +0200)
This will be used in a later commit in the rpcclient "capabilities"
command. Avoids another netlogon_creds_cli_get in the next commit.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source3/rpc_client/cli_netlogon.c
source3/rpc_client/cli_netlogon.h

index 8a866fe8aa5fdd071ba553bef9725acaaf149508..6734442cd0d8aec786265c89304fb7ca2958fc31 100644 (file)
@@ -158,7 +158,8 @@ NTSTATUS rpccli_setup_netlogon_creds_locked(
        enum dcerpc_transport_t transport,
        struct netlogon_creds_cli_context *creds_ctx,
        bool force_reauth,
-       struct cli_credentials *cli_creds)
+       struct cli_credentials *cli_creds,
+       uint32_t *negotiate_flags)
 {
        TALLOC_CTX *frame = talloc_stackframe();
        struct rpc_pipe_client *netlogon_pipe = NULL;
@@ -181,8 +182,7 @@ NTSTATUS rpccli_setup_netlogon_creds_locked(
                         creds->account_name, creds->computer_name,
                         smbXcli_conn_remote_name(cli->conn)));
                if (!force_reauth) {
-                       TALLOC_FREE(frame);
-                       return NT_STATUS_OK;
+                       goto done;
                }
                TALLOC_FREE(creds);
        }
@@ -235,6 +235,11 @@ NTSTATUS rpccli_setup_netlogon_creds_locked(
                 creds->account_name, creds->computer_name,
                 smbXcli_conn_remote_name(cli->conn)));
 
+done:
+       if (negotiate_flags != NULL) {
+               *negotiate_flags = creds->negotiate_flags;
+       }
+
        TALLOC_FREE(frame);
        return NT_STATUS_OK;
 }
@@ -261,7 +266,7 @@ NTSTATUS rpccli_setup_netlogon_creds(
        }
 
        status = rpccli_setup_netlogon_creds_locked(
-               cli, transport, creds_ctx, force_reauth, cli_creds);
+               cli, transport, creds_ctx, force_reauth, cli_creds, NULL);
 
        TALLOC_FREE(frame);
 
index 63db4762fb6605cc72e6b536e756b0e1008d5aa8..ca5589e46eff86a143af1405196c3a99d208a793 100644 (file)
@@ -44,7 +44,8 @@ NTSTATUS rpccli_setup_netlogon_creds_locked(
        enum dcerpc_transport_t transport,
        struct netlogon_creds_cli_context *creds_ctx,
        bool force_reauth,
-       struct cli_credentials *cli_creds);
+       struct cli_credentials *cli_creds,
+       uint32_t *negotiate_flags);
 NTSTATUS rpccli_setup_netlogon_creds(
        struct cli_state *cli,
        enum dcerpc_transport_t transport,