From 1c464232f8848e6d3a28f49f7721f4ac076c5645 Mon Sep 17 00:00:00 2001 From: Ralph Boehme Date: Thu, 4 Jul 2019 11:37:10 +0200 Subject: 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 --- source3/lib/adouble.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source3/lib/adouble.c') 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; } -- cgit v1.2.1