NT status/error codes instead of DOS error codes - bug 3.0.0

Christopher R. Hertel crh at ubiqx.mn.org
Sat Nov 29 23:48:43 GMT 2003


Jeremy Allison wrote:
> 
> On Fri, Nov 28, 2003 at 01:20:35PM -0800, John Kleven wrote:
> > Samba 3.0.0 bug possible - wanted to get any input
> > from developers:
> >
> > When i attach to smbd version 3.0.0 i specify in all
> > my client packets (via flags2 arg) that i do NOT
> > understand NT style error codes.
> >
> > Also, in my capabilities 32 bit int sent in session
> > setup packet -- I say that i do not speak NT style
> > error codes.
> >
> > But Samba 3.0.0 continues to send me NT codes for the
> > packets that i send.
> >
> > Here's the catch -- if the request to the smbd server
> > is succesful (i.e. a session setup login packet to
> > server) it sends me the NT success code (i.e. flags2
> > says that error codes are NT style).  BUT... when a
> > request fails, it DOES send me the DOS error code like
> > it should.
> 
> Can you please send me a capture trace of this and a debug
> level 10 from the smbd ? There is code in smbd/errors.c to
> prevent this from happening (see error_packet()). If we're
> doing this I'd like to know about it.
> 
> The flags in the client packets don't matter, it's the
> bit in the sessionsetup capabilities bit that smbd looks
> at to determine this.

My read on this is that the SessionSetup Capabilities bit is used to inform
the server what the client expects.  If the client says it cannot do NT
error codes, then the server should send only DOS codes.

The FLAGS2 bit indicates what the client or server *has done* in the given
packet, not what the client or server *can do*.  There are some odd cases in
which a Windows server will send NT error codes even though the client asked
for DOS codes.  These situations are rare (jCIFS doesn't do NT codes and has
not yet--as far as I know--excersized any of the odd cases in which Windows
will send NT codes when it shouldn't), but they do exists.

It may be that Windows is assuming that some specific SMB commands or
subcommands can only be requested by Windows clients that know how to
interpret NT error codes, so it doesn't bother to translate.

The above, of course, is specific to Windows behavior.  We shouldn't be
doing that in Samba.  Getting traces to Jeremy will help.  I'm just the
theory guy.

I've seen traces showing this kind of problem with Windows servers when
Extended Security is negotiated.  It appears that Windows assumes that a
client that can handle Extended Security can also handle NT Status.  There
are some notes in my book:  http://ubiqx.org/cifs/SMB.html
See sections 2.5.1 and 2.8.6.

Chris -)-----

-- 
"Implementing CIFS - the Common Internet FileSystem" ISBN: 013047116X
Samba Team -- http://www.samba.org/     -)-----   Christopher R. Hertel
jCIFS Team -- http://jcifs.samba.org/   -)-----   ubiqx development, uninq.
ubiqx Team -- http://www.ubiqx.org/     -)-----   crh at ubiqx.mn.org
OnLineBook -- http://ubiqx.org/cifs/    -)-----   crh at ubiqx.org



More information about the samba-technical mailing list