Ignore:
Timestamp:
Nov 24, 2016, 1:14:11 PM (9 years ago)
Author:
Silvan Scherrer
Message:

Samba Server: update vendor to version 4.4.3

File:
1 edited

Legend:

Unmodified
Added
Removed
  • vendor/current/source3/lib/netapi/cm.c

    r740 r988  
    1919
    2020#include "includes.h"
    21 #include "popt_common.h"
     21#include ".h"
    2222
    2323#include "lib/netapi/netapi.h"
     
    2525#include "libsmb/libsmb.h"
    2626#include "rpc_client/cli_pipe.h"
     27
    2728
    2829/********************************************************************
     
    4950
    5051        for (p = priv_ctx->ipc_connections; p; p = p->next) {
    51                 if (strequal(p->cli->desthost, server_name)) {
     52                const char *remote_name = smbXcli_conn_remote_name(p->cli->conn);
     53
     54                if (strequal(remote_name, server_name)) {
    5255                        return p;
    5356                }
     
    6467                                            struct client_ipc_connection **pp)
    6568{
    66         struct libnetapi_private_ctx *priv_ctx =
    67                 (struct libnetapi_private_ctx *)ctx->private_data;
     69        struct libnetapi_private_ctx *priv_ctx;
    6870        struct user_auth_info *auth_info = NULL;
    6971        struct cli_state *cli_ipc = NULL;
    7072        struct client_ipc_connection *p;
     73
    7174
    7275        if (!ctx || !pp || !server_name) {
    7376                return WERR_INVALID_PARAM;
    7477        }
     78
     79
    7580
    7681        p = ipc_cm_find(priv_ctx, server_name);
     
    8489                return WERR_NOMEM;
    8590        }
    86         auth_info->signing_state = Undefined;
     91        auth_info->signing_state = ;
    8792        set_cmdline_auth_info_use_kerberos(auth_info, ctx->use_kerberos);
    8893        set_cmdline_auth_info_username(auth_info, ctx->username);
     
    103108        }
    104109
    105         cli_ipc = cli_cm_open(ctx, NULL,
    106                                 server_name, "IPC$",
    107                                 auth_info,
    108                                 false, false,
    109                                 PROTOCOL_NT1,
    110                                 0, 0x20);
    111         if (cli_ipc) {
    112                 cli_set_username(cli_ipc, ctx->username);
    113                 cli_set_password(cli_ipc, ctx->password);
    114                 cli_set_domain(cli_ipc, ctx->workgroup);
     110        status = cli_cm_open(ctx, NULL,
     111                             server_name, "IPC$",
     112                             auth_info,
     113                             false, false,
     114                             lp_client_max_protocol(),
     115                             0, 0x20, &cli_ipc);
     116        if (!NT_STATUS_IS_OK(status)) {
     117                cli_ipc = NULL;
    115118        }
    116119        TALLOC_FREE(auth_info);
     
    122125        }
    123126
    124         p = TALLOC_ZERO_P(ctx, struct client_ipc_connection);
     127        p = (ctx, struct client_ipc_connection);
    125128        if (p == NULL) {
    126129                return WERR_NOMEM;
     
    155158
    156159static NTSTATUS pipe_cm_find(struct client_ipc_connection *ipc,
    157                              const struct ndr_syntax_id *interface,
     160                             const struct ndr_e,
    158161                             struct rpc_pipe_client **presult)
    159162{
     
    161164
    162165        for (p = ipc->pipe_connections; p; p = p->next) {
    163 
    164                 if (!rpc_pipe_np_smb_conn(p->pipe)) {
     166                const char *ipc_remote_name;
     167
     168                if (!rpccli_is_connected(p->pipe)) {
    165169                        return NT_STATUS_PIPE_EMPTY;
    166170                }
    167171
    168                 if (strequal(ipc->cli->desthost, p->pipe->desthost)
     172                ipc_remote_name = smbXcli_conn_remote_name(ipc->cli->conn);
     173
     174                if (strequal(ipc_remote_name, p->pipe->desthost)
    169175                    && ndr_syntax_id_equal(&p->pipe->abstract_syntax,
    170                                            interface)) {
     176                                           )) {
    171177                        *presult = p->pipe;
    172178                        return NT_STATUS_OK;
     
    182188static NTSTATUS pipe_cm_connect(TALLOC_CTX *mem_ctx,
    183189                                struct client_ipc_connection *ipc,
    184                                 const struct ndr_syntax_id *interface,
     190                                const struct ndr_e,
    185191                                struct rpc_pipe_client **presult)
    186192{
     
    188194        NTSTATUS status;
    189195
    190         p = TALLOC_ZERO_ARRAY(mem_ctx, struct client_pipe_connection, 1);
     196        p = (mem_ctx, struct client_pipe_connection, 1);
    191197        if (!p) {
    192198                return NT_STATUS_NO_MEMORY;
    193199        }
    194200
    195         status = cli_rpc_pipe_open_noauth(ipc->cli, interface, &p->pipe);
     201        status = cli_rpc_pipe_open_noauth(ipc->cli, e, &p->pipe);
    196202        if (!NT_STATUS_IS_OK(status)) {
    197203                TALLOC_FREE(p);
     
    210216static NTSTATUS pipe_cm_open(TALLOC_CTX *ctx,
    211217                             struct client_ipc_connection *ipc,
    212                              const struct ndr_syntax_id *interface,
     218                             const struct ndr_e,
    213219                             struct rpc_pipe_client **presult)
    214220{
    215         if (NT_STATUS_IS_OK(pipe_cm_find(ipc, interface, presult))) {
     221        if (NT_STATUS_IS_OK(pipe_cm_find(ipc, e, presult))) {
    216222                return NT_STATUS_OK;
    217223        }
    218224
    219         return pipe_cm_connect(ctx, ipc, interface, presult);
     225        return pipe_cm_connect(ctx, ipc, e, presult);
    220226}
    221227
     
    225231WERROR libnetapi_open_pipe(struct libnetapi_ctx *ctx,
    226232                           const char *server_name,
    227                            const struct ndr_syntax_id *interface,
     233                           const struct ndr_e,
    228234                           struct rpc_pipe_client **presult)
    229235{
     
    242248        }
    243249
    244         status = pipe_cm_open(ctx, ipc, interface, &result);
     250        status = pipe_cm_open(ctx, ipc, e, &result);
    245251        if (!NT_STATUS_IS_OK(status)) {
    246252                libnetapi_set_error_string(ctx, "failed to open PIPE %s: %s",
    247                         get_pipe_name_from_syntax(talloc_tos(), interface),
     253                        ,
    248254                        get_friendly_nt_error_msg(status));
    249255                return WERR_DEST_NOT_FOUND;
     
    260266WERROR libnetapi_get_binding_handle(struct libnetapi_ctx *ctx,
    261267                                    const char *server_name,
    262                                     const struct ndr_syntax_id *interface,
     268                                    const struct ndr_e,
    263269                                    struct dcerpc_binding_handle **binding_handle)
    264270{
     
    268274        *binding_handle = NULL;
    269275
    270         result = libnetapi_open_pipe(ctx, server_name, interface, &pipe_cli);
     276        result = libnetapi_open_pipe(ctx, server_name, e, &pipe_cli);
    271277        if (!W_ERROR_IS_OK(result)) {
    272278                return result;
Note: See TracChangeset for help on using the changeset viewer.