mangling scheme

Simo Sorce simo.sorce at xsec.it
Mon Sep 9 07:28:00 GMT 2002


On Mon, 2002-09-09 at 08:33, Lucas Correia Villa Real wrote:
> Hi,
> 
> Recently I did find a little trouble in a program: it creates links
> to the most recently used files, but using the not-so-'default' Win9X
> mangling scheme, that is, 'program files' becomes 'progra~1' and not
> 'progr~-1'.

This seem to me the correct behaviour, why do you think it should be
progr~1 ?

> I did a search over the samba archives and noticed some patches and 
> discussions about performance and even about non-compliance between 
> Win9x and WinNT mangling methods. Is there a working* patch to do 
> that kind of stuff? If not, can someone point me to the algorithms
> used by Win9X/NT to do that? Will such a patch be welcome by Samba?

I extendedly tested the w2k alghorithms, that I suppose are the same as
NT, and they seem to use the 6chars+~1 through ~5 and then they start to
produce a poor hash based name like prA9BF~1 that is clearly a 2 bytes
lenght hex representation. The exact alghorithm is not known to me, but
we tested that it is really poor and prone to lot of name collisions.
We implemented a new mangling alghorithm for HEAD called hash2 that is
pretty good. Look at smbd/mangle_hash2.c if you are curious.

About patches they are always welcome, but to be accepted they need to
address a real problem and get it the right way, what do you have in
mind exactly?

> Thanks in advance,
> Lucas
> 
> * performance is not a problem in my target network, so anything will
> be really welcome :)

I have some code for a tdb based persistent mangling db that could help
but it is not ready yet and broken in little pieces part of new code and
part of code from an older not very good implementation.

Simo.

-- 
Simo Sorce - simo.sorce at xsec.it
Xsec s.r.l.
via Durando 10 Ed. G - 20158 - Milano
tel. +39 02 2399 7130 - fax: +39 02 700 442 399
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 232 bytes
Desc: This is a digitally signed message part
Url : http://lists.samba.org/archive/samba-technical/attachments/20020909/d4323e9d/attachment.bin


More information about the samba-technical mailing list