Add extra parm to cli_full_connection call. Tim, you should probably look at this.
[gd/samba-autobuild/.git] / source3 / python / py_common.c
index e21858e07226f47911396ba5ce3879f147bd7f91..364271d57c4aa05bf9d2563d3099808c1b78ff8f 100644 (file)
@@ -218,7 +218,7 @@ BOOL py_parse_creds(PyObject *creds, char **username, char **domain,
    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;
@@ -233,17 +233,16 @@ struct cli_state *open_pipe_creds(char *server, PyObject *creds,
 
        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;
        }