Changeset 988 for vendor/current/libgpo/gpo_fetch.c
- Timestamp:
- Nov 24, 2016, 1:14:11 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
vendor/current/libgpo/gpo_fetch.c
r740 r988 23 23 #include "../libgpo/gpo_ini.h" 24 24 25 #if _SAMBA_BUILD_ == 426 #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 #else36 25 #include "libgpo/gpo_proto.h" 37 26 #include "libsmb/libsmb.h" 38 #endif39 27 40 28 /**************************************************************** … … 83 71 return NT_STATUS_NO_MEMORY; 84 72 } 85 #if _SAMBA_BUILD_ == 486 path = string_sub_talloc(mem_ctx, path, "\\", "/");87 #else88 73 path = talloc_string_sub(mem_ctx, path, "\\", "/"); 89 #endif90 74 if (!path) { 91 75 return NT_STATUS_NO_MEMORY; … … 135 119 } 136 120 137 static NTSTATUS gpo_connect_server(ADS_STRUCT *ads, struct loadparm_context *lp_ctx,121 static NTSTATUS gpo_connect_server(ADS_STRUCT *ads, 138 122 const char *server, const char *service, void *ret_cli) 139 123 { 140 124 NTSTATUS result; 141 #if _SAMBA_BUILD_ == 3142 125 struct cli_state *cli; 143 126 144 145 127 result = cli_full_connection(&cli, 146 global_myname(),128 lp_netbios_name(), 147 129 server, 148 130 NULL, 0, … … 160 142 } 161 143 *(struct cli_state **) ret_cli = cli; 162 #else163 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 #endif188 144 return NT_STATUS_OK; 189 145 } … … 195 151 NTSTATUS gpo_fetch_files(TALLOC_CTX *mem_ctx, 196 152 ADS_STRUCT *ads, 197 struct loadparm_context *lp_ctx,198 153 const char *cache_dir, 199 struct GROUP_POLICY_OBJECT *gpo)154 const struct GROUP_POLICY_OBJECT *gpo) 200 155 { 201 156 NTSTATUS result; 202 157 char *server, *service, *nt_path, *unix_path; 203 158 char *nt_ini_path, *unix_ini_path; 204 #if _SAMBA_BUILD_ == 3205 159 struct cli_state *cli; 206 #else207 struct smbcli_state *cli;208 #endif209 160 210 161 … … 214 165 NT_STATUS_NOT_OK_RETURN(result); 215 166 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); 220 171 221 172 result = gpo_prepare_local_store(mem_ctx, cache_dir, unix_path);
Note:
See TracChangeset
for help on using the changeset viewer.