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

4450 Commits

Author SHA1 Message Date
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
Tim Prouty
122dbbf00a s3 vfs: Add a destructor to the fsp extension data API
I'm not certain if the dummy pointer is needed in struct vfs_fsp_data,
but I added it to be consistent with the comment below.
2009-02-09 23:46:12 -08:00
todd stecher
54c51a66e3 S3: New module interface for SMB message statistics gathering
This changelist allows for the addition of custom performance
monitoring modules through smb.conf. Entrypoints in the main message
processing code have been added to capture the command, subop, ioctl,
identity and message size statistics.
2009-02-09 13:23:44 -08:00
Volker Lendecke
9941e730ca Fix memleaks in chain_reply for async requests 2009-02-07 19:25:34 +01:00
Volker Lendecke
422e77f32a Convert api_RNetGroupEnum to use samr instead of pdb 2009-02-07 19:25:34 +01:00
Volker Lendecke
2fd79e15f7 Close samr_handle if open_domain failed 2009-02-07 19:25:34 +01:00
Günter Kukkukk
e4ad0a1d1f Don't try and delete a default ACL from a file. 2009-02-05 18:57:41 -08:00
Jeremy Allison
e7c09d8b10 Fix bug #Bug 6090 renaming or deleting a "not matching/resolving" symlink is failing.
Reported by Kukks. Make sure we correctly use LSTAT in all cases where
POSIX pathnames are being used. This matters when dealing with symlinks
pointing to invalid paths being renamed or deleted not all deletes and
renames are done via an nt_create open.
Jeremy.
2009-02-04 16:33:52 -08:00
Jeremy Allison
553818add8 Fix bug #6082 - smbd_gpfs_getacl failed: Windows client can´t rename or delete file
This fixes the generic rename/delete problem for 3.3.0 and above.
Fixed slightly differently to discussions, user viewable modified
ACLs are not a good idea :-).
Jeremy.
2009-02-02 17:10:27 -08:00
Dan Sledz
d96248a9b4 Add two new parameters to control how we verify kerberos tickets. Removes lp_use_kerberos_keytab parameter.
The first is "kerberos method" and replaces the "use kerberos keytab"
with an enum.  Valid options are:
secrets only - use only the secrets for ticket verification (default)
system keytab - use only the system keytab for ticket verification
dedicated keytab - use a dedicated keytab for ticket verification.
secrets and keytab - use the secrets.tdb first, then the system keytab

For existing installs:
"use kerberos keytab = yes" corresponds to secrets and keytab
"use kerberos keytab = no" corresponds to secrets only

The major difference between "system keytab" and "dedicated keytab" is
that the latter method relies on kerberos to find the correct keytab
entry instead of filtering based on expected principals.

The second parameter is "dedicated keytab file", which is the keytab
to use when in "dedicated keytab" mode.  This keytab is only used in
ads_verify_ticket.
2009-02-01 20:23:31 -08:00
Volker Lendecke
50ca5af9f3 Convert api_RNetUserEnum to use the srv_samr_nt.c directly
This is a sample for other accesses to pdb to go via samr. The goal is to
access passdb only via srv_samr_nt.c. If that is done, then we can easily swap
in another samr implementation like for example samba4's via a unix domain
socket.
2009-02-01 14:34:23 +01:00
Volker Lendecke
dba6624dca Fix nonempty blank lines 2009-02-01 14:34:22 +01:00
Volker Lendecke
19ce90b90e Just for fun: Move some bytes from bss to text 2009-02-01 14:34:22 +01:00
Volker Lendecke
72729bfaee Make reply_pipe_read_andx async 2009-01-31 17:50:18 +01:00
Volker Lendecke
2d5ec28b3b Make reply_pipe_write async 2009-01-31 17:50:18 +01:00
Volker Lendecke
8ef92f7e32 Make reply_pipe_write_and_X async 2009-01-31 17:50:18 +01:00
Volker Lendecke
e8b2b46cae Make-np_write-handle-0-byte-writes-as-NT_STATUS_OK 2009-01-31 17:50:18 +01:00
Volker Lendecke
c2fe28ba59 Convert api_rpc_trans_reply to async np_* 2009-01-31 17:50:18 +01:00
Volker Lendecke
cee0d85e0b make send_file_readbraw static 2009-01-31 11:09:39 +01:00
Volker Lendecke
d94e9c802c Remove the global variable "chain_size" 2009-01-31 11:09:39 +01:00
Jeremy Allison
864852a4ae Upgrade POSIX inheritance storage to a new format (version 2). Stores
the Windows ACL type and flags if "map acl inherit" is set.
Jeremy.
2009-01-29 15:58:50 -08:00
Tim Prouty
b8f7cdbd79 s3: Add a new SMB_VFS_GET_ALLOC_SIZE vfs operation
This allows module implementors to customize what allocation size is
returned to the client.
2009-01-29 15:29:33 -08:00
Michael Adam
ba482e6b8d s3:smbd: make smbd_open_one_socket() static
Michael
2009-01-29 15:42:10 +01:00
Stefan Metzmacher
3ee1acdc8e s3:smbd: ignore open_socket_in() failures
This restores the pre e0232934fb
behavior.

metze
2009-01-29 15:33:47 +01:00
Stefan Metzmacher
e0232934fb s3:smbd: wait for new connection via fd events
metze
2009-01-27 15:28:12 +01:00
Stefan Metzmacher
bf2347bd7d s3:smbd: make mdns registration event driven.
metze
2009-01-27 15:28:11 +01:00
Stefan Metzmacher
e11e82318c s3:smbd: make inetd code path more clear
metze
2009-01-27 15:28:11 +01: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
4a22713495 s3:smbd: remove pointless respond_to_all_remaining_local_messages() function
This the process_kernel_oplock() function never response to messages,
it only generates messages to ourself.

metze
2009-01-27 15:28:10 +01:00
Stefan Metzmacher
b8c416fe2a s3:smbd: convert aio to use tevent_signal
metze
2009-01-27 15:28:09 +01:00
Stefan Metzmacher
ac61f650ae s3:smbd: use signal events for SIGTERM, SIGHUP and SIGCHLD
metze
2009-01-27 15:28:07 +01:00
Stefan Metzmacher
27f812f3a8 s3:smbd: move all code that handles a client connection into smbd_process()
metze
2009-01-27 15:28:07 +01:00
Stefan Metzmacher
6a2b7f9815 s3:smbd: we should setup the client socket in the same way in all code pathes
We should behave the same in inetd, interactive and deamon modes.

metze
2009-01-27 15:28:07 +01:00
Stefan Metzmacher
7d93d3d4b8 s3:namecache: remove unused namecache_shutdown() function
metze
2009-01-27 15:28:06 +01:00
Volker Lendecke
c0fea1f0f7 Fix chain_reply for pipe reads
The caller might have over-allocated reply->outbuf. Deal with that.

Sorry, Günther, for giving you so much pain ...

Volker
2009-01-25 12:18:34 +01:00
todd stecher
48b0016cff Extend NTIMES to allow setting create_time
1) Add in smb_file_time struct to clarify code and make room for createtime.
2) Get and set create time from SMB messages.
3) Fixup existing VFS modules + examples Some OS'es allow for the
setting of the birthtime through kernel interfaces. This value is
generically used for Windows createtime, but is not settable in the
code today.
2009-01-23 21:05:38 -08:00
Jeremy Allison
634cc6b64a Fix logic error in try_chown - we shouldn't arbitrarily chown
to ourselves unless that was passed in.
Jeremy.
2009-01-22 15:57:41 -08:00
Jeremy Allison
81533e2d39 Second part of the attemt to fix #4308 - Excel save operation corrupts file ACLs.
If the chown succeeds then the ACL set should also. Ensure this is the case
(refactor some of this code to make it simpler to read also).
Jeremy.
2009-01-22 14:38:57 -08:00
Jeremy Allison
2d81c9e957 Another attempt to fix bug #4308 - Excel save operation corrupts file ACLs.
Simo is completely correct. We should be doing the chown *first*, and fail the
ACL set if this fails. The long standing assumption I made when writing the
initial POSIX ACL code was that Windows didn't control who could chown a file
in the same was as POSIX. In POSIX only root can do this whereas I wasn't sure
who could do this in Windows at the time (I didn't understand the privilege
model). So the assumption was that setting the ACL was more important (early
tests showed many failed ACL set's due to inability to chown). But now we have
privileges in smbd, and we must always fail an ACL set when we can't chown
first. The key that Simo noticed is that the CREATOR_OWNER bits in the ACL
incoming are relative to the *new* owner, not the old one. This is why the old
user owner disappears on ACL set - their access was set via the USER_OBJ in the
creator POSIX ACL and when the ownership changes they lose their access.

Patch is simple - just ensure we do the chown first before evaluating the
incoming ACL re-read the owners. We already have code to do this it just wasn't
rigorously being applied.
Jeremy.
2009-01-22 10:57:10 -08:00
Stefan Metzmacher
830b31a41a s3:smbd: we don't need to call message_dispatch() anymore it's event triggered now
metze
2009-01-22 12:37:31 +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
048f8dba14 s3: always call run_events() before and after sys_select()
And always setup the fd events.

metze
2009-01-22 12:37:29 +01:00
Volker Lendecke
55dfad40af "userdom_struct" does not need "full_name" anymore -- unused 2009-01-20 23:10:16 +01:00
Volker Lendecke
520f88143b Remove some unused code 2009-01-20 16:41:32 +01:00
Volker Lendecke
b8b6cddb29 Remove some smb fsp knowledge from rpc_server/
np_open/read/write don't have to know about files_struct
2009-01-20 16:41:14 +01:00
Stefan Metzmacher
fcf9f72e04 s3:smbd: call message_dispatch() before processing incoming PDUs
This is a hack to fix races which happen with the RAW-RENAME and RAW-OPLOCK
tests. We should try to remove it later.

metze
2009-01-20 00:40:56 +01:00
Stefan Metzmacher
dc6edf1ab4 s3:cluster: fix ctdb ipv6 support
We need to use CTDB_CONTROL_TCP_CLIENT instead of CTDB_CONTROL_TCP_ADD.

CTDB_CONTROL_TCP_CLIENT has support for 2 modes in newer ctdb versions:

- with struct ctdb_control_tcp it only supports ipv4.
- with struct ctdb_control_tcp_addr it supports ipv4 and ipv6.

You need new header files which defines struct ctdb_control_tcp_addr,
but at runtime it should be fine to work against older
ctdb versions (<= 1.0.68).

metze
2009-01-16 15:16:59 +01:00
Volker Lendecke
0d7ca8e89e remove the old chain_reply code 2009-01-16 13:00:45 +01:00
Volker Lendecke
ddaa65ef6e Correctly calculate the offset for read&x 2009-01-16 13:00:44 +01:00