name manglinig

Lang Martin lang at cross-cc.com
Fri Oct 27 15:09:33 GMT 2000


I've run into a name-mangling snag, but first a snip from the smb.conf
man page:

>This  algorithm  can  cause name collisions only if
>files in a directory  share  the  same  first  five
>alphanumeric  characters. The probability of such a
>clash is 1/1300.

This should be nixed from the docs, because it is a silly thing to say.
Possibly true if filenames are chosen randomly, but I have about 100
directories full of files with 13 character base names, the first 9
characters of which are garanteed to be the same in each directory.

We hacked the mangling algorithm to use the first 2 and last 3
characters of the base name, the magic character, and the two character
hash thingy.

Basically, I'm wondering if anyone has run into this and if it is
sensible to:
a) add a config directive that checks every mangled name
   against the stack, and thereby guarantee that every short name is unique
   (I don't even know if the the short names are stored in the stack)
b) add a directive like "Mangled Rule" that uses the regular expression
   library so mangling could be adapted to weird cases like this.

I basically don't have any idea about the relative efficiency of the
regex library and the stack-check process (although I strongly suspect
that regex would be faster).  Anyway, throwing it out there --- has
anyone messed with all this?

Lang Martin




More information about the samba-technical mailing list