summaryrefslogtreecommitdiffstats
path: root/source3/smbd/filename.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/smbd/filename.c')
-rw-r--r--source3/smbd/filename.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/source3/smbd/filename.c b/source3/smbd/filename.c
index ee9ce3f835..a88829de9d 100644
--- a/source3/smbd/filename.c
+++ b/source3/smbd/filename.c
@@ -150,7 +150,11 @@ static void stat_cache_add( char *full_orig_name, char *orig_translated_path)
stat_cache_entry *scp;
pstring orig_name;
pstring translated_path;
- int namelen = strlen(orig_translated_path);
+ int namelen;
+
+ if (!lp_stat_cache()) return;
+
+ namelen = strlen(orig_translated_path);
/*
* Don't cache trivial valid directory entries.
@@ -235,8 +239,12 @@ static BOOL stat_cache_lookup( char *name, char *dirpath, char **start, SMB_STRU
{
stat_cache_entry *scp;
stat_cache_entry *longest_hit = NULL;
- int namelen = strlen(name);
+ int namelen;
+
+ if (!lp_stat_cache()) return False;
+ namelen = strlen(name);
+
*start = name;
global_stat_cache_lookups++;