From: Ralph Boehme Date: Thu, 11 May 2017 05:59:20 +0000 (+0200) Subject: vfs_streams_xattr: invalidate stat info if xattr was not found X-Git-Tag: samba-4.5.13~13 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=da22be9167a342e2edfbdb49a9b9d34e5bde9b66;p=thirdparty%2Fsamba.git vfs_streams_xattr: invalidate stat info if xattr was not found We stat the basefile so we leave valid stat info from the base file behind, even though the xattr for the stream was not there. Bug: https://bugzilla.samba.org/show_bug.cgi?id=12791 Signed-off-by: Ralph Boehme Reviewed-by: Richard Sharpe Reviewed-by: Volker Lendecke (backported from commit ec32f33ea6d50d9cb504400c3ef1e78643502e1a) --- diff --git a/source3/modules/vfs_streams_xattr.c b/source3/modules/vfs_streams_xattr.c index 66926367823..8425c9d125e 100644 --- a/source3/modules/vfs_streams_xattr.c +++ b/source3/modules/vfs_streams_xattr.c @@ -267,6 +267,7 @@ static int streams_xattr_fstat(vfs_handle_struct *handle, files_struct *fsp, sbuf->st_ex_size = get_xattr_size(handle->conn, fsp, io->base, io->xattr_name); if (sbuf->st_ex_size == -1) { + SET_STAT_INVALID(*sbuf); return -1; } @@ -319,6 +320,7 @@ static int streams_xattr_stat(vfs_handle_struct *handle, smb_fname->base_name, xattr_name); if (smb_fname->st.st_ex_size == -1) { + SET_STAT_INVALID(smb_fname->st); errno = ENOENT; result = -1; goto fail; @@ -370,6 +372,7 @@ static int streams_xattr_lstat(vfs_handle_struct *handle, smb_fname->base_name, xattr_name); if (smb_fname->st.st_ex_size == -1) { + SET_STAT_INVALID(smb_fname->st); errno = ENOENT; result = -1; goto fail;