From: Ralph Boehme Date: Thu, 4 Jul 2019 09:37:10 +0000 (+0200) Subject: adouble: use runtime size when writing out AppleDouble header X-Git-Tag: talloc-2.3.0~104 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1c464232f8848e6d3a28f49f7721f4ac076c5645;p=thirdparty%2Fsamba.git adouble: use runtime size when writing out AppleDouble header 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 Reviewed-by: Jeremy Allison --- diff --git a/source3/lib/adouble.c b/source3/lib/adouble.c index 21d5162c8ff..a88847c27a5 100644 --- a/source3/lib/adouble.c +++ b/source3/lib/adouble.c @@ -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; }