struct loadparm_context *lp_ctx);
const char *dcerpc_server_name(struct dcerpc_pipe *p);
struct dcerpc_pipe *dcerpc_pipe_init(TALLOC_CTX *mem_ctx, struct tevent_context *ev);
-NTSTATUS dcerpc_pipe_open_smb(struct dcerpc_pipe *p,
- struct smbcli_tree *tree,
- const char *pipe_name);
-NTSTATUS dcerpc_pipe_open_smb2(struct dcerpc_pipe *p,
- struct smb2_tree *tree,
- const char *pipe_name);
NTSTATUS dcerpc_fetch_session_key(struct dcerpc_pipe *p,
DATA_BLOB *session_key);
struct composite_context;
return status;
}
-_PUBLIC_ NTSTATUS dcerpc_pipe_open_smb(struct dcerpc_pipe *p,
- struct smbcli_tree *t,
- const char *pipe_name)
-{
- struct smbXcli_conn *conn;
- struct smbXcli_session *session;
- struct smbXcli_tcon *tcon;
- struct composite_context *ctx;
-
- conn = t->session->transport->conn;
- session = t->session->smbXcli;
- tcon = t->smbXcli;
- smb1cli_tcon_set_id(tcon, t->tid);
-
- /* if we don't have a binding on this pipe yet, then create one */
- if (p->binding == NULL) {
- struct dcerpc_binding *b;
- NTSTATUS status;
- const char *r = smbXcli_conn_remote_name(conn);
- char *str;
- SMB_ASSERT(r != NULL);
- str = talloc_asprintf(p, "ncacn_np:%s", r);
- if (str == NULL) {
- return NT_STATUS_NO_MEMORY;
- }
- status = dcerpc_parse_binding(p, str, &b);
- talloc_free(str);
- if (!NT_STATUS_IS_OK(status)) {
- return status;
- }
- p->binding = b;
- }
-
- ctx = dcerpc_pipe_open_smb_send(p->conn,
- conn, session, tcon,
- DCERPC_REQUEST_TIMEOUT * 1000,
- pipe_name);
- if (ctx == NULL) {
- return NT_STATUS_NO_MEMORY;
- }
-
- return dcerpc_pipe_open_smb_recv(ctx);
-}
-
-_PUBLIC_ NTSTATUS dcerpc_pipe_open_smb2(struct dcerpc_pipe *p,
- struct smb2_tree *t,
- const char *pipe_name)
-{
- struct smbXcli_conn *conn;
- struct smbXcli_session *session;
- struct smbXcli_tcon *tcon;
- struct composite_context *ctx;
-
- conn = t->session->transport->conn;
- session = t->session->smbXcli;
- tcon = t->smbXcli;
-
- /* if we don't have a binding on this pipe yet, then create one */
- if (p->binding == NULL) {
- struct dcerpc_binding *b;
- NTSTATUS status;
- const char *r = smbXcli_conn_remote_name(conn);
- char *str;
- SMB_ASSERT(r != NULL);
- str = talloc_asprintf(p, "ncacn_np:%s", r);
- if (str == NULL) {
- return NT_STATUS_NO_MEMORY;
- }
- status = dcerpc_parse_binding(p, str, &b);
- talloc_free(str);
- if (!NT_STATUS_IS_OK(status)) {
- return status;
- }
- p->binding = b;
- }
-
- ctx = dcerpc_pipe_open_smb_send(p->conn,
- conn, session, tcon,
- DCERPC_REQUEST_TIMEOUT * 1000,
- pipe_name);
- if (ctx == NULL) {
- return NT_STATUS_NO_MEMORY;
- }
-
- return dcerpc_pipe_open_smb_recv(ctx);
-}
-
struct composite_context *dcerpc_secondary_smb_send(struct dcecli_connection *c1,
struct dcecli_connection *c2,
const char *pipe_name)