Interaction of share modes and file permissions

jra at dp.samba.org jra at dp.samba.org
Thu Feb 6 17:57:25 GMT 2003


On Thu, Feb 06, 2003 at 02:26:25PM +0000, Neil Hoggarth wrote:
> Consider a file with ownership and mode such that a client has
> read-only permission on that file.
> 
> Suppose that this file is open read-only by second client, with a
> share mode of DENY_WRITE.
> 
> If the first client attempts to open the file read-write then a question
> arises: what is the appropriate response by the server? There are
> multiple reasons why the open should fail ("access denied" and "share
> mode violation"), but the response to the Open AndX request only allows
> for one reason to be communicated back to the client (I think ...).
> 
> I raise this issue because Samba (v2.2.7 on Solaris) appears to respond
> to this circumstance differently than a Windows 2000 system does - Samba
> reports the share mode problem, whereas Windows reports "access denied".

Ok, we treat this as a bug. We need to give the same error codes as
W2K as far ar humanly possible.

> I stumbled across this distinction when trying to diagnose a problem
> with a Windows application called Endnote, which is an academic
> reference manager. The application responds differently depending on
> which error code it gets - as a result, multiple readers can
> simultaneously open an Endnote reference library read-only if it is
> stored on Windows share, but only one reader at a time can open the
> same file if it is stored on a Samba share.
> 
> The fact that the app tries a read-only open on the file if it gets
> "permission denied" but doesn't if it encounters a share mode problem
> is arguably a misfeature of the app, and Samba's choice about how to
> handle the situation seems just as valid as Windows', but I thought
> that I'd highlight the difference in case the team think it is worth
> "correcting" Samba to make it ape a Windows server more closely.
> 
> I have network packet captures which I think illustrate the difference
> between Windows and Samba, which I can provide if anyone is interested

Yes please, I would love to see the ethereal capture traces. If you can
get them to me asap I'll make sure it gets fixed for 2.2.8.

Thanks,

	Jeremy.


More information about the samba-technical mailing list