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/libgpo/gpo_fetch.c

    r740 r988  
    2323#include "../libgpo/gpo_ini.h"
    2424
    25 #if _SAMBA_BUILD_ == 4
    26 #include "param/param.h"
    27 #include "libcli/resolve/resolve.h"
    28 #include <tevent.h>
    29 #include "libcli/libcli.h"
    30 #include "libcli/raw/libcliraw.h"
    31 #include "libcli/libcli_proto.h"
    32 #include "libgpo/ads_convenience.h"
    33 #include "libgpo/gpo_s4.h"
    34 #include "lib/util/util.h"
    35 #else
    3625#include "libgpo/gpo_proto.h"
    3726#include "libsmb/libsmb.h"
    38 #endif
    3927
    4028/****************************************************************
     
    8371                return NT_STATUS_NO_MEMORY;
    8472        }
    85 #if _SAMBA_BUILD_ == 4
    86         path = string_sub_talloc(mem_ctx, path, "\\", "/");
    87 #else
    8873        path = talloc_string_sub(mem_ctx, path, "\\", "/");
    89 #endif
    9074        if (!path) {
    9175                return NT_STATUS_NO_MEMORY;
     
    135119}
    136120
    137 static NTSTATUS gpo_connect_server(ADS_STRUCT *ads, struct loadparm_context *lp_ctx,
     121static NTSTATUS gpo_connect_server(ADS_STRUCT *ads,
    138122                                   const char *server, const char *service, void *ret_cli)
    139123{
    140124        NTSTATUS result;
    141 #if _SAMBA_BUILD_ == 3
    142125        struct cli_state *cli;
    143126
    144 
    145127        result = cli_full_connection(&cli,
    146                         global_myname(),
     128                        lp_netbios_name(),
    147129                        server,
    148130                        NULL, 0,
     
    160142        }
    161143        *(struct cli_state **) ret_cli = cli;
    162 #else
    163         struct smbcli_state *cli = NULL;
    164         struct smbcli_options options;
    165         struct smbcli_session_options session_options;
    166 
    167         lp_smbcli_options(lp_ctx, &options);
    168         lp_smbcli_session_options(lp_ctx, &session_options);
    169 
    170         result = smbcli_full_connection(NULL, &cli,
    171                         server,
    172                         NULL, service,
    173                         NULL /*devtype*/, NULL /* socket options */,
    174                         ads->credentials,
    175                         lp_resolve_context(lp_ctx),
    176                         tevent_context_init(ads),
    177                         &options,
    178                         &session_options,
    179                         lp_iconv_convenience(lp_ctx),
    180                         lp_gensec_settings(ads, lp_ctx));
    181         if (!NT_STATUS_IS_OK(result)) {
    182                 DEBUG(10,("failed to connect: %s\n",
    183                                 nt_errstr(result)));
    184                 return result;
    185         }
    186         *(struct smbcli_state **) ret_cli = cli;
    187 #endif
    188144        return NT_STATUS_OK;
    189145}
     
    195151NTSTATUS gpo_fetch_files(TALLOC_CTX *mem_ctx,
    196152                         ADS_STRUCT *ads,
    197                          struct loadparm_context *lp_ctx,
    198153                         const char *cache_dir,
    199                          struct GROUP_POLICY_OBJECT *gpo)
     154                         const struct GROUP_POLICY_OBJECT *gpo)
    200155{
    201156        NTSTATUS result;
    202157        char *server, *service, *nt_path, *unix_path;
    203158        char *nt_ini_path, *unix_ini_path;
    204 #if _SAMBA_BUILD_ == 3
    205159        struct cli_state *cli;
    206 #else
    207         struct smbcli_state *cli;
    208 #endif
    209160
    210161
     
    214165        NT_STATUS_NOT_OK_RETURN(result);
    215166
    216 
    217         result = gpo_connect_server(ads, lp_ctx, server, service, &cli);
    218         NT_STATUS_NOT_OK_RETURN(result);
    219 
     167        /* for now reuse the existing ds connection */
     168
     169        result = gpo_connect_server(ads, ads->server.ldap_server, service, &cli);
     170        NT_STATUS_NOT_OK_RETURN(result);
    220171
    221172        result = gpo_prepare_local_store(mem_ctx, cache_dir, unix_path);
Note: See TracChangeset for help on using the changeset viewer.