s3:rpc_client: add rpccli_pre_open_netlogon_creds()
authorStefan Metzmacher <metze@samba.org>
Tue, 17 Dec 2013 19:05:56 +0000 (20:05 +0100)
committerStefan Metzmacher <metze@samba.org>
Tue, 7 Jan 2014 11:47:07 +0000 (12:47 +0100)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source3/rpc_client/cli_netlogon.c
source3/rpc_client/cli_netlogon.h

index 89aec37d67d3f586ca072e9a6b027e9e10f3d79e..9342fc3e8c70a6a5a906769e1ec4bd6acbec2e3d 100644 (file)
@@ -128,6 +128,27 @@ NTSTATUS rpccli_netlogon_setup_creds(struct rpc_pipe_client *cli,
        return NT_STATUS_OK;
 }
 
+NTSTATUS rpccli_pre_open_netlogon_creds(void)
+{
+       TALLOC_CTX *frame = talloc_stackframe();
+       struct loadparm_context *lp_ctx;
+       NTSTATUS status;
+
+       lp_ctx = loadparm_init_s3(frame, loadparm_s3_helpers());
+       if (lp_ctx == NULL) {
+               TALLOC_FREE(frame);
+               return NT_STATUS_NO_MEMORY;
+       }
+
+       status = netlogon_creds_cli_open_global_db(lp_ctx);
+       TALLOC_FREE(frame);
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       return NT_STATUS_OK;
+}
+
 NTSTATUS rpccli_create_netlogon_creds(const char *server_computer,
                                      const char *server_netbios_domain,
                                      const char *client_account,
index 82e0923039863afd535d3292882820a5a7f447ad..3096c48d073dbf9935475190cd98b07f8abba1dc 100644 (file)
@@ -37,6 +37,7 @@ NTSTATUS rpccli_netlogon_setup_creds(struct rpc_pipe_client *cli,
                                     const unsigned char machine_pwd[16],
                                     enum netr_SchannelType sec_chan_type,
                                     uint32_t *neg_flags_inout);
+NTSTATUS rpccli_pre_open_netlogon_creds(void);
 NTSTATUS rpccli_create_netlogon_creds(const char *server_computer,
                                      const char *server_netbios_domain,
                                      const char *client_account,