summaryrefslogtreecommitdiffstats
path: root/source/locking/posix.c
Commit message (Collapse)AuthorAgeFilesLines
* r21585: Start syncing the monster that will become 3.0.25pre1Gerald Carter2007-02-281-673/+636
| | | | | | | | Still todo: * release notes * few minor outstanding patches * additional idmap man pages
* r16348: * merging changes from SAMBA_3_0 r16346Gerald Carter2006-06-191-3/+2
| | | | * updating release notes to match
* r15018: Merge Volker's ipc/trans2/nttrans changes overJeremy Allison2006-04-101-16/+75
| | | | | | | | 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.
* r14703: Clarify the return codes for the POSIX locking case. ThisJeremy Allison2006-03-251-2/+6
| | | | | was confusing. Jeremy.
* r13915: Fixed a very interesting class of realloc() bugs found by Coverity.Jeremy Allison2006-03-071-11/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | realloc can return NULL in one of two cases - (1) the realloc failed, (2) realloc succeeded but the new size requested was zero, in which case this is identical to a free() call. The error paths dealing with these two cases should be different, but mostly weren't. Secondly the standard idiom for dealing with realloc when you know the new size is non-zero is the following : tmp = realloc(p, size); if (!tmp) { SAFE_FREE(p); return error; } else { p = tmp; } However, there were *many* *many* places in Samba where we were using the old (broken) idiom of : p = realloc(p, size) if (!p) { return error; } which will leak the memory pointed to by p on realloc fail. This commit (hopefully) fixes all these cases by moving to a standard idiom of : p = SMB_REALLOC(p, size) if (!p) { return error; } Where if the realloc returns null due to the realloc failing or size == 0 we *guarentee* that the storage pointed to by p has been freed. This allows me to remove a lot of code that was dealing with the standard (more verbose) method that required a tmp pointer. This is almost always what you want. When a realloc fails you never usually want the old memory, you want to free it and get into your error processing asap. For the 11 remaining cases where we really do need to keep the old pointer I have invented the new macro SMB_REALLOC_KEEP_OLD_ON_ERROR, which can be used as follows : tmp = SMB_REALLOC_KEEP_OLD_ON_ERROR(p, size); if (!tmp) { SAFE_FREE(p); return error; } else { p = tmp; } SMB_REALLOC_KEEP_OLD_ON_ERROR guarentees never to free the pointer p, even on size == 0 or realloc fail. All this is done by a hidden extra argument to Realloc(), BOOL free_old_on_error which is set appropriately by the SMB_REALLOC and SMB_REALLOC_KEEP_OLD_ON_ERROR macros (and their array counterparts). It remains to be seen what this will do to our Coverity bug count :-). Jeremy.
* r8219: Merge the new open code from HEAD to 3.0. Haven't yet run the tortureJeremy Allison2005-07-081-17/+21
| | | | | | | | | 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.
* r7975: One more tidyup to ensure we're using "struct posix_lock".Jeremy Allison2005-06-281-1/+2
| | | | Jeremy.
* r7972: Tidy up the posix locking in memory db code whilst I'm waiting for jhtJeremy Allison2005-06-281-20/+21
| | | | | to get back to me with a backtrace. Jeremy.
* r6502: add LOCKING debug class - pull PRINTINGDB class definition from trunkHerb Lewis2005-04-271-0/+3
| | | | so our numbers don't get out of sync
* r5625: Reformat (tidy).Jeremy Allison2005-03-021-4/+4
|
* r4088: Get medieval on our ass about malloc.... :-). Take control of all our ↵Jeremy Allison2004-12-071-6/+5
| | | | | | | | | allocation functions so we can funnel through some well known functions. Should help greatly with malloc checking. HEAD patch to follow. Jeremy.
* r3120: Fix bug #1955 reported by Love <lha@stacken.kth.se>. Inconsistent ↵Jeremy Allison2004-10-211-3/+3
| | | | | | error return. Jeremy.
* r2: import HEAD into svn+ssh://svn.samba.org/home/svn/samba/trunkCVS Import User2004-04-041-0/+1312
metze