vfs_fruit: filter empty streams
commit280722734964afa847280851f6d493e2f987f060
authorRalph Boehme <slow@samba.org>
Sat, 20 Oct 2018 12:53:50 +0000 (20 14:53 +0200)
committerKarolin Seeger <kseeger@samba.org>
Tue, 6 Nov 2018 08:10:24 +0000 (6 09:10 +0100)
tree67f7d371fe25132c8cb7c4530ca1efed0c40a07d
parentb0657faba457c632f111d3cb4c58d129bbf52689
vfs_fruit: filter empty streams

First step in achieving macOS compliant behaviour wrt to empty streams:
- hide empty streams in streaminfo
- prevent opens of empty streams

This means that we may carry 0-byte sized streams in our streams
backend, but this shouldn't really hurt.

The previous attempt of deleting the streams when an SMB setinfo eof to
0 request came in, turned out be a road into desaster.

We could set delete-on-close on the stream, but that means we'd have to
check for it for every write on a stream and checking the
delete-on-close bits requires fetching the locking.tdb record, so this
is expensive and I'd like to avoid that overhead.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit ebfcf75e993b1a792db76b94aa898532e1c81eeb)
selftest/knownfail.d/samba3.vfs.fruit
source3/modules/vfs_fruit.c