]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
r22202: Volker is clever :-). Use TDB_NOMMAP to prevent any wild pointer
authorJeremy Allison <jra@samba.org>
Thu, 12 Apr 2007 19:16:29 +0000 (19:16 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 17:19:19 +0000 (12:19 -0500)
problems when validating the winbindd cache. Wish I'd have
thought of that.
Jeremy.

source/nsswitch/winbindd_cache.c

index 8a1241d8d09ffa0b3e6ca502fe3fa7b1e9d3fbaa..51cba8ec908b951036f75d082bfcf2d3aeb5b5a8 100644 (file)
@@ -2790,9 +2790,12 @@ int winbindd_validate_cache(void)
                        goto out;
        }
 
+       /* Doh ! Volker is very smart :-). Use TDB_NOMMAP to prevent
+        * any wild pointer references when reading a corrupt tdb file. */
+
        tdb = tdb_open_log(cache_path,
                        WINBINDD_CACHE_TDB_DEFAULT_HASH_SIZE,
-                       lp_winbind_offline_logon() ? TDB_DEFAULT : (TDB_DEFAULT | TDB_CLEAR_IF_FIRST),
+                       lp_winbind_offline_logon() ? TDB_NOMMAP : (TDB_NOMMAP | TDB_CLEAR_IF_FIRST),
                        O_RDWR|O_CREAT, 0600);
        if (!tdb) {
                goto out;