summaryrefslogtreecommitdiff
path: root/source3/locking/posix.c
AgeCommit message (Collapse)AuthorFilesLines
2011-06-09s3-talloc Change TALLOC_P() to talloc()Andrew Bartlett1-4/+4
Using the standard macro makes it easier to move code into common, as TALLOC_P isn't standard talloc.
2011-06-09s3-talloc Change TALLOC_ARRAY() to talloc_array()Andrew Bartlett1-1/+1
Using the standard macro makes it easier to move code into common, as TALLOC_ARRAY isn't standard talloc.
2011-05-06s3: only include tdb headers where needed.Günther Deschner1-0/+1
Guenther
2011-03-30s3-locking: move locking prototypes out of proto.h.Günther Deschner1-0/+1
Will later become part of locking.h Guenther
2011-03-30s3-includes: only include system/filesys.h when needed.Günther Deschner1-0/+1
Guenther
2010-08-26s3-build: use dbwrap.h only where needed.Günther Deschner1-0/+1
Guenther
2010-02-10s3-locking: update to use DLIST_ADD_AFTER()Andrew Tridgell1-5/+1
(cherry picked from commit 6c6df527e14514027cbcaa6deac25adf04363926)
2009-07-24Make the smbd VFS typesafeVolker Lendecke1-0/+16
2009-07-20s3: Change fsp->fsp_name to be an smb_filename struct!Tim Prouty1-15/+22
2008-12-23Fix more asprintf warnings and some error path errors.Jeremy Allison1-7/+6
Jeremy.
2008-10-14Use {u,}int64_t instead of SMB_BIG_{U,}INT.Jelmer Vernooij1-16/+16
2008-04-21Slight reformatting of fd_close_posix(), while I'm at it.Michael Adam1-5/+9
Wrap lines and remove trailing space. Michael (This used to be commit 74ed53a115b2063d4d5c8572af8f1302bc658882)
2008-04-21Change fd_close_posix() to return int instead of NTSTATUS.Michael Adam1-12/+4
The errno is handed up through the VFS layer to the callers. Michael (This used to be commit d928e6648d61cf2d3c1b77db440efb835b729a84)
2008-04-21Don't modify the fsp in fd_close_posix() anymore.Michael Adam1-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 (This used to be commit df264bf3e00d7d77afcf55e54d2669b9ffa9af4a)
2008-04-21Move the posix pending close functionality down into the VFS layer.Michael Adam1-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 (This used to be commit 3cf56b124a2886c6260455bba4bf77d08e9a4f77)
2008-01-07Remove redundant parameter fd from SMB_VFS_GETLOCK().Michael Adam1-2/+2
Michael (This used to be commit ee5a20becdcdb20d7012732b324c6938fab44f67)
2008-01-07Remove redundant parameter fd from SMB_VFS_LOCK().Michael Adam1-2/+2
Michael (This used to be commit 4f3ab2c406072e0b43581057e7e785e8ad454cfa)
2007-12-22Remove redundant connection_struct from fd_close_posix() parameter list.Michael Adam1-2/+2
Michael (This used to be commit f3365b74ac016eaee1e82eef769dd618af5df201)
2007-12-11Convert the posix_pending_close_db to dbwrap_rbtVolker Lendecke1-126/+130
(This used to be commit 841f4ccbfb5f79ac4f447342e9dd6ef73cacbc65)
2007-12-10Tiny simplificationsVolker Lendecke1-1/+1
locking.c:open_read_only was unused don't export the silly boolean flag locking_init(bool read_only) (This used to be commit 2f3c865707010bc7c463a02782dbee3dc2479da1)
2007-12-10Remove two staticsVolker Lendecke1-39/+17
(This used to be commit 8ee502e1e59960fd8db037f0adf1171b2a18cec5)
2007-11-15Add MAX_DNS_NAME_LENGTH, remove more pstrings.Jeremy Allison1-2/+5
Jeremy. (This used to be commit a1725f4ff7ed375808c78ac661b539557748d0a5)
2007-10-18RIP BOOL. Convert BOOL -> bool. I found a few interestingJeremy Allison1-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. (This used to be commit f35a266b3cbb3e5fa6a86be60f34fe340a3ca71f)
2007-10-10r24571: Only look at errno if the close call actually failedVolker Lendecke1-1/+4
Patch from Ofir Azoulay <Ofir.Azoulay@expand.com> -- thanks (This used to be commit 888e657d758173c0eb4b68059d6fb5ae45b2b2ed)
2007-10-10r23784: use the GPLv3 boilerplate as recommended by the FSF and the license textAndrew Tridgell1-2/+1
(This used to be commit b0132e94fc5fef936aa766fb99a306b3628e9f07)
2007-10-10r23779: Change from v2 or later to v3 or later.Jeremy Allison1-1/+1
Jeremy. (This used to be commit 407e6e695b8366369b7c76af1ff76869b45347b3)
2007-10-10r23510: Tidy calls to smb_panic by removing trailing newlines. Print theJames Peach1-11/+11
failed expression in SMB_ASSERT. (This used to be commit 171dc060e2a576d724eed1ca65636bdafffd7713)
2007-10-10r23183: Check in a change made by Tridge:Volker Lendecke1-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 (This used to be commit 9b10dbbd5de8813fc15ebbb6be9b18010ffe8139)
2007-10-10r23096: Make the lock failure message prettier.James Peach1-4/+4
(This used to be commit 853f41edb8b23d7fdfaba9c4bb37dc27af92a982)
2007-10-10r22009: change TDB_DATA from char * to unsigned char *Stefan Metzmacher1-4/+4
and fix all compiler warnings in the users metze (This used to be commit 3a28443079c141a6ce8182c65b56ca210e34f37f)
2007-10-10r21191: Add in the POSIX open/mkdir/unlink calls.Jeremy Allison1-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. (This used to be commit 83dbbdff345fa9e427c9579183f4380004bf3dd7)
2007-10-10r19668: Convert the locking params to use struct share_param instead of snumVolker Lendecke1-1/+1
(This used to be commit 609dbec600048718b86cd1ecdc2ce49bbdeb803c)
2007-10-10r17452: Some C++ warningsVolker Lendecke1-1/+1
(This used to be commit e4b8c79a9d6f7323953121887af4f482d04a9228)
2007-10-10r17041: Trying to track down a *big* memory leak in the new lock code.Jeremy Allison1-0/+1
Fix a small one first.... (easy to valgrind). Jeremy (This used to be commit 43d24fbd41ed745a5b21514b526e655663c509ee)
2007-10-10r17000: Allow CIFS POSIX locks to coexist with Windows locks.Jeremy Allison1-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. (This used to be commit 2f8cabe98d3776cb0bdf6b4ef1490fe0119e260a)
2007-10-10r16992: Fix bug #3922 reported by jason@ncac.gwu.edu, correctlyJeremy Allison1-1/+1
look at the return code. Jeremy. (This used to be commit f11933b3ac91c6fbacd6b410f4d2c0d400df23ee)
2007-10-10r16987: Fix the logic errors in ref-counting Windows locks.Jeremy Allison1-7/+8
Hopefully will fix the build farm. Still a few errors in RAW-LOCK to look at though... Jeremy. (This used to be commit edd72d37de570fdad09f7ee983b5b22a1613e558)
2007-10-10r16973: Fix subtle logic error in lock ref counting found byJeremy Allison1-7/+7
cifsfs client code. Jeremy. (This used to be commit 53094435d89088124041d57078c21a12e761e2bf)
2007-10-10r16945: Sync trunk -> 3.0 for 3.0.24 code. Still needJeremy Allison1-667/+624
to do the upper layer directories but this is what everyone is waiting for.... Jeremy. (This used to be commit 9dafb7f48ca3e7af956b0a7d1720c2546fc4cfb8)
2007-10-10r16307: Make sure we know we must pass a valid pointer here.Jeremy Allison1-3/+2
Klocwork #1129. Jeremy. (This used to be commit e8d86362ba8762a5e4180e7320f5ac8bb37c203d)
2007-10-10r15018: Merge Volker's ipc/trans2/nttrans changes overJeremy Allison1-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. (This used to be commit 08e52ead03304ff04229e1bfe544ff40e2564fc7)
2007-10-10r14703: Clarify the return codes for the POSIX locking case. ThisJeremy Allison1-2/+6
was confusing. Jeremy. (This used to be commit bc1a605a39e58a7dbdcd4d132345e957e3ed9d5e)
2007-10-10r13915: Fixed a very interesting class of realloc() bugs found by Coverity.Jeremy Allison1-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. (This used to be commit 1d710d06a214f3f1740e80e0bffd6aab44aac2b0)
2007-10-10r8219: Merge the new open code from HEAD to 3.0. Haven't yet run the tortureJeremy Allison1-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. (This used to be commit c7fe18761e2c753afbffd3a78abff46472a9b8eb)
2007-10-10r7975: One more tidyup to ensure we're using "struct posix_lock".Jeremy Allison1-1/+2
Jeremy. (This used to be commit 960a5d37d1cfa25e4f7491b175dab68ac9f37c43)
2007-10-10r7972: Tidy up the posix locking in memory db code whilst I'm waiting for jhtJeremy Allison1-20/+21
to get back to me with a backtrace. Jeremy. (This used to be commit f2bcfdddc769a2939b03a1a6742fec86712c9097)
2007-10-10r6502: add LOCKING debug class - pull PRINTINGDB class definition from trunkHerb Lewis1-0/+3
so our numbers don't get out of sync (This used to be commit 58e307664e02ebf0415f19ed625d2f166d9cb1cc)
2007-10-10r5625: Reformat (tidy).Jeremy Allison1-4/+4
(This used to be commit b94db3a75806f1b09a8a0366029812ba2195727c)
2007-10-10r4088: Get medieval on our ass about malloc.... :-). Take control of all our ↵Jeremy Allison1-6/+5
allocation functions so we can funnel through some well known functions. Should help greatly with malloc checking. HEAD patch to follow. Jeremy. (This used to be commit 620f2e608f70ba92f032720c031283d295c5c06a)
2007-10-10r3120: Fix bug #1955 reported by Love <lha@stacken.kth.se>. Inconsistent ↵Jeremy Allison1-3/+3
error return. Jeremy. (This used to be commit c6b144654ae544c86f7caa35483e25f0cfe5e904)