summaryrefslogtreecommitdiff
path: root/source3/smbd
AgeCommit message (Collapse)AuthorFilesLines
2009-02-27s3-spoolss: use DSPRINT flags instead of SPOOLS_DS flags.Günther Deschner1-1/+1
Guenther
2009-02-26Make us pass the RAW-RENAME torture test I just added.Jeremy Allison2-0/+53
Inside a directory, keep a file open and then renaming the directory should fail with ACCESS_DENIED. Jeremy.
2009-02-25Fix more POSIX path lstat calls. Fix bug where close can returnJeremy Allison1-5/+17
failure if we have a pending modtime and the containing directory of the file has been renamed (there is no POSIX "update time by fd" call). This can't happen on Windows as the rename will fail if there are open files beneath it. Will add a torture test for this. Jeremy.
2009-02-25Make test for open modes more robust against other bits.Jeremy Allison1-1/+1
Jeremy.
2009-02-25Fix bug in processing of open modes in POSIX open.Jeremy Allison1-0/+2
Was missing case of "If file exists open. If file doesn't exist error." Damn damn damn. CIFSFS client will have to have fallback cases for this error for a long time. Jeremy.
2009-02-25Fix some NetBSD warnings.Jeremy Allison1-1/+1
Jeremy.
2009-02-24Allow set attributes on a stream fnum to be redirected to the base filename.Jeremy Allison1-2/+10
Fixes the new RAW-STREAMS torture test. Jeremy.
2009-02-23s3 OneFS: Fix a double free in an error pathTim Prouty1-3/+2
2009-02-23More warning fixes for Solaris.Jeremy Allison4-30/+30
Jeremy.
2009-02-21s3: If sendfile returns 0 bytes read, fall back to the normal read pathTim Prouty1-0/+24
This allows sendfile implementations that are atomic to avoid having to send zeros or kill the client connection on a short read (usually the file was truncated).
2009-02-21Remove the static "chal" from ntlmssp.c:get_challenge()Volker Lendecke2-6/+6
2009-02-21Do not close an fd we know is -1Volker Lendecke1-1/+0
2009-02-20S3: Detect max_open_files from systemtodd stecher1-0/+12
- Attempt to use syscalls to determine max-open-files value. - Add in periodic logging when max file limit reached
2009-02-20s3: Refactor of madvise() usage in c441f58dSteven Danneman1-7/+0
* move to reinit_after_fork() to protect all Samba daemons * only protect parent processes
2009-02-20s3: Make change notify immediately return a catch-all packet on underlying errorSteven Danneman1-1/+14
* This allows a problem in the underlying CN backend to be bubbled up to the general CN layer so a catch-all reply can be returned * We now also return a catch-all response immediately if the server-side event queue becomes too big
2009-02-20s3: Modifications to generic notify structures to allow implementation of ↵Steven Danneman1-0/+2
OneFS notify. The OneFS kernel based change notify system takes an fd of the directory to watch in it's initialization syscall. Since we already have this directory open, this commit plumbs that fd down to the VFS layer via the notify_entry struct. We also need to know if the watch is taken out on a snapshot directory. The full file_id struct is also passed down to make this determination. The file_id marshalling wrappers are hand written here, but should eventually be auto-generated by moving the struct file_id into the idl.
2009-02-19s3: Change the vfs_GetWd cache to use the file_id structTim Prouty1-12/+3
2009-02-19s3: Add extid to the dev/inode pairTim Prouty4-17/+20
This extends the file_id struct to add an additional generic uint64_t field: extid. For backwards compatibility with dev/inodes stored in xattr_tdbs and acl_tdbs, the ext id is ignored for these databases. This patch should cause no functional change on systems that don't use SMB_VFS_FILE_ID_CREATE to set the extid. Existing code that uses the smb_share_mode library will need to be updated to be compatibile with the new extid.
2009-02-19s3: Modify SMB_VFS_FILE_ID_CREATE to take a stat structTim Prouty1-0/+18
Since file_id_create_dev is incompatible with the concept of file_ids, it is now static and in the one file that needs it.
2009-02-19S3: Dumb down debug spew in perfcount module codetodd stecher1-4/+4
2009-02-19S3: Make changes to perfcount API set for when a single request leads to ↵todd stecher1-2/+15
multiple replies (e.g. reply_echo). Change test and onefs modules to match new api set (thanks Volker!).
2009-02-18s3: Fix bug opening streams with truncating dispositionTim Prouty1-1/+1
Do not attempt to delete streams on a truncating open, if the name we're opening is itself a stream. Port 176e8857203944bc332844b700749120ce90c891 to standard open path
2009-02-18S3: Stop creating SMBD cores when failing to create a pipe.todd stecher1-0/+4
This was uncovered when the MAX FD limit was hit, causing an instant core and invoking error reporting. This fix causes SMBD to exit, but without building a core.
2009-02-18S3: Allow SMBD processes to survive in low memory condidtionstodd stecher1-0/+7
This commit adds a configure argument which allows for setting MADV_PROTECT in the madvise() API. With this enabled the kernel won't kill SMBD when it's running low on memory.
2009-02-16make receive_smb_raw_talloc more readableTim Prouty1-4/+4
2009-02-14Rename lp_smb_perfcount_module() to lp_perfcount_module() to match the ↵Volker Lendecke1-1/+1
parameter name
2009-02-14Make smb_load_perfcount_module staticVolker Lendecke1-1/+1
2009-02-14Attempt to fix the build on Solaris 8Volker Lendecke1-1/+1
2009-02-14Fix a valgrind errorVolker Lendecke1-1/+5
2009-02-13s3: Fix uninitialized variable warning (and bug).Zack Kirsch1-1/+1
2009-02-13Noted by Vericode analysis. Correctly use chroot().Jeremy Allison1-1/+5
Jeremy.
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.