summaryrefslogtreecommitdiff
path: root/source3/locking/locking.c
AgeCommit message (Collapse)AuthorFilesLines
2007-10-10r22009: change TDB_DATA from char * to unsigned char *Stefan Metzmacher1-10/+10
and fix all compiler warnings in the users metze (This used to be commit 3a28443079c141a6ce8182c65b56ca210e34f37f)
2007-10-10r21726: Fix stupid cut-n-paste typo. Thanks to volker forJeremy Allison1-1/+1
being on the ball..... :-). Jeremy. (This used to be commit 84ed7bcbe6dc14b18a7e913b153c82da1856a835)
2007-10-10r21724: Optimization pointed out by Volker. If we don'tJeremy Allison1-0/+20
have any outstanding locks or blocking locks then we don't need to read the lock db. on close. Jeremy. (This used to be commit 1b063496f93f78347a6e67549bde54c845499a7d)
2007-10-10r21723: Make use of the per-hashchain "freelists"Volker Lendecke1-0/+3
(This used to be commit f3421ae4cfa263c0e7a8e934b40342ee9885d239)
2007-10-10r21706: get_delete_on_close_flag() is the perfect candidate for ↵Volker Lendecke1-7/+21
tdb_parse_record() (This used to be commit b73685d20751ac343faab79332552cd7ee92d831)
2007-10-10r21257: Better fix for bug #4188 :Jeremy Allison1-36/+1
Windows Vista RC1 and RC2 can't delete directory on Samba share based on work by Joe Meadows <jmeadows@webopolis.com>. Jeremy. (This used to be commit 2dab8928769938ab79da7b7ce2d165fc388f9b00)
2007-10-10r21191: Add in the POSIX open/mkdir/unlink calls.Jeremy Allison1-3/+6
Move more error code returns to NTSTATUS. Client test code to follow... See if this passes the build-farm before I add it into 3.0.25. Jeremy. (This used to be commit 83dbbdff345fa9e427c9579183f4380004bf3dd7)
2007-10-10r20916: Add in the delete on close final fix - but only enabledJeremy Allison1-0/+4
with -DDEVELOPER. Jeremy. (This used to be commit 7f817067a70930ee3502ea3373173e0c23733253)
2007-10-10r20883: W00t! I now understand how "delete on close" reallyJeremy Allison1-23/+16
works - even with the strange "initial delete on close" semantics. The "initial delete on close" flag isn't committed to the share mode db until the handle is closed, and is discarded if any real "delete on close" was set. This allows me to remove the "initial_delete_on_close" flag from the share db, and move it into a BOOL in files_struct. Warning ! You must do a make clean after this. Cope with the wrinkle in directory delete on close which is done differently from files. We now pass all Samba4 smbtortute BASE-DELETE tests except for the one checking that files can't be created in a directory which has the delete on close set (possibly expensive to fix). Jeremy. (This used to be commit f2df77a1497958c1ea791f1d2f4446b5fc3389b3)
2007-10-10r20873: Some correctness fixes w.r.t. Samba4 torture BASE-DELETE.Jeremy Allison1-0/+40
Allow us to correctly refuse to set delete on close on a non-empty directory. There are still some delete-on-close wrinkles to be fixed, but I understand how to do that better now. I'll fix this tomorrow. Jeremy. (This used to be commit 029635885825a5562e7974a6f5675cce3bf1b5dc)
2007-10-10r19668: Convert the locking params to use struct share_param instead of snumVolker Lendecke1-8/+7
(This used to be commit 609dbec600048718b86cd1ecdc2ce49bbdeb803c)
2007-10-10r19078: talloc_strdup can failVolker Lendecke1-0/+6
(This used to be commit 2b3b9ce2a122ec5fd945728c117c321087d85203)
2007-10-10r17924: Get rid of warnings now that talloc is merged.Volker Lendecke1-3/+1
Destructors now take a pointer to the "real" destroyed object as an argument. Volker (This used to be commit 70edd716ef0ccb218fe18d1233bd30abe46b62bf)
2007-10-10r17346: Add optimisation vl needs for the cluster code whereJeremy Allison1-3/+3
we don't get the chainlock when getting the byte range lock record read-only. Jeremy. (This used to be commit fcd798ca0c1b76adb2bcda4a99c40c7aacb0addb)
2007-10-10r17314: Optimisation for POSIX locking. If we're downgradingJeremy Allison1-2/+4
a POSIX lock (applying a read-lock) and we overlap pending read locks then send them an unlock message, we may have allowed them to proceed. Jeremy. (This used to be commit a7a0b6ba50f4cf7c5a0a29809fdff9e1266a29e7)
2007-10-10r17293: After the results from the cluster tests in Germany,Jeremy Allison1-2/+0
fix the messaging code to call the efficient calls : save_re_uid() set_effective_uid(0); messaging_op restore_re_uid(); instead of using heavyweight become_root()/unbecome_root() pairs around all messaging code. Fixup the messaging code to ensure sec_init() is called (only once) so that non-root processes still work when sending messages. This is a lighter weight solution to become_root()/unbecome_root() (which swaps all the supplemental groups) and should be more efficient. I will migrate all server code over to using this (a similar technique should be used in the passdb backend where needed). Jeremy. (This used to be commit 4ace291278d9a44f5c577bdd3b282c1231e543df)
2007-10-10r17177: Get rid of a global variable by adding a private data pointer toVolker Lendecke1-5/+22
share_mode_forall(). Volker (This used to be commit f97f6cedffdc4d10afcac90a163b93a801acf514)
2007-10-10r17105: Fix the race Volker found - we had a non-lockedJeremy Allison1-10/+12
region between detecting a pending lock was needed and when we added the blocking lock record. Make sure that we hold the lock over all this period. Removed the old code for doing blocking locks on SMB requests that never block (the old SMBlock and friends). Discovered something interesting about the strange NT_STATUS_FILE_LOCK_CONFLICT return. If we asked for a lock with zero timeout, and we got an error of NT_STATUS_FILE_LOCK_CONFLICT, treat it as though it was a blocking lock with a timeout of 150 - 300ms. This only happens when timeout is sent as zero and can be seen quite clearly in ethereal. This is the real replacement for old do_lock_spin() code. Re-worked the blocking lock select timeout to correctly use milliseconds instead of the old second level resolution (far too coarse for this work). Jeremy. (This used to be commit b81d6d1ae95a3d3e449dde629884b565eac289d9)
2007-10-10r17098: Samba3 now cleanly passes Samba4 RAW-LOCK tortureJeremy Allison1-56/+46
test. Phew - that was painful :-). But what it means is that we now implement lock cancels and I can add lock cancels into POSIX lock handling which will fix the fast/slow system call issue with cifsfs ! Jeremy. (This used to be commit f1a9cf075b87c76c032d19da0168424c90f6cb3c)
2007-10-10r16945: Sync trunk -> 3.0 for 3.0.24 code. Still needJeremy Allison1-48/+39
to do the upper layer directories but this is what everyone is waiting for.... Jeremy. (This used to be commit 9dafb7f48ca3e7af956b0a7d1720c2546fc4cfb8)
2007-10-10r16661: Fix from jason@ncac.gwu.edu for bug #3875,Jeremy Allison1-1/+1
bad cast warning. Jeremy. (This used to be commit d60e6e0abc17361fe180d6723b970552dc377741)
2007-10-10r16435: Add in the uid info that Jerry needs into theJeremy Allison1-9/+14
share_mode struct. Allows us to know the unix uid of the opener of the file/directory. Needed for info level queries on open files. Jeremy. (This used to be commit d929323d6f513902381369d77bcd7b714346d713)
2007-10-10r16281: Start fixing up gcc4 -O6 warnings on an x86_64 box. size_t != unsignedJeremy Allison1-1/+1
int in a format string. Jeremy. (This used to be commit c49ad9200bf3fdd8b9404d93182c2e04e662190a)
2007-10-10r15943: Update misleading DEBUG statements and comments that refer toJames Peach1-1/+1
open_file_shared. (This used to be commit 784126edff942d1c2f79f7c9feb59980426f331e)
2007-10-10r15670: Fix valgrind-spotted issue in BASE-DELETE test.Jeremy Allison1-0/+1
We were forgetting to increment after copying the primary group gid. Jeremy (This used to be commit 31d16c434e1ee94691f013ed0b31d9f26baeb2cb)
2007-10-10r15668: DOS or FCB opens share one share mode entry from differentJeremy Allison1-16/+7
fsp pointers. Ensure we cope with this to pass Samba4 DENY tests (we used to pass these, there must have been a regression with newer code). We now pass them. Jeremy (This used to be commit fd6fa1d4eaf61783df74ee2da50d331477f06998)
2007-10-10r15083: Using talloc with destructors is nice and all, but in thisJeremy Allison1-12/+12
case it's in a performace critical path and it *hurts* us. Go back to plain malloc/free with an explicit destructor call. Jeremy. (This used to be commit 1c99aed563c29e1b3d70939878af747a0660bfec)
2007-10-10r15018: Merge Volker's ipc/trans2/nttrans changes overJeremy Allison1-118/+187
into 3.0. Also merge the new POSIX lock code - this is not enabled unless -DDEVELOPER is defined. This doesn't yet map onto underlying system POSIX locks. Updates vfs to allow lock queries. Jeremy. (This used to be commit 08e52ead03304ff04229e1bfe544ff40e2564fc7)
2007-10-10r14763: Add a new tuning parameter, open files database hash size,Jeremy Allison1-1/+2
this allows us to experiment with ensuring the tdb hash size for our open files and locking db are appropriately sized. Make the hash size larger by default (10007 instead of 1049) and make the locking db hash size the same as the open file db hash size. Jeremy. (This used to be commit e7225f7e813423c3e2a94af6a9d7ce8a1b50a166)
2007-10-10r14428: Call fill_share_mode_entry with NO_OPLOCK instead of 0.James Peach1-3/+3
(This used to be commit a39cbaa699d111264c2c9dda49a6e4f42acd3fb8)
2007-10-10r13571: Replace all calls to talloc_free() with thye TALLOC_FREE()Gerald Carter1-7/+7
macro which sets the freed pointer to NULL. (This used to be commit b65be8874a2efe5a4b167448960a4fcf6bd995e2)
2007-10-10r13412: Don't use arbitrary uint32 size for uid and gid storage. UseJeremy Allison1-23/+22
correct system size. Fixed a bug that was accidentally introduced by use of uint32 - uid was stored twice, not uid and gid. Jeremy. (This used to be commit 89db006997588c6523ce8f2470d67f3136042256)
2007-10-10r13329: Fix libsmbsharemodes.so to work with the stored delete token.Jeremy Allison1-18/+0
Less trouble than I thought plus it didn't need an interface change (thank goodness !). Jeremy. (This used to be commit dbe2572d1c713f46b0d1d0c405f88456c9336297)
2007-10-10r13294: Fix basic delete on close tests - don't forget to tellJeremy Allison1-5/+10
the data struct how big the token is... :-). Jeremy. (This used to be commit f259de8b69f94ae8b5f4553180f245234bffd397)
2007-10-10r13293: Rather a big patch I'm afraid, but this should fix bug #3347Jeremy Allison1-15/+142
by saving the UNIX token used to set a delete on close flag, and using it when doing the delete. libsmbsharemodes.so still needs updating to cope with this change. Samba4 torture tests to follow. Jeremy. (This used to be commit 23f16cbc2e8cde97c486831e26bcafd4ab4a9654)
2007-10-10r13274: Fix for bug #3467. Not a show stopper.Jeremy Allison1-3/+17
jason qian <jason@infrant.com> was a *fantastic* help in tracking this down. Jeremy. (This used to be commit 9f4a9c70fa232047868e5d8a3f132a2dd6bfee82)
2007-10-10r13198: Fix issues exposed by Jerry's testing on 64-bit SolarisJeremy Allison1-22/+0
(I hope). Separate 3.0.21b patch sent to Jerry. Jeremy. (This used to be commit 837e7ea7e40cedc6b01e023445feb4a90c4bf8b9)
2007-10-10r13194: Don't do extra memcpy's unless we're asked to.Jeremy Allison1-1/+5
Jeremy. (This used to be commit f93e1e75563679dc07958168b283dfc0eb2de5b0)
2007-10-10r13192: Fix up alignment issues when printing share modeJeremy Allison1-4/+8
entries. Add paranioa to debug so we know when an entry is unused. Jeremy. (This used to be commit fa5fab313e3728ff49c00ca1097242039506f83e)
2007-10-10r13110: remove an invalid debug message about call get_share_mode_lock() ↵Gerald Carter1-1/+0
with a NULL service path and fname (we do it all the time internally) (This used to be commit e1f75ea63780f4a1661f19554d18bbd73b069c1b)
2007-10-10r12877: Stop passing structs around in smb messages, insteadJeremy Allison1-7/+10
always linearize into little-endian. Should fix all Solaris issues with this, plus provide a cleaner base moving forward for cluster-aware Samba where smbd's can communicate across different compilers/architectures (eventually these message will have to go cross-machine). Jeremy. (This used to be commit d01824b78576a034428e1cef73868d1169057991)
2007-10-10r12234: Reduce the race condition for renames by holding the lockJeremy Allison1-1/+5
longer. Instigated by complaints on the fix for #3303 from SATOH Fumiyasu <fumiyas@miraclelinux.com>. Jeremy. (This used to be commit 855f5f8c32aa530dbad244805a40200824724618)
2007-10-10r12221: Fix error code paths that can potentially leave a dangling lock.Jeremy Allison1-2/+13
Jeremy. (This used to be commit 123135ed1ddd84cc0a5e8e5ca06a0703d1944e37)
2007-10-10r12213: Final fix for #3303 - send rename messages to smbd'sJeremy Allison1-3/+53
that have open file handles to allow them to correctly implement delete on close. There is a further correctness fix I'm intending to add to this to cope with different share paths, but not right now... Jeremy. (This used to be commit 932e337db8788e75344e1c7cf1ef009d090cb039)
2007-10-10r12203: Add the share path into the sharemode db. This involvesJeremy Allison1-18/+66
revving the minor version number for libsmbsharemodes (we now have a new _ex interface that takes the share path as well as the filename). Needed for #3303. Some code written by SATOH Fumiyasu <fumiya@samba.gr.jp> included in the changes to locking/locking.c. The smbstatus output is a bit of a mess and needs overhauling... Jeremy. (This used to be commit 9d93af713f8520ca506730dd32aa2b994937eaba)
2007-10-10r11435: Allow the hash size of the tdb open (locking) databaseJeremy Allison1-3/+3
to be set in local.h. Change from the default (131) to another prime (1049). Should this be an smb.conf tunable parameter based on the number of open file descriptors available ? If so what scaling factor ? More tests to follow. Jeremy. (This used to be commit 6a902ec49ffea5d0ca0308d5ff51584cece41043)
2007-10-10r11341: Put directory opens into the share mode db so weJeremy Allison1-1/+2
can treat them similarly to file opens (delete on close, share mode violations etc.). This fixes bug #3216 I will up the default hash size on the locking db in a later commit as this means more entries. Jeremy. (This used to be commit 1134abbbb3fd8e8b88e1a5817aae106476a4c126)
2007-10-10r10656: BIG merge from trunk. Features not copied overGerald Carter1-749/+455
* \PIPE\unixinfo * winbindd's {group,alias}membership new functions * winbindd's lookupsids() functionality * swat (trunk changes to be reverted as per discussion with Deryck) (This used to be commit 939c3cb5d78e3a2236209b296aa8aba8bdce32d3)
2007-10-10r8219: Merge the new open code from HEAD to 3.0. Haven't yet run the tortureJeremy Allison1-51/+69
tests on this as it's very late NY time (just wanted to get this work into the tree). I'll test this over the weekend.... Jerry - in looking at the difference between the two trees there seem to be some printing/ntprinting.c and registry changes we might want to examine to try keep in sync. Jeremy. (This used to be commit c7fe18761e2c753afbffd3a78abff46472a9b8eb)
2007-10-10r6594: Fix silly typo causing tdb to be freed twice.Jeremy Allison1-1/+1
Jeremy. (This used to be commit 4f431dfc6b57e1609672c4daa53ab5d62613f6d1)