Separate error handling for cli_full_connection() and cli_nt_session_open()
authorTim Potter <tpot@samba.org>
Tue, 28 May 2002 03:15:09 +0000 (03:15 +0000)
committerTim Potter <tpot@samba.org>
Tue, 28 May 2002 03:15:09 +0000 (03:15 +0000)
(This used to be commit 6f269de03e91b823a30a2a12e41f25f1fa050870)

source3/python/py_common.c

index d81e141e9ceb63d4b25cbde023c7ebd629d94ed7..eb36fc552c396e23126c513cc6e856307eae5625 100644 (file)
@@ -183,10 +183,15 @@ struct cli_state *open_pipe_creds(char *server, PyObject *creds,
                &cli, global_myname, server, &server_ip, 0, "IPC$", "IPC",
                username, domain, password, strlen(password));
        
-       if (!NT_STATUS_IS_OK(result) || !cli_nt_session_open(cli, pipe_name)) {
+       if (!NT_STATUS_IS_OK(result)) {
+               *errstr = strdup("error connecting to IPC$ pipe");
+               return NULL;
+       }
+
+       if (!cli_nt_session_open(cli, pipe_name)) {
                cli_shutdown(cli);
                free(cli);
-               *errstr = strdup("pipe not available");
+               asprintf(errstr, "error opening %s", pipe_name);
                return NULL;
        }