CVS update: samba/source

Jeremy Allison jra at samba.anu.edu.au
Tue Dec 23 13:21:38 EST 1997


Date:	Tuesday December 23, 1997 @ 13:21
Author:	jra

Update of /data/cvs/samba/source
In directory samba:/tmp/cvs-serv553

Modified Files:
	server.c 
Log Message:
Fixed nastly little bug where client was sending open_and_X call
with smb_mode (smb_vwv[3]) of 0x20 == DENY_WRITE + read-only-open.
and smb_ofun (smb_vwv[8]) of 0x11 == Create if not exist plus append
on a read-only share.

This was mapped into the strange unix flags of (O_RDONLY|O_CREAT)
- essentially O_CREAT as O_RDONLY == 0.

We were checking the unix flags directly against O_RDONLY instead
of masking off the open mode flag bits before doing the comparison,
so this open was being refused even though it was valid on a
read-only share.

Also ensured that the O_CREAT bit was masked out of the flags
bit if the open was done on a read-only share (as doing a unix
open( filename, O_RDONLY|O_CREAT, xxx) will create a zero length
file if the user had permission to write into the directory - which
should be denied on a read-only share.

Thanks to Mark Peek @ Whistle for giving me this test case.

Jeremy.



More information about the samba-cvs mailing list