diff options
author | Ralph Boehme <slow@samba.org> | 2018-05-17 16:48:09 +0200 |
---|---|---|
committer | Karolin Seeger <kseeger@samba.org> | 2018-07-12 13:10:25 +0200 |
commit | af4cb57d4f713990973f44678dc5e6d2f9cfa984 (patch) | |
tree | 9de609e43233c0790259d3a8908664ef1a3e8bad | |
parent | c88aa5fb76ae74aefa5ef7a06281f1120d19a8d5 (diff) | |
download | samba-af4cb57d4f713990973f44678dc5e6d2f9cfa984.tar.gz |
vfs_fruit: delete 0 byte size streams if AAPL is enabled
macOS SMB server uses xattrs as storage backend for streams, directly
exposing xattr get/set characteristics. Setting EOF on a stream to 0
just deletes the xattr as macOS doesn't support 0-byte sized xattrs.
Note that this does not apply to the AFP_AfpInfo and AFP_Resource
streams, they have even stranger semantics and we have other tests
for those.
Bug: https://bugzilla.samba.org/show_bug.cgi?id=13441
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): Wed May 30 02:34:29 CEST 2018 on sn-devel-144
(cherry picked from commit 46d127865f3fb14041797d395db3b3234ed3bd6c)
-rw-r--r-- | selftest/knownfail.d/samba3.vfs.fruit | 3 | ||||
-rw-r--r-- | source3/modules/vfs_fruit.c | 3 |
2 files changed, 3 insertions, 3 deletions
diff --git a/selftest/knownfail.d/samba3.vfs.fruit b/selftest/knownfail.d/samba3.vfs.fruit index 5931c471086..8df25bccb79 100644 --- a/selftest/knownfail.d/samba3.vfs.fruit +++ b/selftest/knownfail.d/samba3.vfs.fruit @@ -1,4 +1 @@ ^samba3.vfs.fruit streams_depot.OS X AppleDouble file conversion\(nt4_dc\) -^samba3.vfs.fruit metadata_netatalk.setinfo eof stream\(nt4_dc\) -^samba3.vfs.fruit metadata_stream.setinfo eof stream\(nt4_dc\) -^samba3.vfs.fruit streams_depot.setinfo eof stream\(nt4_dc\) diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c index 1a05d0bae34..013dec0186a 100644 --- a/source3/modules/vfs_fruit.c +++ b/source3/modules/vfs_fruit.c @@ -5537,6 +5537,9 @@ static int fruit_ftruncate(struct vfs_handle_struct *handle, (intmax_t)offset); if (fio == NULL) { + if (offset == 0 && global_fruit_config.nego_aapl) { + return SMB_VFS_NEXT_UNLINK(handle, fsp->fsp_name); + } return SMB_VFS_NEXT_FTRUNCATE(handle, fsp, offset); } |