summaryrefslogtreecommitdiff
path: root/source3/smbd
AgeCommit message (Collapse)AuthorFilesLines
2009-03-05Fix bug #6160 - Office 2007 fails saving files to a Samba mapped drive.Jeremy Allison1-0/+22
Confirmed by reporters. Jeremy.
2009-03-04s3: Change open_streams_for_delete to call through the vfs layerTim Prouty1-5/+7
This eliminates the last direct caller of create_file_unixpath
2009-03-04Second part of fix for #6154, ensure we return max accessJeremy Allison1-0/+9
if admin user. Jeremy.
2009-03-04Fix bug #6154 - zfs does not honor admin users.Jeremy Allison1-0/+5
Jeremy
2009-03-03Fix bug #6155 - "force group" is no longer working as expected.Jeremy Allison3-3/+17
We need to store the "force group" uid separately from the conn->server_info token as we need to apply it separately also. Volker PLEASE CHECK ! Jeremy.
2009-03-01Only copy sharename up from rap_to_pjobidVolker Lendecke1-2/+1
Why?? :-) Another one of the little micro-optimizations that I just came across: If you allocate a variable in a sub-block like the "fstring sharename" in write_file(), gcc even with -O3 will allocate this variable unconditionally on the stack at the beginning of the routine. So with eliminating this fstring we cut 256 bytes of stack in a very hot code path writing to a file. It might make us a bit more cache-friendly. This would probably not be worth a second look if it involved larger code changes, but this one was just too simple to let it pass :-)
2009-02-28Fix bug #6082 - smbd_gpfs_getacl failed: Windows client can´t rename orJeremy Allison1-0/+19
delete file (directory fix). Jeremy.
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.