summaryrefslogtreecommitdiffstats
path: root/source3/modules
Commit message (Collapse)AuthorAgeFilesLines
...
* s3: smbd: Change the function signature of srvstr_push() from returning a ↵Jeremy Allison2014-09-161-2/+8
| | | | | | | | | | | | | | | | | length to returning an NTSTATUS with a length param. srvstr_push_fn() now returns an NTSTATUS reporting any string conversion failure. We need to get serious about returning character set conversion errors inside smbd. Bug 10775 - smbd crashes when accessing garbage filenames https://bugzilla.samba.org/show_bug.cgi?id=10775 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: David Disseldorp <ddiss@samba.org>
* vfs_gpfs: Fix the build with profiling-dataVolker Lendecke2014-09-161-4/+4
| | | | | | | | | | This fails with -Werror=declaration-after-statement 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): Tue Sep 16 01:55:57 CEST 2014 on sn-devel-104
* media_harmony: Fix a crash bugVolker Lendecke2014-09-121-2/+2
| | | | | | | | | | | | Now that the dust has settled, fix a crash bug that was hidden behind the warnings... Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Simo Sorce <idra@samba.org> Reviewed-by: Michael Adam <obnox@samba.org> Autobuild-User(master): Michael Adam <obnox@samba.org> Autobuild-Date(master): Fri Sep 12 02:45:40 CEST 2014 on sn-devel-104
* media_harmony: Fix warningsVolker Lendecke2014-09-121-12/+9
| | | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Simo Sorce <idra@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* vfs_acl_common: dacl size must be updatedRalph Boehme2014-09-111-0/+3
| | | | | | | | | Signed-off-by: Ralph Boehme <rb@sernet.de> 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): Thu Sep 11 03:54:42 CEST 2014 on sn-devel-104
* s3: smbd: vfs_dirsort module.Jeremy Allison2014-09-031-1/+1
| | | | | | | | | | | Fix an off-by-one check that would cause seekdir to seek off the end of the cached array. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ronnie Sahlberg <ronniesahlberg.gmail.com> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Wed Sep 3 19:59:54 CEST 2014 on sn-devel-104
* New VFS module vfs_fruitRalph Boehme2014-08-182-0/+2953
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This module provides enhanced compatibility with Apple SMB clients and interoperability with a Netatalk 3 AFP fileserver. The module intercepts the OS X special streams "AFP_AfpInfo" and "AFP_Resource" and handles them in a special way. All other named streams are deferred to vfs_streams_xattr. The OS X client maps all NTFS illegal characters to the Unicode private range. This module optionally stores the charcters using their native ASCII encoding. Open modes are optionally checked against Netatalk AFP share modes. The "AFP_AfpInfo" named stream is a binary blob containing OS X extended metadata for files and directories. This module optionally reads and stores this metadata in a way compatible with Netatalk 3 which stores the metadata in an EA "org.netatalk.metadata". Cf source3/include/MacExtensions.h for a description of the binary blobs content. The "AFP_Resource" named stream may be arbitrarily large, thus it can't be stored in an EA on most filesystem. ZFS on Solaris is an exception to the rule, because it there EAs can be of any size and EAs are first-class filesystem objects that can be used with normal file syscalls like open(), read(), write(), fcntl() asf. This module stores the AFP_Resource stream in an AppleDouble file, prepending "._" to the filename. On Solaris and ZFS the stream is optionally stored in an EA "org.netatalk.ResourceFork". Signed-off-by: Ralph Boehme <rb@sernet.de> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* vfs3: Pass "lease" through SMB_VFS_CREATE_FILEVolker Lendecke2014-08-115-2/+11
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* vfs_full_audit: Optionally log security descriptors in FSET_NT_ACLVolker Lendecke2014-08-071-2/+20
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* vfs_full_audit: Add "full_audit:syslog"Volker Lendecke2014-08-071-11/+24
| | | | | | | | | | | Defaults to true (for compatibility) With full_audit:syslog=false we DEBUG the messages with level 1. You can explicitly [en|dis]able this with debug class full_audit:0/1 Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* vfs_full_audit: Save full_audit:priority in private_dataVolker Lendecke2014-08-071-1/+4
| | | | | | | lp_parm_enum can become expensive Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* vfs_full_audit: Save full_audit:facility in private_dataVolker Lendecke2014-08-071-3/+13
| | | | | | | lp_parm_enum can become expensive Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* vfs_full_audit: Pass "vfs_full_audit_private_data" to log_failure/success()Volker Lendecke2014-08-071-16/+9
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:smbd: move libasys state from smbXsrv_connection to smbd_server_connectionStefan Metzmacher2014-08-061-7/+7
| | | | | | | | | | This doesn't belong to a connection, it's state used within the VFS stack. And smbd_server_connection is the legacy structure we're using for global VFS state. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* s3:vfs:gpfs: remove a block and reduce indentation in gpfs_is_offline()Michael Adam2014-07-241-8/+6
| | | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Christof Schmitt <cs@samba.org>
* s3:vfs:gpfs: remove all writing uses of stat_ex.vfs_private from vfs_gpfs.Michael Adam2014-07-241-7/+0
| | | | | | | | | | Now that the vfs_private cache is never read in vfs_gpfs, there is no need any more to write it. With this change, vfs_gpfs does not use vfs_private any more. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Christof Schmitt <cs@samba.org>
* s3:vfs:gpfs: Remove all reading uses of stat_ex.vfs_private from vfs_gfs.Michael Adam2014-07-241-23/+22
| | | | | | | | | | | | | | | | | This was used as a cache for offline-info in the stat buffer. But as the implementation of gpfs_is_offline() showed, this cache does not always carry valid information when the stat itself is valid (since at least one call goes to fstatat() directly, circumventing the vfs). So the correct thing is to always call SMB_VFS_IS_OFFLINE() when checking whether a file is offline. For the pread and pwrite calls, we need to call IS_OFFLINE before the actual read and check afterwards if the file was offline before (as a basis whether to send notifications). Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Christof Schmitt <cs@samba.org>
* Revert "s3:vfs:gpfs: log when winAttr-garbage is detected (by heuristics) in ↵Michael Adam2014-07-241-5/+0
| | | | | | | | | | | | | is_offline" This reverts commit 8f44883db94314c007c197927a9dd0809076754d. The next commits will be removing all access to stat_ex.vfs_private from vfs_gpfs. This revert of the last addition is a preparation. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Christof Schmitt <cs@samba.org>
* s3:vfs:gpfs: log when winAttr-garbage is detected (by heuristics) in is_offlineMichael Adam2014-07-131-0/+5
| | | | | | | | | | In is_offline(), check whether the winAttrs are filled with bits outside 0xFFFF and log it prominently: Since GPFS only fills 0xFFFF, this could be due to an uninitialized buffer (or another vfs module filling vfs_private? ...). Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Christof Schmitt <cs@samba.org>
* s3:vfs:gpfs: fix flapping offline: always get winAttrs from gpfs for is_offlineMichael Adam2014-07-131-3/+1
| | | | | | | | | | | | | | | | | | There is a problem of flapping offline due to uninitialized stat buffers. Due to a optimization in vfswrap_readdir which directly calling fastatat (i.e. not through vfs), marking the stat buffer valid, there is nothing this module can do about it and hence can not currently not rely on the vaildity of the stat buffer. By always calling out to GPFS even when the stat buffer is flagged valid, we can always return correct offline information, thereby sacrificing the readdir optimization. Pair-Programmed-With: Volker Lendecke <vl@samba.org> Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Christof Schmitt <cs@samba.org>
* s3:vfs:gpfs: store the winAttrs in the struct_ex when we got them in ↵Michael Adam2014-07-131-0/+1
| | | | | | | | | vfs_gpfs_fstat() This may (e.g.) have lead to some occurrences of flapping offline bits. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Christof Schmitt <cs@samba.org>
* s3:vfs:gpfs: remove extra empty lines.Michael Adam2014-07-101-2/+0
| | | | | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Thu Jul 10 02:50:44 CEST 2014 on sn-devel-104
* s3: VFS modules: Ignore EPERM errors on [f]chmod in crossrename module.Jeremy Allison2014-07-081-2/+4
| | | | | | | This is already done for [f]chown errors. Fix from CurlyMo <curlymoo1@gmail.com> Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* smbd: Remove unused blocking_lock_record* from VFS_BRL_CANCEL_WINDOWSVolker Lendecke2014-07-043-8/+5
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Remove unused blocking_lock_record* from VFS_BRL_LOCK_WINDOWSVolker Lendecke2014-07-043-8/+5
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* vfs_snapper: use a talloc hierarchy for arraysDavid Disseldorp2014-06-301-27/+5
| | | | | | | | | | | Currently the config and snapshot array entries are freed individually. A talloc hierarchy can be used to avoid this behaviour. 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): Mon Jun 30 21:41:13 CEST 2014 on sn-devel-104
* vfs_snapper: don't redefine GMT_FORMAT macroDavid Disseldorp2014-06-301-2/+1
| | | | | | | Use existing header definition. Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* vfs: add previous file version support for vfs_snapperDavid Disseldorp2014-06-301-0/+1215
| | | | | | | | | | | | | | Windows attempts to access previous file versions by first issuing an FSCTL_SRV_ENUMERATE_SNAPSHOTS request, and then using the corresponding snapshot timestamps in subsequent path based requests. This change sees vfs_snapper provide snapshot enumeration data via the get_shadow_copy_data VFS hook. Path based operations are also intercepted, with @GMT-$time components converted to snapper .snapshot/# paths. Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* vfs: add vfs_snapper moduleDavid Disseldorp2014-06-302-0/+835
| | | | | | | | | Provides an interface for accessing snapshots exposed by Snapper. The module communicates with snapperd on the local machine using the D-Bus interface. Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3-shadow-copy2: Protect against already converted namesVolker Lendecke2014-06-271-0/+28
| | | | | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Christof Schmitt <cs@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Fri Jun 27 09:03:53 CEST 2014 on sn-devel-104
* s3-shadow-copy2: Add more debugsVolker Lendecke2014-06-271-0/+9
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Christof Schmitt <cs@samba.org>
* s3-shadow-copy2: Fix incorrect case submountsVolker Lendecke2014-06-271-10/+6
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Christof Schmitt <cs@samba.org>
* s3-shadow-copy2: Remove TODO and fix commentsChristof Schmitt2014-06-271-7/+8
| | | | | | | | | The patch "s3-shadow-copy2: Fix dir/@GMT-2012.10.15-13.48.43 form of paths" takes care of a case marked as TODO, remove it and adjust the comments accordingly. Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* s3-shadow-copy2: Fix dir/@GMT-2012.10.15-13.48.43 form of pathsVolker Lendecke2014-06-271-2/+2
| | | | | | | | | | The previous clause in shadow_copy2_strip_snapshot would only handle @GMT- at the end of a pathname if it was the *only* pathname component. XP seems to send @GMT- at the end under certain circumstances even with a path prefix. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Christof Schmitt <cs@samba.org>
* s3-shadow-copy2: Add extreme debug output to shadow_copy2_strip_snapshotVolker Lendecke2014-06-271-0/+8
| | | | | | | This is sooo hairy to debug when things go wrong :-( Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Christof Schmitt <cs@samba.org>
* build: fix the test and define for msg_accrightsMichael Adam2014-06-161-1/+1
| | | | | | | | | | | It must be "msg_accrights" not "msg_acctrights" ... ^ Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Jelmer Vernooij <jelmer@samba.org> Autobuild-User(master): Michael Adam <obnox@samba.org> Autobuild-Date(master): Mon Jun 16 18:18:04 CEST 2014 on sn-devel-104
* vfs:gpfs: fix a debug messageMichael Adam2014-06-131-1/+1
| | | | | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Fri Jun 13 19:54:23 CEST 2014 on sn-devel-104
* vfs_streams_xattr: add options "prefix" and "store_stream_type"Ralph Boehme2014-06-131-30/+92
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add module options that can be used to configure the stream prefix the module uses (option "prefix", a string) and whether the stream type "$DATA" is appended to the xattr name on disk (option "store_stream_type", a boolean). The default "prefix" is "user.DosStream" and the default for "store_stream_type" is true, this gives unchanged default behaviour when not specifying this option. OS X SMB clients will send xattrs as named streams over the wire, by setting the options to the following values streams_xattr:prefix = user. streams_xattr:store_stream_type = no OS X xattrs will be stored on disk on the server with their unmodified names and as such provide interoperability with other protocols like AFP. In order to prevent access to our internal Samba xattrs, check the xattr name with the function samba_private_attr_name() made public by the previous commit. Signed-off-by: Ralph Boehme <rb@sernet.de> Reviewed-by: Christof Schmitt <cs@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* s3:vfs_afsacl fix compiler warningsChristian Ambach2014-06-041-2/+1
| | | | | | | | Signed-off-by: Christian Ambach <ambi@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Christian Ambach <ambi@samba.org> Autobuild-Date(master): Wed Jun 4 22:34:51 CEST 2014 on sn-devel-104
* vfs_afsacl: remove unused includesChristian Ambach2014-06-041-2/+1
| | | | | | | | | | * auth.h might cause collisions with the Heimdal headers * we should not include afs/afs.h directly, see https://bugs.launchpad.net/ubuntu/+source/openafs/+bug/1319336 http://rt.central.org/rt/Ticket/Display.html?id=131737 Signed-off-by: Christian Ambach <ambi@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s3:lib/afs move afs_settoken.c to common lib dirChristian Ambach2014-06-041-0/+1
| | | | | Signed-off-by: Christian Ambach <ambi@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* build: rename HAVE_MSGHDR_MSG_ACCTRIGHTS to HAVE_STRUCT_MSGHDR_MSG_ACCTRIGHTSMichael Adam2014-06-021-1/+1
| | | | | | | for consistency. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* build: rename HAVE_MSGHDR_MSG_CONTROL to HAVE_STRUCT_MSGHDR_MSG_CONTROLMichael Adam2014-06-021-4/+4
| | | | | | | So that we are consistent with the socket_wrapper define. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* vfs:aio_fork: simplify checking of MSG_CONTROL and MSG_ACCTRIGHTSMichael Adam2014-06-021-9/+8
| | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* s3:vfs_gpfs: increase log level for EPERM and EACCES errors in gpfs_get_xattr()Ralph Wuerthner2014-05-151-2/+9
| | | | | | | | | Signed-off-by: Ralph Wuerthner <ralph.wuerthner@de.ibm.com> Reviewed-by: Christof Schmitt <cs@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Thu May 15 02:19:41 CEST 2014 on sn-devel-104
* s3 : smbd : Protect all possible code paths from fsp->op == NULL.Jeremy Allison2014-05-022-0/+14
| | | | | | | | | | | | | 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>
* vfs_gpfs: Avoid warnings in developer buildChristof Schmitt2014-04-181-5/+4
| | | | | | | | | | Remove an unused variable and use discard_const_p. Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Fri Apr 18 22:25:25 CEST 2014 on sn-devel-104
* 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
* vfs: Store ACL control flags in gpfs vfs module.Alexander Werth2014-04-051-23/+114
| | | | | | | | Use literals to allow a compile and execution on gpfs 3.4. Signed-off-by: Alexander Werth <alexander.werth@de.ibm.com> Reviewed-by: Christof Schmitt <cs@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* vfs: Support NFS control flags in nfs4_acls.c.Alexander Werth2014-04-052-1/+27
| | | | | | | | | | | The ACL control flags stores in particular the dacl protected bit which is responsible for the "Include inherited permissions from this object's parent" checkbox. This stores the information in the ACL struct passed to and from file system specific vfs modules. Signed-off-by: Alexander Werth <alexander.werth@de.ibm.com> Reviewed-by: Christof Schmitt <cs@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>