be freed by calling free(). */
struct cli_state *open_pipe_creds(char *server, PyObject *creds,
- char *pipe_name, char **errstr)
+ int pipe_idx, char **errstr)
{
char *username, *password, *domain;
struct cli_state *cli;
result = cli_full_connection(
&cli, NULL, server, NULL, 0, "IPC$", "IPC",
- username, domain, password, 0);
+ username, domain, password, 0, NULL);
if (!NT_STATUS_IS_OK(result)) {
*errstr = strdup("error connecting to IPC$ pipe");
return NULL;
}
- if (!cli_nt_session_open(cli, pipe_name)) {
+ if (!cli_nt_session_open(cli, pipe_idx)) {
cli_shutdown(cli);
- free(cli);
- asprintf(errstr, "error opening %s", pipe_name);
+ asprintf(errstr, "error opening pipe index %d", pipe_idx);
return NULL;
}