From: Volker Lendecke Date: Tue, 14 Nov 2023 11:09:54 +0000 (+0100) Subject: smbd: Centralize wiping the ".." stat info X-Git-Tag: talloc-2.4.2~723 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=80c98acbf0550c760dbc9de2cc7a3328c3c53bd6;p=thirdparty%2Fsamba.git smbd: Centralize wiping the ".." stat info Make sure this also happens for symlinks etc. Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison --- diff --git a/source3/smbd/dir.c b/source3/smbd/dir.c index 5d37dbafa7a..a4547630ddd 100644 --- a/source3/smbd/dir.c +++ b/source3/smbd/dir.c @@ -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),