summaryrefslogtreecommitdiff
path: root/source3/smbd/dir.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/smbd/dir.c')
-rw-r--r--source3/smbd/dir.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/source3/smbd/dir.c b/source3/smbd/dir.c
index 5fc2e3719e..6e02401e25 100644
--- a/source3/smbd/dir.c
+++ b/source3/smbd/dir.c
@@ -803,7 +803,8 @@ bool get_dir_entry(TALLOC_CTX *ctx,
SMB_OFF_T *size,
uint32 *mode,
time_t *date,
- bool check_descend)
+ bool check_descend,
+ bool ask_sharemode)
{
const char *dname = NULL;
bool found = False;
@@ -841,8 +842,6 @@ bool get_dir_entry(TALLOC_CTX *ctx,
mask_match_search(filename,mask,False) ||
mangle_mask_match(conn,filename,mask)) {
char mname[13];
- struct timespec write_time_ts;
- struct file_id fileid;
if (!mangle_is_8_3(filename, False, conn->params)) {
if (!name_to_8_3(filename,mname,False,
@@ -885,10 +884,15 @@ bool get_dir_entry(TALLOC_CTX *ctx,
*size = sbuf.st_size;
*date = sbuf.st_mtime;
- fileid = vfs_file_id_from_sbuf(conn, &sbuf);
- get_file_infos(fileid, NULL, &write_time_ts);
- if (!null_timespec(write_time_ts)) {
- *date = convert_timespec_to_time_t(write_time_ts);
+ if (ask_sharemode) {
+ struct timespec write_time_ts;
+ struct file_id fileid;
+
+ fileid = vfs_file_id_from_sbuf(conn, &sbuf);
+ get_file_infos(fileid, NULL, &write_time_ts);
+ if (!null_timespec(write_time_ts)) {
+ *date = convert_timespec_to_time_t(write_time_ts);
+ }
}
DEBUG(3,("get_dir_entry mask=[%s] found %s "