summaryrefslogtreecommitdiffstats
path: root/source/smbd/oplock.c
Commit message (Collapse)AuthorAgeFilesLines
* Fix for interesting resource constraint condition. When all opens areJeremy Allison2003-01-301-15/+18
| | | | | | | | | | level 2 and a request for open with no oplock is received then the smbd should send *synchronous* break messages, not asynchronous, otherwise it spins very rapidly, releasing the lock, sending the 'break to none' messages and then re-acquiring the lock before any other process has a chance to get the lock and remove it's own oplock (at least on linux). Jeremy.
* Overly complex but neccessary fix for kernel oplock problems. The issueJeremy Allison2002-06-061-0/+10
| | | | | | | | | | | | | | | is that there are some times when we should return an EINTR from a select, some times when we should not. As we can take a signal at any time, we have to eat EINTR's in some selects. This means we need to check for kernel oplock breaks more often in the main loop, as well as add the queuing mechanism needed for the changenotify code (due to the mistake in understanding POSIX semantics w.r.t. setting a signal mask in a signal handler). This code now passes all my tests. However, (and IMHO and I know tridge disagrees) - the correct way to fix this is to run with RT signals blocked and explicitly unblock them just before the main select, block them after and then process them all in one place. Just my 2cents :-). Jeremy.
* If we don't do the select don't do the recvfrom.Jeremy Allison2002-05-241-0/+1
| | | | Jeremy.
* Fixed silly typo that causes receive_local_message to loop - caused byJeremy Allison2002-05-241-1/+1
| | | | | my removal of the goto. Oops ! Jeremy.
* Merge of bugfixes from 2.2.Jeremy Allison2002-05-221-5/+5
| | | | Jeremy.
* Fix for strangeness in Linux 2.0.x select return.Jeremy Allison2002-05-221-0/+14
| | | | Jeremy.
* Remove horrid goto.Jeremy Allison2002-05-221-10/+5
| | | | Jeremy.
* Merge of receive_local_message fix from 2.2.5.Jeremy Allison2002-05-221-20/+16
| | | | Jeremy.
* Tricky fix. If we were waiting for an oplock break response message fromJeremy Allison2002-05-211-0/+11
| | | | | | | | another smbd and an incoming SIGUSR1 message arrived we'd break out of the wait early - as we have to use sys_select() to wait for an oplock response message, not sys_select_intr() (which ignores EINTR errors) because of the real time signal kernel interface. Jeremy.
* Merge from 2.2.Jeremy Allison2002-05-201-1/+1
| | | | Jeremy.
* Fixed sendto in oplock code.Jeremy Allison2002-04-191-2/+2
| | | | Jeremy.
* Fix oplock recvfrom.Jeremy Allison2002-04-191-1/+1
| | | | Jeremy.
* This split the mangling code up to allow for the possibility of multipleAndrew Tridgell2002-04-111-0/+2
| | | | | | mangling implementation, selectable using "mangling method = " in smb.conf It also tidies the interface a little, although it is still nasty.
* Get the current directory after becoming root.Jeremy Allison2002-03-141-1/+1
| | | | Jeremy.
* Fix from Michael Steffens <michael_steffens@hp.com> to make signalJeremy Allison2002-01-311-1/+1
| | | | | | processing work correctly in winbindd. This is a really good patch that gives full select semantics to the Samba modified select. Jeremy.
* Removed version number from file header.Tim Potter2002-01-301-2/+1
| | | | Changed "SMB/Netbios" to "SMB/CIFS" in file header.
* Don't put a \n on the end of the arg to exit_server()Tim Potter2001-11-051-2/+2
|
* IRIX compiler dies not like casts in macro argsHerb Lewis2001-10-231-1/+1
|
* Move from timestamp to gen count file id's for finding oplocked filesJeremy Allison2001-10-201-835/+784
| | | | | in a tdb. Jeremy.
* Merge the become_XXX -> change_to_XXX fixes from 2.2.2 to HEAD.Jeremy Allison2001-10-181-2/+2
| | | | | Ensure make_conection() can only be called as root. Jeremy.
* Removed 'extern int DEBUGLEVEL' as it is now in the smb.h header.Tim Potter2001-10-021-2/+0
|
* move to SAFE_FREE()Simo Sorce2001-09-171-6/+4
|
* Fix I think for the fcntl spinning problem. Re-prioritize soJeremy Allison2001-09-051-0/+14
| | | | | that oplock break messages get priority over incoming client messages. Jeremy.
* Fixes to ensure invalid vuids cannot stop oplock breaks.Jeremy Allison2001-09-041-5/+7
| | | | | This may have bearing on the Solaris fcntl spin bug. Jeremy.
* Fixed the (incorrect) paranioa fix I put in for the fcntl lock spin.Jeremy Allison2001-08-221-2/+12
| | | | | | Don't delete a share mode that failed to remove the oplock (doh!), just set the oplock entry to zero.... Jeremy.
* This is Jeremy pretending to be Volker, 'cos theVolker Lendecke2001-08-211-0/+13
| | | | | | | | | | | | | | | | | link from Seattle is having problems. I've added 3 things here to work on the fcntl spin problem. 1). Check *all* tdb return codes... :-). 2). If we're asking ourselves to break an oplock, and we can't find a fsp pointer that matches the entry, this is a *logic bug* and we should abort and panic so someone with gdb can pick up the pieces. 3). After we've broken an oplock, ensure that the entry itself has been removed, and if not remove it ourselves. This should not be neccessary in a correctly working environmen,t, but will provide an added layer of robustness in error situations. 4). I hate german keyboards :-) :-). Jeremy.
* fixed usage of socklen_t and also tidied up SIG_ATOMIC_T, using a typedef ↵Andrew Tridgell2001-06-251-1/+1
| | | | instead of a define
* *Wonderful* patch from Andrew Bartlett that will help ensure tdb's areJeremy Allison2001-06-091-2/+4
| | | | | cleaned on clients abending connections. Thanks Andrew ! Jeremy.
* Fixup the large_writex problem (a large_writex can send a full 64k of data,Jeremy Allison2001-05-241-2/+2
| | | | | we already have space for this we just need to understand the length correctly). Jeremy.
* Merge of new 2.2 code into HEAD (Gerald I hate you :-) :-). Allows new SAMRJeremy Allison2001-03-111-6/+0
| | | | | | RPC code to merge with new passdb code. Currently rpcclient doesn't compile. I'm working on it... Jeremy.
* Fix inspited by Alan Romeril. 50% speedup in domain logins with thisJeremy Allison2001-01-301-0/+3
| | | | | change to default break response time of 10ms -> 0ms. Jeremy.
* Ok - fixed a bug in our levelII oplock code. We need to break a level II onJeremy Allison2000-11-161-4/+95
| | | | | | | | | a byte range lock (write lock only, but Win2k breaks on read lock also so I do the same) - if you think about why, this is obvious. Also fixed our client code to do level II oplocks, if requested, and fixed the code where we would assume the client wanted level II if it advertised itself as being level II capable - it may not want that. Jeremy.
* Restructuring of the code to remove dos_ChDir/dos_GetWd and re-vector themJeremy Allison2000-09-271-2/+2
| | | | | | | through the VFS. All file access/directory access code in smbd should now go via the vfs. Added vfs_chown/vfs_chmod calls. Still looking at vfs_get_nt_acl() vfs_set_nt_acl() call API design. Jeremy.
* totally rewrote the async signal, notification and oplock notificationAndrew Tridgell2000-06-121-26/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | handling in Samba. This was needed due to several limitations and races in the previous code - as a side effect the new code is much cleaner :) in summary: - changed sys_select() to avoid a signal/select race condition. It is a rare race but once we have signals doing notification and oplocks it is important. - changed our main processing loop to take advantage of the new sys_select semantics - split the notify code into implementaion dependent and general parts. Added the following structure that defines an implementation: struct cnotify_fns { void * (*register_notify)(connection_struct *conn, char *path, uint32 flags); BOOL (*check_notify)(connection_struct *conn, uint16 vuid, char *path, uint32 flags, void *data, time_t t); void (*remove_notify)(void *data); }; then I wrote two implementations, one using hash/poll (like our old code) and the other using the new Linux kernel change notify. It should be easy to add other change notify implementations by creating a sructure of the above type. - fixed a bug in change notify where we were returning the wrong error code. - rewrote the core change notify code to be much simpler - moved to real-time signals for leases and change notify Amazingly, it all seems to work. I was very surprised!
* Linux kernel oplocks now seem to work, but need a _lot_ of testingAndrew Tridgell2000-06-111-0/+9
| | | | | I had to modify sys_select() to not loop on EINTR. I added a wrapper called sys_select_intr() which gives the old behaviour.
* a first pass at Linux kernel oplocks supportAndrew Tridgell2000-06-101-13/+0
|
* continued the split of the kernel level oplocks code into a moreAndrew Tridgell2000-06-101-377/+122
| | | | | modular form. In this pass I added oplock_irix.c and added a "struct kernel_oplocks" that describes a kernel oplock implementation.
* clean up oplock capability code ready for Linux codeAndrew Tridgell2000-06-091-152/+149
|
* split some of the irix kernel oplocks code into a functionAndrew Tridgell2000-06-091-68/+74
|
* - changed HAVE_KERNEL_OPLOCKS to HAVE_KERNEL_OPLOCKS_IRIXAndrew Tridgell2000-06-081-14/+14
| | | | - added autoconf test for HAVE_KERNEL_OPLOCKS_LINUX
* more merging voodooAndrew Tridgell2000-05-101-0/+4
| | | | | | this adds "#define OLD_NTDOMAIN 1" in lots of places. Don't panic - this isn't permanent, it should go after another few merge steps have been done
* Added sys_fork() and sys_getpid() functions to stop the overheadJeremy Allison2000-05-021-3/+3
| | | | | of doing a system call every time we want to just get our pid. Jeremy.
* Now that fsp's are created on successful file open, the structure memberJeremy Allison2000-04-241-2/+2
| | | | | | | | | | | | fsp->open is no longer needed (if an fsp pointer is valid, then it's open :-). NB for Luke, this patch also did not apply to TNG. TNG is not yet identical w.r.t file serving with HEAD. This makes it impossible for me to help maintain TNG. Please fix asap. lib/substitute.c: Removed unused variable (pidstr). Jeremy.
* finally got sick of the "extern int Client" code and the stupidAndrew Tridgell2000-04-111-7/+3
| | | | | | | | | | | | | | | | assumption that we have one socket everywhere while doing so I discovered a few bugs! 1) the clientgen session retarget code if used from smbd or nmbd would cause a crash as it called close_sockets() which closed our main socket! fixed by removing close_sockets() completely - it is unnecessary 2) the caching in client_addr() and client_name() was bogus - it could easily get fooled and give the wrong result. fixed. 3) the retarget could could recurse, allowing an easy denial of service attack on nmbd. fixed.
* the bulk of the changes to get rid of fd_ptr and move print openAndrew Tridgell2000-04-101-27/+25
| | | | | | | | | handling to printing/printing.c most of this was just replacing things like fsp->fd_ptr->fd with fsp->fd the changes in open.c are quite dramatic. Most of it is removing all the functions that handled the fd multiplexing
* converted all our existing shared memory code to use a tdb databaseAndrew Tridgell1999-12-211-8/+7
| | | | | | | | | | | | | instead of either sysv or mmap shared memory or lock files. this means we can now completely remove locking_shm.c locking_slow.c shmem.c shmem_sysv.c and lots of other things also got simpler locking.c got a bit larger, but is much better compartmentalised now
* first pass at updating head branch to be to be the same as the SAMBA_2_0 branchAndrew Tridgell1999-12-131-198/+466
|
* sys_select added one more argument (read, write selectors).Luke Leighton1999-12-011-1/+1
|
* Sync up critical kernel oplock bugfix. I don't want to loseJeremy Allison1998-12-051-4/+37
| | | | | this.... Jeremy.
* Makefile.in: Added maintainer mode fixes.Jeremy Allison1998-11-251-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | aclocal.m4: Added AC_LIBTESTFUNC. configure.in: Fixed -lsecurity -lsec problems. client.c: dos_ fixes. groupdb/aliasunix.c: Dead code removal. include/includes.h: Added default PRINTCAP_NAME. lib/genrand.c: dos_ fixes. lib/replace.c: Added strtoul. lib/system.c: dos_ fixes. lib/util.c: dos_ fixes. lib/util_sid.c: Signed/unsigned fixes. lib/util_str.c: removed bad const. locking/locking_slow.c: dos_ fixes. printing/printing.c: dos_ fixes. rpc_server/srv_samr.c: Dead code removal. rpc_server/srv_sid.c: global_myworkgroup defined with wrong size AGAIN ! smbd/dir.c: dos_ fixes. smbd/open.c: dos_ fixes. smbd/oplock.c: dos_ fixes. smbd/reply.c smbd/server.c smbd/service.c smbd/uid.c: dos_ fixes. Jeremy.