1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-13 13:18:06 +03:00
samba-mirror/source3/rpc_server
Jeremy Allison 6259f51dd9 This is a *big* checkin that may break some things, but implements the
new open mechanism Andrew & I discussed.

config.sub:
configure: Included the QNX patch.

include/vfs.h:
smbd/vfs-wrap.c:
smbd/vfs.c: Added ftruncate vfs call (needed).

Note that we will also need locking calls in the vfs (to be added).

lib/util_unistr.c:
nmbd/nmbd_processlogon.c: Fix for NT domain logons causing nmbd to core dump.
                          Also fix for sidsize DOS bug.

locking/locking.c: Check value of ret before using it for memdup.

printing/printing.c: Convert print_fsp_open to return an allocated fsp.

rpc_server/srv_lsa.c: Fix for NT domain logons.

I have removed all use of lp_share_modes() from the code (although I
left the parameter in the table for backwards compatibility). It no longer makes
sense for this to exist.

smbd/close.c: Removed lp_share_modes().
smbd/fileio.c: Fixed parameters to unlock_share_entry call in panic code.
smbd/files.c: Correctly set the unix_ERR_code to ERRnofids on fsp allocation fail.

smbd/nttrans.c:
smbd/reply.c:
smbd/trans2.c: Changed all occurrences of open_file_shared/open_directory/
               open_file_stat to return an fsp from the call.

smbd/open.c: Changed all occurrences of open_file_shared/open_directory/
             open_file_stat to return an fsp from the call.

In addition I have fixed a long standing race condition in the deny mode
processing w.r.t. two smbd's creating a file. Andrew, please note that
your original idea of using open with O_EXCL in this case would not work
(I went over the races very carefully) and so we must re-check deny modes
*after* the open() call returns. This is because there is a race between
the open with O_EXCL and the lock of the share mode entry. Imagine the
case where the first smbd does the open with O_EXCL and a deny mode of DENY_ALL,
but is pre-empted before it locks the share modes and creates the deny
mode entry for DENY_ALL. A second smbd could then come in with O_RDONLY
and a deny mode of DENY_NONE and the two opens would be allowed.

The *only* way to fix this race is to lock the share modes after the
open and then do the deny mode checks *after* this lock in the case
where the file did not originally exist.

This code will need extensive testing but seems to initially work.

Jeremy.
(This used to be commit ab0ecc39d6)
2000-04-22 00:33:16 +00:00
..
.cvsignore get away with dummy and .dummy files 1998-09-29 04:52:17 +00:00
srv_lookup.c Snuck in some whitespace cleanup while I was visiting these files. (-: 2000-04-04 00:36:19 +00:00
srv_lsa_hnd.c Snuck in some whitespace cleanup while I was visiting these files. (-: 2000-04-04 00:36:19 +00:00
srv_lsa.c This is a *big* checkin that may break some things, but implements the 2000-04-22 00:33:16 +00:00
srv_netlog.c finally got sick of the "extern int Client" code and the stupid 2000-04-11 13:55:53 +00:00
srv_pipe_hnd.c IRIX include fixes. 2000-03-31 20:44:55 +00:00
srv_pipe.c Sync up with 2.0.7 w.r.t. guest users. 2000-04-18 21:23:26 +00:00
srv_reg.c Removed unused parameter vuid from rpc_server api_* calls. For the very few 2000-04-04 00:35:34 +00:00
srv_samr.c got rid of FILE* in the unix name mapping code 2000-04-16 09:42:09 +00:00
srv_spoolss_nt.c - put the job status in english not french! 2000-04-16 07:28:06 +00:00
srv_spoolss.c Modified interfaces and added checks around *all* *alloc calls 2000-04-06 22:48:53 +00:00
srv_srvsvc.c Removed unused parameter vuid from rpc_server api_* calls. For the very few 2000-04-04 00:35:34 +00:00
srv_util.c Snuck in some whitespace cleanup while I was visiting these files. (-: 2000-04-04 00:36:19 +00:00
srv_wkssvc.c Removed unused parameter vuid from rpc_server api_* calls. For the very few 2000-04-04 00:35:34 +00:00