summaryrefslogtreecommitdiff
path: root/source3/locking
AgeCommit message (Collapse)AuthorFilesLines
2003-02-10Cleanups: (merge from HEAD)Andrew Bartlett1-1/+3
- use safe_strcpy() instead of pstrcpy() for malloc()ed strings - CUPS: a failure in an attempt to automaticly add a printer is not level 0 stuff. - Fix up a possible Realloc() failure segfault Andrew Bartlett (This used to be commit c1cfc296c2efdb2b5972202146e80f0e3b6a3da4)
2003-01-03Fix problem with "hide unreadable". stat file opens are baaack :-).Jeremy Allison1-2/+1
Jeremy. (This used to be commit 62038a0abf193d4dc4f37c31ac77216a10f6f326)
2002-12-20Forward port the change to talloc_init() to make all talloc contextsJeremy Allison1-2/+2
named. Ensure we can query them. Jeremy. (This used to be commit 09a218a9f6fb0bd922940467bf8500eb4f1bcf84)
2002-11-23Lots of fixes for error paths where tdb_fetch() data need freeing.Jeremy Allison2-12/+17
Found via a post from Arcady Chernyak <Arcady.Chernyak@efi.com>. Jeremy. (This used to be commit 5d5762d1787db4392d2dff16024097c638b2d494)
2002-09-25sync'ing up for 3.0alpha20 releaseGerald Carter1-1/+1
(This used to be commit 65e7b5273bb58802bf0c389b77f7fcae0a1f6139)
2002-07-15updated the 3.0 branch from the head branch - ready for alpha18Andrew Tridgell2-9/+21
(This used to be commit 03ac082dcb375b6f3ca3d810a6a6367542bc23ce)
2002-03-23Fix the mp3 rename bug - also tidy up our open code and remove the specialJeremy Allison1-3/+4
cases for rename and unlink. Had to add desired_access into the share mode record. Jeremy. (This used to be commit 3b1b8ac43535fb0839c5474fa55bf7150f6cde31)
2002-03-15if our lock spin code fails then return the first error code, not theAndrew Tridgell1-4/+11
last one. This is what caused the lock1 and lock2 tests to fail. (This used to be commit e7ae8003cb4fdc93db5f842754884a6d2ec93dc0)
2002-03-14Use sys_usleep not usleep.Jeremy Allison1-1/+1
Jeremy. (This used to be commit 8587dd95f850b4c6d2f015fe97ef98759ee8c236)
2002-03-13Ensure we attempt to lock at least once. Only sleep if time param set.Jeremy Allison1-1/+5
Jeremy. (This used to be commit 62b80d5c65ae8cf35347ee5c3d21ce1702c6449e)
2002-03-13include/smb_macros.h: Don't round up an allocation if the size is zero.Jeremy Allison1-1/+25
"One of these locks is not like the others... One of these locks is not quite the same" :-). When is a zero timeout lock not zero ? When it's being processed by Windows 2000 of course.. This code change, ugly though it is - completely fixes the foxpro/access multi-user file system database problems that people have been having. I used a *wonderful* test program donated by "Gerald Drouillard" <gerald@drouillard.ca> which allowed me to completely reproduce this problem, and to finally determine the correct fix. This also explains why Windows 2000 is *so slow* when responding to the smbtorture lock tests. I *love* it when all these things come together and finally make sense :-). Jeremy. (This used to be commit 8aa9860ea2ea7f5aed4b6aa12794fffdfa81b0d0)
2002-03-10this attempts to handle the rather bizarre lock cache semantics inAndrew Tridgell2-1/+15
w2k. It isn't entirely accurate, but its close (This used to be commit e02d7364707c4939efa4ff0ddf9b6d4f48e5d411)
2002-03-05accept the 0/0 lock but don't treat it in any sort of special wayAndrew Tridgell1-1/+0
(This used to be commit 8f7bf38de16a1f5316aa6a413fb697c43862c4c6)
2002-01-30Removed version number from file header.Tim Potter3-6/+3
Changed "SMB/Netbios" to "SMB/CIFS" in file header. (This used to be commit 6a58c9bd06d0d7502a24bf5ce5a2faf0a146edfa)
2002-01-08Debugs that print out a share mode table in debug level 10. This codeJeremy Allison1-4/+46
enabled me to track down a *nasty* bug. Jeremy. (This used to be commit ed5a9a0ee32aec460b9247ab4e4f5e38e8149e08)
2002-01-05Added DEBUG in set_share_mode to track down logic insanity.Jeremy Allison1-0/+8
Jeremy. (This used to be commit 32f4f3a45d473b3be1ae07f6c60897c12323d60c)
2001-12-18Removed unused function, delete_fn()Tim Potter1-57/+0
(This used to be commit f26e8205cff63967b9c1659b8e6ad71cbe36dace)
2001-11-30After conversations with Andrew, improved the robustness of theJeremy Allison1-26/+53
sharemode db in the following way. Originally, on startup and shutdown, smbd would scan the share mode db to ensure it was correct. This lead to scalability issues as scans lock the db for quite a long time. Andrew had the brainstorm that we only care about the record we're about to read. This new code (small change really, but quite significant) causes get_share_modes() to do a process_exists() call against each pid in each record, and to delete any that don't and re-write the entry if any dead records were detected. This allowed me to remove the startup/shutdown scans of the db (they can be added into smbstatus if anyone really cares to have them back). This will please the vfs author who was worried about the time taken on open() calls, and will lead to much greater robustness and scalability in the share mode db. We need much testing of this, and also netbench tests to ensure the extra process_exists() calls don't hurt performance (they shouldn't it's a very simple system call). Jeremy. (This used to be commit 4098d442030e66601450baeb09ae06b39a1ab571)
2001-11-21Don't scan locking db on closedown.Jeremy Allison1-0/+4
Jeremy. (This used to be commit 59cfcd8a6c510204ac059a0d2fddc2fa17199f82)
2001-10-20Move from timestamp to gen count file id's for finding oplocked filesJeremy Allison1-6/+19
in a tdb. Jeremy. (This used to be commit 058ae6b58f61ef46013dd076af3a84de5fbaaab1)
2001-10-19Ensure we mask off deny modes correctly on being set (this shouldn't haveJeremy Allison1-2/+2
caused problems but is tidier). Fix debug statement in locking.c Jeremy. (This used to be commit eac6bbd24ebf00b35e50953bc11186111dc39059)
2001-10-02Removed 'extern int DEBUGLEVEL' as it is now in the smb.h header.Tim Potter3-4/+0
(This used to be commit 2d0922b0eabfdc0aaf1d0797482fef47ed7fde8e)
2001-09-19Removed test code that got added by accident.Jeremy Allison1-22/+0
Jeremy. (This used to be commit fc91ecc236e0d27f5836e9820332ababd762f1a7)
2001-09-18Correct fix for unaligned memcpy - malloc'ed memory incremented by ↵Jeremy Allison1-18/+20
sizeof(struct locking_data) was not forced to be 8 byte aligned. Use union to force it to be correctly aligned for memcpy and use void *, to tell compiler not to optimize aligned copy (this last fix suggested by Trond @ RedHat). The first fix should be sufficient, but this provides a "belt and braces" fix. Jeremy. (This used to be commit 22c5915bb466529ac1bcb5c2574888b360a9775b)
2001-09-18Use structure copy to fix unaligned accesses on 64bit architectures onJeremy Allison1-1/+1
Linux. Jeremy. (This used to be commit b4b891279b6292237113456f1bb0d4393f1f9af1)
2001-09-17move to SAFE_FREE()Simo Sorce3-39/+31
(This used to be commit e61aec84edaf55b9ee087b076d2f1311033dc839)
2001-09-06Fix the 62bit locking onto 32 bit NFS mounts problem generically for HPUX.Jeremy Allison1-94/+21
Don. please check this out. Jeremy. (This used to be commit ce9f95996498f7795aaef069e1443ea1c7d524b3)
2001-09-06got rid of USE_TDB_MMAP_FLAG as its not needed any moreAndrew Tridgell2-2/+2
(This used to be commit c26e0d3f27a05ecc8bd2390f9aab7f9451524e47)
2001-09-06use NTSTATUS not BOOL in do_lock()Andrew Tridgell2-21/+24
(This used to be commit b1b2a5fa5d084dad8ae47777419ab75db1e51eff)
2001-09-052nd DELETE_ON_CLOSE_FLAG fix ...Andrew Tridgell1-3/+3
we set the DELETE_ON_CLOSE_FLAG on all share modes on the file, which means the share mode in the fsp will not match the one in the tdb when we come to close for other file handles, which means we end up with share modes on files after all handles are closed fixed by making the comparison function that says if two shares modes are equal ignore the DELETE_ON_CLOSE_FLAG (This used to be commit 7b39c4c59897669106d7129bad8af3d592d25838)
2001-09-05NFS v2 can return ENOLCK when greater than 31 bit offsets are used.Jeremy Allison1-2/+2
Treat this the same as an EFBIG error. Jeremy (This used to be commit 8fad5177701c1738a7f5bdd7c0082ef23a00b876)
2001-09-04the next stage in the NTSTATUS/WERROR change. smbd and nmbd now compile, but ↵Andrew Tridgell1-6/+6
the client code still needs some work (This used to be commit dcd6e735f709a9231860ceb9682db40ff26c9a66)
2001-08-27converted another bunch of stuff to NTSTATUSAndrew Tridgell1-1/+1
(This used to be commit 1d36250e338ae0ff9fbbf86019809205dd97d05e)
2001-08-27started converting NTSTATUS to be a structure on systems with gcc in order ↵Andrew Tridgell1-6/+6
to make it type incompatible with BOOL so we catch errors sooner. This has already found a number of bugs (This used to be commit 1b778bc7d22efff3f90dc450eb12baa1241cf68f)
2001-08-27converted smbd to use NTSTATUS by defaultAndrew Tridgell2-33/+73
major changes include: - added NSTATUS type - added automatic mapping between dos and nt error codes - changed all ERROR() calls to ERROR_DOS() and many to ERROR_NT() these calls auto-translate to the client error code system - got rid of the cached error code and the writebmpx code We eventually will need to also: - get rid of BOOL, so we don't lose error info - replace all ERROR_DOS() calls with ERROR_NT() calls but that is too much for one night (This used to be commit 83d9896c1ea8be796192b51a4678c2a3b87f7518)
2001-08-26Ignore locks of length zero as they mean different things in Win32Jeremy Allison1-5/+18
and POSIX. Jeremy. (This used to be commit bd9cbf4c6883c1a39f28db8afa7cc0bd04b1b09f)
2001-08-26Don't use CLEAR_IF_FIRST if opening read-only.Jeremy Allison1-1/+1
Jeremy. (This used to be commit f5ba19c12989dd1e996473869468afcfc5dce72e)
2001-08-24we now have all but the dreaded 0/0 lock workingAndrew Tridgell1-30/+67
(This used to be commit 98b6aef18c793187f392f944af516c8b9ebf86e9)
2001-08-240 byte lock ranges ARE validAndrew Tridgell1-6/+3
(This used to be commit 5498da6664a457e4d64502d37fa887dabd9baaa0)
2001-08-22Tidyup fixes for fcntl spin problem.Jeremy Allison1-11/+30
Jeremy. (This used to be commit 27d3dd0e7cb777ef6b21d6966c07045c2940fd37)
2001-08-22Fixed the (incorrect) paranioa fix I put in for the fcntl lock spin.Jeremy Allison1-17/+35
Don't delete a share mode that failed to remove the oplock (doh!), just set the oplock entry to zero.... Jeremy. (This used to be commit fe4aa720181a43f7a636ca029680fab0c836b968)
2001-08-21Missed uninitialized variable return for del_share_mode().Jeremy Allison1-1/+1
Jeremy. (This used to be commit e4a57fb45660b82eaec751f1b41f657a64d963fd)
2001-08-21This is Jeremy pretending to be Volker, 'cos theVolker Lendecke1-64/+136
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. (This used to be commit 1c94fa80646f9e31377fbb41332fe4780f550cab)
2001-08-20Ensure we are very explicit about what we're comparing whenJeremy Allison1-4/+4
we're comparing structures (ie. don't just do a memcmp). I don't think this will fix the fcntl spin issue, but it's a "just in case" change. Jeremy. (This used to be commit 41066208ad8ca20d35a32bdf9ad934e11465c8f1)
2001-08-13Add printing of errno when POSIX lock requests fail.Jeremy Allison1-3/+3
Jeremy. (This used to be commit befbfea21035b0566fc6ba8674587fc44ad7bbdc)
2001-08-12this is a big global fix for the ptr = Realloc(ptr, size) bug.Simo Sorce2-6/+13
many possible mem leaks, and segfaults fixed. someone should port this fix to 2.2 also. (This used to be commit fa8e55b8b465114ce209344965c1ca0333b84db9)
2001-07-30Added "use mmap" for HPUX.Jeremy Allison2-2/+2
Jeremy. (This used to be commit 840802f10677cb0009cb4df4c37c7d01aa5edacd)
2001-07-02Fixed the nastiest locking bug to track down.... smb_pids are sent in theJeremy Allison2-7/+6
lockingX calls - use that instead of smb_pid in the packet. Jeremy. (This used to be commit a3925cb9c6303ce24e5fecad6c8f3a0ba78b9ee0)
2001-06-30Ensure we return correct error on trying to unlock a region not locked.Jeremy Allison1-2/+2
Jeremy. (This used to be commit 015a077acc49e59179dc10256fd32166ee4623e2)
2001-06-30Fixed the first locking error (test #8 found by locktest code fromJeremy Allison2-6/+45
Clarion locktest. Jeremy. (This used to be commit 5c42845b5bb6fafd0ebf93fbdd23d9bf861da865)