s3/rpc_client: return validation from rpccli_netlogon functions
[metze/samba/wip.git] / source3 / rpcclient / cmd_netlogon.c
index 2d6a0829a579364d3ee14af8c08f7bec7818808c..8d62ef7e095d3cbbf97f00f6966d250a9698a65b 100644 (file)
@@ -27,6 +27,7 @@
 #include "rpc_client/cli_netlogon.h"
 #include "secrets.h"
 #include "../libcli/auth/netlogon_creds_cli.h"
+#include "rpc_client/util_netlogon.h"
 
 static WERROR cmd_netlogon_logon_ctrl2(struct rpc_pipe_client *cli,
                                       TALLOC_CTX *mem_ctx, int argc,
@@ -497,6 +498,8 @@ static NTSTATUS cmd_netlogon_sam_logon(struct rpc_pipe_client *cli,
        struct netr_SamInfo3 *info3 = NULL;
        uint8_t authoritative = 0;
        uint32_t flags = 0;
+       uint16_t validation_level;
+       union netr_Validation *validation = NULL;
 
        /* Check arguments */
 
@@ -536,10 +539,19 @@ static NTSTATUS cmd_netlogon_sam_logon(struct rpc_pipe_client *cli,
                                                logon_type,
                                                &authoritative,
                                                &flags,
-                                               &info3);
+                                               &validation_level,
+                                               &validation);
        if (!NT_STATUS_IS_OK(result))
                goto done;
 
+       result = map_validation_to_info3(mem_ctx,
+                                        validation_level,
+                                        validation,
+                                        &info3);
+       if (!NT_STATUS_IS_OK(result)) {
+               return result;
+       }
+
  done:
        return result;
 }