Compile fix for new arguments to cli_full_connection()
[kai/samba.git] / source3 / python / py_common.c
index d81e141e9ceb63d4b25cbde023c7ebd629d94ed7..471a53da8448c61853472726c23c40d04fe9bba9 100644 (file)
@@ -137,8 +137,6 @@ struct cli_state *open_pipe_creds(char *server, PyObject *creds,
        char *username = "", *password = "", *domain = "";
        struct cli_state *cli;
        NTSTATUS result;
-       struct in_addr server_ip;
-       extern pstring global_myname;
        
        /* Extract credentials from the python dictionary */
 
@@ -174,19 +172,19 @@ struct cli_state *open_pipe_creds(char *server, PyObject *creds,
 
        /* Now try to connect */
 
-       if (!resolve_name(server, &server_ip, 0x20))  {
-               asprintf(errstr, "unable to resolve %s", server);
+       result = cli_full_connection(
+               &cli, NULL, server, NULL, 0, "IPC$", "IPC",
+               username, domain, password);
+       
+       if (!NT_STATUS_IS_OK(result)) {
+               *errstr = strdup("error connecting to IPC$ pipe");
                return NULL;
        }
 
-       result = cli_full_connection(
-               &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 (!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;
        }