From: Jeremy Allison Date: Thu, 12 Apr 2007 19:16:29 +0000 (+0000) Subject: r22202: Volker is clever :-). Use TDB_NOMMAP to prevent any wild pointer X-Git-Tag: samba-misc-tags/initial-v3-0-unstable~725 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6b0a8cbbb883b7041ed4b1f6c1ae90233921d154;p=thirdparty%2Fsamba.git r22202: Volker is clever :-). Use TDB_NOMMAP to prevent any wild pointer problems when validating the winbindd cache. Wish I'd have thought of that. Jeremy. --- diff --git a/source/nsswitch/winbindd_cache.c b/source/nsswitch/winbindd_cache.c index 8a1241d8d09..51cba8ec908 100644 --- a/source/nsswitch/winbindd_cache.c +++ b/source/nsswitch/winbindd_cache.c @@ -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;