[jcifs] jCIFS error code handling.

Christopher R. Hertel crh at ubiqx.mn.org
Fri Jul 12 15:19:31 EST 2002

On Fri, Jul 12, 2002 at 01:04:58AM -0400, Allen, Michael B (RSCH) wrote:
> 	I suspect they're both *supposed* to work but if the client says it's sending
> 	NTSTATUS code and it asks for DOS that might be asking too much (just
> 	a guess though).

I don't think that the two code types are agreeable...  I suppose you 
could handle DOS codes in one exchange and NTSTATUS in the next, as long 
as the flag or capabilities bits are being set correctly.

> > Some things about the error codes...
> > 
> > - From what I've been told, in some cases W/NT and W2K will ignore
> >   the flags2 or capabilities flag and send NTSTATUS codes when they 
> >   shouldn't.  Have you ever seen this?
> > 
> 	No. I haven't done any  work on NTSTATUS codes. DOS codes are the
> 	common denominator so you really have to support them anyway.

Except for systems that expect NTSTATUS when doing more advanced SMBs...

> > - The other potential problem is that Windows servers will assume, based 
> >   on the client's use of DOS codes, that the latter is not capable of some
> >   extended security negotiations (and possibly other features).
> > 
> > - I've been shown a neat little trick for creating a list of 32-bit 
> >   NTSTATUS codes.  It's Tridge's handiwork.  I'll be adding the details to 
> >   my book over the weekend.
> > 
> 	Ooo, lemmy guess; run strings on a dll to generate a peice of Win32 c
> 	code that prints them?

That was my idea, but a better way to do it is to modify Samba so that it 
always returns an error code when you try to delete a file (or somesuch).
Then send filenames like "FOO.0xC0000005", and let the hacked code read 
out the hex string... and put it into the status field.  Run a batch job
from DOS to delete the filenames in sequence.  DOS will dutifully format 
the returned error and tell you what the code means.

> > That's all just random thoughts.  I'm looking for comments and any other
> > wisdom regarding handling of errors.
> > 
> 	It would be very nice if you colloect and sort out this information.

That's my goal.

Chris -)-----

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 jcifs mailing list