]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
adouble: use runtime size when writing out AppleDouble header
authorRalph Boehme <slow@samba.org>
Thu, 4 Jul 2019 09:37:10 +0000 (11:37 +0200)
committerJeremy Allison <jra@samba.org>
Fri, 12 Jul 2019 21:31:29 +0000 (21:31 +0000)
We're calling SMB_VFS_NEXT_PWRITE() to write out the AppleDouble header
data. Until now this header always had a fixed sizeof AD_DATASZ_DOT_UND bytes,
but a subsequent commit will change that. Use the correct size which is the
offset of the begining of the resource fork data.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/lib/adouble.c

index 21d5162c8ff40d83a437e211e70a130638a5aa7a..a88847c27a5d2881c84e6f3f1bbe505c63413b13 100644 (file)
@@ -1727,9 +1727,9 @@ int ad_fset(struct vfs_handle_struct *handle,
                len = SMB_VFS_NEXT_PWRITE(handle,
                                          fsp,
                                          ad->ad_data,
-                                         AD_DATASZ_DOT_UND,
+                                         ad_getentryoff(ad, ADEID_RFORK),
                                          0);
-               if (len != AD_DATASZ_DOT_UND) {
+               if (len != ad_getentryoff(ad, ADEID_RFORK)) {
                        DBG_ERR("short write on %s: %zd", fsp_str_dbg(fsp), len);
                        return -1;
                }