]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: Centralize wiping the ".." stat info
authorVolker Lendecke <vl@samba.org>
Tue, 14 Nov 2023 11:09:54 +0000 (12:09 +0100)
committerVolker Lendecke <vl@samba.org>
Wed, 15 Nov 2023 05:10:35 +0000 (05:10 +0000)
Make sure this also happens for symlinks etc.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/smbd/dir.c

index 5d37dbafa7af6c6dde262720b210eee46bb89e53..a4547630dddb7059c97ac2f41c376b5ca469a2e3 100644 (file)
@@ -631,16 +631,6 @@ bool smbd_dirptr_get_entry(TALLOC_CTX *ctx,
                                smb_fname->st = smb_fname->fsp->fsp_name->st;
                        }
 
-                       if (toplevel_dotdot) {
-                               /*
-                                * Ensure posix fileid and sids are hidden
-                                */
-                               smb_fname->st.st_ex_ino = 0;
-                               smb_fname->st.st_ex_dev = 0;
-                               smb_fname->st.st_ex_uid = -1;
-                               smb_fname->st.st_ex_gid = -1;
-                       }
-
                        goto done;
                }
 
@@ -741,6 +731,16 @@ bool smbd_dirptr_get_entry(TALLOC_CTX *ctx,
                        }
                }
 
+               if (toplevel_dotdot) {
+                       /*
+                        * Ensure posix fileid and sids are hidden
+                        */
+                       smb_fname->st.st_ex_ino = 0;
+                       smb_fname->st.st_ex_dev = 0;
+                       smb_fname->st.st_ex_uid = -1;
+                       smb_fname->st.st_ex_gid = -1;
+               }
+
                DBG_NOTICE("mask=[%s] found %s fname=%s (%s)\n",
                           mask,
                           smb_fname_str_dbg(smb_fname),