From: Ralph Boehme Date: Wed, 8 Feb 2017 18:15:38 +0000 (+0100) Subject: vfs_fruit: use SMB_VFS_NEXT_OPEN in two places X-Git-Tag: tdb-1.3.13~713 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3e2a7f6227204e932a8337fe77cdda22d28f85f6;p=thirdparty%2Fsamba.git vfs_fruit: use SMB_VFS_NEXT_OPEN in two places Using the SMB_VFS_OPEN leads to a logic recursion that is hard to follow and debug. It may be called twice for the same fsp with two different smb_fname's. Changing this here to use the NEXT function instead should have no change in behaviour otherwise, but it allows adding sane caching to vfs_catia to handle based VFS ops. BUG: https://bugzilla.samba.org/show_bug.cgi?id=12427 Signed-off-by: Ralph Boehme Reviewed-by: Uri Simchoni --- diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c index cbd1477059f..5bb1da9254d 100644 --- a/source3/modules/vfs_fruit.c +++ b/source3/modules/vfs_fruit.c @@ -2529,8 +2529,8 @@ static int fruit_open_meta_netatalk(vfs_handle_struct *handle, baseflags &= ~O_EXCL; baseflags &= ~O_CREAT; - hostfd = SMB_VFS_OPEN(handle->conn, smb_fname_base, fsp, - baseflags, mode); + hostfd = SMB_VFS_NEXT_OPEN(handle, smb_fname_base, fsp, + baseflags, mode); /* * It is legit to open a stream on a directory, but the base @@ -2539,8 +2539,8 @@ static int fruit_open_meta_netatalk(vfs_handle_struct *handle, if ((hostfd == -1) && (errno == EISDIR)) { baseflags &= ~O_ACCMODE; baseflags |= O_RDONLY; - hostfd = SMB_VFS_OPEN(handle->conn, smb_fname_base, fsp, - baseflags, mode); + hostfd = SMB_VFS_NEXT_OPEN(handle, smb_fname_base, fsp, + baseflags, mode); } TALLOC_FREE(smb_fname_base); @@ -2591,7 +2591,7 @@ exit: * full fsp yet */ fsp->fh->fd = hostfd; - SMB_VFS_CLOSE(fsp); + SMB_VFS_NEXT_CLOSE(handle, fsp); } hostfd = -1; errno = saved_errno; @@ -2681,8 +2681,8 @@ static int fruit_open_rsrc_adouble(vfs_handle_struct *handle, flags |= O_RDWR; } - hostfd = SMB_VFS_OPEN(handle->conn, smb_fname_base, fsp, - flags, mode); + hostfd = SMB_VFS_NEXT_OPEN(handle, smb_fname_base, fsp, + flags, mode); if (hostfd == -1) { rc = -1; goto exit;