[jcifs] URL not correctly parsed if password contains number sign ('#')

Guertler Mario m.guertler at znt.de
Thu Feb 4 14:12:03 UTC 2016


Hi all,

I think I found a bug in your implementation. We are using JCIFS in many applications successfully, but if the number sign ('#') is used in password then we get problems.
I already figured out where the problem is; the passed URL string of constructor 'public SmbFile(String url)' is not correctly parsed.

The following code:

String connectString ="smb://user:passwort#123456789@host/share/Test/";
SmbFile polledFile = new SmbFile(connectString);

Results in following field variables of class SmbFile or better of class URL

authority             "user:test#123456789 at host"
file                         "#123456789 at host/share/Test/"
path                      "#123456789 at host/share/Test/"
protocol              "smb"
userInfo              "user:test#123456789"

So you can see that the file/path is not correct und the access to this file will fail because it does not exist.

Mit freundlichem Gruß / Best regards

Mario Gürtler
Senior Engineer

znt Zentren für Neue Technologien GmbH
Institut Dresden
Am Brauhaus 12
D-01099 Dresden

Hauptverwaltung und Sitz: Lena-Christ-Str. 2, 82031 Grünwald, Amtsgericht München HRB 179019
Geschäftsführer: Bernhard Marsoner, Ulrike Birnstiel
Prokuristen: Hans Mayer, Gerhard Schrottshamer

Office:   +49 351 652 480-20
Mobile:
Fax:      +49 351 652 480-29
E-Mail:   m.guertler at znt.de
Web:     http://www.znt-richter.com<http://www.znt-richter.com/>

[http://www.znt-richter.com/mlogos/logo.jpg]
Munich | Burghausen | Dresden | Villach/Austria | Singapore | Penang/Malaysia | San Francisco/USA

Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese E-Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail ist nicht gestattet.
This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorised copying, disclosure or distribution of the material in this e-mail is strictly forbidden.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.samba.org/pipermail/jcifs/attachments/20160204/e885f5bf/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.jpg
Type: image/jpeg
Size: 2397 bytes
Desc: image001.jpg
URL: <http://lists.samba.org/pipermail/jcifs/attachments/20160204/e885f5bf/image001.jpg>


More information about the jCIFS mailing list