summaryrefslogtreecommitdiffstats
path: root/source3/modules/vfs_default.c
Commit message (Collapse)AuthorAgeFilesLines
* s3 : smbd : Protect all possible code paths from fsp->op == NULL.Jeremy Allison2014-05-021-0/+9
| | | | | | | | | | | | | In changes to come this will be possible for an INTERNAL_OPEN_ONLY. The protection was already in place for some code paths, this makes the coverage compete. Bug 10564 - Lock order violation and file lost https://bugzilla.samba.org/show_bug.cgi?id=10564 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* s3: enforce a positive allocation_file_size for non-empty filesBjörn Baumbach2014-04-051-0/+12
| | | | | | | | | | | | | | Some file systems do not allocate a block for very small files. But for non-empty file should report a positive size. Pair-Programmed-With: Michael Adam <obnox@samba.org> Signed-off-by: Björn Baumbach <bb@sernet.de> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Sat Apr 5 03:09:00 CEST 2014 on sn-devel-104
* smbd: Use asys_resultsVolker Lendecke2014-03-271-18/+15
| | | | | | | | | | When multiple aio requests finish simultaneously, this saves a few syscalls Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Thu Mar 27 08:05:46 CET 2014 on sn-devel-104
* asys: Allow multiple results to be receivedVolker Lendecke2014-03-271-20/+15
| | | | | | | | | | | This makes use of C99 dynamic arrays. In this performance-sensitive code, I would like to avoid malloc/free, and I think 15 years after the standard we might be able to use this feature. Alternatively, we could use the "results" memory area and store the jobids in the upper range, playing some cast-tricks. Should work as well. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* vfs: propagate snapshot enumeration errorsDavid Disseldorp2014-02-271-10/+16
| | | | | | | | | | | | | | | | | The current FSCTL_GET_SHADOW_COPY_DATA/FSCTL_SRV_ENUMERATE_SNAPSHOTS handler squashes all non-ENOSYS errors into an NT_STATUS_UNSUCCESSFUL response. This commit ensures that all errors are propagated up to the client, to aid debugging. The Windows Explorer "Previous Versions" dialogue doesn't appear to distinguish between error codes. It displays "There are no previous versions available". Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Thu Feb 27 22:42:50 CET 2014 on sn-devel-104
* smbd: Slightly simplify vfswrap_fsctlVolker Lendecke2014-02-121-1/+2
| | | | | | | We have the MIN macro, so use it :-) Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* smbd: Fix an uninitialized readVolker Lendecke2014-02-121-0/+1
| | | | | | | We have to ship 64 bytes, and we have to initialize the whole thing. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* param: rename lp function and variable from "fake_dir_create_times" to ↵Garming Sam2014-02-071-4/+4
| | | | | | | | "fake_directory_create_times" Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* loadparm: rename lp[cfg]_dir_mask to lp[cfg]_directory_mask for consistency ↵Michael Adam2014-02-031-1/+1
| | | | | | | | | with docs Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
* s3:vfs fix a compile warningChristian Ambach2013-12-071-1/+1
| | | | | | | | Signed-off-by: Christian Ambach <ambi@samba.org> Reviewed-by: Michael Adam <obnox@samba.org> Autobuild-User(master): Michael Adam <obnox@samba.org> Autobuild-Date(master): Sat Dec 7 14:20:43 CET 2013 on sn-devel-104
* vfs: add [GET/SET]_COMPRESSION hooksDavid Disseldorp2013-11-221-0/+19
| | | | | | | | | | | | | | | The VFS interfaces are sychronous, as the operations only modify meta-data. These hooks are dependent on support for transparent compression by the underlying filesystem - vfs_default returns INVALID_DEVICE_REQUEST. Support for other filesystems providing transparent comression, such as Btrfs and ZFS, can be added in future. The get_compression function takes fsp and smb_fname arguments. The smb_fname argument is needed due to the current dosmode() code-path. Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Fix nonblank line endingsVolker Lendecke2013-08-121-6/+6
| | | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* FSCTL_GET_SHADOW_COPY_DATA: Don't return 4 extra bytes at endChristof Schmitt2013-08-061-2/+2
| | | | | | | | | | | | labels_data_count already accounts for the unicode null character at the end of the array. There is no need in adding space for it again. Signed-off-by: Christof Schmitt <christof.schmitt@us.ibm.com> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Simo Sorce <idra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Tue Aug 6 04:03:17 CEST 2013 on sn-devel-104
* FSCTL_GET_SHADOW_COPY_DATA: Initialize output array to zeroChristof Schmitt2013-08-051-1/+1
| | | | | | | | | Otherwise num_volumes and the end marker can return uninitialized data to the client. Signed-off-by: Christof Schmitt <christof.schmitt@us.ibm.com> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Simo Sorce <idra@samba.org>
* Optimization on POSIX platforms that have fstatat.Jeremy Allison2013-06-101-4/+23
| | | | | | | | | | | Tests show significant speedup in directory listings by using fstatat instead of a full pathname walk. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Mon Jun 10 20:14:12 CEST 2013 on sn-devel-104
* vfs: Convert vfswrap_fs_capabilities to synthetic_smb_fnameVolker Lendecke2013-04-171-7/+3
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* Move copychunk locking to be local to the read/write calls.Jeremy Allison2013-01-181-0/+42
| | | | | | | | | | Eliminates the need to hold locks across the entire lifetime of the call. Next commit will remove these. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: David Disseldorp <ddiss@samba.org>
* s3-vfs: add copy_chunk vfs hooksDavid Disseldorp2013-01-161-0/+111
| | | | | | | | | | | | | | | | | | copy_chunk copies n bytes from a source file at a specific offset to a destination file at a given offset. This interface will be used in handling smb2 FSCTL_SRV_COPYCHUNK ioctl requests. Use a pread/pwrite loop in vfs_default, so that requests referring to the same src and dest file are possible. Provide send and receive hooks for copy chunk VFS interface, allowing asynchronous behaviour. Check whether the request source offset + length exceeds the current size. Return STATUS_INVALID_VIEW_SIZE under such a condition, matching Windows server behaviour. Reviewed by: Jeremy Allison <jra@samba.org>
* s3:vfs_default: optimize vfswrap_asys_finished() and read as much as we canStefan Metzmacher2012-11-051-16/+33
| | | | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Mon Nov 5 19:01:13 CET 2012 on sn-devel-104
* vfs: Improve formatting of vfs_defaultAndrew Bartlett2012-10-111-23/+23
| | | | | | This avoids this bad style being copied into new modules. Andrew Bartlett
* vfs: Use posix_sys_acl_blob_get_file in vfs_default for posix ACLsAndrew Bartlett2012-10-111-0/+2
|
* smbd: Add mem_ctx to {f,}get_nt_acl VFS callAndrew Bartlett2012-10-111-2/+6
| | | | | | | | | | | This makes it clear which context the returned SD is allocated on, as a number of callers do not want it on talloc_tos(). As the ACL transformation allocates and then no longer needs a great deal of memory, a talloc_stackframe() call is used to contain the memory that is not returned further up the stack. Andrew Bartlett
* smbd: Add mem_ctx to sys_acl_init() and all callersAndrew Bartlett2012-10-111-4/+9
| | | | | | | | | | This changes from allocation on NULL to allocation on the supplied memory context. Currently that supplied context is talloc_tos() at the the final consumer of the ACL. Andrew Bartlett
* s3:vfs_default: add basic support for durable handle request and reconnectMichael Adam2012-09-081-3/+6
| | | | | | | | | | | | We only grant durable handles for CIFS/SMB2 only access, that means "kernel oplocks", "kernel share modes" and "posix locking" need to be set to "no". For now we also don't grant durable handles if delete on close is active on the handle. Pair-Programmed-With: Stefan Metzmacher <metze@samba.org> Pair-Programmed-With: Volker Lendecke <vl@samba.org>
* s3:vfs: add durable VFS operationsMichael Adam2012-09-081-1/+34
| | | | | | This allows a VFS module to implement durable handles in different ways. Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
* s3-smbd: Remove sys_acl_*() VFS wrapper functionsAndrew Bartlett2012-08-151-102/+0
| | | | | | | | | | | | | | | | | | | | | | | We no longer do struct smb_acl_t manipuations via the VFS layer, which is now reduced to handling the get/set functions. The only backend that implemented these functions (aside from audit) was the vfs_default module calling the sys_acl code. The various ACL implementation modules either worked on the fully initilaised smb_acl_t object or on NT ACLs. This not only makes the operation of the posix ACL code more efficient (as allocation and free is not put via the VFS), it makes it easier to test and removes the fantasy that a module could safely redefine this structure or the behaviour here. The smb_acls.idl now defines the structure, and it is now allocated with talloc. These operations were originally added to the VFS in commit 3bb219161a270f12c27c3bc7e1220829c6e9f284. Andrew Bartlett
* s3-vfs: async fsyncVolker Lendecke2012-07-181-0/+44
| | | | Signed-off-by: Jeremy Allison <jra@samba.org>
* s3: Move the aio_pthread read/write functionality to vfs_defaultVolker Lendecke2012-07-181-70/+138
| | | | Signed-off-by: Jeremy Allison <jra@samba.org>
* s3-aio: Remove unused VFS functions and moreVolker Lendecke2012-07-181-70/+0
| | | | Signed-off-by: Jeremy Allison <jra@samba.org>
* s3-vfs: async preadVolker Lendecke2012-07-181-0/+45
| | | | Signed-off-by: Jeremy Allison <jra@samba.org>
* s3-vfs: async pwriteVolker Lendecke2012-07-181-0/+48
| | | | Signed-off-by: Jeremy Allison <jra@samba.org>
* loadparm: make the source3/ lp_ functions take an explicit TALLOC_CTX *.Rusty Russell2012-07-181-1/+1
| | | | | | | | | | They use talloc_tos() internally: hoist that up to the callers, some of whom don't want to us talloc_tos(). A simple patch, but hits a lot of files. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
* s3: make log message of FSCTL_IS_VOLUME_DIRTY more clearBjörn Jacke2012-07-121-1/+1
|
* Fix bug #8974 - Kernel oplocks are broken when uid(file) != uid(process).Jeremy Allison2012-06-211-5/+0
| | | | | | | 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
* s3:vfs_default: use fsp_fnum_dbg() for fsp->fnum logging.Michael Adam2012-06-151-6/+10
| | | | | | | | | Note: it is actually wrong to access the fsp->fnum at all here, since the fnum is part of the smb layer that should not be used in the vfs layer. But this is subject be separated more cleanly in later commits. This change only unifies the logging of fsp->fnum. Signed-off-by: Stefan Metzmacher <metze@samba.org>
* s3: Make vfswrap_audit_file staticVolker Lendecke2012-06-121-5/+5
| | | | | | | Signed-off-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Tue Jun 12 02:26:31 CEST 2012 on sn-devel-104
* lib/replace: xattr wrappers in lib/replace rather than source3/lib/system.cAndrew Bartlett2012-06-021-8/+8
| | | | | | | This also moves all the still-used configure tests etc. The unused OSF API is also removed at this time. Andrew Bartlett
* s3:smbd/msdfs: pass 'allow_broken_path' to get_referred_path()Stefan Metzmacher2012-05-241-1/+3
| | | | | | | | Note the DCERPC code should not be smb2 specific! I wonder why this is at all smb2 specific... metze
* Add an audit file VFS routine so we can handle auditing with SACLs.Richard Sharpe2012-04-281-0/+10
| | | | | Autobuild-User: Richard Sharpe <sharpe@samba.org> Autobuild-Date: Sat Apr 28 08:05:00 CEST 2012 on sn-devel-104
* s3: Move the aio signal init to the vfs moduleVolker Lendecke2012-04-091-0/+8
| | | | | | On platforms that don't have an RT signal space, signal initialization fails. aio_fork and aio_pthread don't need the signal, so this would block them from running as well.
* Bug found by Herb. blkcnt_t st_ex_blksize is defined as a signed value. When ↵Jeremy Allison2012-04-061-0/+13
| | | | | | | | it is on a 32-bit system and defined as a long, then inside vfswrap_get_alloc_size() we cast to a uint64_t. This sign-extends when converting to unsigned, so if the high bit of st_ex_blksize is set we return insane values to clients.
* build: Remove SMB_OFF_T, replace with off_tAndrew Bartlett2012-04-061-15/+15
| | | | | | | | | Now that we always require a 64 bit off_t, we no longer need SMB_OFF_T. Andrew Bartlett Autobuild-User: Andrew Bartlett <abartlet@samba.org> Autobuild-Date: Fri Apr 6 01:47:43 CEST 2012 on sn-devel-104
* s3-vfs: Remove unused lremovexattr call from VFS modules, system.c and configureAndrew Bartlett2012-04-051-6/+0
| | | | | | | If this is ever needed again, it would be more appropriate as an options argument to removexattr. Andrew Bartlett
* s3-vfs: Remove unused lsetxattr call from VFS modules, system.c and configureAndrew Bartlett2012-04-051-6/+0
| | | | | | | If this is ever needed again, it would be more appropriate as an options argument to listxattr. Andrew Bartlett
* s3-vfs: Remove unused llistxattr call from VFS modules, system.c and configureAndrew Bartlett2012-04-051-6/+0
| | | | | | | If this is ever needed again, it would be more appropriate as an options argument to listxattr. Andrew Bartlett
* s3-vfs: Remove unused lgetxattr call from VFS modules, system.c and configureAndrew Bartlett2012-04-051-6/+0
|
* build: Remove SMB_STRUCT_DIR defineAndrew Bartlett2012-04-051-10/+10
|
* build: Remove SMB_STRUCT_DIRENT defineAndrew Bartlett2012-04-051-2/+2
|
* build: Remove sys_rewinddir wrapperAndrew Bartlett2012-04-051-1/+1
|
* build: Remove sys_closedir wrapperAndrew Bartlett2012-04-051-1/+1
|