[jcifs] Server resolution for Windows 98

Matthew Tippett matthew.tippett at sympatico.ca
Sun Nov 10 19:05:10 EST 2002


> 
> Um... It's not a "name" per. se.  It's just that it is a permitted CALLED
> NAME in the NBT Session Request.  Windows is picky about the CALLED NAME
> field (Samba is not).  So, if you are talking to Windows NT4, XP, 2k, or to
> Samba, you can use the "*SMBSERVER" name as the called name.  This is very
> useful if the user handed you a DNS name or IP address instead of a NetBIOS
> name.

I also notced it is in the CIFS spec too.  I figured if I had the 
definition wrong, I was pretty much on the right track.

> The correct wildcard name is 
> 
>   *<00><00><00><00><00><00><00><00><00><00><00><00><00><00><00>
> 
> ...which translates to:
> 
>   CKAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA

Could you explain what this 'translation is to?  It looks like it is a 
wierd hex offset from AA?

>   "*\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
>   "*               "
>   "*\0fooberrypie"
> 
> Would all be read by Samba (after encoding, sending over the wire, and
> decoding) as the same thing: "*".
> 

Doesn't that present an opportunity for some subtle bugs?  I assume that 
Andrew (know him from Australia) wouldn't just rely on language 
behaviour (NULL terminated) since the full 16 bytes have a real purpose. 
  (I would go so far as to say that it could even leave Microsoft an 
angle to break a couple of releases of Samba with (by putting a <00> 
near the start.

> On the other hand, all of the Windows systems I've tested do *not* translate
> the NBT name strings back to their original form before comparison.  So
> Windows is looking for "CKAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA".
> That's a speed hack, but it does mean that Windows is pickier.

Is the encoded form supposed to be opaque by the standard?  It would be 
interested in finding the rationale for the translation somehwere :).

> I would say your patch is correct.  If it's faster (and simpler) to define
> it as an array of bytes in encoded form then doing so might make sense. 
> I'll let Mike answer that one.  From a theoretical point of view, there's no
> need to translate it more than once.

I prefer the human readable form :) Plus it is a one line patch as is :).

> 
> Captain Pedantic -)-----
> 

Another bug defeated, I am off to bed!

Matt
-- 
Matthew Tippett - matthew.tippett at sympatico.ca - (416) 435-4118
Technology Forum - http://www.technology-forum.org/
Commercial Open Source - http://www.commercialos.org/




More information about the jcifs mailing list