[SCM] Samba Shared Repository - branch master updated

Stefan Metzmacher metze at samba.org
Wed Jul 3 11:42:01 UTC 2024


The branch, master has been updated
       via  2aca5cfbfa4 smbd: correctly restore ENOENT if fstatfs() modifies it
      from  95420715881 pidl:Wireshark Fix the type of array of pointerse to hf_ values

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 2aca5cfbfa45d2fcf00688388688812445123f3f
Author: Stefan Metzmacher <metze at samba.org>
Date:   Wed Jul 3 10:58:33 2024 +0200

    smbd: correctly restore ENOENT if fstatfs() modifies it
    
    Review with: git show -U5
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>
    
    Autobuild-User(master): Stefan Metzmacher <metze at samba.org>
    Autobuild-Date(master): Wed Jul  3 11:41:12 UTC 2024 on atb-devel-224

-----------------------------------------------------------------------

Summary of changes:
 source3/smbd/open.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/smbd/open.c b/source3/smbd/open.c
index 0c101c19b46..7999b3f082e 100644
--- a/source3/smbd/open.c
+++ b/source3/smbd/open.c
@@ -1190,10 +1190,8 @@ static NTSTATUS reopen_from_fsp(struct files_struct *dirfsp,
 				struct statfs sbuf = {};
 				int ret = fstatfs(old_fd, &sbuf);
 				if (ret == -1) {
-					int saved_errno = errno;
 					DBG_ERR("fstatfs failed: %s\n",
 						strerror(errno));
-					errno = saved_errno;
 				} else if (sbuf.f_type == AUTOFS_SUPER_MAGIC) {
 					/*
 					 * When reopening an as-yet
@@ -1203,6 +1201,8 @@ static NTSTATUS reopen_from_fsp(struct files_struct *dirfsp,
 					 */
 					goto namebased_open;
 				}
+				/* restore ENOENT if changed in the meantime */
+				errno = ENOENT;
 			}
 #endif
 			status = map_nt_error_from_unix(errno);


-- 
Samba Shared Repository



More information about the samba-cvs mailing list