summaryrefslogtreecommitdiff
path: root/source3/smbd/oplock_linux.c
Commit message (Collapse)AuthorAgeFilesLines
* Wrap setting leases in become_root()/unbecome_root() to ensure correct ↵Jeremy Allison2013-08-071-13/+20
| | | | | | | | | | delivery of signals. Remove workaround for Linux kernel bug https://bugzilla.kernel.org/show_bug.cgi?id=43336 as we don't need to set capabilities when we're already root. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Simo Sorce <idra@samba.org>
* Fix bug #8974 - Kernel oplocks are broken when uid(file) != uid(process).Jeremy Allison2012-06-211-0/+13
| | | | | | | Based on a fix from "Etienne Dechamps " <e-t172@akegroup.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Thu Jun 21 21:53:58 CEST 2012 on sn-devel-104
* s3:smbd/oplock_linux: don't overwrite private_dataStefan Metzmacher2012-02-101-2/+0
| | | | | | | | | | | | | We set ctx->private_data = sconn a few lines above and expect 'sconn' in the signal event handler. Thanks to Christian Ambach <ambi@samba.org> for the bug report. metze Autobuild-User: Stefan Metzmacher <metze@samba.org> Autobuild-Date: Fri Feb 10 21:48:18 CET 2012 on sn-devel-104
* s3:smbd/oplock: pass smbd_server_connection to linux_init_kernel_oplocks()Stefan Metzmacher2011-12-131-5/+12
| | | | metze
* s3: Fix some nonempty blank linesVolker Lendecke2011-09-131-3/+3
|
* s3-globals Remove smbd_event_context() (use server_event_context())Andrew Bartlett2011-05-311-1/+1
| | | | | | | | This has been a wrapper around server_event_context() for some time now, and removing this from dummmysmbd.c assists with library dependencies. Andrew Bartlett
* s3: include smbd/smbd.h where needed.Günther Deschner2011-03-301-0/+1
| | | | Guenther
* s3-includes: only include system/filesys.h when needed.Günther Deschner2011-03-301-0/+1
| | | | Guenther
* s3: Lift smbd_server_conn from file_find_fdVolker Lendecke2010-09-281-1/+1
|
* s3: Remove smbd_messaging_context() from linux_oplock_signal_handler()Volker Lendecke2010-07-051-1/+1
|
* Hopefully last part of the fix for bug 6651 - smbd SIGSEGV when breaking ↵Jeremy Allison2009-09-031-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | oplocks. This one is subtle. There is a race condition where a signal can be queued for oplock break, and then the file can be closed by the client before the signal can be processed. Currently if this occurs we panic (we can't match an incoming signal fd with a fsp pointer). Simply log the error (at debug level 10 right now, might be too much) and then return without processing the break request. It looks like there is another race condition with this fix, but here's why it won't happen. If the signal was pending (caused by a kernel oplock break from a local file open), and the client closed the file and then re-opened another file which happened to use the same file descriptor as the file just closed, then theoretically the oplock break requests could be processed on the wrong fd. Here's why this should be very rare.. Processing a pending signal always take precedence over an incoming network request, so as long as the client close request is non-chained then the break signal should always be harmlessly processed *before* the open can be called. If the open is chained onto the close, and the fd on the new open is the same as the old closed fd, then it's possible this race will occur. However, all that will happen is that we'll lose the oplock on this file. A shame, but not a fatal event. Jeremy.
* Help debug for bug 6651 - smbd SIGSEGV when breaking oplocks.Jeremy Allison2009-08-241-0/+4
| | | | | | Should help track if we get invoked with an invalid fd from the signal handler. Jeremy.
* s3: Change fsp->fsp_name to be an smb_filename struct!Tim Prouty2009-07-201-4/+5
|
* s3 oplocks: Make the level2 oplock contention API more granularTim Prouty2009-02-091-2/+4
| | | | | | | | | | | | | | | | | | This replaces release_level2_oplocks_on_change with contend_level2_oplock_begin/end in order to contend level2 oplocks throughout an operation rather than just at the begining. This is necessary for some kernel oplock implementations, and also lays the groundwork for better correctness in Samba's standard level2 oplock handling. The next step for non-kernel oplocks is to add additional state to the share mode lock struct that prevents any new opens from granting oplocks while a contending operation is in progress. All operations that contend level 2 oplocks are now correctly spanned except for aio and synchronous writes. The two write paths both have non-trivial error paths that need extra care to get right. RAW-OPLOCK and the rest of 'make test' are still passing with this change.
* s3 oplocks: Differentiate between releasing an oplock vs. downgrading to ↵Tim Prouty2009-02-091-1/+1
| | | | | | | Level 2 for kernel oplocks Pass in an extra argument when releasing an oplock so kernel oplock implementations can support downgrading from Level 1 to Level 2.
* s3:smbd: make kernel oplocks event drivenStefan Metzmacher2009-01-271-49/+17
| | | | | | And use signal events for Linux oplocks. metze
* s3:smbd: restructure kernel oplocks codeStefan Metzmacher2009-01-221-12/+24
| | | | | | | | This converts the irix oplocks code to use a fd event and removes the last special case for file descriptors for the main sys_select(). metze
* s3:smbd: move all globals and static variables in globals.[ch]Stefan Metzmacher2009-01-081-18/+14
| | | | | | The goal is to move all this variables into a big context structure. metze
* Fix Bug #5285. (libcap header mismatch)Günther Deschner2008-05-281-46/+2
| | | | | | | | | | Can someone with gpfs available test this ? The only codepath using this function is the modules/gpfs.c module. The fix resolves at least the build issues Samba has with recent kernel / libcap versions by using the portable cap_get_proc()/cap_set_proc() interface (instead of using capget/capset). Guenther (This used to be commit 177955141247a4eb56ba0d82dc1add7f52175c40)
* Merge CTDB-related fixes from samba-ctdb 3.0 branch ↵Alexander Bokovoy2008-01-161-6/+16
| | | | | | (http://samba.org/~tridge/3_0-ctdb) Signed-off-by: Alexander Bokovoy <ab@samba.org>(This used to be commit 0c8e23afbbb2d081fc23908bafcad04650bfacea)
* Remove redundant parameter fd from SMB_VFS_LINUX_SETLEASE().Michael Adam2008-01-071-2/+2
| | | | | Michael (This used to be commit 8880eb82f16d561a4023ec8426f8ea35c579a7a6)
* RIP BOOL. Convert BOOL -> bool. I found a few interestingJeremy Allison2007-10-181-3/+3
| | | | | | | | 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)
* r25055: Add file_id_string_tosVolker Lendecke2007-10-101-4/+4
| | | | | This removes file_id_string_static and file_id_string_static2 (This used to be commit 638c848c9afe374feb30e34c494f89b2a6c64f7b)
* r23784: use the GPLv3 boilerplate as recommended by the FSF and the license textAndrew Tridgell2007-10-101-2/+1
| | | | (This used to be commit b0132e94fc5fef936aa766fb99a306b3628e9f07)
* r23779: Change from v2 or later to v3 or later.Jeremy Allison2007-10-101-1/+1
| | | | | Jeremy. (This used to be commit 407e6e695b8366369b7c76af1ff76869b45347b3)
* r23183: Check in a change made by Tridge:Volker Lendecke2007-10-101-12/+12
| | | | | | | | | | | | | | 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)
* r21324: Add linux setlease to the vfs layer. Next round, as Volker points out,Jim McDonough2007-10-101-9/+18
| | | | | | | | | | it should be abstracted a little higher up so other os'es can have an entry, but it will take a bit more work. Thanks to Chetan Shringarpure and Mathias Dietz. I didn't increment the vfs number again because the kernel change notify stuff hasn't been released yet anyway. (This used to be commit 9463211bf3b46ee408b88dfbf42d498e3839d4cc)
* r17896: Reformatting. I did not want to do it anymore, but these ones looked ↵Volker Lendecke2007-10-101-12/+19
| | | | | | | | | just silly :-) Volker (This used to be commit 8b6f5937db4b18db711dd0c4f1ae904087249000)
* r15668: DOS or FCB opens share one share mode entry from differentJeremy Allison2007-10-101-3/+3
| | | | | | | | 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)
* r15446: Tidy up the formatting of locking debug messages and make it moreJames Peach2007-10-101-0/+1
| | | | | | consistent. Bring oplocks withing the purview of the locking debug channel. (This used to be commit e817cfd7d3a42d141198122eada58b5a7ba90e9c)
* r12735: After talking to Tridge and Jeremy... This needs to be made more genericVolker Lendecke2007-10-101-16/+6
| | | | | | | before it goes in. Volker (This used to be commit 2c3d5c029a31111e1fe84ddc13c1bfc183d8bfde)
* r12721: GPFS 2.4 on Linux will contain some windows semantics, ie share ↵Volker Lendecke2007-10-101-6/+16
| | | | | | | | | | | | | | | | | modes and oplocks across the cluster. Adapt Samba to it. The gpfs API is called via libgpfs.so. This code is written with dlopen(), so that you can compile on a system with gpfs installed and later on run on systems without gpfs available. So to actually make Samba call gpfs share mode calls you need to compile with gpfs.h and libgpfs.so around and set 'gpfs share = yes' on the shares you export from GPFS. Volker (This used to be commit 2253b17a1a88555291b59d52c826c81c2b8f7e7f)
* r10656: BIG merge from trunk. Features not copied overGerald Carter2007-10-101-53/+3
| | | | | | | | * \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)
* r8219: Merge the new open code from HEAD to 3.0. Haven't yet run the tortureJeremy Allison2007-10-101-4/+4
| | | | | | | | | | 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)
* r7440: * merge registry server changes from trunk (so far) for moreGerald Carter2007-10-101-1/+1
| | | | | | | printmig.exe work * merge the sys_select_signal(char c) change from trunk in order to keeo the winbind code in sync (This used to be commit a112c5570a7f8ddddde1af0fa665f40a6067e8cf)
* r6586: get rid of a few more compiler warningsHerb Lewis2007-10-101-0/+2
| | | | (This used to be commit 173375f8d88bf8e8db8d60e5d5f0e5dcc28767d9)
* r6225: get rid of warnings from my compiler about nested externsHerb Lewis2007-10-101-16/+16
| | | | (This used to be commit efea76ac71412f8622cd233912309e91b9ea52da)
* r6149: Fixes bugs #2498 and 2484.Derrell Lipman2007-10-101-3/+9
| | | | | | | | | | | | | | | | | | | 1. using smbc_getxattr() et al, one may now request all access control entities in the ACL without getting all other NT attributes. 2. added the ability to exclude specified attributes from the result set provided by smbc_getxattr() et al, when requesting all attributes, all NT attributes, or all DOS attributes. 3. eliminated all compiler warnings, including when --enable-developer compiler flags are in use. removed -Wcast-qual flag from list, as that is specifically to force warnings in the case of casting away qualifiers. Note: In the process of eliminating compiler warnings, a few nasties were discovered. In the file libads/sasl.c, PRIVATE kerberos interfaces are being used; and in libsmb/clikrb5.c, both PRIAVE and DEPRECATED kerberos interfaces are being used. Someone who knows kerberos should look at these and determine if there is an alternate method of accomplishing the task. (This used to be commit 994694f7f26da5099f071e1381271a70407f33bb)
* Fix more 64-bit printf warnings.Tim Potter2003-11-031-2/+2
| | | | (This used to be commit 23443e3aa079710221557e18158d0ddb8ff48a36)
* Fix from Steve G <linux_4ever@yahoo.com>. Ensure sigemptyset is called onJeremy Allison2003-05-151-0/+1
| | | | | | the sa_mask to prevent valgrind complaints. Jeremy. (This used to be commit e065c3a58f5c7f2612596574046a73869183dbd3)
* merged real time signal fixes from headAndrew Tridgell2003-03-281-1/+4
| | | | (This used to be commit 03a5e62300f3cfb96d14570b73a758e6fa64c449)
* Merge indirection, signed/unsigned and uninitialiased-value fixes from HEAD.Andrew Bartlett2003-01-141-0/+2
| | | | | Andrew Bartlett (This used to be commit 2a1adb8f81d8966e8919fffb9b4c69f3e6acd44f)
* updated the 3.0 branch from the head branch - ready for alpha18Andrew Tridgell2002-07-151-27/+30
| | | | (This used to be commit 03ac082dcb375b6f3ca3d810a6a6367542bc23ce)
* Removed version number from file header.Tim Potter2002-01-301-2/+1
| | | | | Changed "SMB/Netbios" to "SMB/CIFS" in file header. (This used to be commit 6a58c9bd06d0d7502a24bf5ce5a2faf0a146edfa)
* Fixed unsigned / long unsigned format missmatch.Jeremy Allison2001-11-061-4/+4
| | | | | Jeremy (This used to be commit 86c2f9636635283beb8e496315a7bfac881355dd)
* Move from timestamp to gen count file id's for finding oplocked filesJeremy Allison2001-10-201-46/+46
| | | | | | in a tdb. Jeremy. (This used to be commit 058ae6b58f61ef46013dd076af3a84de5fbaaab1)
* Removed 'extern int DEBUGLEVEL' as it is now in the smb.h header.Tim Potter2001-10-021-2/+0
| | | | (This used to be commit 2d0922b0eabfdc0aaf1d0797482fef47ed7fde8e)
* convert more code to using d_printfAndrew Tridgell2001-09-081-1/+2
| | | | (This used to be commit 60d297303488ed583537ca2853828fccd6da2ade)
* fixed usage of socklen_t and also tidied up SIG_ATOMIC_T, using a typedef ↵Andrew Tridgell2001-06-251-5/+5
| | | | | | instead of a define (This used to be commit e2ecff419fdc0a0dc7551b33b377dc11061ef2a3)
* More compiler warning fixes.Tim Potter2001-05-081-2/+2
| | | | (This used to be commit 88a7b2c3f80b17ca8ab2112e9a98f55f1a11d88c)