[prev in list] [next in list] [prev in thread] [next in thread]
List: samba-technical
Subject: Re: Possible incorrect error mapping ...
From: Andrew Bartlett <abartlet () samba ! org>
Date: 2004-04-28 22:41:31
Message-ID: 1083192091.4244.3310.camel () piglett ! bartlett ! house
[Download RAW message or body]
On Thu, 2004-04-29 at 03:16, Richard Sharpe wrote:
> 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?
Well, there are two issues here:
The first is that our mapping from DOS -> NTSTATUS error codes is not
the best (the only mapping that we know is accurate is the NTSTATUS ->
DOS mapping, because it was extracted over-the-wire from a windows
server).
The second issue is that we should have NTSTATUS error returns in the
code, and translate to DOS only if the client is dos-only.
When forcing DOS error codes, what does win2k reply with? If it is
DOS,ERRnoaccess then things are fine, otherwise we need to use
ERROR_BOTH() and figure out why that case is weird...
Andrew Bartlett
--
Andrew Bartlett abartlet@pcug.org.au
Manager, Authentication Subsystems, Samba Team abartlet@samba.org
Student Network Administrator, Hawker College abartlet@hawkerc.net
http://samba.org http://build.samba.org http://hawkerc.net
["signature.asc" (application/pgp-signature)]
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic