From: Ralph Boehme Date: Fri, 17 May 2019 08:41:29 +0000 (+0200) Subject: vfs_fruit: pass handle to ad_fset() X-Git-Tag: ldb-2.0.5~558 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=585d4d49770b4ddc3f7d9dcbb3e322f072767781;p=thirdparty%2Fsamba.git vfs_fruit: pass handle to ad_fset() On the course of removing ad_handle from struct adouble, step 1. Bug: https://bugzilla.samba.org/show_bug.cgi?id=13968 Signed-off-by: Ralph Boehme Reviewed-by: Jeremy Allison --- diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c index 9e22a1338ae..5f4ae06d845 100644 --- a/source3/modules/vfs_fruit.c +++ b/source3/modules/vfs_fruit.c @@ -542,7 +542,9 @@ static struct adouble *ad_get(TALLOC_CTX *ctx, const struct smb_filename *smb_fname, adouble_type_t type); static int ad_set(struct adouble *ad, const struct smb_filename *smb_fname); -static int ad_fset(struct adouble *ad, files_struct *fsp); +static int ad_fset(struct vfs_handle_struct *handle, + struct adouble *ad, + files_struct *fsp); static int adouble_path(TALLOC_CTX *ctx, const struct smb_filename *smb_fname__in, struct smb_filename **ppsmb_fname_out); @@ -2067,7 +2069,9 @@ static int ad_set(struct adouble *ad, const struct smb_filename *smb_fname) * * @return status code, 0 means success **/ -static int ad_fset(struct adouble *ad, files_struct *fsp) +static int ad_fset(struct vfs_handle_struct *handle, + struct adouble *ad, + files_struct *fsp) { int rc = -1; ssize_t len; @@ -2089,7 +2093,7 @@ static int ad_fset(struct adouble *ad, files_struct *fsp) switch (ad->ad_type) { case ADOUBLE_META: - rc = SMB_VFS_NEXT_SETXATTR(ad->ad_handle, + rc = SMB_VFS_NEXT_SETXATTR(handle, fsp->fsp_name, AFPINFO_EA_NETATALK, ad->ad_data, @@ -2097,7 +2101,7 @@ static int ad_fset(struct adouble *ad, files_struct *fsp) break; case ADOUBLE_RSRC: - len = SMB_VFS_NEXT_PWRITE(ad->ad_handle, + len = SMB_VFS_NEXT_PWRITE(handle, fsp, ad->ad_data, AD_DATASZ_DOT_UND, @@ -3611,7 +3615,7 @@ static int fruit_open_rsrc_adouble(vfs_handle_struct *handle, fsp->fh->fd = hostfd; - rc = ad_fset(ad, fsp); + rc = ad_fset(handle, ad, fsp); fsp->fh->fd = -1; if (rc != 0) { rc = -1; @@ -4699,7 +4703,7 @@ static ssize_t fruit_pwrite_meta_netatalk(vfs_handle_struct *handle, memcpy(p, &ai->afpi_FinderInfo[0], ADEDLEN_FINDERI); - ret = ad_fset(ad, fsp); + ret = ad_fset(handle, ad, fsp); if (ret != 0) { DBG_ERR("ad_pwrite [%s] failed\n", fsp_str_dbg(fsp)); TALLOC_FREE(ad); @@ -4855,7 +4859,7 @@ static ssize_t fruit_pwrite_rsrc_adouble(vfs_handle_struct *handle, if ((n + offset) > ad_getentrylen(ad, ADEID_RFORK)) { ad_setentrylen(ad, ADEID_RFORK, n + offset); - ret = ad_fset(ad, fsp); + ret = ad_fset(handle, ad, fsp); if (ret != 0) { DBG_ERR("ad_pwrite [%s] failed\n", fsp_str_dbg(fsp)); TALLOC_FREE(ad); @@ -5957,7 +5961,7 @@ static int fruit_ftruncate_rsrc_adouble(struct vfs_handle_struct *handle, ad_setentrylen(ad, ADEID_RFORK, offset); - rc = ad_fset(ad, fsp); + rc = ad_fset(handle, ad, fsp); if (rc != 0) { DBG_ERR("ad_fset [%s] failed [%s]\n", fsp_str_dbg(fsp), strerror(errno));