[PATCH] Fix AppleDouble conversion in vfs_fruit
Jeremy Allison
jra at samba.org
Tue Oct 9 21:24:33 UTC 2018
On Tue, Oct 09, 2018 at 01:03:50PM +0200, Ralph Böhme via samba-technical wrote:
> On Tue, Oct 09, 2018 at 01:00:23PM +0200, Ralph Böhme via samba-technical wrote:
> > On Tue, Oct 09, 2018 at 12:35:22PM +0200, Ralph Böhme wrote:
> > > please hold on, something's fishy. This was passing manual make test
> > > vfs.fruit whereas it's now failing. Checking...
> >
> > The culprit was a last minute change in 3/21 to use a pointer instead of
> > an array to store the filler bytes. The problem is that whenever
> > ad_pack() is called it overwrites the original filler bytes.
> >
> > So attached is the original version of the patchset without this change.
> > Passes manual make test vfs.fruit again.
> >
> > CI: https://gitlab.com/samba-team/devel/samba/pipelines/32396036
>
> and here's the patch.
Reviewing this - I have a question about the following.
ad_getentryoff(ad, ADEID_FINDERI) + ADEDLEN_FINDERI -> ADEDOFF_RFORK_DOT_UND
isn't what you're replacing here. You're replacing:
ad_getentryoff(ad, ADEID_RFORK) -> ADEDOFF_RFORK_DOT_UND
so either the code or the commit message isn't right.
You are doing that replacement in patch
[PATCH 13/21] vfs_fruit: use ADEDOFF_RFORK_DOT_UND offset macro in ad_convert_move_reso()
so this looks like a cut-and-paste commit message
fail.
Can you clarify ?
Jeremy.
-----------------------------------------------------------------------
From 4bae23cc5cab811da09123d3d5676604cfdeb13c Mon Sep 17 00:00:00 2001
From: Ralph Boehme <slow at samba.org>
Date: Fri, 5 Oct 2018 19:15:04 +0200
Subject: [PATCH 11/21] vfs_fruit: use ADEDOFF_RFORK_DOT_UND offset macro in
ad_convert_truncate()
We really want the fixed size offset here, not a calculated one. Note
that "ad_getentryoff(ad, ADEID_FINDERI) + ADEDLEN_FINDERI" is equal to
ADEDOFF_RFORK_DOT_UND.
Bug: https://bugzilla.samba.org/show_bug.cgi?id=13649
Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
---
source3/modules/vfs_fruit.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c
index 41476625b33..02db5923c6a 100644
--- a/source3/modules/vfs_fruit.c
+++ b/source3/modules/vfs_fruit.c
@@ -1161,8 +1161,8 @@ static bool ad_convert_truncate(struct adouble *ad,
* FIXME: direct ftruncate(), but we don't have a fsp for the
* VFS call
*/
- rc = ftruncate(ad->ad_fd, ad_getentryoff(ad, ADEID_RFORK)
- + ad_getentrylen(ad, ADEID_RFORK));
+ rc = ftruncate(ad->ad_fd, ADEDOFF_RFORK_DOT_UND +
+ ad_getentrylen(ad, ADEID_RFORK));
if (rc != 0) {
return false;
}
More information about the samba-technical
mailing list