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

1835 Commits

Author SHA1 Message Date
Ralph Boehme
ee431fc525 vfs_fruit: ignore delete on the AFP_Resource stream
OS X ignores deletes on the AFP_Resource stream. This was discovered by
torture tests against OS X SMB server.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-12-21 23:21:18 +01:00
Ralph Boehme
f569fd5e44 vfs_fruit: fix offset and len handling for AFP_AfpInfo stream
When reading from the AFP_AfpInfo stream, OS X ignores the offset from
the request and always reads from offset=0.

The offset bounds check has a off-by-1 bug in OS X, so a request
offset=60 (AFP_AfpInfo stream has a ficed size of 60 bytes), len=1
returns 1 byte from offset 0 insteaf of returning 0.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-12-21 23:21:18 +01:00
Ralph Boehme
e94b17715e vfs_fruit: writing all 0 to AFP_AfpInfo stream
When writing all 0 to AFP_AfpInfo stream we can remove the underlying
storage object. This beaviour of OS X SMB server was found with a
torture test.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-12-21 23:21:18 +01:00
Ralph Boehme
4024153894 vfs_fruit: handling of ftruncate() on AFP_AfpInfo stream
With help of some torture tests I verified the following behaviour of OS
X SMB server:

* ftruncate AFP_AfpInfo stream > 60 bytes results in an error
  NT_STATUS_ALLOTTED_SPACE_EXCEEDED

* ftruncate AFP_AfpInfo stream <=60 returns success but has no effect

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-12-21 23:21:17 +01:00
Ralph Boehme
0af7bf4249 vfs_fruit: stat AFP_AfpInfo must fail when it doesn't exist
Bug: https://bugzilla.samba.org/show_bug.cgi?id=11347

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-12-21 23:21:17 +01:00
Ralph Boehme
748adea77f vfs_fruit: fix some debug messages
Bug: https://bugzilla.samba.org/show_bug.cgi?id=11347

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-12-21 23:21:17 +01:00
Jose A. Rivera
f27ba17fcf vfs_glusterfs: Fix a memory leak in AIO
Signed-off-by: Jose A. Rivera <jarrpa@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>

Autobuild-User(master): Ira Cooper <ira@samba.org>
Autobuild-Date(master): Thu Dec 17 20:55:22 CET 2015 on sn-devel-144
2015-12-17 20:55:22 +01:00
Jeremy Allison
acbb4ddb68 CVE-2015-5299: s3-shadow-copy2: fix missing access check on snapdir
Fix originally from <partha@exablox.com>

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
2015-12-16 12:56:48 +01:00
Ira Cooper
4767291cb9 vfs_glusterfs: Attach missing destructor.
This activates the new AIO code's cancellation logic.

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): Tue Dec 15 23:33:12 CET 2015 on sn-devel-104
2015-12-15 23:33:10 +01:00
Ira Cooper
36813a4203 vfs_glusterfs: Move vfs_gluster_write and vfs_gluster_pwrite.
Move the functions to a more logical location.

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): Sat Dec 12 01:03:40 CET 2015 on sn-devel-104
2015-12-12 01:03:40 +01:00
Ira Cooper
8d3b9009e5 vfs_glusterfs: Add white space so vfs_glusterfs_pread_send and vfs_glusterfs_pwrite_send match.
These two functions are basically the same thing, so they should be
formatted the same.

Signed-off-by: Ira Cooper <ira@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-12-11 21:56:12 +01:00
Ira Cooper
640ecbbcd0 vfs_glusterfs: Fix AIO crash on smb.conf reload.
This fixes an issue where we couldn't handle cancellation properly
so when smb.conf was reloaded we crashed.

Signed-off-by: Ira Cooper <ira@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-12-11 21:56:12 +01:00
Ralph Boehme
1d7bef5a75 vfs_fruit: enable POSIX directory rename semantics
Bug: https://bugzilla.samba.org/show_bug.cgi?id=11065

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-12-01 20:45:20 +01:00
Ralph Boehme
89a7394d67 vfs_fruit: add a flag that tracks whether use of AAPL was negotiated
Add a flag that tracks whether use of AAPL was negotiated, ensuring we
don't enable AAPL features for clients that didn't negotiate it.

Torture test that need AAPL must call the new function enable_aapl().

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

Signed-off-by: Ralph Boehme <slow@samba.org>
2015-12-01 20:45:20 +01:00
Ralph Boehme
d698cec1c7 s3:smbd: convert file_struct.posix_open to a bitmap with flags
This is in preperation of a more fine grained control of POSIX behaviour
in the SMB and VFS layers.

Inititally we use an uint8_t for the flags bitmap and add a define
posix_flags as posix_open in order to avoid breaking the VFS ABI.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-12-01 20:45:20 +01:00
Andreas Schneider
3de59437c3 s3-vfs_snapper: Fix a possible use without init warning
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2015-11-17 16:48:23 +01:00
Jeremy Allison
c4be0b7ff4 s3: smbd: Change aio_pending_size static variable to a new "aio max threads" smb.conf parameter.
Removes accessor functions as now this parameter is set
under user control in smb.conf. Default is 100.

Note that this doesn't limit the number of outstanding
aio requests, it just causes them to go onto the
pthreadpool queue.

Now we need to prioritize pthreadpool pipe replies
ahead of incoming SMB2 requests, but that's a patch
for another day.

Based on ideas from Volker.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2015-11-13 21:36:19 +01:00
Jeremy Allison
5327c60049 s3: smbd: Remove --with-aio-support. We no longer would ever prefer POSIX-RT aio, use pthread_aio instead.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2015-11-13 21:36:19 +01:00
Jeremy Allison
17f4110c47 s3: smbd: Remove outstanding_aio_calls from globals.
Access via functions only.

Signed-off-by: Jeremy Allison <jra@samba.org>
Signed-off-by: Christof Schmitt <cs@samab.org>
2015-11-13 01:44:21 +01:00
Jeremy Allison
803938260d s3: smbd: Remove aio_pending_size from globals.
Access via functions only.

Signed-off-by: Jeremy Allison <jra@samba.org>
Signed-off-by: Christof Schmitt <cs@samba.org>
2015-11-13 01:44:21 +01:00
Volker Lendecke
42d5b06d7a vfs: Remove smb_traffic_analyzer
Holger Hetterich told me in a personal email that he does not have
time to care about this project anymore and that he is fine to
remove it from Samba.

Why the removal? It contains homegrown crypto that would need to
be thoroughly audited and/or fixed. And if it's neither maintained
nor widely used I'd rather have it removed.

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 Nov 11 00:23:35 CET 2015 on sn-devel-104
2015-11-11 00:23:35 +01:00
Volker Lendecke
af26da1e47 vfs_acl_*: Only sha256 needed
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2015-11-09 07:53:18 +01:00
Volker Lendecke
dee23e9472 vfs_cap: Fix a warning
clang warns about increased alignment cast. talloc_size does align properly.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2015-11-09 07:53:18 +01:00
Volker Lendecke
c526f5f28c vfs_fruit: Fix a typo
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2015-11-09 07:53:18 +01:00
Volker Lendecke
23663b9719 vfs_gpfs: Re-enable share modes
is_ntfs_default_stream_smb_fname returns false for a NULL stream name, so for
streamless filenames we do not set gpfs share modes without this patch.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=11243
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>

Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Fri Nov  6 03:21:01 CET 2015 on sn-devel-104
2015-11-06 03:21:01 +01:00
Volker Lendecke
2515ad78a7 vfs_gpfs: Fix the build with -Werror=declaration-after-statement
Bug: https://bugzilla.samba.org/show_bug.cgi?id=11243
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-11-06 00:17:08 +01:00
Uri Simchoni
b37ecbd06d vfs_offline: add vfs_offline module
This module marks all file in the share as offline.
It can be useful for shares mounted on top of a remote file
system (either through a samba VFS module or via FUSE).

Offline files change the behavior of Windows explorer, and
prevent it from peeking inside folders just for the sake of
drawing a nice icon of them. This greatly reduces the number
of requests Windows Explorer makes, and improves user experience
when dealing with remote file systems.

The offline bit also has an effect on the behavior of Windows
redirector.

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-11-04 22:15:24 +01:00
Ralph Boehme
2881679e3e vfs_streams_xattr: fix and simplify streams_xattr_get_name()
streams_xattr_get_name() fails to chop off the stream type in case
config->store_stream_type is false and the passed stream name contains a
stream type.

Eg when the passed in stream name is ":mystream:$DATA", but
config->store_stream_type is false, we must generate a xattr name of
"mystream" or "user.mystream".

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

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 Oct 16 23:27:01 CEST 2015 on sn-devel-104
2015-10-16 23:27:01 +02:00
Ralph Boehme
fedd09662c vfs_fruit: hide the Netatalk metadata xattr in streaminfo
Bug: https://bugzilla.samba.org/show_bug.cgi?id=11466

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-10-16 20:24:20 +02:00
Ralph Boehme
c8ee1a059b vfs_fruit: add and use define for the Netatalk metadata xattr
Bug: https://bugzilla.samba.org/show_bug.cgi?id=11466

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-10-16 20:24:20 +02:00
Volker Lendecke
258ce91f31 lib: Move sys_rw* to lib/util
genrand.c will require it soon

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-10-13 01:23:07 +02:00
Uri Simchoni
5709dece48 vfs_commit: set the fd on open before calling SMB_VFS_FSTAT
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11547

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Oct  8 02:56:41 CEST 2015 on sn-devel-104
2015-10-08 02:56:41 +02:00
Ralph Boehme
5d7eaf959a vfs_fruit: return value of ad_pack in vfs_fruit.c
ad_pack() in vfs_fruit.c returns false on failure and 0 on success -
i.e. return value is interpreted as success even when it fails.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>

Autobuild-User(master): Uri Simchoni <uri@samba.org>
Autobuild-Date(master): Tue Oct  6 16:14:42 CEST 2015 on sn-devel-104
2015-10-06 16:14:42 +02:00
Volker Lendecke
48d4aac563 fruit: Fix CID 1323186 Dereference before null check
In all other "goto fail;" paths we had already dereferenced fsp,
so the if-statement checking for fsp!=NULL was unnecessary. This
fix gives us an additional error message in case check_aapl fails.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>

Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Tue Sep  8 13:47:01 CEST 2015 on sn-devel-104
2015-09-08 13:47:01 +02:00
Volker Lendecke
2a8b21e5ae vfs_gpfs: Avoid calling gpfs_is_offline on every i/o
Asks gpfs as long as a file is offline. Once it was reported online once,
we'll not ask anymore.  This assumes that while we have a file open it
won't be migrated away. This might not *always* be true, but probably
close enough. And as long as we don't have a proper notification mechanism
and as long as polling is too expensive, this seems like a good strategy.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>

Autobuild-User(master): Christof Schmitt <cs@samba.org>
Autobuild-Date(master): Sat Sep  5 01:50:09 CEST 2015 on sn-devel-104
2015-09-05 01:50:09 +02:00
Volker Lendecke
53a8cc7c0d vfs_gpfs: Introduce vfs_gpfs_fsp_is_offline
This consolidates a few common calls

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
2015-09-04 22:51:06 +02:00
Ralph Boehme
6263495b5b vfs_fruit: delete ._ file when deleting the basefile
0 byte resource fork streams are not listed by vfs_streaminfo, as a
result stream cleanup/deletion of file deletion doesn't remove the
resourcefork stream.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-09-02 03:50:21 +02:00
Ralph Boehme
db1c074435 vfs_fruit: split and simplify fruit_ftruncate
Bug: https://bugzilla.samba.org/show_bug.cgi?id=11467

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-09-02 03:50:21 +02:00
Ralph Boehme
34759c8e7c vfs_fruit: handling of empty resource fork
Opening the resource fork stream with O_CREAT mustn't create a visible
node in the filesystem, only create a file handle. As long as the
creator didn't write into the stream, other openers withour O_CREAT
MUST get an ENOENT error. This is way OS X SMB server implements it.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-09-02 03:50:21 +02:00
Richard Sharpe
e6c234d31a Move the error handling for svhdx to vfswrap_create to give VFS module writers a chance to handle RSVD opens if they want to.
Also handle a review comment by Metze.

Signed-off-by: Richard Sharpe <rsharpe@samba.org>
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): Fri Aug 28 03:19:36 CEST 2015 on sn-devel-104
2015-08-28 03:19:35 +02:00
Stefan Metzmacher
64c6cc34d7 s3:vfs_smb_traffic_analyzer: remove samba_ prefix from AES_* function calls
This should be an implementation detail in lib/crypto/aes.h.

In future we may add support for other implementations.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-08-27 20:23:20 +02:00
Volker Lendecke
4a442e2eb7 lib: Make sid_parse take a uint8_t
sid_parse takes a binary blob, uint8_t reflects this a bit
better than char * does

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-08-26 21:41:12 +02:00
Robin Hack
59e955bfd1 vfs_scannedonly: Remove vfs_scannedonly from samba source tree.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11459
Signed-off-by: Robin Hack <hack.robin@gmail.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Fri Aug 21 07:17:35 CEST 2015 on sn-devel-104
2015-08-21 07:17:35 +02:00
Stefan Metzmacher
7b2ff4cbd3 s3:modules/perfcount_*: make function prototypes available via static_decl_perfcount;
This allows the static build of the modules.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2015-08-20 16:06:21 +02:00
Stefan Metzmacher
37b2677648 s3:modules/vfs_*: make function prototypes available via static_decl_vfs;
This allows the static build of the modules.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2015-08-20 16:06:21 +02:00
Stefan Metzmacher
72e0885413 s3:wscript: remove leftover from vfs_notify_fam
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2015-08-20 16:06:20 +02:00
Volker Lendecke
22e1fb3466 vfs: Add some {}
The "mode = " from a very casual view looked as if it was part of the
if-condition

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>
2015-08-20 12:49:22 +02:00
Volker Lendecke
b5ce90e609 nfs4acls: Remove type_name param from smbacl4_get_vfs_params
It is kindof unexpected that we get params for something else but
"nfs4:"

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>

Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Thu Aug 13 17:45:31 CEST 2015 on sn-devel-104
2015-08-13 17:45:31 +02:00
Volker Lendecke
173dca482b nfs4acls: Fix a small memleak
We don't need the nt_ace_list beyond this function, make_sec_acl makes
a copy and make_sec_desc makes another one

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-08-13 14:40:16 +02:00
Volker Lendecke
9287b6788d nfs4acls: Introduce a helper variable
... triggered by removing a "==false" condition

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-08-13 14:40:16 +02:00