[jcifs] Long Sharenames

Christopher R. Hertel crh at ubiqx.mn.org
Fri Jul 23 16:36:15 GMT 2004


On Fri, Jul 23, 2004 at 07:18:16AM -0400, Eric Glass wrote:
> > 
> > I can see all shares on all servers of my network, except those whose names
> > are 13 characters or more.
> > 
> 
> Retrieving share names > 12 characters requires support for RPC; this
> isn't yet supported in jCIFS.

This really should be in our FAQ.

Lander,

The long answer is that share names are limited to 12 characters on some
Windows systems.  This probably goes all the way back to PC-DOS.  Recall
that DOS supported file names with a maximum length of 12 characters.  
That's 8 characters, a dot ('.'), and three more characters for a total of
12.  My guess is that some fixed-length field somewhere in the OS was 
re-used to accomodate share names.

Going back to the OS/2, DOS, and LANManager days, IBM and Microsoft (not 
sure who did what) came up with a set of remote functions known as Remote 
Administration Protocol (RAP).  RAP is a bit silly in some ways, but it's 
easier to implement than MS-RPC (which came later, as part of Windows NT).

The RAP function to list share names limits the share length to 13 bytes, 
the last of which must be a nul byte.  That's where the 12 bytes come 
from.

You'll find that Win/9x clients have the same limitation.  They only send 
RAP calls (no RPC) so they can only see share names <= 12 bytes in length.

I'm not sure about W/Me and XP-Home.

Chris -)-----

-- 
"Implementing CIFS - the Common Internet FileSystem" ISBN: 013047116X
Samba Team -- http://www.samba.org/     -)-----   Christopher R. Hertel
jCIFS Team -- http://jcifs.samba.org/   -)-----   ubiqx development, uninq.
ubiqx Team -- http://www.ubiqx.org/     -)-----   crh at ubiqx.mn.org
OnLineBook -- http://ubiqx.org/cifs/    -)-----   crh at ubiqx.org


More information about the jcifs mailing list