From: Ralph Boehme Date: Mon, 2 Sep 2019 10:21:56 +0000 (+0200) Subject: s3:smbd: skip write-time fetching for directories. X-Git-Tag: talloc-2.3.1~911 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bdda10875ed1a21a66829206c77a1ffd998c9569;p=thirdparty%2Fsamba.git s3:smbd: skip write-time fetching for directories. The whole logic only applies to files. Signed-off-by: Ralph Boehme Reviewed-by: Jeremy Allison Autobuild-User(master): Jeremy Allison Autobuild-Date(master): Wed Sep 11 00:33:26 UTC 2019 on sn-devel-184 --- diff --git a/source3/smbd/dir.c b/source3/smbd/dir.c index f60812fd8c9..49e8dd17451 100644 --- a/source3/smbd/dir.c +++ b/source3/smbd/dir.c @@ -892,7 +892,7 @@ bool smbd_dirptr_get_entry(TALLOC_CTX *ctx, continue; } - if (ask_sharemode) { + if (ask_sharemode && !S_ISDIR(smb_fname.st.st_ex_mode)) { struct timespec write_time_ts; struct file_id fileid; diff --git a/source3/smbd/smb2_query_directory.c b/source3/smbd/smb2_query_directory.c index dc8c09b8969..aee17cdaed6 100644 --- a/source3/smbd/smb2_query_directory.c +++ b/source3/smbd/smb2_query_directory.c @@ -618,7 +618,9 @@ static bool smb2_query_directory_next_entry(struct tevent_req *req) } } - if (state->async_ask_sharemode) { + if (state->async_ask_sharemode && + !S_ISDIR(smb_fname->st.st_ex_mode)) + { struct tevent_req *subreq = NULL; char *buf = state->base_data + state->last_entry_off;