[jcifs] Incorrect return from SmbFile.getUncPath()

dircha at bethel.edu dircha at bethel.edu
Tue Nov 12 19:27:57 EST 2002

I am using jcifs-0.7.0b7.jar (and also found this error in 0b6).

I use jcifs.smb.SmbFile.getUncPath() to create a corresponding java.io.File
object. The problem is that in the return value the share name is dropped.

Given an SmbFile constructed with this string:
"smb://BG/SharedDocs/My Music/" where BG is a computer on the network,

SmbFile.getUncPath() is returning "\\BG\My Music\".

I believe the error is on line 689 of jcifs.smb.SmbFile.java in the
getUncPath0() method. The share name is extracted to the member "share", but
then the value assigned to the member "unc" begins at the '/' after the share
name. The incorrect value in "unc" is then returned to the caller (getUncPath()).

--Chad Dirks

More information about the jcifs mailing list