[PATCH] Fix Name mangling in HEAD

John E. Malmberg malmberg at Encompasserve.org
Mon Mar 25 06:17:04 GMT 2002

On Mon, 25 Mar 2002, Simo Sorce wrote:

> Sorry, my mistake, windows use a little different scheme!
> averyl~1.txt
> averyl~2.txt
> averyl~3.txt
> averyl~4.txt
> averyl~5.txt
> avA4BD~1.txt
> avA4FC~1.txt
> avF3D6~1.txt
> avAB5F~1.txt
> avAB54~1.txt
> windows use a week 16 bit number as hash and put it as a hex number in
> the file name after the first 2 letters of the original name.

Which version of windows?

Windows NT and Windows 95 do not use the same name mangling scheme.  And I
do not know how many schemes there are in use by windows.

Storing mangled names in a TDB only works if SAMBA is the only way that
files in a directory get created, renameded or deleted.  Otherwise you
need some sort of scheduled tasked to resynchronize them.

But it appears that is the only portable way to permanently associate an
8.3 name with a long file name.

I suppose symlinks would be much faster than a TDB, but who wants all
those extra files to show up in a directory?  And files deleted, created,
or renamed by other than SAMBA are still a problem.

Since there is no consistency in the Windows implementations of mangled
filenames, there is no reason that SAMBA must comply with any of them,
except that once a mangled name is associated with a real file name, that
relationship must remain for the life of the real file name.

The faster the algorithm the better of course.

Is the name mangling now being done in the default VFS layer, so that if a
VFS understands how to maintain a mangled name, it can bypass the less
efficient TDB method?

wb8tyw at qsl.network
Personal Opinion Only

More information about the samba-technical mailing list