return NT_STATUS_OK;
}
-static NTSTATUS gpo_connect_server(ADS_STRUCT *ads,
+static NTSTATUS gpo_connect_server(struct cli_credentials *creds,
const char *server, const char *service, void *ret_cli)
{
NTSTATUS result;
- struct cli_credentials *creds = NULL;
struct cli_state *cli = NULL;
- creds = cli_session_creds_init(NULL,
- ads->auth._user_name,
- NULL, /* domain (use default) */
- NULL, /* realm (use default) */
- ads->auth._password,
- true, /* use_kerberos */
- true, /* fallback_after_kerberos */
- false, /* use_ccache */
- false); /* pw_nt_hash */
- if (creds == NULL) {
- return NT_STATUS_NO_MEMORY;
- }
-
result = cli_full_connection_creds(&cli,
lp_netbios_name(),
server,
service, "A:",
creds, 0,
SMB_SIGNING_REQUIRED);
- TALLOC_FREE(creds);
if (!NT_STATUS_IS_OK(result)) {
DEBUG(10,("check_refresh_gpo: "
"failed to connect: %s\n",
****************************************************************/
NTSTATUS gpo_fetch_files(TALLOC_CTX *mem_ctx,
- ADS_STRUCT *ads,
+ struct cli_credentials *creds,
const char *cache_dir,
const struct GROUP_POLICY_OBJECT *gpo)
{
/* for now reuse the existing ds connection */
- result = gpo_connect_server(ads, server, service, &cli);
+ result = gpo_connect_server(creds, server, service, &cli);
NT_STATUS_NOT_OK_RETURN(result);
result = gpo_prepare_local_store(mem_ctx, cache_dir, unix_path);