From: Ralph Boehme Date: Thu, 15 Mar 2018 15:48:38 +0000 (+0100) Subject: smbd: pass get_dosmode to mode_fn in smbd_dirptr_get_entry() X-Git-Tag: ldb-1.5.0~144 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8954085ad713546ea84237bbe355973226fc3cb8;p=thirdparty%2Fsamba.git smbd: pass get_dosmode to mode_fn in smbd_dirptr_get_entry() 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 Reviewed-by: Stefan Metzmacher --- diff --git a/source3/smbd/dir.c b/source3/smbd/dir.c index 8f2f22d3eb1..c3af5233e98 100644 --- a/source3/smbd/dir.c +++ b/source3/smbd/dir.c @@ -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; diff --git a/source3/smbd/globals.h b/source3/smbd/globals.h index e8a1e53a419..d151d33b968 100644 --- a/source3/smbd/globals.h +++ b/source3/smbd/globals.h @@ -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, diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c index cd147f031da..238cd9f1cef 100644 --- a/source3/smbd/trans2.c +++ b/source3/smbd/trans2.c @@ -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); }