| 1 | /*
|
|---|
| 2 | * Unix SMB/CIFS implementation.
|
|---|
| 3 | * NetApi Support
|
|---|
| 4 | * Copyright (C) Guenther Deschner 2008
|
|---|
| 5 | *
|
|---|
| 6 | * This program is free software; you can redistribute it and/or modify
|
|---|
| 7 | * it under the terms of the GNU General Public License as published by
|
|---|
| 8 | * the Free Software Foundation; either version 3 of the License, or
|
|---|
| 9 | * (at your option) any later version.
|
|---|
| 10 | *
|
|---|
| 11 | * This program is distributed in the hope that it will be useful,
|
|---|
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|---|
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|---|
| 14 | * GNU General Public License for more details.
|
|---|
| 15 | *
|
|---|
| 16 | * You should have received a copy of the GNU General Public License
|
|---|
| 17 | * along with this program; if not, see <http://www.gnu.org/licenses/>.
|
|---|
| 18 | */
|
|---|
| 19 |
|
|---|
| 20 | #include "includes.h"
|
|---|
| 21 |
|
|---|
| 22 | #include "lib/netapi/netapi.h"
|
|---|
| 23 | #include "lib/netapi/netapi_private.h"
|
|---|
| 24 |
|
|---|
| 25 | /********************************************************************
|
|---|
| 26 | ********************************************************************/
|
|---|
| 27 |
|
|---|
| 28 | struct client_ipc_connection {
|
|---|
| 29 | struct client_ipc_connection *prev, *next;
|
|---|
| 30 | struct cli_state *cli;
|
|---|
| 31 | struct client_pipe_connection *pipe_connections;
|
|---|
| 32 | };
|
|---|
| 33 |
|
|---|
| 34 | struct client_pipe_connection {
|
|---|
| 35 | struct client_pipe_connection *prev, *next;
|
|---|
| 36 | struct rpc_pipe_client *pipe;
|
|---|
| 37 | };
|
|---|
| 38 |
|
|---|
| 39 | /********************************************************************
|
|---|
| 40 | ********************************************************************/
|
|---|
| 41 |
|
|---|
| 42 | static struct client_ipc_connection *ipc_cm_find(
|
|---|
| 43 | struct libnetapi_private_ctx *priv_ctx, const char *server_name)
|
|---|
| 44 | {
|
|---|
| 45 | struct client_ipc_connection *p;
|
|---|
| 46 |
|
|---|
| 47 | for (p = priv_ctx->ipc_connections; p; p = p->next) {
|
|---|
| 48 | if (strequal(p->cli->desthost, server_name)) {
|
|---|
| 49 | return p;
|
|---|
| 50 | }
|
|---|
| 51 | }
|
|---|
| 52 |
|
|---|
| 53 | return NULL;
|
|---|
| 54 | }
|
|---|
| 55 |
|
|---|
| 56 | /********************************************************************
|
|---|
| 57 | ********************************************************************/
|
|---|
| 58 |
|
|---|
| 59 | static WERROR libnetapi_open_ipc_connection(struct libnetapi_ctx *ctx,
|
|---|
| 60 | const char *server_name,
|
|---|
| 61 | struct client_ipc_connection **pp)
|
|---|
| 62 | {
|
|---|
| 63 | struct libnetapi_private_ctx *priv_ctx =
|
|---|
| 64 | (struct libnetapi_private_ctx *)ctx->private_data;
|
|---|
| 65 | struct user_auth_info *auth_info = NULL;
|
|---|
| 66 | struct cli_state *cli_ipc = NULL;
|
|---|
| 67 | struct client_ipc_connection *p;
|
|---|
| 68 |
|
|---|
| 69 | if (!ctx || !pp || !server_name) {
|
|---|
| 70 | return WERR_INVALID_PARAM;
|
|---|
| 71 | }
|
|---|
|
|---|