summaryrefslogtreecommitdiffstats
path: root/source3/modules
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* s3: vfs_dirsort module.Jeremy Allison2014-02-121-7/+112
| | | | | | | | | | | | | | | | | | | | | | | Allow dirsort to work when multiple simultaneous directories are open. The old code only keeps one active private data pointer on the connection struct, opening a second directory on the same connection will overwrite it. This modification turns the private data pointer into a linked list of open directories on the connection struct, and finds the correct one by searching on the passed in DIR *. With this code in place, smbd passes raw.search torture test on a share definition with: vfs objects = dirsort https://bugzilla.samba.org/show_bug.cgi?id=10406 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* param: rename lp function and variable from "fake_dir_create_times" to ↵Garming Sam2014-02-073-6/+6
| | | | | | | | "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>
* s3: modules: streaminfo: As we have no VFS function SMB_VFS_LLISTXATTR we ↵Jeremy Allison2014-02-082-2/+24
| | | | | | | | | | | | | | can't cope with a symlink when lp_posix_pathnames() is true. Fix bug : Bug 10429 - samba returns STATUS_OBJECT_NAME_NOT_FOUND when attempting to remove dangling symlink https://bugzilla.samba.org/show_bug.cgi?id=10429 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Jeff Layton <jlayton@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Sat Feb 8 00:01:16 CET 2014 on sn-devel-104
* dbwrap: add a dbwrap_flags argument to db_open()Michael Adam2014-02-072-2/+2
| | | | | | | | | | This is in preparation to support handing flags to backends, in particular activating read only record support for ctdb databases. For a start, this does nothing but adding the parameter, and all databases use DBWRAP_FLAG_NONE. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* vfs_btrfs: pass-through copy-chunk(len=0) requestsDavid Disseldorp2014-02-061-1/+21
| | | | | | | | | | | Never map copy-chunk(len=0) requests to BTRFS_IOC_CLONE_RANGE ioctls. A BTRFS_IOC_CLONE_RANGE with @src_length=0 results in a clone of all data from @src_offset->EOF! BUG: https://bugzilla.samba.org/show_bug.cgi?id=10424 Signed-off-by: David Disseldorp <ddiss@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>
* vfs_time_audit: Make durable functions staticVolker Lendecke2014-01-241-16/+16
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* vfs/glusterfs: in case atime is not passed, set it to the current atimeNiels de Vos2014-01-151-4/+22
| | | | | | | | | | | | | The Linux CIFS client does not pass an updated atime when a write() is done. This causes the vfs/glusterfs module to set the atime to -1 on the Gluster backend, resulting in an atime far in the future (year 2106). Signed-off-by: Niels de Vos <ndevos@redhat.com> Reviewed-by: Ira Cooper <ira@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Wed Jan 15 21:31:30 CET 2014 on sn-devel-104
* s3: Avoid oplock break by storing timestamps with gpfs_set_timesChristof Schmitt2014-01-093-6/+69
| | | | | | | | | | | | | | | | The gpfs_set_times API call allows setting timestamps directly in GPFS without going through the utime() call. Using this API call fixes an unecessary oplock break when a client sends a SET_FILE_ALLOCATION_INFO request and no other client has opened the file. The call to utime() triggers the oplock break through the Linux kernel. Using the gpfs_set_times call for updating the timestamp avoids the call to utime() and the oplock break. Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Christof Schmitt <cs@samba.org> Autobuild-Date(master): Thu Jan 9 00:04:48 CET 2014 on sn-devel-104
* vfs_glusterfs: Enable per client log filePoornima Gurusiddaiah2013-12-171-20/+29
| | | | | | | | | | | | | | | | In Samba configuration file, one of the options of gluster type is log file, the value of this option was not allowed to contain any variables, as a result all the clients would have a single log file, which complicated debugging. In this patch, variable substitution is performed for gluster log file. Hence allowing user to customise the gluster log file name. Signed-off-by: Poornima Gurusiddaiah <pgurusid@redhat.com> Reviewed-by: Ira Cooper <ira@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Tue Dec 17 23:44:16 CET 2013 on sn-devel-104
* scannedonly: Fix CID 242109 Unchecked return value from libraryVolker Lendecke2013-12-171-4/+6
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3: Handle stat call with capability in vfs_gpfsAbhidnya Joshi2013-12-161-0/+56
| | | | | | | | Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Christof Schmitt <cs@samba.org> Autobuild-User(master): Christof Schmitt <cs@samba.org> Autobuild-Date(master): Mon Dec 16 20:05:23 CET 2013 on sn-devel-104
* s3-waf: build new vfs_worm moduleVolker Lendecke2013-12-121-0/+8
| | | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3-modules: add new vfs_worm moduleVolker Lendecke2013-12-121-0/+97
| | | | | | | | VFS module to disallow writes for older files. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* shadow_copy2: Fix some typosDavid Keegel2013-12-121-3/+3
| | | | | | | | Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org> Autobuild-User(master): Michael Adam <obnox@samba.org> Autobuild-Date(master): Thu Dec 12 17:58:24 CET 2013 on sn-devel-104
* shadow_copy2: add a comment explaining why we don't talloc_zero_array().Michael Adam2013-12-111-0/+9
| | | | | | | | | | | Since I stumbled over this slighly sublte point, I thought it is worthwile to point it our in a comment. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Michael Adam <obnox@samba.org> Autobuild-Date(master): Wed Dec 11 19:55:20 CET 2013 on sn-devel-104
* shadow_copy2: revert expensive and unnecessary zero-initializationMichael Adam2013-12-111-1/+1
| | | | | | | | | | | | | | | I was being overly cautious. This is initialization is not necessary, since further down in the for-loop, the memory always gets fully initialized because the insert string is inserted at various slash positions. So this talloc_zero_array can be skipped: this an expensive thing to do in virtually every VFS call. This essentially reverts commit 249e9b4a34d8959bd94735c1921ecfc24d6a2705. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* s3:vfs_btrfs change includesChristian Ambach2013-12-071-2/+1
| | | | | | | use the ones from libreplace instead of system ones Signed-off-by: Christian Ambach <ambi@samba.org> Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
* 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
* s3:modules:shadow_copy2: remove redundant documentation comment blockMichael Adam2013-12-071-77/+4
| | | | | | | | | and refer to the manual page instead Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s3:modules:shadow_copy2: improve headline commentMichael Adam2013-12-071-1/+1
| | | | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s3:module:shadow_copy2: add my (C)Michael Adam2013-12-071-0/+1
| | | | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* vfs_btrfs: advertise per-file compression capabilityDavid Disseldorp2013-11-221-0/+15
| | | | | | | | | | Plumb into the get_fs_capabilities code path to advertise the FILE_FILE_COMPRESSION attribute. Also, document file compression support in the VFS btrfs man page. Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* vfs_btrfs: fix copy-chunk dest unlock argsDavid Disseldorp2013-11-221-1/+1
| | | | | | | src_fsp used instead of dest_fsp for unlock. Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* vfs_btrfs: add [GET/SET]_COMPRESSION handlersDavid Disseldorp2013-11-221-2/+117
| | | | | | | | | Translate such requests into FS_IOC_GETFLAGS and FS_IOC_SETFLAGS ioctls respectively. The module makes no distinction between compression types, only whether or not compression is enabled. Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* vfs: add [GET/SET]_COMPRESSION hooksDavid Disseldorp2013-11-223-0/+112
| | | | | | | | | | | | | | | 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>
* s3-vfs: Make glfs_set_preopened() static.Andreas Schneider2013-11-151-1/+1
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3-vfs: Remove unused variable in vfs_glusterfs.Andreas Schneider2013-11-151-1/+0
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3-vfs: Fix stream_depot vfs module on btrfs.Andreas Schneider2013-11-121-6/+4
| | | | | | | | | | | | Checking if the directory is empty using 'nlink == 2' only checks if there are no subdirectories. It doesn't indicate if there are files in the directory. However checking link count for no subdirectories is wrong and applications shouldn't rely on it, see: https://lkml.org/lkml/2012/2/1/756 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: David Disseldorp <ddiss@samba.org>
* Revert "s3-vfs: Fix stream_depot vfs module on btrfs."David Disseldorp2013-11-121-8/+8
| | | | | | | | | | | | | | | | This reverts commit 29f12e7d5960906935e3af1405e9759a07d64750. The wrong patch was pushed, according to Andreas: I sent a second version cause the first was not complete. I've discussed with Volker after I sent the patch and then sent a new patch which a) also does the right thin in the unlink case b) only tried to remove the server is the deletion of the file was successful. Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* smbd: Fix CID 1035478 Negative array index readVolker Lendecke2013-11-111-6/+19
| | | | | | | lp_parm_enum can return -1. Add error checking. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ira Cooper <ira@samba.org>
* s3-vfs: Fix stream_depot vfs module on btrfs.Andreas Schneider2013-11-081-8/+8
| | | | | | | | | | | | Checking if the directory is empty using 'nlink == 2' only checks if there are no subdirectories. It doesn't indicate if there are files in the directory. However checking link count for no subdirectories is wrong and applications shouldn't rely on it, see: https://lkml.org/lkml/2012/2/1/756 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* vfs: Fix some build warnings in glusterfs.Andreas Schneider2013-11-041-2/+2
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: David Disseldorp <ddiss@samba.org>
* vfs: Fix building the glusterfs module.Andreas Schneider2013-11-041-2/+2
| | | | | | | | Using calloc directly throws an error. This fixes building the glusterfs module. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: David Disseldorp <ddiss@samba.org>
* s3:modules: nfs4_acls ACLs with zero entries are fine.Alexander Werth2013-10-301-6/+6
| | | | | | | | Signed-off-by: Alexander Werth <alexander.werth@de.ibm.com> Reviewed-by: David Disseldorp <ddiss@samba.org> Autobuild-User(master): David Disseldorp <ddiss@samba.org> Autobuild-Date(master): Wed Oct 30 20:31:42 CET 2013 on sn-devel-104
* s3:modules: Fix realloc with zero sized ACLsAlexander Werth2013-10-301-5/+7
| | | | | | | | A realloc with size zero is similar to a free. Since we return the number of acls that's not an error. Signed-off-by: Alexander Werth <alexander.werth@de.ibm.com> Reviewed-by: David Disseldorp <ddiss@samba.org>
* s3/time_audit: Add offline and durable functionsChristof Schmitt2013-10-121-0/+111
| | | | | | | | Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Sat Oct 12 13:00:02 CEST 2013 on sn-devel-104
* shadow_copy2: use stored mount_point instead of recalculating.Michael Adam2013-10-051-9/+1
| | | | | | | | | | | | In the case of snapdirseverywhere but NOT crossmountpoints. This spares stat calls. And is the only correct thing to do if the mount point was specified in the configuration. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* shadow_copy2: improve debug in shadow_copy2_convert() in snapdirseverywhere modeMichael Adam2013-10-051-1/+2
| | | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* shadow_copy2: fix shadow_copy2_convert() in the classical case.Michael Adam2013-10-051-2/+45
| | | | | | | | | | I.e. the non-snapdirseverywhere case. This in particular fixes the case of a snapdir hierarchy that is parallel to the share or mountpoint and not subordinate. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* shadow_copy2: add some blank lines for visual separation to ↵Michael Adam2013-10-051-0/+2
| | | | | | | | shadow_copy2_convert() Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* shadow_copy2: initialize "converted" string to null in shadow_copy2_convert()Michael Adam2013-10-051-1/+1
| | | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* shadow_copy2: fix shadow_copy2_strip_snapshot() in the classical caseMichael Adam2013-10-051-0/+30
| | | | | | | | | | | I.e., fix detection of already converted names. This is done by using the shadow_copy2_snapshot_path() function and comparing if the input string starts with that. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* shadow_copy2: add some debug to shadow_copy2_strip_snapshot()Michael Adam2013-10-051-1/+11
| | | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* shadow_copy2: add comments explaining decisions in shadow_copy2_strip_snapshot()Michael Adam2013-10-051-0/+10
| | | | | | | | This should make it more easy to understand what the cases are. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* shadow_copy2: introduce shadow_copy2_snapshot_path()Michael Adam2013-10-051-0/+37
| | | | | | | | | This builds the posix snapshot path for the connection at the provided timestamp. For the non-snapdirseverywhere case. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* shadow_copy2: factor shadow_copy2_posix_gmt_string() out of ↵Michael Adam2013-10-051-21/+47
| | | | | | | | | | shadow_copy2_insert_string() for re-use.. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* shadow_copy2: shadow_copy2_insert_string(): do not prepend a "/" in absolute ↵Michael Adam2013-10-051-2/+20
| | | | | | | | mode Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>