summaryrefslogtreecommitdiff
path: root/source3/modules
AgeCommit message (Collapse)AuthorFilesLines
2018-04-03s3:modules: Set -Wno-strict-overflow for getdate if supportedAndreas Schneider1-0/+5
bison generates an C89 files which does some weired things. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2018-04-03s3:modules: Generate new getdate.c with bisonAndreas Schneider1-977/+897
bison -o source3/modules/getdate.c source3/modules/getdate.y<Paste> Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2018-04-03s3:modules: Update getdate.y to work with newer bison versionsAndreas Schneider1-122/+121
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2018-04-03s3:modules: fix the build of vfs_aixacl2.cStefan Metzmacher1-2/+3
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13345 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Björn Jacke <bjacke@samba.org> Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Tue Apr 3 20:18:58 CEST 2018 on sn-devel-144
2018-04-03s3:modules: make virusfilter_io_connect_path() more portableStefan Metzmacher1-15/+16
We have existing utility functions to prepare a socket. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13343 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Björn Jacke <bjacke@samba.org>
2018-04-03s3:modules: fix the picky-developer build of vfs_virusfilter.c on FreeBSD 11Stefan Metzmacher1-2/+3
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13344 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Björn Jacke <bjacke@samba.org>
2018-03-29vfs_fruit: Fix CID 1433613 Operands don't affect resultVolker Lendecke1-2/+2
Two changes: First, we can't check multiplication overflow after the operation. This has to be done before with a division. Second, there is no OFF_T_MAX, and both operands are size_t, so check for SIZE_MAX. The result is assigned to off_t, but I'm not sure where the automatic coercion from size_t to off_t would happen. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2018-03-21s3: smbd: Fruit. Make the use of dom_sid_compare_domain() much clearer.Jeremy Allison1-2/+3
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13319 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2018-03-20s3:vfs_preopen: Change to a do-while loop and fix the checkAndreas Schneider1-2/+2
This fixes compilation with -Wstrict-overflow=2 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-03-20s3:modules: Fix size type in getdateAndreas Schneider2-2/+2
This fixes compilation with -Wstrict-overflow=2 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-03-20s3:vfs_nettalk: Fix size typesAndreas Schneider1-1/+1
This fixes compilation with -Wstrict-overflow=2 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-03-16s3: smbd: vfs_fruit: Replace code in fruit_fget_nt_acl() with ↵Jeremy Allison1-28/+7
remove_virtual_nfs_aces(). BUG: https://bugzilla.samba.org/show_bug.cgi?id=13319 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2018-03-16s3: smbd: vfs_fruit: Replace code in check_ms_nfs() with ↵Jeremy Allison1-37/+1
remove_virtual_nfs_aces(). BUG: https://bugzilla.samba.org/show_bug.cgi?id=13319 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2018-03-16s3: smbd: vfs_fruit: Add remove_virtual_nfs_aces() a generic NFS ACE remover.Jeremy Allison1-0/+43
Not yet used, will be used to tidyup existing code. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13319 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2018-03-08s3: vfs_fruit. Change check_ms_nfs() to remove the virtual ACE's generated ↵Jeremy Allison1-1/+42
by fruit_fget_nt_acl(). Ensures they don't get stored in the underlying ACL. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13319 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org> Autobuild-User(master): Ralph Böhme <slow@samba.org> Autobuild-Date(master): Thu Mar 8 04:09:38 CET 2018 on sn-devel-144
2018-03-07s3: vfs_fruit. If the security descriptor was modified, ensure we set the ↵Jeremy Allison1-0/+21
flags correctly to reflect the ACE's left. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13319 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2018-03-07s3: vfs_fruit: Ensure we operate on a copy of the incoming security descriptor.Jeremy Allison1-1/+11
This will allow us to modify it in the next commit. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13319 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2018-03-07s3: vfs_fruit. Ensure we only return one set of the 'virtual' UNIX ACE entries.Jeremy Allison1-0/+28
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13319 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2018-03-01s3:modules: Add FALL_THROUGH statements in getdate.cAndreas Schneider1-2/+3
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-03-01s3:modules: Add FALL_THROUGH statements in vfs_acl_common.cAndreas Schneider1-0/+1
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-02-26vfs_glusterfs: Fix the wrong pointer being sent in glfs_fsync_asyncPoornima G1-1/+1
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13297 Pair-Programmed-With: Anoop C S <anoopcs@redhat.com> Signed-off-by: Poornima G <pgurusid@redhat.com> Reviewed-by: Guenther Deschner <gd@samba.org> Reviewed-by: Michael Adam <obnox@samba.org> Autobuild-User(master): Günther Deschner <gd@samba.org> Autobuild-Date(master): Mon Feb 26 20:17:50 CET 2018 on sn-devel-144
2018-02-23vfs_fruit: use off_t, not size_t for TM size calculationsRalph Boehme1-7/+6
size_t is only a 32-bit integer on 32-bit platforms. We must use off_t for file sizes. https://bugzilla.samba.org/show_bug.cgi?id=13296 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2018-01-31vfs_virusfilter: Fix CID 1428738 Macro compares unsigned to 0Volker Lendecke1-1/+1
vsnprintf returns "int" and not "size_t" 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): Wed Jan 31 05:28:48 CET 2018 on sn-devel-144
2018-01-31vfs_virusfilter: Fix CID 1428740 Macro compares unsigned to 0Volker Lendecke1-1/+1
vsnprintf returns "int" and not "size_t" Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2018-01-31vfs_virusfilter: Fix CID 1428739 Buffer not null terminatedVolker Lendecke1-1/+7
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2018-01-25Samba-VirusFilter: clean up dir check vfs_close and vfs_openTrever L. Adams1-2/+6
Signed-off-by: Trever L. Adams <trever.adams@gmail.com> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: David Disseldorp <ddiss@samba.org>
2018-01-25Samba-VirusFilter: fix virusfilter_vfs_close() crashTrever L. Adams1-1/+1
Signed-off-by: Trever L. Adams <trever.adams@gmail.com> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: David Disseldorp <ddiss@samba.org>
2018-01-24Samba-VirusFilter: clamav VFS and man page.Trever L. Adams4-0/+200
Signed-off-by: Trever L. Adams <trever.adams@gmail.com> Signed-off-by: SATOH Fumiyasu <fumiyas@osstech.co.jp> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org> Autobuild-User(master): Ralph Böhme <slow@samba.org> Autobuild-Date(master): Wed Jan 24 15:08:59 CET 2018 on sn-devel-144
2018-01-24Samba-VirusFilter: F-Secure AntiVirus (fsav) VFS and man page.Trever L. Adams4-0/+456
Signed-off-by: Trever L. Adams <trever.adams@gmail.com> Signed-off-by: SATOH Fumiyasu <fumiyas@osstech.co.jp> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2018-01-24Samba-VirusFilter: Sophos VFS backend.Trever L. Adams4-5/+408
Signed-off-by: Trever L. Adams <trever.adams@gmail.com> Signed-off-by: SATOH Fumiyasu <fumiyas@osstech.co.jp> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2018-01-24Samba-VirusFilter: common headers and sources.Trever L. Adams5-0/+2872
Samba-VirusFilter Contributors: SATOH Fumiyasu @ OSS Technology Corp., Japan Module creator/maintainer Luke Dixon luke.dixon@zynstra.com Samba 4 support Trever L. Adams Documentation Code contributions Samba-master merge work With many thanks to the Samba Team. Signed-off-by: Trever L. Adams <trever.adams@gmail.com> Signed-off-by: SATOH Fumiyasu <fumiyas@osstech.co.jp> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2018-01-22waf: Fix NFS quota support with libtirpcAndreas Schneider1-0/+9
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13238 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Mon Jan 22 17:26:52 CET 2018 on sn-devel-144
2018-01-21vfs_fileid: Fix the 32-bit buildVolker Lendecke1-2/+2
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2018-01-17vfs_glusterfs: Add fallocate support for vfs_glusterfsSachin Prabhu1-1/+27
Adds fallocate support to the vfs glusterfs plugin. v2: Add check for glusterfs-api version. RHBZ: 1478875 Signed-off-by: Sachin Prabhu <sprabhu@redhat.com> Reviewed-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Wed Jan 17 06:09:29 CET 2018 on sn-devel-144
2018-01-13vfs_default: use VFS statvfs macro in fs_capabilitiesDavid Disseldorp1-7/+7
Currently the vfs_default fs_capabilities handler calls statvfs directly, rather than calling the vfs macro. This behaviour may cause issues for VFS modules that delegate fs_capabilities handling to vfs_default but offer their own statvfs hook. Bug: https://bugzilla.samba.org/show_bug.cgi?id=13208 Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2018-01-13vfs_ceph: add fs_capabilities hook to avoid local statvfsDavid Disseldorp1-0/+15
Adding the fs_capabilities() hook to the CephFS VFS module avoids fallback to the vfs_default code-path, which calls statvfs() against the share path on the *local* filesystem. Bug: https://bugzilla.samba.org/show_bug.cgi?id=13208 Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2018-01-10vfs_fruit: initialise bandsize to please a compilerDouglas Bagnall1-1/+1
GCC on a Ubuntu 16.04 instance said: [3174/4240] Compiling source3/modules/vfs_cap.c In file included from ../source3/include/includes.h:301:0, from ../source3/modules/vfs_fruit.c:20: ../source3/modules/vfs_fruit.c: In function ‘fruit_disk_free’: ../source3/../lib/util/debug.h:217:7: error: ‘bandsize’ may be used uninitialized in this function [-Werror=maybe-uninitialized] && (dbgtext body) ) ^ ../source3/modules/vfs_fruit.c:6302:9: note: ‘bandsize’ was declared here size_t bandsize; ^ [3175/4240] Compiling source3/modules/vfs_expand_msdfs.c [3176/4240] Compiling source3/modules/vfs_shadow_copy.c [3177/4240] Compiling source3/modules/vfs_shadow_copy2.c cc1: all warnings being treated as errors Waf: Leaving directory /home/ubuntu/autobuild/b17854/samba-o3/bin' Build failed: -> task failed (err #1): {task: cc vfs_fruit.c -> vfs_fruit_25.o} make: *** [all] Error 1 As far as I can tell, it is wrong, and the bandsize variable never gets passed uninititalised to DEBUG. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Ralph Boehme <slow@samba.org>
2018-01-09vfs_fruit: set delete-on-close for empty finderinfoRalph Boehme1-24/+36
We previously removed the stream from the underlying filesystem stream backing store when the client zeroes out FinderInfo in the AFP_AfpInfo stream, but this causes certain operations to fail (eg stat) when trying to access the stream over any file-handle open on that stream. So instead of deleting, set delete-on-close on the stream. The previous commit already implemented not to list list streams with delete-on-close set which is necessary to implemenent correct macOS semantics for this particular stream. Bug: https://bugzilla.samba.org/show_bug.cgi?id=13181 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Ralph Böhme <slow@samba.org> Autobuild-Date(master): Tue Jan 9 17:09:12 CET 2018 on sn-devel-144
2018-01-09vfs_fruit: filter out AFP_AfpInfo streams with pending delete-on-closeRalph Boehme1-1/+71
This is in preperation of fixing the implementation of removing the AFP_AfpInfo stream by zeroing the FinderInfo out. We currently remove the stream blob from the underyling filesystem backing store, but that results in certain operations to fail on any still open file-handle. The fix comes in the next commit which will convert to backing store delete operation to a set delete-on-close on the stream. This commit adds filtering on streams that have the delete-on-close set. It is only needed for the fruit:metadata=stream case, as with fruit:metadata=netatalk the filtering is already done in fruit_streaminfo_meta_netatalk(). Bug: https://bugzilla.samba.org/show_bug.cgi?id=13181 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2018-01-09vfs_fruit: factor out delete_invalid_meta_stream() from ↵Ralph Boehme1-23/+34
fruit_streaminfo_meta_stream() No change in behaviour, just some refactoring before adding more code to fruit_streaminfo_meta_stream() in the next commit. Bug: https://bugzilla.samba.org/show_bug.cgi?id=13181 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2018-01-08vfs_fileid: fix a use after freeRalph Boehme1-1/+3
Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Ralph Böhme <slow@samba.org> Autobuild-Date(master): Mon Jan 8 03:16:30 CET 2018 on sn-devel-144
2018-01-06vfs_fileid: add fileid:algorithm = fsname_norootdirRalph Boehme1-3/+42
Based-on-a-patch-by: Ralph Wuerthner <ralph.wuerthner@de.ibm.com> Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Sat Jan 6 04:41:24 CET 2018 on sn-devel-144
2018-01-06vfs_fileid: add fileid:nolockinode parameterRalph Boehme1-1/+12
Based-on-a-patch-by: Ralph Wuerthner <ralph.wuerthner@de.ibm.com> Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2018-01-06vfs_fileid: add fileid:algorithm = fsname_nodirsRalph Boehme1-0/+14
Enabling fileid:algorithm = fsname_nodirs uses the hostname algorithm for directories and thus breaks cluster lock coherence for directories. Based-on-a-patch-by: Christian Ambach <ambi@samba.org> Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2018-01-06vfs_fileid: add fileid:algorithm = hostnameRalph Boehme1-0/+31
Using fileid:algorithm = hostname makes fileid generate fileids based on the hostname. This breaks cluster lock coherence. Based-on-a-patch-by: Christian Ambach <ambi@samba.org> Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2018-01-06vfs_fileid: convert dev argument of the device_mapping_fn to SMB_STRUCT_STATRalph Boehme1-8/+8
This is in preperation of adding an additional mapping function that acts differently depending of the file type. No change in behaviour. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2018-01-06vfs_fileid: add "fstype/mntdir deny/allow list" optionRalph Wuerthner1-0/+114
When using the fsname or fsid algorithm a stat() and statfs() call is required for all mounted file systems to generate the file_id. If e.g. an NFS file system is unresponsive such a call might block and the smbd process will become unresponsive. Add "fileid:fstype deny", "fileid:fstype allow", "fileid:mntdir deny", and "fileid:mntdir allow" options to ignore potentially unresponsive file systems. See also https://lists.samba.org/archive/samba-technical/2016-January/111553.html for a discussion about why this is useful. Signed-off-by: Ralph Wuerthner <ralph.wuerthner@de.ibm.com> Reviewed-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2018-01-06vfs_fileid: preserve errno in an error code pathRalph Boehme1-0/+3
Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2018-01-06vfs_fileid: add a DEBUG message to log dev and inodeRalph Boehme1-0/+3
Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2018-01-06vfs_fruit: add "time machine max size" optionRalph Boehme1-0/+428
This can be used to configure a per client filesystem size limit on TimeMachine shares. It's a nasty hack but it was reportedly working well in Netatalk where it's taken from. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>