1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00
Commit Graph

68 Commits

Author SHA1 Message Date
Christof Schmitt
01e563be72 smbd: Remove unused define
CAP_LEASE is not used in the file oplock_linux.c, so remove it there.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2020-01-21 22:08:41 +00:00
Christof Schmitt
6a19404e98 smbd: Remove unused function linux_set_lease_capability
This function is no longer used. In case this capability would be
required, set_effective_capability(LEASE_CAPABILITY) could also be
called directly.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2020-01-21 22:08:41 +00:00
Volker Lendecke
79291056c5 smbd: Use file_id_str_buf() in linux_release_kernel_oplock()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-11-12 20:56:34 +00:00
Volker Lendecke
f7dc033481 smbd: Use file_id_str_buf() in linux_oplock_signal_handler()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-11-12 20:56:34 +00:00
Volker Lendecke
4f8db9b3cf vfs: Make "fd_handle->gen_id" 64-bit everywhere
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-09-17 22:49:35 +00:00
Ralph Boehme
ac597b0706 Revert "smbd: explain that/why we use the raw tevent_context for linux_oplock_signal_handler()"
This reverts commit dc517b20f6.

See the discussion in

https://lists.samba.org/archive/samba-technical/2018-December/131731.html

for the reasoning behind this revert.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2019-01-11 23:11:17 +01:00
Andreas Schneider
95432e30e9 s3:smbd: Use #ifdef instead of #if for config.h definitions
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
2018-11-28 23:19:24 +01:00
Volker Lendecke
7460d9b97e smbd: Remove koplocks->contend_level2 callbacks
This was only implemented by onefs in this way. If we get around to use
for example fanotify or something similar, we can either re-add them or
do it in a different way. For now, simplify the code.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>

Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Wed Aug 22 00:57:31 CEST 2018 on sn-devel-144
2018-08-22 00:57:31 +02:00
Stefan Metzmacher
dc517b20f6 smbd: explain that/why we use the raw tevent_context for linux_oplock_signal_handler()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2018-06-18 08:59:19 +02:00
Jeremy Allison
1af8b07929 Wrap setting leases in become_root()/unbecome_root() to ensure correct 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>
2013-07-31 17:07:58 -07:00
Jeremy Allison
dd763d6d8e Fix bug #8974 - Kernel oplocks are broken when uid(file) != uid(process).
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
2012-06-21 21:53:58 +02:00
Stefan Metzmacher
389bb4fbe1 s3:smbd/oplock_linux: don't overwrite private_data
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
2012-02-10 21:48:18 +01:00
Stefan Metzmacher
641a2dea81 s3:smbd/oplock: pass smbd_server_connection to linux_init_kernel_oplocks()
metze
2011-12-13 20:31:09 +01:00
Volker Lendecke
f6fa51ddf7 s3: Fix some nonempty blank lines 2011-09-13 11:00:12 +02:00
Andrew Bartlett
e5dd03d199 s3-globals Remove smbd_event_context() (use server_event_context())
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
2011-05-31 00:32:07 +02:00
Günther Deschner
8c24ebf371 s3: include smbd/smbd.h where needed.
Guenther
2011-03-30 01:13:08 +02:00
Günther Deschner
0e771263ee s3-includes: only include system/filesys.h when needed.
Guenther
2011-03-30 01:13:07 +02:00
Volker Lendecke
eadc4b5b78 s3: Lift smbd_server_conn from file_find_fd 2010-09-28 07:36:18 +02:00
Volker Lendecke
8ea271bb2e s3: Remove smbd_messaging_context() from linux_oplock_signal_handler() 2010-07-05 11:06:28 +02:00
Jeremy Allison
bdc7bdb0d3 Hopefully last part of the fix for bug 6651 - smbd SIGSEGV when breaking 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.
2009-09-03 07:40:48 -07:00
Jeremy Allison
2135461037 Help debug for bug 6651 - smbd SIGSEGV when breaking oplocks.
Should help track if we get invoked with an invalid fd from
the signal handler.
Jeremy.
2009-08-24 21:14:52 -07:00
Tim Prouty
5a8d70d465 s3: Change fsp->fsp_name to be an smb_filename struct! 2009-07-20 17:26:56 -07:00
Tim Prouty
c6f1f055fd s3 oplocks: Make the level2 oplock contention API more granular
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.
2009-02-09 23:47:45 -08:00
Tim Prouty
9c1310fa6a s3 oplocks: Differentiate between releasing an oplock vs. downgrading to 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.
2009-02-09 23:47:44 -08:00
Stefan Metzmacher
52f6a4436f s3:smbd: make kernel oplocks event driven
And use signal events for Linux oplocks.

metze
2009-01-27 15:28:10 +01:00
Stefan Metzmacher
196028ab7b s3:smbd: restructure kernel oplocks code
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
2009-01-22 12:37:29 +01:00
Stefan Metzmacher
3dde0cbb76 s3:smbd: move all globals and static variables in globals.[ch]
The goal is to move all this variables into a big context structure.

metze
2009-01-08 12:22:21 +01:00
Günther Deschner
611072fc1c Fix Bug #5285. (libcap header mismatch)
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 1779551412)
2008-05-28 13:22:52 +02:00
Alexander Bokovoy
68694369fc Merge CTDB-related fixes from samba-ctdb 3.0 branch (http://samba.org/~tridge/3_0-ctdb)
Signed-off-by: Alexander Bokovoy <ab@samba.org>(This used to be commit 0c8e23afbb)
2008-01-16 12:09:48 +03:00
Michael Adam
26169410cd Remove redundant parameter fd from SMB_VFS_LINUX_SETLEASE().
Michael
(This used to be commit 8880eb82f1)
2008-01-07 21:47:56 +01:00
Jeremy Allison
30191d1a57 RIP BOOL. Convert BOOL -> bool. I found a few interesting
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 f35a266b3c)
2007-10-18 17:40:25 -07:00
Volker Lendecke
4ee8b2937d r25055: Add file_id_string_tos
This removes file_id_string_static and file_id_string_static2
(This used to be commit 638c848c9a)
2007-10-10 12:30:36 -05:00
Andrew Tridgell
5e54558c6d r23784: use the GPLv3 boilerplate as recommended by the FSF and the license text
(This used to be commit b0132e94fc)
2007-10-10 12:28:22 -05:00
Jeremy Allison
d824b98f80 r23779: Change from v2 or later to v3 or later.
Jeremy.
(This used to be commit 407e6e695b)
2007-10-10 12:28:20 -05:00
Volker Lendecke
e8156439f2 r23183: Check in a change made by Tridge:
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 9b10dbbd5d)
2007-10-10 12:22:52 -05:00
Jim McDonough
5a052edf03 r21324: Add linux setlease to the vfs layer. Next round, as Volker points out,
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 9463211bf3)
2007-10-10 12:17:56 -05:00
Volker Lendecke
49a08c7c5a r17896: Reformatting. I did not want to do it anymore, but these ones looked just
silly :-)

Volker
(This used to be commit 8b6f5937db)
2007-10-10 11:38:57 -05:00
Jeremy Allison
cc9ea93456 r15668: DOS or FCB opens share one share mode entry from different
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 fd6fa1d4ea)
2007-10-10 11:17:06 -05:00
James Peach
5910e397d3 r15446: Tidy up the formatting of locking debug messages and make it more
consistent. Bring oplocks withing the purview of the locking debug
channel.
(This used to be commit e817cfd7d3)
2007-10-10 11:16:45 -05:00
Volker Lendecke
4d1d826be4 r12735: After talking to Tridge and Jeremy... This needs to be made more generic
before it goes in.

Volker
(This used to be commit 2c3d5c029a)
2007-10-10 11:06:02 -05:00
Volker Lendecke
a189257c15 r12721: GPFS 2.4 on Linux will contain some windows semantics, ie share 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 2253b17a1a)
2007-10-10 11:06:01 -05:00
Gerald Carter
54abd2aa66 r10656: BIG merge from trunk. Features not copied over
* \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 939c3cb5d7)
2007-10-10 11:04:48 -05:00
Jeremy Allison
af8a691db1 r8219: Merge the new open code from HEAD to 3.0. Haven't yet run the torture
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 c7fe18761e)
2007-10-10 10:58:18 -05:00
Gerald Carter
129b461673 r7440: * merge registry server changes from trunk (so far) for more
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 a112c5570a)
2007-10-10 10:57:09 -05:00
Herb Lewis
1c4bbe0654 r6586: get rid of a few more compiler warnings
(This used to be commit 173375f8d8)
2007-10-10 10:56:46 -05:00
Herb Lewis
978ca84860 r6225: get rid of warnings from my compiler about nested externs
(This used to be commit efea76ac71)
2007-10-10 10:56:30 -05:00
Derrell Lipman
9840db418b r6149: Fixes bugs #2498 and 2484.
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 994694f7f2)
2007-10-10 10:56:24 -05:00
Tim Potter
fbb8f131c2 Fix more 64-bit printf warnings.
(This used to be commit 23443e3aa0)
2003-11-03 14:34:25 +00:00
Jeremy Allison
3ededa5f7b Fix from Steve G <linux_4ever@yahoo.com>. Ensure sigemptyset is called on
the sa_mask to prevent valgrind complaints.
Jeremy.
(This used to be commit e065c3a58f)
2003-05-15 17:37:52 +00:00
Andrew Tridgell
567fcd81ed merged real time signal fixes from head
(This used to be commit 03a5e62300)
2003-03-28 01:07:05 +00:00