From ffa727f33b06e71403303b53797a068f455b22f8 Mon Sep 17 00:00:00 2001 From: Ralph Boehme Date: Tue, 7 Feb 2017 15:01:53 +0100 Subject: [PATCH] vfs_fruit: use stat info from base_fsp This is also supposed to be valid in the VFS stack, so there's no need to re-stat here. Bug: https://bugzilla.samba.org/show_bug.cgi?id=12427 Signed-off-by: Ralph Boehme Reviewed-by: Uri Simchoni --- source3/modules/vfs_fruit.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c index 47cc394a302..81dfbd9774a 100644 --- a/source3/modules/vfs_fruit.c +++ b/source3/modules/vfs_fruit.c @@ -2838,15 +2838,9 @@ static int fruit_open_rsrc_adouble(vfs_handle_struct *handle, SMB_VFS_HANDLE_GET_DATA(handle, config, struct fruit_config_data, return -1); - if (!(flags & O_CREAT) && !VALID_STAT(smb_fname->st)) { - rc = SMB_VFS_NEXT_STAT(handle, smb_fname); - if (rc != 0) { - rc = -1; - goto exit; - } - } - - if (VALID_STAT(smb_fname->st) && S_ISDIR(smb_fname->st.st_ex_mode)) { + if ((!(flags & O_CREAT)) && + S_ISDIR(fsp->base_fsp->fsp_name->st.st_ex_mode)) + { /* sorry, but directories don't habe a resource fork */ rc = -1; goto exit; -- 2.47.2