From: Ralph Boehme Date: Wed, 8 Feb 2017 18:16:21 +0000 (+0100) Subject: vfs_streams_xattr: use SMB_VFS_NEXT_OPEN and CLOSE X-Git-Tag: tdb-1.3.13~743 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4e2c7d0ec45adf5992446e3e05c90dd40c2fd75b;p=thirdparty%2Fsamba.git vfs_streams_xattr: use SMB_VFS_NEXT_OPEN and CLOSE Using the SMB_VFS_OPEN leads to a recursion in the VFS that is hard to follow and debug. It's called twice for the same fsp with two different smb_fname's which makes it at least hard to debug, it may even be an invalid usage. Changing this here to use the NEXT function instead should have no change in behaviour otherwise. Bug: https://bugzilla.samba.org/show_bug.cgi?id=12565 Signed-off-by: Ralph Boehme Reviewed-by: Uri Simchoni --- diff --git a/source3/modules/vfs_streams_xattr.c b/source3/modules/vfs_streams_xattr.c index e193d3572c5..66926367823 100644 --- a/source3/modules/vfs_streams_xattr.c +++ b/source3/modules/vfs_streams_xattr.c @@ -449,8 +449,8 @@ static int streams_xattr_open(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 * fd has to be read-only. @@ -458,8 +458,8 @@ static int streams_xattr_open(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); @@ -547,7 +547,7 @@ static int streams_xattr_open(vfs_handle_struct *handle, * we don't have a full fsp yet */ fsp->fh->fd = hostfd; - SMB_VFS_CLOSE(fsp); + SMB_VFS_NEXT_CLOSE(handle, fsp); } return -1;