Fix for @ in pathname from Kian Win.
authorJeremy Allison <jra@samba.org>
Mon, 22 Oct 2001 02:50:20 +0000 (02:50 +0000)
committerJeremy Allison <jra@samba.org>
Mon, 22 Oct 2001 02:50:20 +0000 (02:50 +0000)
Jeremy.
(This used to be commit 070fd5180fef921efb363ff24f04a298254f108b)

source3/libsmb/libsmbclient.c

index 9dca4637f4ea4d3e57e3bd654404800c348b64b2..6a00855bff6fe49fc03442b39371b293b088327d 100644 (file)
@@ -92,6 +92,7 @@ smbc_parse_path(const char *fname, char *server, char *share, char *path,
   static pstring s;
   pstring userinfo;
   char *p;
+  char *q, *r;
   int len;
 
   server[0] = share[0] = path[0] = user[0] = password[0] = (char)0;
@@ -133,7 +134,10 @@ smbc_parse_path(const char *fname, char *server, char *share, char *path,
    * exists ...
    */
 
-  if (strchr_m(p, '@')) { 
+  /* check that '@' occurs before '/', if '/' exists at all */
+  q = strchr_m(p, '@');
+  r = strchr_m(p, '/');
+  if (q && (!r || q < r)) {
     pstring username, passwd, domain;
     char *u = userinfo;