[PATCH] vfs_fruit: resource fork length

Ralph Böhme rb at sernet.de
Wed Sep 17 06:00:51 MDT 2014


On Tue, Sep 16, 2014 at 02:57:12PM -0700, Jeremy Allison wrote:
> On Tue, Sep 16, 2014 at 11:32:58AM -0700, Jeremy Allison wrote:
> > On Tue, Sep 16, 2014 at 08:18:57PM +0200, Volker Lendecke wrote:
> > > On Tue, Sep 16, 2014 at 10:51:09AM -0700, Jeremy Allison wrote:
> > > > On Tue, Sep 16, 2014 at 10:34:05AM +0200, Ralph Böhme wrote:
> > > > > Hi
> > > > > 
> > > > > attached please find an update for the vfs_fruit torture test and
> > > > > fixes for two issue:
> > > > > 
> > > > > * the resource fork size that gets written to ther AppleDouble header
> > > > >   is calculated wrong when the resource is extended with pwrite()
> > > > > 
> > > > > * the resource fork size is not updated upon ftruncate()
> > > > > 
> > > > > This patch series depends the other patch submitted recently.
> > > > > 
> > > > > Review and commit (if ok) appreciated.
> > > > 
> > > > LGTM - 'Reviewed-by: Jeremy Allison <jra at samba.org>'.
> > > > 
> > > > Can I get a second Team reviewer please ?
> > > 
> > > R-b: Me. Off to a talk, can you push?
> > 
> > Yes - done - thanks !
> 
> Ralph - trying to push this and the previous
> patch I'm getting:
> 
> [573/1680 in 53m44s] samba3.vfs.fruit(s3dc)
> [574/1680 in 53m45s] samba3.vfs.fruit(plugin_s4_dc)
> (../source4/torture/vfs/fruit.c:1208) writing to resource fork
> Open stream vfs_fruit_dir\torture_write_rfork_io:AFP_Resource:$DATA
> UNEXPECTED(failure): samba3.vfs.fruit.resource fork IO(plugin_s4_dc)
>
> REASON: _StringException: _StringException:
> (../source4/torture/vfs/fruit.c:1227) Incorrect status
> NT_STATUS_ACCESS_DENIED - should be NT_STATUS_OK
>
> Can you investigate and let give me an
> updated patchset please ?

looks like I can't reproduce this. :/ Both make check and smbtorture
complete successfully. Is the error reproducible on your system?

$ make check
...
[572/1666 in 29m25s, 21 errors] idmap.rfc2307
[573/1666 in 29m25s, 21 errors] samba3.vfs.fruit(s3dc)
[574/1666 in 29m26s, 21 errors] samba3.vfs.fruit(plugin_s4_dc)
[575/1666 in 29m26s, 21 errors] samba3.rpc.lsa.lookupsids over ncacn_np with [] (s3dc)
...
$ make check TESTS=fruit
...
ALL OK (4 tests in 1 testsuites)

A summary with detailed information can be found in:
  ./st/summary
'testonly' finished successfully (8.821s)
$ ./bin/smbtorture -U ralph%SECRET //localhost/vfs_fruit --option=torture:share1=vfs_fruit --option=torture:share2=vfs_fruitless --option=torture:localdir=/Volumes/vfs_apple/ vfs.fruit
smbtorture 4.2.0pre1-DEVELOPERBUILD
Using seed 1410955001
time: 2014-09-17 13:56:41.338717
progress: 4
test: read metadata
time: 2014-09-17 13:56:41.342433
Checking metadata access
Open stream vfs_fruit_dir\torture_read_metadata:AFP_AfpInfo:$DATA
Open stream vfs_fruit_dir\torture_read_metadata:AFP_AfpInfo:$DATA
time: 2014-09-17 13:56:41.459341
success: read metadata
test: write metadata
time: 2014-09-17 13:56:41.459402
Open stream vfs_fruit_dir\torture_write_metadata:AFP_AfpInfo:$DATA
time: 2014-09-17 13:56:41.559560
success: write metadata
test: resource fork IO
time: 2014-09-17 13:56:41.559600
(../source4/torture/vfs/fruit.c:1208) writing to resource fork
Open stream vfs_fruit_dir\torture_write_rfork_io:AFP_Resource:$DATA
(../source4/torture/vfs/fruit.c:1231) check resource fork size after write
(../source4/torture/vfs/fruit.c:1251) writing to resource fork at large offset
Open stream vfs_fruit_dir\torture_write_rfork_io:AFP_Resource:$DATA
(../source4/torture/vfs/fruit.c:1264) truncate resource fork and check size
time: 2014-09-17 13:56:41.657192
success: resource fork IO
test: OS X AppleDouble file conversion
time: 2014-09-17 13:56:41.657236
(../source4/torture/vfs/fruit.c:1353) test OS X AppleDouble conversion
Open stream vfs_fruit_dir\test_adouble_conversion:AFP_Resource:$DATA
time: 2014-09-17 13:56:41.739036
success: OS X AppleDouble file conversion
$ 

For easier reference, I've pushed the branch with both patchsets to my
github repo: <https://github.com/slowfranklin/samba/commits/adrsize>

The code tries to open the resource fork stream before line 1227:
<https://github.com/slowfranklin/samba/blob/adrsize/source4/torture/vfs/fruit.c#L1227>

ZERO_STRUCT(io);
io.smb2.in.create_disposition = NTCREATEX_DISP_OPEN;
io.smb2.in.desired_access = SEC_FILE_READ_ATTRIBUTE |
                            SEC_FILE_WRITE_ATTRIBUTE |
                            SEC_RIGHTS_FILE_ALL;
io.smb2.in.fname = rfork;
status = smb2_create(tree1, mem_ctx, &(io.smb2));
CHECK_STATUS(status, NT_STATUS_OK);

Lgtm.

-Ralph

-- 
SerNet GmbH, Bahnhofsallee 1b, 37081 Göttingen
phone: +49-551-370000-0, fax: +49-551-370000-9
AG Göttingen, HRB 2816, GF: Dr. Johannes Loxen
http://www.sernet.de,mailto:kontakt@sernet.de


More information about the samba-technical mailing list