Bug 1301 - SAMBA_3_0 (svn) returns NT_STATUS_ACCESS_DENIED when Win2K returns NT_STATUS_SHARING_VIOLATION
SAMBA_3_0 (svn) returns NT_STATUS_ACCESS_DENIED when Win2K returns NT_STATUS_...
Status: RESOLVED WORKSFORME
Product: Samba 3.0
Classification: Unclassified
Component: File Services
3.0.0preX
Other other
: P3 normal
: none
Assigned To: Richard Sharpe
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2004-04-28 11:23 UTC by Richard Sharpe
Modified: 2005-02-07 08:07 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Richard Sharpe 2004-04-28 11:23:12 UTC
In looking at some smbtorture DENY1 tests, I noticed that Samba returns
NT_STATUS_ACCESS_DENIED when Win2K returns NT_STATUS_SHARING_VIOLATION.

This happens when a file is opened and then opened again with an OpenX call
where DENY=ALL is specified.

The problem is that open_file_shared returns NULL (or False) if it could not
open the file, and we get no idea why the file could not be opened when we try
to handle the problem in reply_open_and_X (or anywhere else).

A couple of solutions suggest themselves:

1. Allow file_open_shared1 to handle the error it self and generate the error
response, or

2. Have file_open_shared and file_open_shared1 return an error status that can
be used by callers to give better error returns.
Comment 1 Richard Sharpe 2004-05-05 09:46:02 UTC
Since we now have an internal bug logged to fix this problem, I was
thinking of making the following changes ...

1. Change open_file_shared and open_file_shared1 to return an NT_STATUS
result.

2. Change all the returns in open_file_shared1 to STATUS_ACCESS_DENIED
except for those cases where ENOMEM or SHARING_VIOLATION applies.

3. Change the functions that call open_file_shared to map the status
returned as needed and plug it into the response.

Do we have any dissent?

Comment 2 Richard Sharpe 2004-05-14 09:13:57 UTC
OK, it seems that the fix can be simpler than that, since there is already a
mechanism for providing explicit error returns there.

At the bottom of the loop that deals with share mode violations, add something like:

                        unix_ERR_class = ERRDOS;
                        unix_ERR_code = ERRbadshare;
                        unix_ERR_ntstatus = NT_STATUS_SHARING_VIOLATION;

just before the 'return NULL;'
Comment 3 Gerald (Jerry) Carter 2004-11-11 13:47:18 UTC
is this fixed?
Comment 4 Gerald (Jerry) Carter 2005-02-07 08:07:47 UTC
closing.  no response from richard.