summaryrefslogtreecommitdiff
path: root/source3/smbd
AgeCommit message (Collapse)AuthorFilesLines
2009-02-13Add VFS ops for Windows BRL: Lock, Unlock and Cancel:Zack Kirsch3-53/+75
This patch adds 3 new VFS OPs for Windows byte range locking: BRL_LOCK_WINDOWS, BRL_UNLOCK_WINDOWS and BRL_CANCEL_WINDOWS. Specifically: * I renamed brl_lock_windows, brl_unlock_windows and brl_lock_cancel to *_default as the default implementations of the VFS ops. * The blocking_lock_record (BLR) is now passed into the brl_lock_windows and brl_cancel_windows paths. The Onefs implementation uses it - future implementations may find it useful too. * Created brl_lock_cancel to do what brl_lock/brl_unlock do: set up a lock_struct and call either the Posix or Windows lock function. These happen to be the same for the default implementation. * Added helper functions: increment_current_lock_count() and decrement_current_lock_count(). * Minor spelling correction in brl_timeout_fn: brl -> blr. * Changed blocking_lock_cancel() to return the BLR that it has cancelled. This allows us to assert its the lock that we wanted to cancel. If this assert ever fires, this path will need to take in the BLR to cancel, rather than choosing on its own. * Adds a small helper function: find_blocking_lock_record_by_id(). Used by the OneFS implementation, but could be useful for others.
2009-02-13Remove typedef struct blocking_lock_record and move references to struct ↵Zack Kirsch1-19/+19
blocking_lock_record.
2009-02-10Remove an unused extern referenceVolker Lendecke1-2/+0
2009-02-10Convert api_NetUserGetGroups to use samr instead of pdbVolker Lendecke1-50/+68
2009-02-09s3: Added SMB_VFS_INIT_SEARCH_OP to initialize data at the beginning of SMB ↵Steven Danneman3-3/+20
search requests. By default this VFS call is a NOOP, but the onefs vfs module takes advantage of it to initialize direntry search caches at the beginning of each TRANS2_FIND_FIRST, TRANS2_FIND_NEXT, SMBffirst, SMBsearch, and SMBunique
2009-02-09Pass stat buffer down through all levels of VFS_READDIR wrappersSteven Danneman4-96/+103
* VFS_OP_READDIR can now provide stat information, take advantage of it if it's available * is_visible_file(): optimistically expect the provided stat buffer is already valid * dptr_ReadDirName(): refactor code for easier readability, functionality is the same
2009-02-09Add an optional SMB_STRUCT_SMB parameter to VFS_OP_READDIRSteven Danneman1-2/+2
* this allows VFS implementations that prefetch stat information on readdir to return it through one VFS call * backwards compatibility is maintained by passing in NULL * if the system readdir doesn't return stat info, the stat struct is set to invalid
2009-02-09s3 OneFS: Add kernel oplocks implementationTim Prouty2-0/+805
A few functions in oplocks_onefs.c need to be accessed from the onefs vfs module. It would be ideal if oplocks were implemented at the vfs layer, but since they aren't yet, a new header is added to source3/include to make these functions available to the onefs vfs module. oplocks_onefs.o doesn't need to be linked into the onefs vfs module explicitly, since it is already linked into smbd by default.
2009-02-09s3 oplocks: Remove oplocks before handling delete on close semanticsTim Prouty1-4/+5
Unlinking a file while still holding an oplock can cause problems with kernel oplocks. This simply releases the oplock before actually unlinking the file.
2009-02-09s3 oplocks: Add capabilites flags field to the kernel_oplocks structTim Prouty2-2/+32
Here is a short description for each of the new capability flags: KOPLOCKS_LEVEL2_SUPPORTED: Level 2 oplocks are supported natively in the kernel. KOPLOCKS_DEFERRED_OPEN_NOTIFICATION: The kernel notifies deferred openers when they can retry the open. KOPLOCKS_TIMEOUT_NOTIFICATION: The kernel notifies smbds when an oplock break times out. KOPLOCKS_OPLOCK_BROKEN_NOTIFICATION: The kernel notifies smbds when an oplock is broken.
2009-02-09s3 oplocks: Make the level2 oplock contention API more granularTim Prouty7-27/+62
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-09s3 oplocks: Differentiate between releasing an oplock vs. downgrading to ↵Tim Prouty3-4/+4
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-09s3 vfs: Add a destructor to the fsp extension data APITim Prouty1-1/+7
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-09S3: New module interface for SMB message statistics gatheringtodd stecher11-35/+278
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-07Fix memleaks in chain_reply for async requestsVolker Lendecke1-0/+2
2009-02-07Convert api_RNetGroupEnum to use samr instead of pdbVolker Lendecke1-30/+81
2009-02-07Close samr_handle if open_domain failedVolker Lendecke1-0/+1
2009-02-05Don't try and delete a default ACL from a file.Günter Kukkukk1-4/+8
2009-02-04Fix bug #Bug 6090 renaming or deleting a "not matching/resolving" symlink is ↵Jeremy Allison3-30/+88
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-02Fix bug #6082 - smbd_gpfs_getacl failed: Windows client can´t rename or ↵Jeremy Allison2-18/+49
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-01Add two new parameters to control how we verify kerberos tickets. Removes ↵Dan Sledz2-3/+3
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-01Convert api_RNetUserEnum to use the srv_samr_nt.c directlyVolker Lendecke1-26/+77
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-01Fix nonempty blank linesVolker Lendecke1-58/+57
2009-02-01Just for fun: Move some bytes from bss to textVolker Lendecke2-2/+2
2009-01-31Make reply_pipe_read_andx asyncVolker Lendecke1-13/+57
2009-01-31Make reply_pipe_write asyncVolker Lendecke1-13/+48
2009-01-31Make reply_pipe_write_and_X asyncVolker Lendecke1-20/+52
2009-01-31Make-np_write-handle-0-byte-writes-as-NT_STATUS_OKVolker Lendecke1-43/+27
2009-01-31Convert api_rpc_trans_reply to async np_*Volker Lendecke1-29/+119
2009-01-31make send_file_readbraw staticVolker Lendecke1-6/+6
2009-01-31Remove the global variable "chain_size"Volker Lendecke4-15/+31
2009-01-29Upgrade POSIX inheritance storage to a new format (version 2). StoresJeremy Allison1-200/+360
the Windows ACL type and flags if "map acl inherit" is set. Jeremy.
2009-01-29s3: Add a new SMB_VFS_GET_ALLOC_SIZE vfs operationTim Prouty3-43/+17
This allows module implementors to customize what allocation size is returned to the client.
2009-01-29s3:smbd: make smbd_open_one_socket() staticMichael Adam1-3/+3
Michael
2009-01-29s3:smbd: ignore open_socket_in() failuresStefan Metzmacher1-1/+4
This restores the pre e0232934fbf69a9e72de1d9844b14d70b34a2d6a behavior. metze
2009-01-27s3:smbd: wait for new connection via fd eventsStefan Metzmacher1-211/+227
metze
2009-01-27s3:smbd: make mdns registration event driven.Stefan Metzmacher2-125/+108
metze
2009-01-27s3:smbd: make inetd code path more clearStefan Metzmacher1-24/+20
metze
2009-01-27s3:smbd: make kernel oplocks event drivenStefan Metzmacher6-201/+33
And use signal events for Linux oplocks. metze
2009-01-27s3:smbd: remove pointless respond_to_all_remaining_local_messages() functionStefan Metzmacher2-27/+0
This the process_kernel_oplock() function never response to messages, it only generates messages to ourself. metze
2009-01-27s3:smbd: convert aio to use tevent_signalStefan Metzmacher3-104/+52
metze
2009-01-27s3:smbd: use signal events for SIGTERM, SIGHUP and SIGCHLDStefan Metzmacher4-96/+102
metze
2009-01-27s3:smbd: move all code that handles a client connection into smbd_process()Stefan Metzmacher2-218/+218
metze
2009-01-27s3:smbd: we should setup the client socket in the same way in all code pathesStefan Metzmacher1-21/+15
We should behave the same in inetd, interactive and deamon modes. metze
2009-01-27s3:namecache: remove unused namecache_shutdown() functionStefan Metzmacher1-2/+0
metze
2009-01-25Fix chain_reply for pipe readsVolker Lendecke1-1/+11
The caller might have over-allocated reply->outbuf. Deal with that. Sorry, Günther, for giving you so much pain ... Volker
2009-01-23Extend NTIMES to allow setting create_timetodd stecher4-69/+97
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-22Fix logic error in try_chown - we shouldn't arbitrarily chownJeremy Allison1-6/+9
to ourselves unless that was passed in. Jeremy.
2009-01-22Second part of the attemt to fix #4308 - Excel save operation corrupts file ↵Jeremy Allison1-131/+144
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-22Another attempt to fix bug #4308 - Excel save operation corrupts file ACLs.Jeremy Allison1-25/+4
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.