]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
vfs_streams_xattr: invalidate stat info if xattr was not found
authorRalph Boehme <slow@samba.org>
Thu, 11 May 2017 05:59:20 +0000 (07:59 +0200)
committerKarolin Seeger <kseeger@samba.org>
Mon, 14 Aug 2017 08:50:10 +0000 (10:50 +0200)
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 <slow@samba.org>
Reviewed-by: Richard Sharpe <realrichardsharpe@gmail.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
(backported from commit ec32f33ea6d50d9cb504400c3ef1e78643502e1a)

source3/modules/vfs_streams_xattr.c

index 66926367823ebbe6e7102fd7975d4f4a91d0ae4d..8425c9d125e612f722b4e35ca7b36e60df3b3a4e 100644 (file)
@@ -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;