syncing up with HEAD. Seems to be a lot of differences creeping in
[vlendec/samba-autobuild/.git] / source3 / client / client.c
index eb6b57276089a6407f374bc08b734d15b908c6ba..f25ed1623b0d96c865620a5ffecf90b9f2f86856 100644 (file)
@@ -2436,9 +2436,24 @@ static struct cli_state *do_connect(const char *server, const char *share)
 
        if (!cli_send_tconX(c, sharename, "?????",
                            password, strlen(password)+1)) {
-               d_printf("tree connect failed: %s\n", cli_errstr(c));
-               cli_shutdown(c);
-               return NULL;
+               pstring full_share;
+
+               /*
+                * Some servers require \\server\share for the share
+                * while others are happy with share as we gave above
+                * Lets see if we give it the long form if it works
+                */
+               pstrcpy(full_share, "\\\\");
+               pstrcat(full_share, server);
+               pstrcat(full_share, "\\");
+               pstrcat(full_share, sharename);
+               if (!cli_send_tconX(c, full_share, "?????", password,
+                                       strlen(password) + 1)) {
+
+                       d_printf("tree connect failed: %s\n", cli_errstr(c));
+                       cli_shutdown(c);
+                       return NULL;
+               }
        }
 
        DEBUG(4,(" tconx ok\n"));