summaryrefslogtreecommitdiff
path: root/source3/smbd/oplock.c
AgeCommit message (Collapse)AuthorFilesLines
2001-03-11Merge of new 2.2 code into HEAD (Gerald I hate you :-) :-). Allows new SAMRJeremy Allison1-6/+0
RPC code to merge with new passdb code. Currently rpcclient doesn't compile. I'm working on it... Jeremy. (This used to be commit 0be41d5158ea4e645e93e8cd30617c038416e549)
2001-01-30Fix inspited by Alan Romeril. 50% speedup in domain logins with thisJeremy Allison1-0/+3
change to default break response time of 10ms -> 0ms. Jeremy. (This used to be commit 541c7df16fff03f98c253a46b501574cafb4469f)
2000-11-16Ok - fixed a bug in our levelII oplock code. We need to break a level II onJeremy Allison1-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. (This used to be commit 213cd0b5192307cd4b0026cae94b2f52fb1b0c02)
2000-09-27Restructuring of the code to remove dos_ChDir/dos_GetWd and re-vector themJeremy Allison1-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. (This used to be commit f96625ec124adb6e110dc54632e006b3620a962b)
2000-06-12totally rewrote the async signal, notification and oplock notificationAndrew Tridgell1-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! (This used to be commit 44766c39e0027c762bee8b33b12c621c109a3267)
2000-06-11Linux kernel oplocks now seem to work, but need a _lot_ of testingAndrew Tridgell1-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. (This used to be commit b28cc4163bc2faaa80c5782fc02c8f03c410cdeb)
2000-06-10a first pass at Linux kernel oplocks supportAndrew Tridgell1-13/+0
(This used to be commit 3253085d9883a181c04b9c9ecf7d0ccdfbcee88d)
2000-06-10continued the split of the kernel level oplocks code into a moreAndrew Tridgell1-377/+122
modular form. In this pass I added oplock_irix.c and added a "struct kernel_oplocks" that describes a kernel oplock implementation. (This used to be commit b5ceab810292602ea9a81696c20a781c16b706c2)
2000-06-09clean up oplock capability code ready for Linux codeAndrew Tridgell1-152/+149
(This used to be commit 70dcc791b45ac64fc536ef449e4e6b53b2b68fd4)
2000-06-09split some of the irix kernel oplocks code into a functionAndrew Tridgell1-68/+74
(This used to be commit 6b888d600d95e2595c3f79494edcc55e88e2980d)
2000-06-08- changed HAVE_KERNEL_OPLOCKS to HAVE_KERNEL_OPLOCKS_IRIXAndrew Tridgell1-14/+14
- added autoconf test for HAVE_KERNEL_OPLOCKS_LINUX (This used to be commit 0368f68529a9244663c199068e95d1a1d93152fa)
2000-05-10more merging voodooAndrew Tridgell1-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 (This used to be commit 92109d7b3c06f240452d39f669ecb8c9c86ab610)
2000-05-02Added sys_fork() and sys_getpid() functions to stop the overheadJeremy Allison1-3/+3
of doing a system call every time we want to just get our pid. Jeremy. (This used to be commit 148628b616b5c29ba6340d65fc3ddbcabba6e67a)
2000-04-24Now that fsp's are created on successful file open, the structure memberJeremy Allison1-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. (This used to be commit 389b700a26e8a308a0dff6fc038c38068aa0119a)
2000-04-11finally got sick of the "extern int Client" code and the stupidAndrew Tridgell1-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. (This used to be commit 5937ab14d222696e40a3fc6f0e6a536f2d7305d3)
2000-04-10the bulk of the changes to get rid of fd_ptr and move print openAndrew Tridgell1-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 (This used to be commit d1827a3648009fd0a0d165055015d9aeda7a1037)
1999-12-21converted all our existing shared memory code to use a tdb databaseAndrew Tridgell1-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 (This used to be commit e48c2d9937eea0667b8cd3332e49c06314ef31e7)
1999-12-13first pass at updating head branch to be to be the same as the SAMBA_2_0 branchAndrew Tridgell1-198/+466
(This used to be commit 453a822a76780063dff23526c35408866d0c0154)
1999-12-01sys_select added one more argument (read, write selectors).Luke Leighton1-1/+1
(This used to be commit e4d92ff9dfc51735e6932748f66a7c20b2c1cb6a)
1998-12-05Sync up critical kernel oplock bugfix. I don't want to loseJeremy Allison1-4/+37
this.... Jeremy. (This used to be commit 5287f3d19b7d8e76970f1ce1abfd95b7341434e5)
1998-11-25Makefile.in: Added maintainer mode fixes.Jeremy Allison1-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. (This used to be commit 6acb4b68f68d516e2ac3c47e500f5600d653435e)
1998-11-24Fixed oplock test path spec bug.Jeremy Allison1-1/+1
Jeremy. (This used to be commit 252dd8b8929adbdff9917395d4f8caad2d7882b2)
1998-11-18Fixed crash bug which was assuming that fd_ptr was always non-nullJeremy Allison1-1/+1
(which is not the case with open directories). Jeremy. (This used to be commit c154b1601f5891d664fc538ec8874fa8ef2061e6)
1998-11-17Added the same open()/fopen()/creat()/mmap() -> sys_XXX calls.Jeremy Allison1-1/+1
Tidied up some of the mess (no other word for it). Still doesn't compile cleanly. There are calls with incorrect parameters that don't seem to be doing the right thing. This code still needs surgery :-(. Jeremy. (This used to be commit 18ff93a9abbf68ee8c59c0af3e57c63e4a015dac)
1998-11-16Makefile.in: Re-added quotes round ROFF call for DGUX.Jeremy Allison1-2/+1
script/installman.sh: Make installman ignore ROFF argument if it is "". smbd/oplock.c: Move location of oplock test file to lockdir. Jeremy. (This used to be commit 6c25a3314243997508b0b2da4bfa10bb979e9c10)
1998-11-16O_EXCL fixes for printing files & oplocks.Jeremy Allison1-1/+1
Jeremy. (This used to be commit 4ca71c90985b1c88d92bdd0f9079a4afc263dc46)
1998-11-13Makefile.in configure configure.in include/config.h.in: Changes for DGUX and ↵Jeremy Allison1-1/+1
UNIXWARE. groupdb/aliasdb.c groupdb/aliasfile.c groupdb/groupfile.c: Don't use snprinf, use slprintf. include/includes.h: Fix YP problem. include/smb.h: Fix ZERO_STRUCTP. lib/util_sock.c: Added strerror() in debugs. passdb/ldap.c: Don't use snprinf, use slprintf. rpc_client/cli_lsarpc.c rpc_client/cli_pipe.c rpc_parse/parse_sec.c rpc_server/srv_pipe.c: Don't use snprinf, use slprintf. script/installman.sh: DGUX changes. smbd/open.c smbd/oplock.c: Fixed gcc warnings. web/swat.c: Changes USER to SWAT_USER. (This used to be commit 4c2b5a00983501e5d4aad1456ba8b5ab0dfd9b4c)
1998-10-21at the interop Isaac (at least I _think_ it was Isaac) said that if aAndrew Tridgell1-1/+14
MS client doesn't respond to a oplock break request then we might try resending the request. This morning Sues Win95 machine had this problem (thus forcing me to do something about it!). When starting winword her box refused to answer an oplock break request. I have added code to resend the oplock break request up to 3 times at 10 second intervals before killing the socket. of course, as soon as I did this her box started to behave again so I haven't been able to tell if this fix actually works, but it can't be worse than dropping the socket immediately. (This used to be commit a1c4d8351b9171416693e6d7a9045bdce9217edb)
1998-10-15config: Fix crypt prototype on RedHat Linux.Jeremy Allison1-1/+1
include/includes.h: Fix crypt prototype on RedHat Linux. smbd/fileio.c: Fix mmap bug found by WinCE client. smbd/ipc.c: Fix WinCE wierdness with pipes being opened as \server\pipe\lanman smbd/password.c: Fix encrypted null passwords. Jeremy. (This used to be commit 475992730c0ecbf31c09b3518df2f0354cec61da)
1998-10-14more warnings...Luke Leighton1-1/+1
(This used to be commit 8b9c0bad889d4f26987d87c54b4d8bf102af1744)
1998-09-30libsmb/clientgen.c: Fixed signed/unsigned compile warnings spotted by Herb.Jeremy Allison1-2/+4
param/loadparm.c: smbd/oplock.c: Allow kernel oplocks to be turned off in the smb.conf file. smbd/server.c: Move init_structs() to after the smb.conf file is loaded - preparation for making a "max open files" parameter. Jeremy. (This used to be commit 6a261517a09b005f502a37941431308fa8bf2c5c)
1998-09-28Changes to test in configure if capabilities are enabled on a system.Jeremy Allison1-2/+2
Changes to get Samba to compile cleanly with the IRIX compiler with the options : -fullwarn -woff 1209,1174 (the -woff options are to turn off warnings about unused function parameters and controlling loop expressions being constants). Split prototype generation as we hit a limit in IRIX nawk. Removed "." code in smbd/filename.c (yet again :-). Jeremy. (This used to be commit e0567433bd72aec17bf5a54cc292701095d25f09)
1998-09-25Makefile.in: Fixed bug with continuation line causing proto to fail.Jeremy Allison1-34/+12
Added $(PROGS) $(SPROGS) as targets for make clean. acconfig.h: Added HAVE_IRIX_SPECIFIC_CAPABILITIES. configure.in: Added sys/capability.h header check. Added function checks for srandom random srand rand. Added HAVE_IRIX_SPECIFIC_CAPABILITIES test. includes.h: Added #include <sys/capability.h>. ntdomain.h: Moved struct acct_info into here from smb.h smb.h: Added KERNEL_OPLOCK_CAPABILITY define. Moved enum action_type into rpcclient.h Moved struct cli_state into client.h Moved struct nt_client_info, struct tar_client_info, struct client_info into rpcclient.h lib/genrand.c: Changed to use sys_random() & friends. lib/smbrun.c: Lose capabilities after fork. lib/system.c: Added set_process_capability(), set_inherited_process_capability() sys_random(), sys_srandom(). lib/util.c: Added Ander's EFBIG lock check to fcntl_lock for 64 bit access to an 32 bit mounted NFS filesystem. nmbd/nmbd.c: Changed to use sys_random() & friends. nmbd/nmbd_browsesync.c: Changed to use sys_random() & friends. passdb/ldap.c: Missed one pdb_encode_acct_ctrl call. passdb/passdb.c: Changed to Ander's code for ' ' characters. passdb/smbpass.c: Added Ander's code to reset ACB_PWNOTREQ. script/mkproto.awk: Added 'long' to prototypes. smbd/chgpasswd.c: Lose capabilities after fork. smbd/open.c: Do the mmap *after* the kernel oplock. smbd/oplock.c: Removed stub code from kernel oplock path. Added set_process_capability(), set_inherited_process_capability() calls. smbd/reply.c: Initialize count = 0, offset = 0. smbd/server.c: Added set_process_capability(), set_inherited_process_capability() calls. tests/summary.c: Ensure we have RANDOM or RAND. utils/smbpasswd.c: Added Ander's code to reset ACB_PWNOTREQ. utils/torture.c: Changed to use sys_random() & friends. Jeremy. (This used to be commit e8be306f23963ac00b1a383ebe0cc1421529fb02)
1998-09-24Integration of Anders Blomdell <anders.blomdell@control.lth.se>'sJeremy Allison1-4/+35
smbpasswd changes. Not exactly the same as his code - several changes. Jeremy. (This used to be commit e96747a8e3b9ea5a79c4258e55d7e8f3bf0bf193)
1998-09-23Hoist by my own petard with warnings (forgot to set strict warningsJeremy Allison1-6/+6
in Makefile before compiling & checking in :-). Jeremy. (This used to be commit 05fb3c82a57549fba74016eae31b53de30417b3c)
1998-09-23smbd/oplock.c: Use O_CREAT and O_TRUNC and correct mode flagsJeremy Allison1-1/+1
when creating oplock test file. smbd/server.c: Check for existance of kernel oplocks before becoming a daemon. Jeremy. (This used to be commit b42779e17e754d4a2f75904e2187c9209e0a53f0)
1998-09-23First cut at kernel oplocks. This should have no effect unless runninJeremy Allison1-141/+477
on a machine that supports them in autoconf. Move various functions out of lib/util.c into smbd/process.c and smbd/oplock.c where they belong. Jeremy. (This used to be commit c3c5e13f85c97939746070132dad941e79c546fb)
1998-09-18Fixed problems with premature kernel oplock checkin code.Jeremy Allison1-2/+1
The ./configure & build now seem to work ok. Jeremy. (This used to be commit 7c1a5ed1c2a55543d3f3c8bbd38e6c9c35b80390)
1998-09-18configure configure.in include/config.h.in include/includes.hJeremy Allison1-0/+61
Fixed bugs in readline autoconf. param/loadparm.c smbd/open.c smbd/oplock.c: Started on kernel oplock code - checking forced by above issue. Should not be used currently. Jeremy. (This used to be commit f939efac9e6c45331b17e3d3aa6bc2235e886c1a)
1998-09-11Added ssize_t to configure code.Jeremy Allison1-60/+0
Got 'religion' about using size_t and ssize_t for read/write stuff as part of the code to expose 64 bits to the client. This checkin does all the 'easy' stuff - such as all the read/write/lock calls - but now comes the harder parts (open & friends) and all the file enquiry functions..... Jeremy. (This used to be commit 36544fe5476f7770bd5748574fc54be7b3ee4d4a)
1998-09-05tridge the destroyer returns!Andrew Tridgell1-1/+3
prompted by the interpret_security() dead code that Jean-Francois pointed out I added a make target "finddead" that finds potentially dead (ie. unused) code. It spat out 304 function names ... I went through these are deleted many of them, making others static (finddead also reports functions that are used only in the local file). in doing this I have almost certainly deleted some useful code. I may have even prevented compilation with some compile options. I apologise. I decided it was better to get rid of this code now and add back the one or two functions that are needed than to keep all this baggage. So, if I have done a bit too much "destroying" then let me know. Keep the swearing to a minimum :) One bit I didn't do is the ubibt code. Chris, can you look at that? Heaps of unused functions there. Can they be made static? (This used to be commit 2204475c87f3024ea8fd1fbd7385b2def617a46f)
1998-09-05Fixed one more Debug problem with inode in non-64 bit case.Jeremy Allison1-1/+1
Jeremy. (This used to be commit 94d63cc382ac0d8a523db98b93750225082b09b1)
1998-09-04Modified dev_t and ino_t code to be 64 bit clean (including changesJeremy Allison1-21/+102
to oplock break message passing). I think that smbd/nmbd are now inode and offset size independent (at least for 32 bit and 64 bit systems). Now to expose all this new functionality to NT clients..... Jeremy. (This used to be commit 5910d07bbf45a34d3c901461f74704c029a79474)
1998-08-31configure.in, configure: include/config.h.in: Added stropts and poll.Jeremy Allison1-8/+17
include/smb.h: Moved old typedefs of uint8 etc. into include/includes.h where all the other defines live (changed them from typedefs to defines). Other changes : changed from using uint32 to SMB_DEV_T and SMB_INO_T in preparation for moving to size independed (ie. 64 bit clean) device and inode access. Stat call wrapper comes next :-). Jeremy. (This used to be commit 3d9ec96de5e04e83abafe9c5d980bd39eee856ea)
1998-08-17Fixed bug introduced by the recent changes where the chain_fnumJeremy Allison1-0/+5
could be overwritten in oplock processing code. Jeremy. (This used to be commit 908a583b48e37c5e869216f4dc92d4a587ff1238)
1998-08-17move soem variables from server.c that don't belong there.Andrew Tridgell1-5/+9
(This used to be commit f92475aa3cb3ade576c39c02c7996c949c42082a)
1998-08-17this completes the splitup of server.c.Andrew Tridgell1-0/+639
the splitup was done with an axe, not a scalpel, so there are some rough edges. I mostly wanted to get the general form right with fine tuning of what goes where to come later. Still, this is better than what we had before where server.c was a general repository for anything that didn't fit elsewhere. (This used to be commit a6d194886a4a5f7507fa37289ff96c1be56f14a6)