]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: Centralize fdos_mode() in smbd_dirptr_get_entry()
authorVolker Lendecke <vl@samba.org>
Tue, 14 Nov 2023 11:11:17 +0000 (12:11 +0100)
committerVolker Lendecke <vl@samba.org>
Wed, 15 Nov 2023 05:10:35 +0000 (05:10 +0000)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/smbd/dir.c

index a4547630dddb7059c97ac2f41c376b5ca469a2e3..0fe38d2a650366b4823e1e812fd4164bdcd05634 100644 (file)
@@ -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",