From: Ralph Boehme Date: Wed, 27 Jun 2018 11:07:00 +0000 (+0200) Subject: s3: smbd: fix a check in stat_cache_add() X-Git-Tag: tevent-0.9.37~77 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4ad2a716fb0733e44f5bc000fb85e31aff83e682;p=thirdparty%2Fsamba.git s3: smbd: fix a check in stat_cache_add() As the comment above the if condition says: /* * If we are in case insentive mode, we don't need to * store names that need no translation - else, it * would be a waste. */ Ie if stat_cache_add() is called as stat_cache_add("foo/bar", "foo/bar", false) There's no need to cache the path, as a simple stat() on the client supplied name (full_orig_name) matches the name used in the filesystem (passed to stat_cache_add() as translated_path). So fix the if condition to match the comment. Signed-off-by: Ralph Boehme Reviewed-by: Jeremy Allison --- diff --git a/source3/smbd/statcache.c b/source3/smbd/statcache.c index d49f5eebdf0..27f9dec48f7 100644 --- a/source3/smbd/statcache.c +++ b/source3/smbd/statcache.c @@ -73,7 +73,7 @@ void stat_cache_add( const char *full_orig_name, * would be a waste. */ - if (case_sensitive && (strcmp(full_orig_name, translated_path) == 0)) { + if (!case_sensitive && (strcmp(full_orig_name, translated_path) == 0)) { return; }