smbd: pass get_dosmode to mode_fn in smbd_dirptr_get_entry()
authorRalph Boehme <slow@samba.org>
Thu, 15 Mar 2018 15:48:38 +0000 (16:48 +0100)
committerRalph Boehme <slow@samba.org>
Fri, 27 Jul 2018 11:07:15 +0000 (13:07 +0200)
This finally uses "get_dosmode" as passed in from the SMB2 layer, but
all callers still pass true, so no change in behaviour.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
source3/smbd/dir.c
source3/smbd/globals.h
source3/smbd/trans2.c

index 8f2f22d3eb136be5f1fae900c479651a68b31fde..c3af5233e9861892a8eea0c04835fd41f5fc1840 100644 (file)
@@ -1096,6 +1096,7 @@ bool smbd_dirptr_get_entry(TALLOC_CTX *ctx,
                           bool (*mode_fn)(TALLOC_CTX *ctx,
                                           void *private_data,
                                           struct smb_filename *smb_fname,
+                                          bool get_dosmode,
                                           uint32_t *_mode),
                           void *private_data,
                           char **_fname,
@@ -1190,7 +1191,7 @@ bool smbd_dirptr_get_entry(TALLOC_CTX *ctx,
                        .base_name = pathreal, .st = sbuf
                };
 
-               ok = mode_fn(ctx, private_data, &smb_fname, &mode);
+               ok = mode_fn(ctx, private_data, &smb_fname, get_dosmode, &mode);
                if (!ok) {
                        TALLOC_FREE(dname);
                        TALLOC_FREE(fname);
@@ -1319,6 +1320,7 @@ static bool smbd_dirptr_8_3_match_fn(TALLOC_CTX *ctx,
 static bool smbd_dirptr_8_3_mode_fn(TALLOC_CTX *ctx,
                                    void *private_data,
                                    struct smb_filename *smb_fname,
+                                   bool get_dosmode,
                                    uint32_t *_mode)
 {
        connection_struct *conn = (connection_struct *)private_data;
index e8a1e53a4193ba27b2b3629d9880ae92e223c79c..d151d33b968a3f897869a85ae08b28db80aaa83a 100644 (file)
@@ -185,6 +185,7 @@ bool smbd_dirptr_get_entry(TALLOC_CTX *ctx,
                           bool (*mode_fn)(TALLOC_CTX *ctx,
                                           void *private_data,
                                           struct smb_filename *smb_fname,
+                                          bool get_dosmode,
                                           uint32_t *_mode),
                           void *private_data,
                           char **_fname,
index cd147f031dae2cf0ab3d44629305b5b2770b46c7..238cd9f1cef8750ebac0c6713f101d077cac5036 100644 (file)
@@ -1708,6 +1708,7 @@ static bool smbd_dirptr_lanman2_match_fn(TALLOC_CTX *ctx,
 static bool smbd_dirptr_lanman2_mode_fn(TALLOC_CTX *ctx,
                                        void *private_data,
                                        struct smb_filename *smb_fname,
+                                       bool get_dosmode,
                                        uint32_t *_mode)
 {
        struct smbd_dirptr_lanman2_state *state =
@@ -1741,7 +1742,7 @@ static bool smbd_dirptr_lanman2_mode_fn(TALLOC_CTX *ctx,
 
        if (ms_dfs_link) {
                mode = dos_mode_msdfs(state->conn, smb_fname);
-       } else {
+       } else if (get_dosmode) {
                mode = dos_mode(state->conn, smb_fname);
        }