uint16 fnum;
const char *desthost;
+ const char *srv_name_slash;
const char *domain;
const char *user_name;
int privileges;
fstring desthost;
- fstring srv_name_slash;
/* The credentials used to open the cli_state connection. */
fstring domain;
}
fstrcpy(cli->desthost, host);
- fstr_sprintf(cli->srv_name_slash, "\\\\%s", cli->desthost);
- strupper_m(cli->srv_name_slash);
/* allow hostnames of the form NAME#xx and do a netbios lookup */
if ((p = strchr(cli->desthost, '#'))) {
}
return rpccli_lsa_OpenPolicy2(cli, mem_ctx,
- cli->cli->srv_name_slash,
+ cli->srv_name_slash,
&attr,
des_access,
pol);
return NULL;
}
+ result->srv_name_slash = talloc_asprintf_strupper_m(
+ result, "\\\\%s", result->desthost);
+ if (result->srv_name_slash == NULL) {
+ TALLOC_FREE(result);
+ return NULL;
+ }
+
if (pipe_idx == PI_NETLOGON) {
/* Set up a netlogon credential chain for a netlogon pipe. */
result->dc = TALLOC_ZERO_P(result, struct dcinfo);
DEBUG(10,("rpccli_samr_chgpasswd_user\n"));
- init_lsa_String(&server, cli->cli->srv_name_slash);
+ init_lsa_String(&server, cli->srv_name_slash);
init_lsa_String(&account, username);
/* Calculate the MD4 hash (NT compatible) of the password */
DEBUG(10,("rpccli_samr_chng_pswd_auth_crap\n"));
- init_lsa_String(&server, cli->cli->srv_name_slash);
+ init_lsa_String(&server, cli->srv_name_slash);
init_lsa_String(&account, username);
memcpy(&new_nt_password.data, new_nt_password_blob.data, 516);
DEBUG(10,("rpccli_samr_chgpasswd_user3\n"));
- init_lsa_String(&server, cli->cli->srv_name_slash);
+ init_lsa_String(&server, cli->srv_name_slash);
init_lsa_String(&account, username);
/* Calculate the MD4 hash (NT compatible) of the password */
info_in.info1 = info1;
status = rpccli_samr_Connect5(cli, mem_ctx,
- cli->cli->srv_name_slash,
+ cli->srv_name_slash,
access_mask,
1,
&info_in,
}
status = rpccli_samr_Connect4(cli, mem_ctx,
- cli->cli->srv_name_slash,
+ cli->srv_name_slash,
SAMR_CONNECT_W2K,
access_mask,
connect_pol);
}
status = rpccli_samr_Connect2(cli, mem_ctx,
- cli->cli->srv_name_slash,
+ cli->srv_name_slash,
access_mask,
connect_pol);
return status;
}
status = rpccli_srvsvc_NetRemoteTOD(cli, mem_ctx,
- cli->cli->srv_name_slash,
+ cli->srv_name_slash,
&tod,
&result);
if (!NT_STATUS_IS_OK(status)) {
}
status = rpccli_svcctl_OpenSCManagerW(pipe_hnd, mem_ctx,
- pipe_hnd->cli->srv_name_slash,
+ pipe_hnd->srv_name_slash,
NULL,
SC_RIGHT_MGR_ENUMERATE_SERVICE,
&hSCM,
/* Open the Service Control Manager */
status = rpccli_svcctl_OpenSCManagerW(pipe_hnd, mem_ctx,
- pipe_hnd->cli->srv_name_slash,
+ pipe_hnd->srv_name_slash,
NULL,
SC_RIGHT_MGR_ENUMERATE_SERVICE,
&hSCM,
/* Open the Service Control Manager */
status = rpccli_svcctl_OpenSCManagerW(pipe_hnd, mem_ctx,
- pipe_hnd->cli->srv_name_slash,
+ pipe_hnd->srv_name_slash,
NULL,
SC_RIGHT_MGR_ENUMERATE_SERVICE,
&hSCM,
/* Open the Service Control Manager */
status = rpccli_svcctl_OpenSCManagerW(pipe_hnd, mem_ctx,
- pipe_hnd->cli->srv_name_slash,
+ pipe_hnd->srv_name_slash,
NULL,
SC_RIGHT_MGR_ENUMERATE_SERVICE,
&hSCM,
/* Open the Service Control Manager */
status = rpccli_svcctl_OpenSCManagerW(pipe_hnd, mem_ctx,
- pipe_hnd->cli->srv_name_slash,
+ pipe_hnd->srv_name_slash,
NULL,
SC_RIGHT_MGR_ENUMERATE_SERVICE,
&hSCM,
/* Open the Service Control Manager */
status = rpccli_svcctl_OpenSCManagerW(pipe_hnd, mem_ctx,
- pipe_hnd->cli->srv_name_slash,
+ pipe_hnd->srv_name_slash,
NULL,
SC_RIGHT_MGR_ENUMERATE_SERVICE,
&hSCM,