From da22be9167a342e2edfbdb49a9b9d34e5bde9b66 Mon Sep 17 00:00:00 2001 From: Ralph Boehme Date: Thu, 11 May 2017 07:59:20 +0200 Subject: [PATCH] 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) --- source3/modules/vfs_streams_xattr.c | 3 +++ 1 file changed, 3 insertions(+) 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; -- 2.47.2