From: Volker Lendecke Date: Tue, 14 Nov 2023 11:11:17 +0000 (+0100) Subject: smbd: Centralize fdos_mode() in smbd_dirptr_get_entry() X-Git-Tag: talloc-2.4.2~722 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=aaa73cce1da0c9058615a9b3d91e926d445277de;p=thirdparty%2Fsamba.git smbd: Centralize fdos_mode() in smbd_dirptr_get_entry() Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison --- diff --git a/source3/smbd/dir.c b/source3/smbd/dir.c index a4547630ddd..0fe38d2a650 100644 --- a/source3/smbd/dir.c +++ b/source3/smbd/dir.c @@ -626,11 +626,6 @@ bool smbd_dirptr_get_entry(TALLOC_CTX *ctx, } if (!S_ISLNK(smb_fname->st.st_ex_mode)) { - if (get_dosmode) { - mode = fdos_mode(smb_fname->fsp); - smb_fname->st = smb_fname->fsp->fsp_name->st; - } - goto done; } @@ -699,13 +694,12 @@ bool smbd_dirptr_get_entry(TALLOC_CTX *ctx, continue; } +done: if (get_dosmode) { mode = fdos_mode(smb_fname->fsp); smb_fname->st = smb_fname->fsp->fsp_name->st; } - done: - if (!dir_check_ftype(mode, dirtype)) { DBG_INFO("[%s] attribs 0x%" PRIx32 " didn't match " "0x%" PRIx32 "\n",