From 19f49de92e176495f3e0640502d4a330eacbf59e Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Mon, 7 Apr 2008 09:21:19 +0200 Subject: smbd: make it possible to disable get_file_infos() on searches metze (This used to be commit 404a865a34c3a7c67131b3f99e92c11b2abe3e39) --- source3/smbd/dir.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'source3/smbd/dir.c') 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 " -- cgit