1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00
Commit Graph

2124 Commits

Author SHA1 Message Date
Volker Lendecke
cf97ec56d2 nfs4acls: Remove an obsolete comment
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-08-13 14:40:15 +02:00
Volker Lendecke
157711cb47 nfs4acls: Use an anon struct for SMB4ACE_T
-typedef struct _SMB4ACE_T {char dontuse;} SMB4ACE_T;
+struct SMB4ACE_T;

Same as for ACL_T

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-08-13 14:40:15 +02:00
Volker Lendecke
f15ad38d14 nfs4acls: Use an anon struct for SMB4ACL_T
The relevant change:

-typedef struct _SMB4ACL_T {char dontuse;} SMB4ACL_T;
+struct SMB4ACL_T;

We can use anonymous structs to prevent direct use. This patch will
trigger a set of simplifications in the next patches

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-08-13 14:40:15 +02:00
Volker Lendecke
9db523b169 nfs4acls: Use ZERO_STRUCTP
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-08-13 14:40:15 +02:00
Ralph Boehme
1db11998bf vfs_catia: run translation on stream names
With vfs_fruit option "fruit:encoding = native" we're already converting
stream names that contain illegal NTFS characters from their on-the-wire
Unicode Private Range encoding to their native ASCII representation.

Unfortunately the reverse mapping for stream names was not perfomed.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=11278

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-08-07 09:52:12 +02:00
Ralph Boehme
fb9a64ea37 vfs_streams_xattr: stream names may contain colons
With vfs_fruit option "fruit:encoding = native" we're already converting
stream names that contain illegal NTFS characters from their on-the-wire
Unicode Private Range encoding to their native ASCII representation.

As as result the name of xattrs storing the streams (via
vfs_streams_xattr) may contain a colon, so we have to use strrchr_m()
instead of strchr_m() for matching the stream type suffix.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=11278

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-08-07 09:52:12 +02:00
Günther Deschner
3d0b23dbd4 vfs: fix build warning in smb traffic analyzer.
Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2015-07-24 13:39:31 +02:00
Volker Lendecke
45e3b05966 vfs: Fix CID 1312072 Failure to restore non-local value
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 Jul 22 09:06:29 CEST 2015 on sn-devel-104
2015-07-22 09:06:29 +02:00
Volker Lendecke
d7a33d8b3d vfs: Fix CID 1312073 Argument cannot be negative
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-07-22 06:01:28 +02:00
Volker Lendecke
fec300b0c1 vfs: Consolidate failure paths in vfswrap_init_asys_ctx
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): Fri Jul 17 01:35:33 CEST 2015 on sn-devel-104
2015-07-17 01:35:33 +02:00
Volker Lendecke
93af8a1a23 vfs: Fix CID 1035384 Unchecked return value from library
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-07-16 22:32:24 +02:00
Ralph Boehme
5b3ed904ca vfs_shadow_copy2: change log level from 0 to 1 and log share path
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2015-07-16 17:19:19 +02:00
Volker Lendecke
40bcdb364b vfs_fruit: Fix the 32-bit build
"z" is only for size_t, here we have off_t

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>

Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Mon Jul 13 11:53:47 CEST 2015 on sn-devel-104
2015-07-13 11:53:47 +02:00
Christof Schmitt
2d62b9ab7d vfs_gpfs: Use C99 initializers instead of ZERO_STRUCT
Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2015-07-08 02:54:26 +02:00
Christof Schmitt
4099bdfae8 vfs_gpfs: Use ACL defines from GPFS 3.5 header files
GPFS 3.5 is now the oldest support version. Cleanup the ACL code by
using the defines and structs from the 3.5 header file.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2015-07-08 02:54:26 +02:00
Volker Lendecke
70283ffd38 smbd: Remove SMB_VFS_NOTIFY_WATCH
No longer needed

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-07-07 23:51:24 +02:00
Volker Lendecke
730b025d7b smbd: Remove the notify_fam module
This has been moved to main smbd

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-07-07 23:51:24 +02:00
Volker Lendecke
a24f0379ac param: Make "kernel change notify" global
With a central notifyd, we can't do this per share anymore. Notifyd will
only look at absolute paths, not shares.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-07-07 23:51:24 +02:00
Volker Lendecke
8fec35994c vfs_fruit: Fix CID 1311244 Out-of-bounds read
We should not call memcpy if the offset is exactly AFP_INFO_SIZE

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>

Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Tue Jul  7 14:04:39 CEST 2015 on sn-devel-104
2015-07-07 14:04:39 +02:00
Ralph Boehme
25f302a47c vfs_fruit: check offset and length for AFP_AfpInfo read requests
fruit_pread doesn't check the offset and length parameters and instead
always writes 60 bytes, the size of the AFP_AfpInfo blob, to the the
passed buffer. If the passed in buffer is smaller, we overwrite
something somewhere.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=11363

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2015-07-02 22:45:10 +02:00
Ralph Boehme
20075e6b30 s3:vfs: copy_chunk buffer size
Use a dynamically allocated copy_chunk buffer size with an upper bound
of 8 MB for now.

The previous size of 64 KB has proven to really hurt performance,
especially with "strict locking = yes".

The SMB2 protocol level maximum allowed copy_chunk size is 1 MB, that's
what will be used as buffer size in the typical case.

With the AAPL copyfile extension the requested copy_chunk size is the
size whole file, which would then make use of a larger buffer up to the
limit of 8 MB.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-07-01 23:05:55 +02:00
Ralph Boehme
6fd351f23b vfs:fruit: implement copyfile style copy_chunk
Implement Apple's special copy_chunk ioctl that requests a copy of the
whole file along with all attached metadata.

These copy_chunk requests have a chunk count of 0 that we translate to a
copy_chunk_send VFS call overloading the parameters src_off = dest_off =
num = 0.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=11317

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-06-23 11:45:23 +02:00
Ralph Boehme
f0d6e4e3c3 vfs_fruit: simplify lp_parm_bool check
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-06-23 11:45:23 +02:00
Ralph Boehme
b26a1449a0 vfs_fruit: add option veto_appledouble
vfs_fruit adds a wildcard path "._*" to the vetolist in order to prevent
client access to ._ AppleDouble files created internally by vfs_fruit
for storing the Mac resource fork stream.

Unfortunately there are legitimite use cases where an OS X client may
want to use such filenames, extracting ZIP archives (where the archive
contains ._ files) being one of them.

A possible simple solution to this problem would be to not veto ._ files
in the first place, even though that exposes internally created ._ files
which the client shouldn't be able to access.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=11305

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>

Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Tue Jun  9 14:48:14 CEST 2015 on sn-devel-104
2015-06-09 14:48:12 +02:00
Karolin Seeger
1afb7cc92e vfs_hpuxacl: Fix typo in comment...
and remove some trailing whitespaces.

Signed-off-by: Karolin Seeger <kseeger@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-05-21 22:54:20 +02:00
Stefan Metzmacher
9ee3422a70 s3:modules: remove unused allow_warnings=True for vfs_nfs4acl_xattr
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2015-05-19 13:43:13 +02:00
Stefan Metzmacher
dacc86effb s3:vfs_nfs4acl_xattr: fix compiler warnings
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2015-05-19 13:43:13 +02:00
Stefan Metzmacher
15d9374444 s3:modules: remove unused allow_undefined_symbols=False from vfs_glusterfs
This is the default...

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2015-05-19 13:43:13 +02:00
Stefan Metzmacher
dfd245dc38 s3:modules: remove unused allow_undefined_symbols=True from vfs_aio_*
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2015-05-19 13:43:13 +02:00
Stefan Metzmacher
54f7672d72 s3:modules: remove unused allow_warnings=True for vfs_aio_fork
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2015-05-19 13:43:13 +02:00
Stefan Metzmacher
54a80b396c s3:vfs_aio_fork: avoid -Wcast-qual warnings
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2015-05-19 13:43:13 +02:00
Stefan Metzmacher
542a6d9d0c s3:modules: remove unused allow_warnings=True for vfs_preopen
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2015-05-19 13:43:13 +02:00
Stefan Metzmacher
362288a0a4 s3:vfs_preopen: avoid compiler warnings
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2015-05-19 13:43:13 +02:00
Stefan Metzmacher
a2ead174b4 s3:modules: remove unused allow_warnings=True for vfs_unityed_media
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2015-05-19 13:43:13 +02:00
Ralph Boehme
fe93f7d677 vfs_fruit: comment fix: the options are documented
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): Fri May  8 21:27:45 CEST 2015 on sn-devel-104
2015-05-08 21:27:45 +02:00
Ralph Boehme
1b8a0e6a26 vfs_fruit: add option "nfs_aces" that controls the NFS ACEs stuff
Bug: https://bugzilla.samba.org/show_bug.cgi?id=11213

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-05-08 18:38:14 +02:00
Volker Lendecke
ca157b35ac vfs: Fix the O3 developer build
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 May  7 23:11:38 CEST 2015 on sn-devel-104
2015-05-07 23:11:38 +02:00
Volker Lendecke
e241b739fb Fix a few printf format errors
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-05-07 20:20:19 +02:00
Ralph Boehme
3876e59826 vfs_gpfs: move failure label before END_PROFILE
The label was added in 5e65ae14dd as part
of fix for bug 11244, but was wrongly placed behind END_PROFILE.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=11244

Signed-off-by: Ralph Boehme <slow@samba.org>

Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Thu May  7 19:22:00 CEST 2015 on sn-devel-104
2015-05-07 19:22:00 +02:00
Volker Lendecke
009cf612c8 smbd: Fix CID 703870 Uninitialized scalar variable
msg.msg_flags was uninitialized in the recvmsg call

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>
2015-05-06 15:37:14 +02:00
Richard Sharpe
e60cc280d6 Convert all uint8/16/32 to _t in all modules.
Signed-off-by: Richard Sharpe <rsharpe@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-05-06 04:14:14 +02:00
Jeremy Allison
0f23bf228c s3: smbd: VFS: fake_acl module called get_full_smb_filename() with a stream path, then used the result to call XATTR functions directly.
Ensure when pulling XATTR values, we don't allow a stream filename.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11249

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2015-05-05 14:01:25 +02:00
Jeremy Allison
ccb4f791fd s3: smbd: VFS: For all EA and ACL calls use synthetic_smb_fname(), not synthetic_smb_fname_split().
EA's and ACL paths are all post-stream name checks (and shouldn't
get stream names). This one took a *long* time to find.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11249

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2015-05-05 14:01:25 +02:00
Jeremy Allison
14f4e254bb s3: smbd: VFS: All the places that are currently calling vfs_stat_smb_fname() and vfs_lstat_smb_fname() should be calling vfs_stat_smb_basename().
They are all post-stream name processing.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11249

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2015-05-05 14:01:25 +02:00
Richard Sharpe
4889cee60e Convert uint32/16/8 to _t for the last two include files in source3/include.
There are still many files to touch before we can remove the #define but this
gets the last include files in source3/includes.

Signed-off-by: Richard Sharpe <rsharpe@samba.org>
Reviewed-by: Jeremy Allson <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri May  1 21:52:25 CEST 2015 on sn-devel-104
2015-05-01 21:52:25 +02:00
Jeremy Allison
d68383e963 s3: smbd: Incorrect file size returned in the response of "FILE_SUPERSEDE Create"
https://bugzilla.samba.org/show_bug.cgi?id=11240

Signed-off-by: Kenny Dinh <kdinh@peaxy.net>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <rb@sernet.de>
2015-04-30 19:35:10 +02:00
Ralph Boehme
5e65ae14dd vfp_gpfs: ensure END_PROFILE is always called
Bug: https://bugzilla.samba.org/show_bug.cgi?id=11244

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>

Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Thu Apr 30 19:34:41 CEST 2015 on sn-devel-104
2015-04-30 19:34:41 +02:00
Ralph Boehme
d748652e5b vfs: kernel_flock and named streams
Streams implementing VFS modules may implement streams in a way that the
fsp will have the basefile open in the fsp fd, so lacking a distinct fd
for the stream, kernel_flock will apply on the basefile which is
wrong. The actual check is deffered to the VFS module implementing the
kernel_flock call.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=11243

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-04-29 23:42:20 +02:00
Ralph Wuerthner
fdbca5e13a vfs_gpfs: Fix ENODATA for getacl on .snapshot dirs
Fall back to POSIX ACLs in this case.

Signed-off-by: Ralph Wuerthner <ralph.wuerthner@de.ibm.com>
Reviewed-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>

Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Tue Apr 28 13:19:25 CEST 2015 on sn-devel-104
2015-04-28 13:19:25 +02:00
Björn Jacke
60fbfc5563 vfs_fruit: also map characters below 0x20
we need to map 0x01-0x1F to 0xF001-0xF01F as 0x01-0x1F are win32 illegal
characters.

see https://support.microsoft.com/en-us/kb/kbview/117258

Even if the MS KB article writes "invalid ntfs characters" they are actually
not illegal in ntfs, just in the win32 API.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11221

Signed-off-by: Bjoern Jacke <bj@sernet.de>
Reviewed-by: Ralf Böhme <slow@samba.org>

Autobuild-User(master): Björn Jacke <bj@sernet.de>
Autobuild-Date(master): Fri Apr 17 20:00:48 CEST 2015 on sn-devel-104
2015-04-17 20:00:48 +02:00
Christof Schmitt
ad54184925 vfs_gpfs: Remove vfs_gpfs_get_quotas
Call get_gpfs_quota directly from vfs_gpfs_disk_free_quota to get user
and group quotas.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-04-17 00:49:21 +02:00
Christof Schmitt
dd029e6c6f vfs_gpfs: Remove check for fileset quota
Querying the fileset id requires additional GPFS API calls and also
opening a directory, which might have other side effects. A better
option would be configuring the file system with --filesetdf, then the
fileset quota is automatically reflected in the free space information
reported from gpfs.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-04-17 00:49:21 +02:00
Yan, Zheng
8a19314132 vfs_ceph: add empty ACL callbacks
If a vfs module has no ACL callbacks, smbd will use its default ACL
callbacks. These default ACL callbacks operate on local filesytem,
it's clearly wrong for ceph case.

libcephfs does not support ACL yet, so this patch adds ACL callbacks
that do nothing.

Signed-off-by: Yan, Zheng <zyan@redhat.com>
Reviewed-by: Ira Cooper <ira@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2015-04-02 14:02:18 +02:00
Yan, Zheng
628fa5bc00 vfs_ceph: use 'file descriptor' version xattr functions when possible
libcephfs version 0.94 adds 'file descriptor' version xattr functions.
This patch makes corresponding samba VFS callbacks use these new
functions.

Signed-off-by: Yan, Zheng <zyan@redhat.com>
Reviewed-by: Ira Cooper <ira@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2015-04-02 14:02:18 +02:00
David Disseldorp
9d29f7ea17 vfs: add vfs_shell_snap module
The shell_snap VFS module plumbs into the snapshot (aka shadow-copy)
management paths used by Samba's File Server Remote VSS Protocol (FSRVP)
server.
The following shell callouts may be configured in smb.conf:

shell_snap: check path command
	- Called when an FSRVP client wishes to check whether a given
	  share supports snapshot create/delete requests.
	- The command is called with a single <share path> argument.
	- The command must return 0 if <share path> is capable of being
	  snapshotted.

shell_snap: create command
	- Called when an FSRVP client wishes to create a snapshot.
	- The command is called with a single <share path> argument.
	- The command must return 0 status if the snapshot was
	  successfully taken.
	- The command must output the path of the newly created snapshot
	  to stdout.

shell_snap: delete command
	- Called when an FSRVP client wishes to delete a snapshot.
	- The command is called with <base share path> and
	  <snapshot share path> arguments.
	- The command must return 0 status if the snapshot was
	  successfully removed.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-03-31 18:40:25 +02:00
David Disseldorp
9f7dd07d26 vfs_snapper: create/delete snapshot support
Extend vfs_snapper to support the new remote snapshot creation and
deletion hooks added for FSRVP.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-03-31 18:40:25 +02:00
David Disseldorp
9b5b46a092 vfs_btrfs: add snapshot create/delete calls
The "btrfs: manipulate snapshots" smb.conf parameter is disabled by
default, to encourage use of, and pass requests through to, the
vfs_snapper module.
When enabled, issue BTRFS_IOC_SNAP_CREATE_V2 and BTRFS_IOC_SNAP_DESTROY
ioctls accordingly. The ioctls are issued as root, so rely on permission
checks in the calling FSRVP server process.

Base share paths must exist as btrfs subvolumes in order to
be supported for snapshot operations.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-03-31 18:40:25 +02:00
David Disseldorp
67ee428467 vfs: add snapshot create/delete hooks
This change adds three new VFS hooks covering snapshot manipulation:
- snap_check_path
  Check whether a path supports snapshots.
- snap_create
  Request the creation of a snapshot of the provided path.
- snap_delete
  Request the deletion of a snapshot.

These VFS call-outs will be used in future by Samba's File Server Remote
VSS Protocol (FSRVP) server.

MS-FSVRP states:
  At any given time, Windows servers allow only one shadow copy set to
  be going through the creation process.
Therefore, only provide synchronous hooks for now, which can be
converted to asynchronous _send/_recv functions when the corresponding
DCE/RPC server infrastructure is in place.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-03-31 18:40:24 +02:00
Christof Schmitt
868f83e5c6 vfs_gpfs: Remove warning after failure of get_gpfs_fset_id
get_gpfs_fset_id already emits more detailed warnings, there is no need
to print an additional warning in the calling function.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
2015-03-30 11:04:15 +02:00
Ralph Boehme
4cc51f905c vfs_fruit: enhance handling of malformed AppleDouble files
Trying for fixup a broken AppleDouble file with a resourcefork entry
offset + length > filesystem resulted in a crashing memmove() in
ad_convert().

Add a specific safety check that stats the ._ file and limits the
resource fork length to the filesize.

While we're at it, now that we know the filesize in ad_unpack(), add
additional checks that verify this.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=11125

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>

Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Thu Mar 26 12:39:01 CET 2015 on sn-devel-104
2015-03-26 12:39:01 +01:00
Christof Schmitt
8dcf8cfe66 gpfswrap: Move gpfswrap to lib/util
Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2015-03-23 21:22:12 +01:00
Yan, Zheng
7551a4edb5 vfs_ceph: remove cephwrap_init_stat_ex_from_stat()
cephwrap_init_stat_ex_from_stat() lacks code that makes 'create'
timestamp. Besides that, it's identical to init_stat_ex_from_stat().

Signed-off-by: Yan, Zheng <zyan@redhat.com>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>
2015-03-19 18:02:13 +01:00
Yan, Zheng
16956d4eb1 vfs_ceph: fix ntimes_fn callback
add null timespec check for atime/mtime. Also add code that stores
create_time by EA.

Signed-off-by: Yan, Zheng <zyan@redhat.com>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>
2015-03-19 18:02:13 +01:00
Volker Lendecke
f686db87a4 source3: Replace ccan hash calls with tdb_jenkins_hash
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2015-03-17 11:30:52 +01:00
Volker Lendecke
de811f14af lib: Remove tdb_compat
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2015-03-17 11:30:52 +01:00
David Disseldorp
12c0b6bf40 s3/vfs: change fallocate mode flags from enum->uint32_t
The Linux fallocate syscall offers a mode parameter which can take the
following flags:
FALLOC_FL_KEEP_SIZE
FALLOC_FL_PUNCH_HOLE (since 2.6.38)
FALLOC_FL_COLLAPSE_RANGE (since 3.15)
FALLOC_FL_ZERO_RANGE (since 3.14)

The flags are not exclusive, e.g. FALLOC_FL_PUNCH_HOLE must be specified
alongside FALLOC_FL_KEEP_SIZE.

Samba currently takes a vfs_fallocate_mode enum parameter for the VFS
fallocate hook, taking either an EXTEND_SIZE or KEEP_SIZE value. This
commit changes the fallocate hook such that it accepts a uint32_t flags
parameter, in preparation for PUNCH_HOLE and ZERO_RANGE support.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-03-09 21:27:07 +01:00
Volker Lendecke
91ff65b2f6 vfs_fruit: Fix CID 1273290 Uninitialized scalar variable
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>

Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Fri Mar  6 23:56:36 CET 2015 on sn-devel-104
2015-03-06 23:56:36 +01:00
Volker Lendecke
bccf5c9a7b perfcount: Fix CID 1035494 Out-of-bounds read
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>

Autobuild-User(master): Ira Cooper <ira@samba.org>
Autobuild-Date(master): Thu Mar  5 18:28:44 CET 2015 on sn-devel-104
2015-03-05 18:28:44 +01:00
Volker Lendecke
819d4b4bcd perfcount: Fix CID 1035493 Out-of-bounds read
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>
2015-03-05 15:59:12 +01:00
Volker Lendecke
bd3b2c3d9b perfcount: Fix CID 1035492 Out-of-bounds read
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>
2015-03-05 15:59:11 +01:00
Volker Lendecke
5968310060 perfcount: Fix CID 1274043 Division or modulo by zero
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>
2015-03-05 15:59:11 +01:00
Volker Lendecke
ddb84ef2d3 aio_fork: Fix CID 1273291 Uninitialized scalar variable
The previous code left msg.msg_flags uninitialized

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2015-03-03 17:34:38 +01:00
Christof Schmitt
3c2cf5e0d6 gpfs: Add include guard to gpfswrap.h
Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>

Autobuild-User(master): Christof Schmitt <cs@samba.org>
Autobuild-Date(master): Tue Mar  3 01:01:25 CET 2015 on sn-devel-104
2015-03-03 01:01:24 +01:00
Christof Schmitt
a11fed1671 gpfs: Rename library wrapper to gpfswrap
The code in gpfs.c and vfs_gpfs.h now only wraps the gpfs library.
Rename the files to gpfswrap to make it clear that this is the only
purpose of that file.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
2015-03-02 22:31:08 +01:00
Christof Schmitt
b765b17fea gpfs: Update file headers
Update file headers to reflect the new code organization and reformat
for consistency.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
2015-03-02 22:31:08 +01:00
Christof Schmitt
5e022bc339 gpfs: Remove unncessary includes from gpfs.c
replace.h provides everything that is required (errno and ENOSYS).

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
2015-03-02 22:31:08 +01:00
Christof Schmitt
d93767fe8f gpfs: Move DBGC_CLASS definition below includes
Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
2015-03-02 22:31:08 +01:00
Christof Schmitt
b69957d65d gpfs: Include gpfs_fcntl.h only from vfs_gpfs header file
Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
2015-03-02 22:31:08 +01:00
Christof Schmitt
f508f273b2 gpfs: Move definition of GPFS_GETACL_NATIVE to vfs_gpfs.c
Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
2015-03-02 22:31:08 +01:00
Christof Schmitt
38a89f23f1 gpfs: Move smbd_gpfs_set_times_path to vfs_gpfs.c
Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
2015-03-02 22:31:08 +01:00
Christof Schmitt
a5ca63b266 gpfs: Move get_gpfs_fset_id to vfs_gpfs.c
Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
2015-03-02 22:31:08 +01:00
Christof Schmitt
a36c46d9db gpfs: Move get_gpfs_quota to vfs_gpfs.c
Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
2015-03-02 22:31:08 +01:00
Christof Schmitt
9948163a64 gpfs: Move set_gpfs_lease to vfs_gpfs.c
Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
2015-03-02 22:31:08 +01:00
Christof Schmitt
f9629aee81 gpfs: Move set_gpfs_sharemode to vfs_gpfs.c
Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
2015-03-02 22:31:08 +01:00
Christof Schmitt
26991065f2 gpfs: Introduce wrapper for gpfs_getfilesetid
Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
2015-03-02 22:31:08 +01:00
Christof Schmitt
e30d501217 gpfs: Introduce wrapper for gpfs_fcntl
Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
2015-03-02 22:31:08 +01:00
Christof Schmitt
c4f1f3b253 gpfs: Introduce wrapper for gpfs_quotactl
Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
2015-03-02 22:31:08 +01:00
Christof Schmitt
1907a88a6d gpfs: Introduce wrapper for gpfs_set_times_path
Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
2015-03-02 22:31:08 +01:00
Christof Schmitt
db01831082 gpfs: Rename wrapper for gpfs_lib_init
Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
2015-03-02 22:31:08 +01:00
Christof Schmitt
eefb916192 gpfs: Rename wrapper for gpfs_ftruncate
Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
2015-03-02 22:31:08 +01:00
Christof Schmitt
15c2b3a825 gpfs: Rename wrapper for gpfs_prealloc
Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
2015-03-02 22:31:08 +01:00
Christof Schmitt
4d57c20ba8 gpfs: Rename wrapper for gpfs_get_winattrs
Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
2015-03-02 22:31:08 +01:00
Christof Schmitt
2cecf08298 gpfs: Rename wrapper for gpfs_get_winattrs_path
Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
2015-03-02 22:31:08 +01:00
Christof Schmitt
e9e87d456a gpfs: Rename wrapper for gpfs_set_winattrs_path
Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
2015-03-02 22:31:08 +01:00
Christof Schmitt
fdd6078ddd gpfs: Rename wrapper for gpfs_get_realfilename_path
Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
2015-03-02 22:31:08 +01:00
Christof Schmitt
5fa1ee8b7b gpfs: Rename wrapper for gpfs_putacl
Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
2015-03-02 22:31:07 +01:00
Christof Schmitt
d266ad1e4b gpfs: Rename wrapper for gpfs_getacl
Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
2015-03-02 22:31:07 +01:00
Christof Schmitt
193b5dd143 gpfs: Introduce wrapper for gpfs_set_lease
Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
2015-03-02 22:31:07 +01:00
Christof Schmitt
5fb2568d5b gpfs: Introduce wrapper for gpfs_set_share
Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
2015-03-02 22:31:07 +01:00
Christof Schmitt
ca69d43dfd gpfs: Simplify initialization for gpfs library wrapper
Merge the code for initializing the function pointers in one function.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
2015-03-02 22:31:07 +01:00
Christof Schmitt
4a89e8452e gpfs: Remove search for libgpfs_gpl.so
Similar to the header files, libgpfs_gpl.so no longer exists. The
library is now always called libgpfs.so.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
2015-03-02 22:31:07 +01:00
Christof Schmitt
f826c86bf1 gpfs: Look for gpfs header files also in /usr/lpp/mmfs/include/
That is the default directory for the gpfs header files.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
2015-03-02 22:31:07 +01:00
Christof Schmitt
1264a4efd9 gpfs: Always use gpfs_fcntl.h headerfile
gpfs_gpl.h no longer exists, everything from that header file has been
merged to gpfs.h. gpfs_fcntl.h implicitly includes gpfs.h. Simplify the
code by only looking for gpfs_fcntl.h and including that file.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
2015-03-02 22:31:07 +01:00
Volker Lendecke
3ec06454e1 vfs_catia: Simplify init_mappings()
No else required after return

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 Feb 26 21:22:30 CET 2015 on sn-devel-104
2015-02-26 21:22:30 +01:00
David Disseldorp
41c4666a72 s3/vfs: remove unused SMB_VFS_DISK_FREE() small_query parameter
The small_query parameter for SMB_VFS_DISK_FREE() was, prior to the
previous commit, used to obtain 16-bit wide free-space information for
the deprecated dskattr SMB_COM_QUERY_INFORMATION_DISK command.

With the dskattr handler now performing the 16-bit collapse directly,
the small_query parameter can be removed from the entire code path.

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): Tue Feb 17 05:37:20 CET 2015 on sn-devel-104
2015-02-17 05:37:20 +01:00
Yan, Zheng
2501afe08b vfs_ceph: fix disk_free_fn callback
Free space and available space should be in unit of block size. Besides,
we should call disk_norm() to adjust the returned values.

Signed-off-by: Yan, Zheng <zyan@redhat.com>
Reviewed-by: Ira Cooper <ira@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>

Autobuild-User(master): Ira Cooper <ira@samba.org>
Autobuild-Date(master): Mon Feb 16 18:14:02 CET 2015 on sn-devel-104
2015-02-16 18:14:02 +01:00
Christof Schmitt
618af83d1b vfs_prealloc: Remove call to gpfs_prealloc
Calling gpfs_prealloc changes the actual size of the file, and this
should not be done implicitly. Also this code does not compile due to
the missing dependency to the gpfs library. The best way solution here
is probably removing the call to gpfs_prealloc. The vfs_gpfs module
already implements the call to gpfs_prelloc when this can be done
safely.

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): Wed Feb 11 02:03:09 CET 2015 on sn-devel-104
2015-02-11 02:03:08 +01:00
Volker Lendecke
4143cbac8c nfs4: Fix a confusing debug message
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>

Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Mon Feb  9 12:25:06 CET 2015 on sn-devel-104
2015-02-09 12:25:06 +01:00
Richard Sharpe
b66e4bed4f Fix a couple of DEBUG statements that were copied from elsewhere. Removed the misleading function name since the DEBUG message will print out the function name anyway.
Signed-of-by: Richard Sharpe <rsharpe@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>

Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Sun Jan 25 12:58:08 CET 2015 on sn-devel-104
2015-01-25 12:58:08 +01:00
Ira Cooper
3b2d8bdbb1 vfs_glusterfs: Add comments to the pipe(2) code.
The guarantees around read(2) and write(2) and pipes are critical
to understanding this code.  Hopefully these comments will help.

Signed-off-by: Ira Cooper <ira@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Jan 23 20:58:51 CET 2015 on sn-devel-104
2015-01-23 20:58:51 +01:00
Volker Lendecke
db63e4887c vfs: Fix a typo
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>

Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Thu Jan 22 13:14:38 CET 2015 on sn-devel-104
2015-01-22 13:14:37 +01:00
Michael Adam
cde5d380e1 vfs:glusterfs: whitespace fix.
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 Jan 22 03:20:17 CET 2015 on sn-devel-104
2015-01-22 03:20:17 +01:00
David Disseldorp
32e9d7fa22 vfs_snapper: encode and decode Snapper DBus strings
Snapper uses a special character encoding for strings used in DBus
requests and responses. This change ensures that Samba packs and unpacks
strings in the corresponding format, using the previously added
encode/decode helper functions.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=11055

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-01-22 00:57:10 +01:00
David Disseldorp
3d48fc9673 vfs_snapper: add DBus string encoding and decoding helpers
Snapper uses the following mechanism for encoding and decoding strings
used in DBus traffic:
Characters above 127 (0x7F - ASCII DEL) must be encoded hexadecimal as
"\x??". As a consequence "\" must be encoded as "\\".

This change adds string encoding and decoding helpers to vfs_snapper.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=11055

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-01-22 00:57:10 +01:00
David Disseldorp
f72fa6390b vfs_snapper: free dbus req messages in error paths
Bug: https://bugzilla.samba.org/show_bug.cgi?id=11055

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-01-22 00:57:09 +01:00
Ira Cooper
4c3a3d9e6a vfs_glusterfs: Replace eventfd with pipes, for AIO use
Pipes clean up the AIO implementation substantially, due to the fact
that they implement a natural ithread safe queue instead of us
creating our own queue.

Signed-off-by: Ira Cooper <ira@samba.org>
Signed-off-by: Poornima G <pgurusid@redhat.com>
Reviewed-by: Günther Deschner <gd@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>

Autobuild-User(master): Ira Cooper <ira@samba.org>
Autobuild-Date(master): Wed Jan 21 20:40:11 CET 2015 on sn-devel-104
2015-01-21 20:40:10 +01:00
Ralph Boehme
15511f7c51 vfs_unityed_media: VFS module for sharing AVID projects
Based on <https://code.google.com/p/vfs-unityed-media/>.

The existing VFS module media_harmony has some problems relative to Avid
media sharing:

Avid looks at the modification time of the ingest directory. Since
media_harmony has everyone using the same directory, users (or client
systems) have to somehow create "fake" directories with special names
and then media_harmony returns the mod time of those fake directories
for the different clients rather than the actual mod time of the
communal ingest directory.

To make matters worse, users then have to have a special utility or
understand how to update the modtime on these specially named
directories. Otherwise, their client system will never update the
indexes to show new media.

To make it even worse than that, Avid creates new directories on the
fly, so you can't just set this up statically at the beginning. Avid
will silently create a new directory and your reindexing problems will
start all over until you create new fake directories.

With unityed_media:

* there are no reindexes between clients

* clients don't need to know which directories have been created for
  them, it's automatic.

* clients never have to reindex other systems directories.

* unityed_media let's each client have their own directories.

* unityed_media works much more like Avid's own ISIS servers work.

A module option controls which name is appended to client specific
paths: the username, the hostname (will not work with OS X) or the
client's IP.

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 10 04:15:04 CET 2015 on sn-devel-104
2015-01-10 04:15:04 +01:00
Günther Deschner
5deb685ecd s3-vfs: Fix developer build of vfs_ceph module.
Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2015-01-09 15:09:06 +01:00
Volker Lendecke
56e2384dfe vfs_fruit: mmap under FreeBSD needs PROT_READ
We memmove, which does read

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Böhme <rb@sernet.de>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-01-08 23:38:06 +01:00
Volker Lendecke
d9c22a3af2 vfs_fruit: fix base_fsp name conversion
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2015-01-08 13:08:07 +01:00
Volker Lendecke
0f6bf3575e smbd: Properly handle EINTR in vfs_aio_fork
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2015-01-06 00:33:10 +01:00
Volker Lendecke
4b1e6ae5d3 smbd: Use msghdr.[ch] in vfs_aio_fork
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2015-01-06 00:33:10 +01:00
Volker Lendecke
9bd7e52db0 smbd: Use msghdr_prep_fds in vfs_aio_fork
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2015-01-06 00:33:09 +01:00
Volker Lendecke
93b3c157b7 vfs_fruit: Avoid double ()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>

Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Thu Dec 18 19:19:04 CET 2014 on sn-devel-104
2014-12-18 19:19:04 +01:00
Volker Lendecke
6dedccd91d vfs_fruit: Avoid double initialization
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2014-12-18 16:55:10 +01:00
raghavendra talur
af9ec9fea5 vfs/glusterfs: Change xattr key to match gluster key.
Gluster changed the key used to do get_real_filename
in 3.5. This changes Samba's glusterfs vfs-module
to use the same key.

This will render SMB_VFS_GET_REALFILENAME() working
again under 3.5 and will remove support for that functionality
for Gluster 3.4 and older.

Signed-off-by: raghavendra talur <raghavendra.talur@gmail.com>
Reviewed-by: Ira Cooper <ira@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-12-17 18:45:06 +01:00
Poornima G
051b81aac8 vfs_glusterfs: Implement AIO support
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): Wed Dec 17 16:35:37 CET 2014 on sn-devel-104
2014-12-17 16:35:37 +01:00
Poornima G
26b3544251 vfs_glusterfs: Change sys_get_acl_file/fd to return ACLs corresponding to mode bits when there are no ACLs set.
Signed-off-by: Poornima G <pgurusid@redhat.com>

Reviewed-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-12-17 14:11:07 +01:00
Ralph Boehme
3554d88a58 vfs_streams_xattr: add missing call to SMB_VFS_NEXT_CONNECT
Signed-off-by: Ralph Boehme <slow@samba.org>
Rewviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Dec 12 02:09:24 CET 2014 on sn-devel-104
2014-12-12 02:09:24 +01:00
raghavendra talur
a12ae815b0 vfs_glusterfs: Set connectpath as snapdir-entry-path.
snapview client in gluster would require connectpath
in order add snapdir entry to readdir result.

Signed-off-by: raghavendra talur <raghavendra.talur@gmail.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): Wed Dec 10 16:38:27 CET 2014 on sn-devel-104
2014-12-10 16:38:27 +01:00
raghavendra talur
2fb4317352 vfs_glusterfs: Remember the connect path too for reopening.
As Samba allows us to share subdirs, lets re-use preopened
connections to glusterfs only if they are for same volume
AND same connectpath.

Signed-off-by: raghavendra talur <raghavendra.talur@gmail.com>
Reviewed-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-12-10 14:15:06 +01:00
Poornima G
a4fa9ca5a7 vfs_glusterfs: In vfs_gluster_sys_acl_get_file/fd, reduce the number of getxattr calls.
Signed-off-by: Poornima G <pgurusid@redhat.com>
Reviewed-by: Ira Cooper <ira@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2014-12-10 14:15:06 +01:00
Volker Lendecke
a5a5326152 notify_inotify: inotify_watch now takes a mem_ctx
This will make it easier to integrate into proper memory hierarchies.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-12-09 04:12:09 +01:00
Volker Lendecke
f530d6d97b notify_inotify: Make inotify_watch return 0/errno
More like a cleanup, but I want to use inotify_watch in notifyd
that I would like to keep as light as possible

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-12-09 04:12:09 +01:00
Volker Lendecke
8a49485938 smbd: Move lp_parm_bool out of notify_inotify.c
Notifyd should be as independent of Samba infrastructure as possible,
and it will call notify_inotify

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-12-09 04:12:08 +01:00
Andreas Schneider
4acf171ab9 vfs: Add missing include for sys_pread() in cacheprime module.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Mon Dec  8 16:54:51 CET 2014 on sn-devel-104
2014-12-08 16:54:51 +01:00
Jeremy Allison
2845e1c29f s3: modules: Fix *allocate* calls to follow POSIX error return convention.
Fix up the ceph, fruit, time_audit and streams_xattr modules to follow
the -1,errno convention for errors.

Reported by Jones <jones.kstw@gmail.com> who provided the
initial patch. This patch tested and confirmed working
by him as well.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: David Disseldorp <ddiss@suse.de>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Mon Dec  8 02:59:43 CET 2014 on sn-devel-104
2014-12-08 02:59:43 +01:00
Jeremy Allison
c9235deee0 s3: smbd: Fix *allocate* calls to follow POSIX error return convention.
vfswrap_fallocate() is broken in that it can call posix_fallocate()
which returns an int error (and doesn't set errno) but can also
call Linux fallocate() which returns -1 and sets errno.

Standardize on the -1,errno convention.

Reported by Jones <jones.kstw@gmail.com> who provided the
initial patch. This patch tested and confirmed working
by him as well.

https://bugzilla.samba.org/show_bug.cgi?id=10982

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: David Disseldorp <ddiss@suse.de>
2014-12-08 00:33:06 +01:00
Volker Lendecke
0013001e70 lib: Split out write_data[_iov]
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-12-07 00:12:07 +01:00
Volker Lendecke
97b2570a5e lib: Split out sys_[read|write] & friends
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-12-07 00:12:07 +01:00
Ralph Boehme
353acb6d29 vfs_fruit: AAPL support
* readdir_attr VFS functions, used in trans2 when marshalling
  metadata associated with a directory entry

* support for reading and writing UNIX mode via MS NFS ACEs in NT ACL

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-12-04 22:11:08 +01:00
Ralph Boehme
5ff72827c3 s3:smbd: ignore dacls with MS NFS ACEs
Ignore NFS ACEs in code the modifies
* default POSIX ACLs
* VFS: NFSv4 ACLs
* VFS: xattr and tdb ACLs

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-12-04 22:11:08 +01:00
Ralph Boehme
142db4048f s3:vfs: add create tags to SMB_VFS_CREATEFILE
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-12-04 22:11:07 +01:00
Ralph Boehme
b65e37dc01 s3:vfs: add SMB_VFS_READDIR_ATTR()
SMB_VFS_READDIR_ATTR is a last minute hook to fetch additional metadata
for a directory entry when we're already marshalling the SMB reply
buffer.

This would be used, when there's a need to repurpose some fields in the
the reply, like it's done with Apple's SMB2 extension "AAPL".

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-12-04 22:11:07 +01:00
Stefan Metzmacher
dd17204e6f s3:modules: remove unused allow_warnings=True for non_posix_acls, and vfs_media_harmony
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-11-25 07:25:44 +01:00
Stefan Metzmacher
522c71531f s3:modules: rename variables in vfs_fruit.c to fix shadow warnings
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-11-25 07:25:44 +01:00
Ralph Boehme
927290b384 vfs_streams_xattr: check stream type
Only allow access to the stream type "$DATA". vfs_streams_depot does
this too and it fixes the failing test "smb2.streams.names".

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 Nov 22 01:07:54 CET 2014 on sn-devel-104
2014-11-22 01:07:54 +01:00
Ralph Boehme
1076e4e4e2 vfs_streams_xattr: initialize pointer
Intitialize pointer to NULL, otherwise we talloc_free() an unitialized
pointer in the error code path.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-11-21 22:47:05 +01:00
Ralph Boehme
1160fcfe3d vfs_streams_xattr: fix check with samba_private_attr_name()
We want to check with samba_private_attr_name() whether the xattr name
is a private one, unfortunately it flags xattrs that begin with the
default streams prefix as private.  By only calling
samba_private_attr_name() in case the xattr does NOT begin with the
default prefix, we know that if it returns 'true' it definitely one of
our internal xattr like "user.DOSATTRIB".

This fixes a bug introduced in 634bcb09a0
that denied all access to valid stream xattrs.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-11-21 22:47:05 +01:00
Stefan Metzmacher
553b83c4d5 s3:smbprofile: profile async pread/pwrite/fsync syscalls
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Nov 19 23:13:10 CET 2014 on sn-devel-104
2014-11-19 23:13:10 +01:00
Stefan Metzmacher
14ff976406 s3:modules: make use of END_PROFILE_BYTES() when START_PROFILE_BYTES() was used
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-11-19 20:51:36 +01:00
Ralph Boehme
5f68f7289c vfs_snapper: check for <linux/ioctl.h>
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>

Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Sun Nov  9 16:02:24 CET 2014 on sn-devel-104
2014-11-09 16:02:24 +01:00
Noel Power
6faef4d213 btrfs: don't leak opened directory handle
Closing a directory handle file descriptor via close() is undefined,
according to:
http://pubs.opengroup.org/onlinepubs/9699919799/functions/dirfd.html

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): David Disseldorp <ddiss@samba.org>
Autobuild-Date(master): Tue Nov  4 20:51:02 CET 2014 on sn-devel-104
2014-11-04 20:51:02 +01:00
Michael Adam
0fbd854204 s3:vfs:aio_pthread: use smbXsrv_connection for schedule_deferred_open_message_smb
This fixes an incompatible pointer warning which uncovered
a real bug. This caller was missed when converting the function.

This fix is only temporary, since we use fsp->sconn->client->connections
which is supposed to be the start of the list of transport connections
by a given client treated by this smbd process. Currently there is only
one such connection, but with multi-channel there might be more. So
we will need to improve this in the future.

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): Thu Oct 23 23:10:35 CEST 2014 on sn-devel-104
2014-10-23 23:10:35 +02:00
Volker Lendecke
3a7fd8b0e9 vfs: fix a typo
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 Oct 21 04:58:44 CEST 2014 on sn-devel-104
2014-10-21 04:58:44 +02:00
Ralph Boehme
f593835e54 vfs_posixacl: catch ACL_EVERYONE on FreeBSD
Using POSIX ACL API on FreeBSD may return NFSv4 style tag type
ACL_EVERYONE. Catch the error and issue a helpful log message telling
users to enable zfsacl VFS module.

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): Sun Oct 12 00:22:19 CEST 2014 on sn-devel-104
2014-10-12 00:22:19 +02:00
Jeremy Allison
57bcb8055e s3: lib, s3: modules: Fix compilation on Solaris.
Based on work from YOUZHONG YANG <youzhong@gmail.com>.
Code needs fixing when HAVE_STRUCT_MSGHDR_MSG_CONTROL is
not defined. Also Solaris doesn't have msg_flags field
(which we set to zero anyway, so if we initialize
the entire struct to zero, we never need to refer to it).

https://bugzilla.samba.org/show_bug.cgi?id=10849

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 Oct  6 12:33:36 CEST 2014 on sn-devel-104
2014-10-06 12:33:35 +02:00
Ralph Boehme
1ef2be68f8 vfs_fruit: deal with vfs_catia not being loaded
Signed-off-by: Ralph Boehme <rb@sernet.de>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>

Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Wed Oct  1 01:59:25 CEST 2014 on sn-devel-104
2014-10-01 01:59:25 +02:00
Ralph Boehme
b2626c2d23 vfs_fruit: remove redundant assignment
Signed-off-by: Ralph Boehme <rb@sernet.de>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-09-30 23:35:09 +02:00
Ralph Boehme
04ebed1386 vfs_fruit: fix possible uninitialized use
Signed-off-by: Ralph Boehme <rb@sernet.de>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-09-30 23:35:08 +02:00
Ralph Boehme
b6ec190e74 vfs_fruit: update rfork size in AppleDouble header
Update the AppleDouble entry with the new size when ftruncating a
resource fork.

Signed-off-by: Ralph Boehme <rb@sernet.de>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Sep 25 23:43:35 CEST 2014 on sn-devel-104
2014-09-25 23:43:35 +02:00
Ralph Boehme
168191d9bf vfs_fruit: ad_write: path may be NULL for rfork
In preperation of the next commit where we want to call ad_write() on
a resource fork without having a name, just an fsp, which is fine for
resource forks.

Signed-off-by: Ralph Boehme <rb@sernet.de>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2014-09-25 21:19:12 +02:00
Ralph Boehme
87347f9772 vfs_fruit: fix resource fork length calculation
Don't add the AppleDouble header size to the resource fork size.

Signed-off-by: Ralph Boehme <rb@sernet.de>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2014-09-25 21:19:12 +02:00
Ralph Boehme
ef4b415510 vfs_fruit: fix unpacking of AppleDouble files
OS X AppleDouble files may contain a FinderInfo AppleDouble entry
larger then 32 bytes containing additional packed xattrs. ad_unpack()
must deal with this in a way that allows callers to possibly fixup
the entry.

Signed-off-by: Ralph Boehme <rb@sernet.de>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2014-09-25 21:19:12 +02:00
Abhidnya Joshi
9fca4f71c0 s3: vfs module: Adding new vfs module for Symantec VxFS.
This mainly handles ACL related functions.

Modified to add requirement for -DCFLAGS=-DXATTR_USER_NTACL="user.NTACL"
and to hide access to XATTR_USER_NTACL by jra.

Signed-off-by: Abhidnya Joshi <abhidnya_joshi@symantec.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Sep 18 02:30:06 CEST 2014 on sn-devel-104
2014-09-18 02:30:06 +02:00
Jeremy Allison
0519088c53 s3: smbd: Change the function signature of srvstr_push() from returning a 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>
2014-09-16 01:56:54 +02:00
Volker Lendecke
c56a88da6e vfs_gpfs: Fix the build with profiling-data
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
2014-09-16 01:55:57 +02:00
Volker Lendecke
8c1b1435fe media_harmony: Fix a crash bug
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
2014-09-12 02:45:40 +02:00
Volker Lendecke
4038eb8968 media_harmony: Fix warnings
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Simo Sorce <idra@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-09-12 00:17:21 +02:00
Ralph Boehme
0c53b293ab vfs_acl_common: dacl size must be updated
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
2014-09-11 03:54:42 +02:00
Jeremy Allison
7f976f42c4 s3: smbd: vfs_dirsort module.
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
2014-09-03 19:59:54 +02:00
Ralph Boehme
4df557e3ce New VFS module vfs_fruit
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>
2014-08-18 17:42:50 +02:00
Volker Lendecke
446de4f680 vfs3: Pass "lease" through SMB_VFS_CREATE_FILE
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-08-11 21:11:16 +02:00
Volker Lendecke
4d9432fd24 vfs_full_audit: Optionally log security descriptors in FSET_NT_ACL
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-08-07 22:12:12 +02:00
Volker Lendecke
221afae9ae vfs_full_audit: Add "full_audit:syslog"
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>
2014-08-07 22:12:12 +02:00
Volker Lendecke
b76bc4b713 vfs_full_audit: Save full_audit:priority in private_data
lp_parm_enum can become expensive

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-08-07 22:12:12 +02:00
Volker Lendecke
7efee03c84 vfs_full_audit: Save full_audit:facility in private_data
lp_parm_enum can become expensive

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-08-07 22:12:12 +02:00
Volker Lendecke
02d22d6a61 vfs_full_audit: Pass "vfs_full_audit_private_data" to log_failure/success()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-08-07 22:12:12 +02:00
Stefan Metzmacher
3afdd77bea s3:smbd: move libasys state from smbXsrv_connection to smbd_server_connection
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>
2014-08-06 09:51:11 +02:00
Michael Adam
eb0577dca0 s3:vfs:gpfs: remove a block and reduce indentation in gpfs_is_offline()
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
2014-07-24 11:56:10 +02:00
Michael Adam
d87d13f4c2 s3:vfs:gpfs: remove all writing uses of stat_ex.vfs_private from vfs_gpfs.
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>
2014-07-24 11:56:09 +02:00
Michael Adam
16a040f8ef s3:vfs:gpfs: Remove all reading uses of stat_ex.vfs_private from vfs_gfs.
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>
2014-07-24 11:56:09 +02:00
Michael Adam
44e9ab21dd Revert "s3:vfs:gpfs: log when winAttr-garbage is detected (by heuristics) in 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>
2014-07-24 11:56:09 +02:00
Michael Adam
26290ba8a4 s3:vfs:gpfs: log when winAttr-garbage is detected (by heuristics) in is_offline
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>
2014-07-13 08:59:11 +02:00
Michael Adam
31e6750714 s3:vfs:gpfs: fix flapping offline: always get winAttrs from gpfs for is_offline
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>
2014-07-13 08:59:11 +02:00
Michael Adam
573ca6ef6b s3:vfs:gpfs: store the winAttrs in the struct_ex when we got them in 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>
2014-07-13 08:59:11 +02:00
Michael Adam
e7c683ba69 s3:vfs:gpfs: remove extra empty lines.
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
2014-07-10 02:50:44 +02:00
Jeremy Allison
c6baacd7f0 s3: VFS modules: Ignore EPERM errors on [f]chmod in crossrename module.
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>
2014-07-08 07:49:37 +02:00
Volker Lendecke
6f8fd3d5ab smbd: Remove unused blocking_lock_record* from VFS_BRL_CANCEL_WINDOWS
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-07-04 06:31:16 +02:00
Volker Lendecke
b08fe2d98d smbd: Remove unused blocking_lock_record* from VFS_BRL_LOCK_WINDOWS
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-07-04 06:31:16 +02:00
David Disseldorp
f0f18c56c6 vfs_snapper: use a talloc hierarchy for arrays
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
2014-06-30 21:41:12 +02:00
David Disseldorp
224e1c105b vfs_snapper: don't redefine GMT_FORMAT macro
Use existing header definition.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-06-30 19:25:15 +02:00
David Disseldorp
377a1c860e vfs: add previous file version support for vfs_snapper
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>
2014-06-30 19:25:15 +02:00
David Disseldorp
9261f7c6a0 vfs: add vfs_snapper module
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>
2014-06-30 19:25:15 +02:00
Volker Lendecke
9c19532134 s3-shadow-copy2: Protect against already converted names
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
2014-06-27 09:03:53 +02:00
Volker Lendecke
1d488270a1 s3-shadow-copy2: Add more debugs
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
2014-06-27 06:49:10 +02:00
Volker Lendecke
87cad88230 s3-shadow-copy2: Fix incorrect case submounts
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
2014-06-27 06:49:10 +02:00
Christof Schmitt
b053d4b3f9 s3-shadow-copy2: Remove TODO and fix comments
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>
2014-06-27 06:49:10 +02:00
Volker Lendecke
16a6181289 s3-shadow-copy2: Fix dir/@GMT-2012.10.15-13.48.43 form of paths
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>
2014-06-27 06:49:10 +02:00
Volker Lendecke
68c7b339cc s3-shadow-copy2: Add extreme debug output to shadow_copy2_strip_snapshot
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>
2014-06-27 06:49:10 +02:00
Michael Adam
0e9d4f68f9 build: fix the test and define for msg_accrights
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
2014-06-16 18:18:04 +02:00
Michael Adam
c709328278 vfs:gpfs: fix a debug message
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
2014-06-13 19:54:23 +02:00
Ralph Boehme
634bcb09a0 vfs_streams_xattr: add options "prefix" and "store_stream_type"
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>
2014-06-13 13:22:18 +02:00
Christian Ambach
2ee7d017e8 s3:vfs_afsacl fix compiler warnings
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
2014-06-04 22:34:51 +02:00
Christian Ambach
c3607d2edf vfs_afsacl: remove unused includes
* 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>
2014-06-04 20:09:39 +02:00
Christian Ambach
558850c495 s3:lib/afs move afs_settoken.c to common lib dir
Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-06-04 20:09:38 +02:00
Michael Adam
65a6c31d9d build: rename HAVE_MSGHDR_MSG_ACCTRIGHTS to HAVE_STRUCT_MSGHDR_MSG_ACCTRIGHTS
for consistency.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2014-06-02 22:48:12 +02:00
Michael Adam
86be491912 build: rename HAVE_MSGHDR_MSG_CONTROL to HAVE_STRUCT_MSGHDR_MSG_CONTROL
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>
2014-06-02 22:48:12 +02:00
Michael Adam
abedc7116e vfs:aio_fork: simplify checking of MSG_CONTROL and MSG_ACCTRIGHTS
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2014-06-02 22:48:12 +02:00
Ralph Wuerthner
5d998358e2 s3:vfs_gpfs: increase log level for EPERM and EACCES errors in gpfs_get_xattr()
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
2014-05-15 02:19:41 +02:00
Jeremy Allison
bed323cebc s3 : smbd : Protect all possible code paths from fsp->op == NULL.
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>
2014-05-02 21:27:07 +02:00
Christof Schmitt
c0651a32fc vfs_gpfs: Avoid warnings in developer build
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
2014-04-18 22:25:25 +02:00
Björn Baumbach
c35b31f452 s3: enforce a positive allocation_file_size for non-empty files
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
2014-04-05 03:09:00 +02:00
Alexander Werth
69b7631ca7 vfs: Store ACL control flags in gpfs vfs module.
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>
2014-04-05 00:50:14 +02:00
Alexander Werth
a5d5bdc36b vfs: Support NFS control flags in nfs4_acls.c.
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>
2014-04-05 00:50:14 +02:00
Stefan Metzmacher
ba07368c68 s3:modules: explicitly use allow_warnings=True were needed
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-04-02 09:03:46 +02:00
Christof Schmitt
7f2d12c4c0 Rename module init functions from samba_init_module
Some modules use samba_init_module as the name for the init functions,
others use a name based on the module name.

Rename the init functions from samba_init_module, to be consistent
across all modules. This change also allows to build idmap_tdb2 and
perfcount_test statically.

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): Wed Apr  2 08:50:04 CEST 2014 on sn-devel-104
2014-04-02 08:50:03 +02:00
Volker Lendecke
d6db35d7a5 tdb_wrap: Remove tdb_wrap_open_ again
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-03-31 22:52:14 +02:00
Volker Lendecke
801b947e12 vfs: Avoid passing lp_ctx to tdb_wrap_open in posix_eadb_init
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-03-31 22:52:13 +02:00
Volker Lendecke
2e2137f56d smbd: Use asys_results
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
2014-03-27 08:05:46 +01:00
Volker Lendecke
c35fec883c asys: Allow multiple results to be received
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>
2014-03-27 06:06:12 +01:00
Volker Lendecke
c5d07df6ab pthreadpool: Allow multiple jobs to be received
This can avoid syscalls when multiple jobs are finished simultaneously

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-03-27 06:06:11 +01:00
Christian Ambach
9debea56c8 s3:modules/vfs_gpfs add gpfs:recalls option
When this option is set to no, an attempt to open an offline file will
be rejected with access denied.  This helps preventing recall storms
triggered by careless applications like Finder and Explorer.

Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2014-03-14 10:45:10 +01:00
Ralph Boehme
80e5ae1cef vfs_catia: add chmod()
Clients using UNIX extensions need chmod() to go through catia.

Signed-off-by: Ralph Boehme <rb@sernet.de>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>

Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Tue Mar 11 13:39:17 CET 2014 on sn-devel-104
2014-03-11 13:39:17 +01:00
David Disseldorp
ca3998d043 vfs: propagate snapshot enumeration errors
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
2014-02-27 22:42:50 +01:00
Jose A. Rivera
64bae74f56 vfs_glusterfs: Remove "integer fd" code and store the glfs pointers.
Change-Id: I74347199e54be0d1dc031985534da1e56fd3e280
Signed-off-by: Jose A. Rivera <jarrpa@redhat.com>
Reviewed-by: Christopher R. Hertel <crh@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>
2014-02-25 12:27:51 -08:00
Christopher R. Hertel
86aa43c73c vfs_glusterfs: smb_stat_ex_from_stat commenting and cleanup.
Change-Id: If1b54e62b4fc2240aa17e5d1eae8f279f2fdfc42
Signed-off-by: Christopher R. Hertel <crh@samba.org>
Reviewed-by: Jose A. Rivera <jarrpa@redhat.com>
Reviewed-by: Ira Cooper <ira@samba.org>
2014-02-25 12:27:51 -08:00
Christopher R. Hertel
910a56a7cb vfs_glusterfs: Comment the top of the file.
Change-Id: I98b512da2e0e56f061247a7c48ce576287b43827
Signed-off-by: Christopher R. Hertel <crh@samba.org>
Reviewed-by: Jose A. Rivera <jarrpa@redhat.com>
Reviewed-by: Ira Cooper <ira@samba.org>
2014-02-25 12:27:40 -08:00
Volker Lendecke
f0a385f35f smbd: Slightly simplify vfswrap_fsctl
We have the MIN macro, so use it :-)

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-02-12 21:47:31 +01:00
Volker Lendecke
e4bad92480 smbd: Fix an uninitialized read
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>
2014-02-12 21:47:06 +01:00
Jeremy Allison
fd79652b0e s3: vfs_dirsort module.
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>
2014-02-12 12:37:03 +13:00
Garming Sam
f4414d63cd param: rename lp function and variable from "fake_dir_create_times" to "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>
2014-02-07 16:19:13 -08:00
Jeremy Allison
17adbbcad7 s3: modules: streaminfo: As we have no VFS function SMB_VFS_LLISTXATTR we 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
2014-02-08 00:01:16 +01:00
Michael Adam
cf0cb0add9 dbwrap: add a dbwrap_flags argument to db_open()
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>
2014-02-07 16:06:06 +01:00
David Disseldorp
3be664969d vfs_btrfs: pass-through copy-chunk(len=0) requests
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>
2014-02-06 16:15:29 -08:00
Michael Adam
43d59d5cc4 loadparm: rename lp[cfg]_dir_mask to lp[cfg]_directory_mask for consistency 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>
2014-02-03 13:27:25 +13:00
Volker Lendecke
c6edb37f28 vfs_time_audit: Make durable functions static
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-01-24 13:42:38 -08:00
Niels de Vos
276c1616cf vfs/glusterfs: in case atime is not passed, set it to the current atime
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
2014-01-15 21:31:30 +01:00
Christof Schmitt
d1dacd62bb s3: Avoid oplock break by storing timestamps with gpfs_set_times
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
2014-01-09 00:04:47 +01:00
Poornima Gurusiddaiah
078c86810f vfs_glusterfs: Enable per client log file
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
2013-12-17 23:44:16 +01:00
Volker Lendecke
5677c63f1c scannedonly: Fix CID 242109 Unchecked return value from library
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-12-17 01:57:12 +01:00
Abhidnya Joshi
92257ee41f s3: Handle stat call with capability in vfs_gpfs
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
2013-12-16 20:05:23 +01:00
Volker Lendecke
5b127a6f6b s3-waf: build new vfs_worm module
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-12-12 12:50:21 -08:00
Volker Lendecke
2004317c09 s3-modules: add new vfs_worm module
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>
2013-12-12 12:50:21 -08:00
David Keegel
9acacb27ec shadow_copy2: Fix some typos
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
2013-12-12 17:58:24 +01:00
Michael Adam
27baff0ec9 shadow_copy2: add a comment explaining why we don't talloc_zero_array().
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
2013-12-11 19:55:20 +01:00
Michael Adam
71318d7d68 shadow_copy2: revert expensive and unnecessary zero-initialization
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 249e9b4a34.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2013-12-11 17:54:22 +01:00
Christian Ambach
5e2f59dce3 s3:vfs_btrfs change includes
use the ones from libreplace instead of system ones

Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
2013-12-07 16:45:15 +01:00
Christian Ambach
2eda479ffd s3:vfs fix a compile warning
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
2013-12-07 14:20:43 +01:00
Michael Adam
6685e6512e s3:modules:shadow_copy2: remove redundant documentation comment block
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>
2013-12-07 07:43:50 +13:00
Michael Adam
bffaf17d48 s3:modules:shadow_copy2: improve headline comment
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-12-07 07:43:48 +13:00
Michael Adam
b5b5674287 s3:module:shadow_copy2: add my (C)
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-12-07 07:43:45 +13:00
David Disseldorp
423230f473 vfs_btrfs: advertise per-file compression capability
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>
2013-11-22 08:56:45 -08:00
David Disseldorp
b24e42a702 vfs_btrfs: fix copy-chunk dest unlock args
src_fsp used instead of dest_fsp for unlock.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-11-22 08:56:45 -08:00
David Disseldorp
3627ed7326 vfs_btrfs: add [GET/SET]_COMPRESSION handlers
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>
2013-11-22 08:56:45 -08:00
David Disseldorp
d8d5d4c742 vfs: add [GET/SET]_COMPRESSION hooks
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>
2013-11-22 08:56:45 -08:00
Andreas Schneider
4deb00a60f s3-vfs: Make glfs_set_preopened() static.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-11-15 11:07:58 -08:00
Andreas Schneider
9e7e83e9d0 s3-vfs: Remove unused variable in vfs_glusterfs.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-11-15 11:07:55 -08:00
Andreas Schneider
654b784e9c s3-vfs: Fix stream_depot vfs module on btrfs.
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>
2013-11-12 17:33:12 +01:00
David Disseldorp
2405e7906c Revert "s3-vfs: Fix stream_depot vfs module on btrfs."
This reverts commit 29f12e7d59.

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>
2013-11-12 17:33:12 +01:00
Volker Lendecke
ea83ac6b01 smbd: Fix CID 1035478 Negative array index read
lp_parm_enum can return -1. Add error checking.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>
2013-11-11 21:04:09 +01:00
Andreas Schneider
29f12e7d59 s3-vfs: Fix stream_depot vfs module on btrfs.
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>
2013-11-08 09:42:20 -08:00
Andreas Schneider
d35d6a2dfa vfs: Fix some build warnings in glusterfs.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
2013-11-04 15:04:20 +01:00
Andreas Schneider
25d62dda5c vfs: Fix building the glusterfs module.
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>
2013-11-04 15:04:18 +01:00
Alexander Werth
508b86e6ef s3:modules: nfs4_acls ACLs with zero entries are fine.
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
2013-10-30 20:31:42 +01:00
Alexander Werth
a6bc2fd0d1 s3:modules: Fix realloc with zero sized ACLs
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>
2013-10-30 18:44:40 +01:00
Christof Schmitt
26b1103008 s3/time_audit: Add offline and durable functions
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
2013-10-12 13:00:02 +02:00
Michael Adam
6ccbc1347d shadow_copy2: use stored mount_point instead of recalculating.
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>
2013-10-05 09:21:33 +13:00
Michael Adam
935120dbc0 shadow_copy2: improve debug in shadow_copy2_convert() in snapdirseverywhere mode
Signed-off-by: Michael Adam <obnox@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-10-05 09:21:31 +13:00
Michael Adam
9ab89371c8 shadow_copy2: fix shadow_copy2_convert() in the classical case.
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>
2013-10-05 09:21:30 +13:00
Michael Adam
86988db1f0 shadow_copy2: add some blank lines for visual separation to shadow_copy2_convert()
Signed-off-by: Michael Adam <obnox@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-10-05 09:21:29 +13:00
Michael Adam
249e9b4a34 shadow_copy2: initialize "converted" string to null in shadow_copy2_convert()
Signed-off-by: Michael Adam <obnox@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-10-05 09:21:28 +13:00
Michael Adam
4b8d9c65f4 shadow_copy2: fix shadow_copy2_strip_snapshot() in the classical case
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>
2013-10-05 09:21:26 +13:00
Michael Adam
afcb84e69f shadow_copy2: add some debug to shadow_copy2_strip_snapshot()
Signed-off-by: Michael Adam <obnox@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-10-05 09:21:25 +13:00
Michael Adam
3d053b1ab3 shadow_copy2: add comments explaining decisions in shadow_copy2_strip_snapshot()
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>
2013-10-05 09:21:24 +13:00
Michael Adam
38e108563d shadow_copy2: introduce shadow_copy2_snapshot_path()
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>
2013-10-05 09:21:22 +13:00
Michael Adam
4cc5140bbe shadow_copy2: factor shadow_copy2_posix_gmt_string() out of shadow_copy2_insert_string()
for re-use..

Signed-off-by: Michael Adam <obnox@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-10-05 09:21:21 +13:00
Michael Adam
304a0f531c shadow_copy2: shadow_copy2_insert_string(): do not prepend a "/" in absolute mode
Signed-off-by: Michael Adam <obnox@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-10-05 09:21:20 +13:00
Michael Adam
e86923eb52 shadow_copy2: make shadow_copy2_find_snapdir() return const char *
instead of char *. This eliminates compiler warnings.
snapdir is a const string in all occasions.

Signed-off-by: Michael Adam <obnox@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-10-05 09:21:18 +13:00
Michael Adam
dbdb436a80 shadow_copy2: in the classical case, use configured path in shadow_copy2_find_snapdir()
There is no point in searching for snapdir if not in snapdirseverywhere mode.

Signed-off-by: Michael Adam <obnox@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-10-05 09:21:17 +13:00
Michael Adam
ea898ea1ac shadow_copy2: implement disk_free
Signed-off-by: Michael Adam <obnox@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-10-05 09:21:15 +13:00
Michael Adam
c4f9954ebb shadow_copy2: log resulting config at the end of shadow_copy2_connect()
Signed-off-by: Michael Adam <obnox@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-10-05 09:21:14 +13:00
Michael Adam
a7ca55c8da shadow_copy2: add snapshot_basepath to the config.
This is the absolute version of snapdir.

Signed-off-by: Michael Adam <obnox@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-10-05 09:21:13 +13:00
Michael Adam
d34dc1b002 shadow_copy2: add rel_connectpath to config.
This is the share root, relative to the basedir.

Signed-off-by: Michael Adam <obnox@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-10-05 09:21:11 +13:00
Michael Adam
2d5a3af4bc shadow_copy2: introduce "shadow:mountpoint" option
Possiblity to explicitly set the share's mount point.
This is useful mainly for debugging and testing purposes.

Signed-off-by: Michael Adam <obnox@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-10-05 09:21:10 +13:00
Michael Adam
ed751b9ee4 shadow_copy2: re-add the basedir option.
Disable basedir if it is not an absolute path or if
snapdirseverywhere or crossmountpoints is enabled.

Pair-Programmed-With: Björn Baumbach <bb@sernet.de>

Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Björn Baumbach <bb@sernet.de>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-10-05 09:21:09 +13:00
Michael Adam
1e887fcda0 shadow_copy2: disable "snapdir:crossmountpoints" if the snapdir is absolute.
Signed-off-by: Michael Adam <obnox@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-10-05 09:21:07 +13:00
Michael Adam
843954989c shadow_copy2: introduce the bool "snapdir_absolute" in the config.
Not exposed but to be used internally.

Signed-off-by: Michael Adam <obnox@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-10-05 09:21:05 +13:00
Michael Adam
1ecef57435 shadow_copy2: introduce config struct and function shadow_copy2_connect()
This moves the parsing of the config to a central place.
So users of configuation don't need to call lp_parm_... all the time.

Signed-off-by: Michael Adam <obnox@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-10-05 09:21:01 +13:00
Michael Adam
5c900fd930 shadow_copy2: add comment block explaining shadow_copy2_convert()
Signed-off-by: Michael Adam <obnox@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-10-05 09:20:58 +13:00
Michael Adam
5da5512985 shadow_copy2: add comment block explaining shadow_copy2_insert_string()
Signed-off-by: Michael Adam <obnox@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-10-05 09:20:56 +13:00
Michael Adam
b90d1e6ac0 shadow_copy2: add comment block explaining shadow_copy2_find_snapdir()
Signed-off-by: Michael Adam <obnox@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-10-05 09:20:55 +13:00
Michael Adam
5b494b3dea shadow_copy2: add header comment explaining have_snapdir()
Signed-off-by: Michael Adam <obnox@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-10-05 09:20:53 +13:00
Michael Adam
9361824ddd shadow_copy2: add comment header describing shadow_copy2_strip_snapshot()
Signed-off-by: Michael Adam <obnox@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-10-05 09:20:51 +13:00
Michael Adam
01cb88977d shadow_copy2: break overly long lines in shadow_copy2_snapshot_to_gmt()
According to coding guidelines.

Signed-off-by: Michael Adam <obnox@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-10-05 09:20:49 +13:00
Michael Adam
41d818e8d8 build: get rid of vars=locals() in source3/modules/wscript_build
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
2013-09-24 23:00:48 +02:00
Michael Adam
f575b5c531 build: get rid of source file variables in source3/modules/wscript_build
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
2013-09-24 22:58:48 +02:00
Michael Adam
c9a6805f3d s3:modules: vfs_afsacl has the afs_syscall prototype via proto.h
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2013-09-23 20:55:29 +02:00
Volker Lendecke
07948ef6e1 smbd: Add brl_fsp access function 2013-09-11 08:27:11 +02:00
Christof Schmitt
c8c0632c87 s3:smb2_find: Return that timestamps do not exist as directories
When a Windows client receives a large directory listing while
querying snapshots, it sends a find request asking for the
timestamp as a directory. A Windows server returns NO_SUCH_FILE,
so make sure Samba returns the same. Otherwise the client will
get confused and display timestamps in the 'previous versions' dialog.

Signed-off-by: Christof Schmitt <christof.schmitt@us.ibm.com>
Reviewed-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 10 22:38:51 CEST 2013 on sn-devel-104
2013-09-10 22:38:50 +02:00
Christopher R. Hertel
ba04400d01 vfs_glusterfs: Fix excessive debug output from vfs_gluster_open().
The vfs_gluster_open() function generates a debug message (at level 0)
for every failed attempt to open a pathname.  This includes cases in
which attempts are made to open a directory as a file (those attempts
are retried calling vfs_gluster_opendir()).  The result is that the log
file fills with messages about failed attempts to open directories, just
because they are directories.

This latest version, of the patch completely removes logging from the
vfs_gluster_open() function.  The error code returned is handled in
upper layers, and the open function in the default VFS module does not
log any errors.

Signed-off-by: Christopher R. Hertel <crh@redhat.com>
Reviewed-by: susant palai <spalai@redhat.com>
Reviewed-by: raghavendra talur <rtalur@redhat.com>
Reviewed-by: Jose A. Rivera <jarrpa@redhat.com>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Fri Aug 30 02:43:48 CEST 2013 on sn-devel-104
2013-08-30 02:43:48 +02:00
Abhidnya Joshi
91186fcf9d s3: fix missing braces in nfs4_acls.c
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): Wed Aug 28 20:25:56 CEST 2013 on sn-devel-104
2013-08-28 20:25:55 +02:00
Anand Avati
c8c84b47be vfs_glusterfs: Implement proper mashalling/unmarshalling of ACLs
Use the primitives available in Samba byteorder.h for implementing
proper (un)marshalling of ACL xattrs.
- Incorporated Raghavendra Talur's comments on v3

Signed-off-by: Anand Avati <avati@redhat.com>
Signed-off-by: Raghavendra Talur <rtalur@redhat.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Christopher R. Hertel <crh@samba.org>
Tested-by: Jose A. Rivera <jarrpa@redhat.com>

Autobuild-User(master): Simo Sorce <idra@samba.org>
Autobuild-Date(master): Fri Aug 16 20:34:51 CEST 2013 on sn-devel-104
2013-08-16 20:34:51 +02:00
Volker Lendecke
8420d1c8ee smbd: Fix nonblank line endings
Signed-off-by: Volker Lendecke <vl@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-08-12 17:25:53 +12:00
Susant Kumar Palai
a973b1ce7a VFS plugin was sending the actual size of the volume instead of the total number of block units because of which windows was getting the wrong volume capacity.
Signed-off-by: Susant Kumar Palai <spalai@redhat.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Christopher R. Hertel <crh@samba.org>
2013-08-09 10:51:24 -07:00
Christof Schmitt
eb50fb8f3b FSCTL_GET_SHADOW_COPY_DATA: Don't return 4 extra bytes at end
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
2013-08-06 04:03:17 +02:00
Christof Schmitt
30e724cbff FSCTL_GET_SHADOW_COPY_DATA: Initialize output array to zero
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>
2013-08-05 17:10:56 -07:00
Ralph Wuerthner
f9d19c459f Ensure gpfs kernel leases are wrapped in a become_root()/unbecome_root() pair.
Ensures correct lease owner for signal delivery.

Signed-off-by: Ralph Wuerthner <ralphw@de.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): Thu Aug  1 03:57:11 CEST 2013 on sn-devel-104
2013-08-01 03:57:11 +02:00
Alexander Werth
9b2aa351ce s3: Remove old mode special substitution.
The mode special substitution now happens in a separate function.
The substitution at this point is unnecessary.

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Christian Ambach <ambi@samba.org>

Autobuild-User(master): Christian Ambach <ambi@samba.org>
Autobuild-Date(master): Tue Jul 16 00:52:26 CEST 2013 on sn-devel-104
2013-07-16 00:52:26 +02:00
Jeremy Allison
b00d9d2453 Use existing "acl map full control" parameter to control the adding of the DELETE_CHILD parameter on NFSv4/ZFS/GPFS file ACE's.
Windows maps an open request of GENERIC_ALL on files to 0x1FF specific bits, which
includes DELETE_CHILD even though this has no meaning on file ACE's. If a returned
NFSv4 ACE entry for a file has all other specific bits set except for DELETE (which
comes from the containing directory) and DELETE_CHILD (which has no meaning) then
optionally add it into the returned ACE entry.

This is using the same parameter in the same way as it is currently used
in smbd/posix_acls.c. Note that as this parameter is on by default, it
is already being tested in the existing raw.acl tests.

Fixes issue with Microsoft SMB2 torture test suite found at the interop event
in Redmond, WA.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>
2013-06-24 19:33:34 +02:00
Jeremy Allison
6c49f90965 Fix glusterfs backend crash found at the Microsoft interop event.
Based on a fix originally from Raghavendra Talur <rtalur@redhat.com>.

When a new document is created in explorer, a check for file_exist is made.
vfs_gluster_get_real_filename was returning 0 even when the file did not
exist.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: "Christopher R. Hertel" <crh@ubiqx.mn.org>
2013-06-21 10:58:47 -07:00
Andrew Bartlett
fc13489c91 build: Build with system md5.h on OpenIndiana
This changes (again...) our system md5 detection to cope with how
OpenIndiana does md5.  I'm becoming increasingly convinced this isn't
worth our while (we should have just done samba_md5...), but for now
this change seems to work on FreeBSD, OpenIndiana and Linux with
libbsd.

This needs us to rename struct MD5Context -> MD5_CTX, but we provide a
config.h define to rename the type bad if MD5_CTX does not exist (it does
however exist in the md5.h from libbsd).

Andrew Bartlett

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Jun 19 21:32:36 CEST 2013 on sn-devel-104
2013-06-19 21:32:36 +02:00
David Disseldorp
8d759658a0 vfs_catia: use translate direction enum instead of int
Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-06-17 12:26:36 -07:00
Christof Schmitt
4cd7e1d283 vfs_streams_xattr: Do not attempt to write empty attribute twice
The create disposition FILE_OVERWRITE_IF is mapped to the flags
O_CREAT|O_TRUNC. In vfs_streams_xattr, this triggers two calls to
SMB_VFS_SETXATTR. The second can fail if O_EXCL is also set, resulting
in an unnecessary error.

Merge the identical code to handle O_CREAT and O_TRUNC to avoid setting
an empty attribute twice. Also add the flags parameter to the debug
message.

Signed-off-by: Christof Schmitt <christof.schmitt@us.ibm.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2013-06-17 10:41:46 -07:00
Christof Schmitt
5c488cfb79 Initialize the file descriptor in the files_struct before trying to close it. Otherwise, if one of the SETXATTR calls had failed, the close() call will return EBADF.
Signed-off-by: Christof Schmitt <christof.schmitt@us.ibm.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Richard Sharpe <rsharpe@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Jun 13 01:43:18 CEST 2013 on sn-devel-104
2013-06-13 01:43:17 +02:00
Jeremy Allison
2a65e8befe Optimization on POSIX platforms that have fstatat.
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
2013-06-10 20:14:12 +02:00
Anand Avati
0b8b6fdc96 vfs_glusterfs: Samba VFS module for glusterfs
Implement a Samba VFS plugin for glusterfs based on gluster's gfapi.
This is a "bottom" vfs plugin (not something to be stacked on top of
another module), and translates (most) calls into closest actions
on gfapi.

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Simo Sorce <idra@samba.org>
Signed-off-by: Anand Avati <avati@redhat.com>
2013-05-30 10:57:35 +10:00
Volker Lendecke
1c9ef675d1 smbd: Fix a ISO C90 forbids mixed declarations and code warning
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Matthieu Patou <mat@matws.net>

Autobuild-User(master): Matthieu Patou <mat@samba.org>
Autobuild-Date(master): Sat May 18 01:40:04 CEST 2013 on sn-devel-104
2013-05-18 01:40:03 +02:00
Karolin Seeger
dcbe45b945 source3/modules/vfs_catia.c: Fix typo in comment.
Signed-off-by: Karolin Seeger <kseeger@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-05-15 21:04:42 -07:00
Volker Lendecke
5868accc71 vfs_gpfs: slightly simplify connect()
DISCONNECT can be arbitrarily complex, TALLOC_FREE of a simple struct
is easier.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Christian Ambach <ambi@samba.org>

Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Tue May 14 18:11:29 CEST 2013 on sn-devel-104
2013-05-14 18:11:29 +02:00
Andrew Bartlett
fde1757f80 build: Add missing dep from vfs_nfs4acl_xattr to NDR_NFS4ACL
Reviewed-by: Andreas Schneider <asn@samba.org>

Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Tue May 14 01:23:17 CEST 2013 on sn-devel-104
2013-05-14 01:23:17 +02:00
Christian Ambach
e0ca7c4cff s3:modules/vfs_aixacl2 fix compile errors
fix various compile errors that were introduced with latest ACL changes

Signed-off-by: Christian Ambach <ambi@samba.org>
Pair-Programmed-With: Alexander Werth <alexander.werth@de.ibm.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-05-09 06:18:21 +02:00
Jeremy Allison
c1c9b99054 Fix missing TALLOC_FREE of stackframes.
Signed-off-by: Jeremy Allison <jra@samba.org>
2013-05-09 06:18:21 +02:00
Jeremy Allison
fb1847f41c Tidy up old bool usage. False -> false, True -> true.
Signed-off-by: Jeremy Allison <jra@samba.org>
2013-05-09 06:18:21 +02:00
Andrew Bartlett
00cb6354cf vfs: Allow CREATOR GROUP to be used with vfs_zfsacl
The solaris acl() code requires that both ACE_GROUP|ACE_IDENTIFIER_GROUP be
set to indicate the @group permissions.

Otherwise, it would return Invalid Paramter to clients.

Andrew Bartlett
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-05-09 06:18:21 +02:00
Alexander Werth
dae5f1943e s3: Update README.nfs4acls.txt
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-05-09 06:18:21 +02:00
Alexander Werth
a9f75bd3b7 s3: Use mode bits in some cases in mode simple.
Non inheriting ACL entries will show mode bits.
With this an file owner change does affect the effective ACL because
the special owner acl will now refer to the new owner.
This could be fixed by updating the ACL on a file owner change.

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-05-09 06:18:21 +02:00
Alexander Werth
ec138b2f82 s3: Add changes that keep nfs4:mode special behavior.
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-05-09 06:18:21 +02:00
Alexander Werth
877f833af4 s3: Mapping of cifs creator owner to nfs owner@ ace.
This is ignored in nfs4mode special for compatibility.
Also ensure that we drop non inheriting creator owner
aces since these don't contribute to who can access
a file.

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-05-09 06:18:21 +02:00
Alexander Werth
83774a8bc2 s3: Mapping of special entries to creator owner in mode simple.
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-05-09 06:18:21 +02:00
Alexander Werth
4a3bf4dd9b s3: Add params parameter to smbacl4_nfs42win function.
Reviewed-By: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-05-09 06:18:21 +02:00
Alexander Werth
7978fe2584 s3: Change smbacl4_get_vfs_params to use connection_struct instead of fsp.
Reviewed-By: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-05-09 06:18:21 +02:00
Alexander Werth
be0e269246 s3: Move up declaration of params struct and related function.
We need the parameters earlier in the code so we move up
    the declaration of the params struct. Since reading the
    parameters is closely related the definition of the function
    smbacl4_get_vfs_params has also been moved up.

Reviewed-By: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-05-09 06:18:21 +02:00
Alexander Werth
97eb8f73e5 vfs: Add inheritance emulation to vfs_nfs4acl_xattr.
Recursively inherit ACL from parent directory if no acl xattr is
found on the current file.
Use a default ACL if a non-inheriting ACL is encountered.
With this the nfs4acl_xattr.dynamic test passes.
But the nfs4acl_xattr.inheritance test results in an error because
of warnings that cause the test to pass a failed result.

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-05-09 06:18:21 +02:00
Andrew Bartlett
76969abba0 vfs: Add new VFS module vfs_nfs4acl_xattr to use nfs4acl.idl
This uses the xattr format used by the patches at http://users.suse.com/~agruen/nfs4acl/

Andrew Bartlett
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-05-09 06:18:20 +02:00
Andrew Bartlett
5d517f4166 vfs: Remove unused security_info argument in vfz_zfsacl.c
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-05-09 06:18:20 +02:00
Alexander Werth
188d0f0975 vfs: Fix compile of vfs_gpfs.c.
Since the smb4acl is now correctly allocated on mem_ctx and not
the talloc stack frame we can free the stack frame correctly.
And the chmod emulation code now needs the vfs handle since
that is now required by the callback function to set the smb4acl.

Reviewed-By: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-05-09 06:18:20 +02:00
Andrew Bartlett
a65568750b vfs: Allocate SMB4ACL_T on an explict memory context
This ensures the caller knows exactly what the memory lifetime of this
returned object is.  This makes the NFSv4 ACL code consistent with the
POSIX and NT ACL code, to avoid supprising developers who have worked
on those other parts of the ACL code.

Most of this patch is adding a memory context to the callers and passing it in.

Andrew Bartlett
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-05-09 06:18:20 +02:00
Andrew Bartlett
67bb7d93ba vfs: Add vfs_handle_struct argument to smb_set_nt_acl_nfs4 and the callback
This allows the callback to call xattr based storage functions that need this argument.

Andrew Bartlett

Reviewed-by: Jeremy Allison <jra@samba.org>
2013-05-09 06:18:20 +02:00
Jeremy Allison
bf332392e1 Fix warnings and one compile error caused by newer gcc 4.7.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>

Autobuild-User(master): David Disseldorp <ddiss@samba.org>
Autobuild-Date(master): Sun May  5 19:01:38 CEST 2013 on sn-devel-104
2013-05-05 19:01:37 +02:00
Sam Lang
301a1f9192 Implements a vfs module for cephfs, a distributed file system
with posix semantics, built on the ceph distributed object
storage layer.  The ceph vfs module interfaces to the libcephfs
userspace API, and is primarily a lightweight wrapper around
libcephfs, translating error codes and parameters as necessary.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
Reviewed-by: Volker Lendecke <Volker.Lendecke@SerNet.DE>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-24 12:53:18 -07:00
Volker Lendecke
0cb056472d vfs: Convert dirsort_opendir to synthetic_smb_fname
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-17 14:50:02 -07:00
Volker Lendecke
730c57bf52 vfs: Convert vfs_scannedonly to synthetic_smb_fname
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-17 14:50:02 -07:00
Volker Lendecke
97d006ff7d vfs: Convert non_posix_sys_acl_blob_get_file_helper to synthetic_smb_fname
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-17 14:49:59 -07:00
Volker Lendecke
3d05622c56 vfs: Convert vfswrap_fs_capabilities to synthetic_smb_fname
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-17 14:49:59 -07:00
Volker Lendecke
a61307489c vfs: Convert streams_depot_streaminfo to synthetic_smb_fname
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-17 14:49:59 -07:00
Volker Lendecke
952d348f87 vfs: Convert collect_one_stream to synthetic_smb_fname
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-17 14:49:59 -07:00
Volker Lendecke
83e6ff1511 vfs: Convert streams_depot_rmdir to synthetic_smb_fname
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-17 14:49:59 -07:00
Volker Lendecke
87d92093af vfs: Convert streams_depot_unlink to synthetic_smb_fname
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-17 14:49:59 -07:00
Volker Lendecke
1729d78692 vfs: Convert streams_depot_open to synthetic_smb_fname
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-17 14:49:59 -07:00
Volker Lendecke
3794574bc1 vfs: Convert stream_smb_fname to synthetic_smb_fname
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-17 14:49:59 -07:00
Volker Lendecke
987ebb1591 vfs: Convert stream_dir to synthetic_smb_fname
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-17 14:49:59 -07:00
Volker Lendecke
441467c266 vfs: Convert fake_acls_sys_acl_delete_def_file to synthetic_smb_fname
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-17 14:49:58 -07:00
Volker Lendecke
63f3980a88 vfs: Convert vfs_gpfs_chmod to synthetic_smb_fname
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-17 14:49:58 -07:00
Volker Lendecke
58bb3ae99d vfs: Convert gpfsacl_emu_chmod to synthetic_smb_fname
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-17 14:49:58 -07:00
Volker Lendecke
19e88da1dc vfs: Convert recycle_unlink to synthetic_smb_fname
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-17 14:49:58 -07:00
Volker Lendecke
3dafdd3c0b vfs: Convert streams_xattr_streaminfo to synthetic_smb_fname
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-17 14:49:58 -07:00
Volker Lendecke
bef6c7615c vfs: Convert streams_xattr_open to synthetic_smb_fname
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-17 14:49:58 -07:00
Volker Lendecke
ec5ac9080b vfs: Convert streams_xattr_fstat to synthetic_smb_fname
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-17 14:49:58 -07:00
Volker Lendecke
7d57b8adf2 vfs: Convert xattr_tdb_get_file_id to synthetic_smb_fname
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-17 14:49:58 -07:00
Volker Lendecke
c1ad69556c vfs: Convert hpuxacl_sys_acl_set_file to synthetic_smb_fname
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-17 14:49:57 -07:00
Volker Lendecke
855ca77f82 vfs: Convert afsacl_get_nt_acl to synthetic_smb_fname
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-17 14:49:57 -07:00
Volker Lendecke
fecf225068 vfs: Convert cap_ntimes to cp_smb_filename
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-17 14:49:56 -07:00
Volker Lendecke
acf70b9e06 vfs: Convert cap_unlink to cp_smb_filename
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-17 14:49:56 -07:00
Volker Lendecke
4d3184e96c vfs: Convert cap_rename to cp_smb_filename
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-17 14:49:56 -07:00
Volker Lendecke
fb7afce2d3 vfs: Convert alloc_get_client_smb_fname to cp_smb_filename
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-17 14:49:56 -07:00
Volker Lendecke
e49718111e vfs: Convert catia_ntimes to cp_smb_filename
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-17 14:49:56 -07:00
Volker Lendecke
7d27464172 vfs: Convert catia_unlink to cp_smb_filename
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-17 14:49:56 -07:00
Volker Lendecke
db4bbc0c4f vfs: Convert catia_rename to cp_smb_filename
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-17 14:49:55 -07:00
Volker Lendecke
6fffea81ac vfs: Convert recycle_do_touch to cp_smb_filename
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-17 14:49:55 -07:00
Volker Lendecke
79e005072e vfs: Convert recycle_get_file_size to cp_smb_filename
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-17 14:49:55 -07:00
Volker Lendecke
36bfe54c3b vfs: Convert recycle_file_exists to cp_smb_filename
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-17 14:49:55 -07:00
Volker Lendecke
9b875f6244 vfs: Convert streams_xattr_unlink to cp_smb_filename
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-17 14:49:55 -07:00
Volker Lendecke
2c733b2ffb vfs: Convert xattr_tdb_unlink to cp_smb_filename
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-17 14:49:55 -07:00
Volker Lendecke
e0e5953494 vfs: Convert shadow_copy2_ntimes to cp_smb_filename
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-17 14:49:55 -07:00
Volker Lendecke
33037d80d5 vfs: Convert shadow_copy2_unlink to cp_smb_filename
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-17 14:49:55 -07:00
Volker Lendecke
19ee070853 vfs: Convert posix_eadb_unlink to cp_smb_filename
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-17 14:49:55 -07:00
Volker Lendecke
0221f8bb90 vfs: Convert unlink_acl_tdb to cp_smb_filename
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-17 14:49:55 -07:00
Jeremy Allison
33478058c7 Remove unneeded initializations (we already talloc_zero).
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2013-04-11 09:49:42 -07:00
Jeremy Allison
353718c3f9 Remove the use of dirfd inside the vfs_dirsort.c.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2013-04-11 09:49:41 -07:00
Jeremy Allison
6ae58dd153 Convert mtime from a time_t to a struct timespec.
In preparation for removing the dirfd and using fsp_stat()
and VFS_STAT functions.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2013-04-11 09:49:41 -07:00
Jeremy Allison
770512e3bd Check SMB_VFS_NEXT_OPENDIR return in dirsort_opendir().
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2013-04-11 09:49:41 -07:00
Jeremy Allison
7e437a39ab Clean error paths in opendir and fd_opendir by only setting handle data on success.
Pass extra struct dirsort_privates * to open_and_sort_dir() function
to avoid it having to re-read the handle data.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2013-04-11 09:49:41 -07:00
Jeremy Allison
cdcb631912 Protect open_and_sort_dir() from the directory changing size.
Otherwise there could be an error between initial count, allocation
and re-read.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2013-04-11 09:49:41 -07:00
Jeremy Allison
53d980bb0e Use an index i rather than re-using a state variable.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2013-04-11 09:49:41 -07:00
Jeremy Allison
b30697f638 Protect against early error in SMB_VFS_NEXT_READDIR.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2013-04-11 09:49:41 -07:00
Jeremy Allison
c55eb37114 Change source3/modules/vfs_dirsort.c from MALLOC -> TALLOC.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2013-04-11 09:49:41 -07:00
Volker Lendecke
69b3d19445 vfs_fake_perms: Fix bug 9775, segfault for "artificial" conn_structs
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 Apr 10 00:12:06 CEST 2013 on sn-devel-104
2013-04-10 00:12:06 +02:00
Volker Lendecke
ce2fb2d019 vfs_fake_perms: Slightly streamline code
Don't initialize a variable directly set

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-09 22:20:35 +02:00
Volker Lendecke
60c2953a9d vfs_fake_perms: Slightly streamline code
Do an early error return

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-09 22:20:35 +02:00
Stefan Metzmacher
0d75c90225 s3:modules: fix the build of vfs_notify_fam (bug #9545)
This adds the --with-fam option and configure checks.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2013-04-03 09:53:08 +02:00
Andrew Bartlett
d27f00cd4c vfs-btrfs: Fix build on 32 bit platforms by using long long types
Reviewed-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>

Autobuild-User(master): Rusty Russell <rusty@rustcorp.com.au>
Autobuild-Date(master): Sun Mar 24 06:17:55 CET 2013 on sn-devel-104
2013-03-24 06:17:55 +01:00
Rusty Russell
c202dc9705 Revert "vfs_btrfs: fix compile on 32-bit platforms."
This reverts commit fd6d0361d6.

Unreviewed, and Andrew has a better fix.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2013-03-24 13:58:46 +10:30
Rusty Russell
fd6d0361d6 vfs_btrfs: fix compile on 32-bit platforms.
uint64_t are not unsigned longs on 32-bit platforms:

[3265/3996] Compiling source3/modules/vfs_btrfs.c
../source3/modules/vfs_btrfs.c: In function ‘btrfs_copy_chunk_send’:
../source3/modules/vfs_btrfs.c:118:3: error: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘uint64_t’ [-Werror=format]
../source3/modules/vfs_btrfs.c:118:3: error: format ‘%ld’ expects argument of type ‘long int’, but argument 4 has type ‘int64_t’ [-Werror=format]
../source3/modules/vfs_btrfs.c:118:3: error: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 5 has type ‘uint64_t’ [-Werror=format]
../source3/modules/vfs_btrfs.c:118:3: error: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 7 has type ‘uint64_t’ [-Werror=format]
../source3/modules/vfs_btrfs.c: In function ‘btrfs_copy_chunk_recv’:
../source3/modules/vfs_btrfs.c:180:2: error: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘off_t’ [-Werror=format]
cc1: some warnings being treated as errors

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2013-03-23 17:26:57 +10:30
Stefan Metzmacher
1f139ae2d1 s3:waf fix build on AIX
AIX acl code needs to be built by default on AIX,
otherwise smbd will fail to start because of missing symbols

This fixes Bug 9557 - build succeeds, but binaries don't run

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Christian Ambach <ambi@samba.org>

Autobuild-User(master): Christian Ambach <ambi@samba.org>
Autobuild-Date(master): Thu Mar 21 16:31:19 CET 2013 on sn-devel-104
2013-03-21 16:31:19 +01:00
Andrew Bartlett
1ccfaa413a vfs_smb_traffic_analyzer: Cast mode_t to unsigned int for GNU/Solaris build
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-03-15 10:38:58 -07:00
David Disseldorp
15ce3a9c2f s3-vfs: add vfs_btrfs module
Currently it only plumbs itself into the copy_chunk call path,
translating such requests into BTRFS_IOC_CLONE_RANGE calls.

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-03-09 06:30:21 +01:00
Guenter Kukkukk
93d57dfbaf vfs_catia: add my copyright
Signed-off-by: Guenter Kukkukk <kukks@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Mar  7 22:24:47 CET 2013 on sn-devel-104
2013-03-07 22:24:47 +01:00
Guenter Kukkukk
f7a63dc3ae vfs_catia: fix the translation to "vfs_translate_to_windows"
THANKS to an IRC user (Raimund ?) who asked for a char mapping possibility.
I suggested vfs_catia - but it did not work!
Hopefully now it will. :-)

Signed-off-by: Guenter Kukkukk <kukks@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-03-07 11:33:39 -08:00
Guenter Kukkukk
bb680efb0a vfs_catia: add debug class for that module
Signed-off-by: Guenter Kukkukk <kukks@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-03-07 11:33:25 -08:00