diff options
-rw-r--r-- | source3/libsmb/libsmbclient.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/source3/libsmb/libsmbclient.c b/source3/libsmb/libsmbclient.c index 9dca4637f4..6a00855bff 100644 --- a/source3/libsmb/libsmbclient.c +++ b/source3/libsmb/libsmbclient.c @@ -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; |