]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: smbd: fix a check in stat_cache_add()
authorRalph Boehme <slow@samba.org>
Wed, 27 Jun 2018 11:07:00 +0000 (13:07 +0200)
committerRalph Boehme <slow@samba.org>
Sat, 7 Jul 2018 11:41:09 +0000 (13:41 +0200)
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 <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/smbd/statcache.c

index d49f5eebdf032449ac2c74458264f8898cd59ccf..27f9dec48f76bb26b88196d7cd10ebf0492f4838 100644 (file)
@@ -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;
        }