NWFS mangled name algorithm.

John E. Malmberg wb8tyw at qsl.net
Tue Mar 28 14:49:04 GMT 2000


From: Gerald Carter <cartegw at Eng.Auburn.EDU>

> Jeremy Allison wrote:
> >
> > Andrew, any comments on changing to one of these in Samba
> > instead of the (rather crappy:-) str_checksum() function ?
>
> Just a comment here.  Every time the filename mangling
> code changes to produce a different name, it is possible
> to break PIF file shortcuts under Windows 9x.  I noticed
> this between 2.0.3 and 2.0.6.  Only affects PIF files
> to DOS programs whose filenames are not 8.3 compliant
> obviously.  Most often occurs when a batch file uses a LFN.
>
It will not help much.

The only way not to break things is to do like M$soft does and store the
mangled short filename as an attribute of the file.

This of course presents it's own problems, as the native operating system
does not know about it to update it when the file is renamed.

That is assuming the  underlying file system has a place such an attribute
could be stored.

This problem exists even in a pure M$soft environment.  Each time you change
a long file name it recalculates the short name.  Different revisions of
Windose 9x and Windows NT use different mangling algorithms.

There is also no guarantee that a specific short name will be available when
it is being calculated.

The only reason this problem appears less frequently in a pure Microsoft is
that the short file name is an attribute of the file.  In fact, it seems
that the short file name is the true name of the file, and the long file
name is the attribute.

One user that I know of, managed to create two directories with the name
"Delete me test" on an NT share.  The 8.3 filenames were unique, but the
long file names were identical, including case!  The only way to delete the
directory was from a DOS cmd window using the 8.3 short name.

-John
wb8tyw at qsl.net



More information about the samba-technical mailing list