Possible incorrect error mapping ...

Richard Sharpe rsharpe at richardsharpe.com
Wed Apr 28 17:16:12 GMT 2004


Hi,

In looking at some smborture DENY1 problems, I noticed that we seem to be 
returning the wrong value if the client opens a file without asking for 
WRITE access, and then try to write the file.

In reply_write_and_X we use the CHECK_WRITE macro, which translates into:

#define CHECK_WRITE(fsp) if (!(fsp)->can_write) \
                                return(ERROR_DOS(ERRDOS,ERRbadaccess))

This eventually calls dos_to_ntstatus, which uses this entry:

        {ERRDOS,        ERRbadaccess,   NT_STATUS_INVALID_LOCK_SEQUENCE},

and we see NT_STATUS_INVALID_LOCK_SEQUENCE on the wire, however, Win2K 
returns NT_STATUS_ACCESS_DENIED (which seems vastly more reasonable).

The question, of course, is, are there circumstances when ERRbadaccess 
should map to NT_STATUS_INVALID_LOCK_SEQUENCE, or is the code just wrong 
at the moment?
 
Regards
-----
Richard Sharpe, rsharpe[at]richardsharpe.com, rsharpe[at]samba.org, 
sharpe[at]ethereal.com, http://www.richardsharpe.com




More information about the samba-technical mailing list