1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-12 09:18:10 +03:00

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 <slow@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
This commit is contained in:
Ralph Boehme 2017-02-08 19:15:38 +01:00 committed by Uri Simchoni
parent ad8a3b6971
commit 3e2a7f6227

View File

@ -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;