summaryrefslogtreecommitdiffstats
path: root/source/locking/posix.c
Commit message (Collapse)AuthorAgeFilesLines
* Fix more asprintf warnings and some error path errors.Jeremy Allison2009-01-021-7/+6
| | | | | Jeremy. (cherry picked from commit 44ab658b6d80c66f20d80aede7fc7cd2b9a941b1)
* Slight reformatting of fd_close_posix(), while I'm at it.Michael Adam2008-04-211-5/+9
| | | | | | Wrap lines and remove trailing space. Michael
* Change fd_close_posix() to return int instead of NTSTATUS.Michael Adam2008-04-211-12/+4
| | | | | | The errno is handed up through the VFS layer to the callers. Michael
* Don't modify the fsp in fd_close_posix() anymore.Michael Adam2008-04-211-4/+0
| | | | | | | | Now that it is inside the vfs layer, this function should not alter the fsp (i.e. set fsp->fh->fd = -1) anymore. That belongs above the vfs layer. Michael
* Move the posix pending close functionality down into the VFS layer.Michael Adam2008-04-211-3/+3
| | | | | | | | | | | | | | | | | This hides the pending close fds from the outside. Call order of SMB_VFS_CLOSE is reversed. Originally, it was: fd_close -> fd_close_posix -> SMB_VFS_CLOSE -> close And now it is: fd_close -> SMB_VFS_CLOSE -> fd_close_posix -> close This is in preparation of removing the fd parameter from the SMB_VFS_CLOSE function. But it is also the right place for the pending close calls anyways. Michael
* Remove redundant parameter fd from SMB_VFS_GETLOCK().Michael Adam2008-01-071-2/+2
| | | | Michael
* Remove redundant parameter fd from SMB_VFS_LOCK().Michael Adam2008-01-071-2/+2
| | | | Michael
* Remove redundant connection_struct from fd_close_posix() parameter list.Michael Adam2007-12-221-2/+2
| | | | Michael
* Convert the posix_pending_close_db to dbwrap_rbtVolker Lendecke2007-12-111-126/+130
|
* Tiny simplificationsVolker Lendecke2007-12-101-1/+1
| | | | | | locking.c:open_read_only was unused don't export the silly boolean flag locking_init(bool read_only)
* Remove two staticsVolker Lendecke2007-12-101-39/+17
|
* Add MAX_DNS_NAME_LENGTH, remove more pstrings.Jeremy Allison2007-11-151-2/+5
| | | | Jeremy.
* RIP BOOL. Convert BOOL -> bool. I found a few interestingJeremy Allison2007-10-181-15/+15
| | | | | | | bugs in various places whilst doing this (places that assumed BOOL == int). I also need to fix the Samba4 pidl generation (next checkin). Jeremy.
* r24571: Only look at errno if the close call actually failedVolker Lendecke2007-10-101-1/+4
| | | | Patch from Ofir Azoulay <Ofir.Azoulay@expand.com> -- thanks
* r23784: use the GPLv3 boilerplate as recommended by the FSF and the license textAndrew Tridgell2007-10-101-2/+1
|
* r23779: Change from v2 or later to v3 or later.Jeremy Allison2007-10-101-1/+1
| | | | Jeremy.
* r23510: Tidy calls to smb_panic by removing trailing newlines. Print theJames Peach2007-10-101-11/+11
| | | | failed expression in SMB_ASSERT.
* r23183: Check in a change made by Tridge:Volker Lendecke2007-10-101-18/+8
| | | | | | | | | | | | | This replaces the internal explicit dev/ino file id representation by a "struct file_id". This is necessary as cluster file systems and NFS don't necessarily assign the same device number to the shared file system. With this structure in place we can now easily add different schemes to map a file to a unique 64-bit device node. Jeremy, you might note that I did not change the external interface of smb_share_modes.c. Volker
* r23096: Make the lock failure message prettier.James Peach2007-10-101-4/+4
|
* r22009: change TDB_DATA from char * to unsigned char *Stefan Metzmacher2007-10-101-4/+4
| | | | | | and fix all compiler warnings in the users metze
* r21191: Add in the POSIX open/mkdir/unlink calls.Jeremy Allison2007-10-101-5/+9
| | | | | | | | 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.
* r19668: Convert the locking params to use struct share_param instead of snumVolker Lendecke2007-10-101-1/+1
|
* r17452: Some C++ warningsVolker Lendecke2007-10-101-1/+1
|
* r17041: Trying to track down a *big* memory leak in the new lock code.Jeremy Allison2007-10-101-0/+1
| | | | | Fix a small one first.... (easy to valgrind). Jeremy
* r17000: Allow CIFS POSIX locks to coexist with Windows locks.Jeremy Allison2007-10-101-1/+1
| | | | | | | We shouldn't allow this on the same smbd, but the cifsfs client negotiates POSIX locks then sends Windows ones. Doh ! Can't fix shipped client code.... Jeremy.
* r16992: Fix bug #3922 reported by jason@ncac.gwu.edu, correctlyJeremy Allison2007-10-101-1/+1
| | | | | look at the return code. Jeremy.
* r16987: Fix the logic errors in ref-counting Windows locks.Jeremy Allison2007-10-101-7/+8
| | | | | | Hopefully will fix the build farm. Still a few errors in RAW-LOCK to look at though... Jeremy.
* r16973: Fix subtle logic error in lock ref counting found byJeremy Allison2007-10-101-7/+7
| | | | | cifsfs client code. Jeremy.
* r16945: Sync trunk -> 3.0 for 3.0.24 code. Still needJeremy Allison2007-10-101-667/+624
| | | | | | | to do the upper layer directories but this is what everyone is waiting for.... Jeremy.
* r16307: Make sure we know we must pass a valid pointer here.Jeremy Allison2007-10-101-3/+2
| | | | | Klocwork #1129. Jeremy.
* r15018: Merge Volker's ipc/trans2/nttrans changes overJeremy Allison2007-10-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 Allison2007-10-101-2/+6
| | | | | was confusing. Jeremy.
* r13915: Fixed a very interesting class of realloc() bugs found by Coverity.Jeremy Allison2007-10-101-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 Allison2007-10-101-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 Allison2007-10-101-1/+2
| | | | Jeremy.
* r7972: Tidy up the posix locking in memory db code whilst I'm waiting for jhtJeremy Allison2007-10-101-20/+21
| | | | | to get back to me with a backtrace. Jeremy.
* r6502: add LOCKING debug class - pull PRINTINGDB class definition from trunkHerb Lewis2007-10-101-0/+3
| | | | so our numbers don't get out of sync
* r5625: Reformat (tidy).Jeremy Allison2007-10-101-4/+4
|
* r4088: Get medieval on our ass about malloc.... :-). Take control of all our ↵Jeremy Allison2007-10-101-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 Allison2007-10-101-3/+3
| | | | | | error return. Jeremy.
* Prefix VFS API macros with SMB_ for consistency and to avoid problems with ↵Alexander Bokovoy2003-05-141-5/+5
| | | | VFS_ macros at system side. We currently have one clash with AIX and its VFS_LOCK. Compiled and tested -- no new functionality or code, just plain rename of macros for yet-unreleased VFS API version. Needs to be done before a24 is out
* Fix VFS layer:Alexander Bokovoy2003-05-111-6/+5
| | | | | | | | | 1. Finally work with cascaded modules with private data storage per module 2. Convert VFS API to macro calls to simplify cascading 3. Add quota support to VFS layer (prepare to NT quota support) Patch by Stefan (metze) Metzemacher, with review of Jelmer and me Tested in past few weeks. Documentation to new VFS API for third-party developers to follow
* Fixes for HPUX only having limited POSIX lock range from Michael Steffens ↵Jeremy Allison2003-02-121-12/+7
| | | | | | <michael.steffens@hp.com> Jeremy.
* Forward port the change to talloc_init() to make all talloc contextsJeremy Allison2002-12-201-2/+2
| | | | | named. Ensure we can query them. Jeremy.
* Lots of fixes for error paths where tdb_fetch() data need freeing.Jeremy Allison2002-11-231-11/+14
| | | | | Found via a post from Arcady Chernyak <Arcady.Chernyak@efi.com>. Jeremy.
* Removed version number from file header.Tim Potter2002-01-301-2/+1
| | | | Changed "SMB/Netbios" to "SMB/CIFS" in file header.
* Removed 'extern int DEBUGLEVEL' as it is now in the smb.h header.Tim Potter2001-10-021-1/+0
|
* move to SAFE_FREE()Simo Sorce2001-09-171-23/+15
|
* Fix the 62bit locking onto 32 bit NFS mounts problem generically for HPUX.Jeremy Allison2001-09-061-94/+21
| | | | | Don. please check this out. Jeremy.
* NFS v2 can return ENOLCK when greater than 31 bit offsets are used.Jeremy Allison2001-09-051-2/+2
| | | | | Treat this the same as an EFBIG error. Jeremy