From 9f41ff47d0efc17cc4bf2f210aa05d2865798386 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 12 Apr 2007 19:16:29 +0000 Subject: 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. (This used to be commit 6b0a8cbbb883b7041ed4b1f6c1ae90233921d154) --- source3/nsswitch/winbindd_cache.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'source3/nsswitch/winbindd_cache.c') diff --git a/source3/nsswitch/winbindd_cache.c b/source3/nsswitch/winbindd_cache.c index 8a1241d8d0..51cba8ec90 100644 --- a/source3/nsswitch/winbindd_cache.c +++ b/source3/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; -- cgit