summaryrefslogtreecommitdiff
path: root/source3/nsswitch
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2007-04-12 19:16:29 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:19:19 -0500
commit9f41ff47d0efc17cc4bf2f210aa05d2865798386 (patch)
tree6e3ad552a27d54b0d2d9b548d4b5f2921588d213 /source3/nsswitch
parenta6fa4b4e56fbd825c7b195933c9da2afced5d39d (diff)
downloadsamba-9f41ff47d0efc17cc4bf2f210aa05d2865798386.tar.gz
samba-9f41ff47d0efc17cc4bf2f210aa05d2865798386.tar.bz2
samba-9f41ff47d0efc17cc4bf2f210aa05d2865798386.zip
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)
Diffstat (limited to 'source3/nsswitch')
-rw-r--r--source3/nsswitch/winbindd_cache.c5
1 files changed, 4 insertions, 1 deletions
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;