Author: jra Date: 2007-04-12 19:16:29 +0000 (Thu, 12 Apr 2007) New Revision: 22202
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=22202 Log: 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. Modified: branches/SAMBA_3_0/source/nsswitch/winbindd_cache.c Changeset: Modified: branches/SAMBA_3_0/source/nsswitch/winbindd_cache.c =================================================================== --- branches/SAMBA_3_0/source/nsswitch/winbindd_cache.c 2007-04-12 15:06:24 UTC (rev 22201) +++ branches/SAMBA_3_0/source/nsswitch/winbindd_cache.c 2007-04-12 19:16:29 UTC (rev 22202) @@ -2790,9 +2790,12 @@ 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;