Fix bug 7590 - offline login fails because winbind deletes cache on every startup.
authorJeremy Allison <jra@samba.org>
Tue, 27 Jul 2010 08:54:01 +0000 (01:54 -0700)
committerKarolin Seeger <kseeger@samba.org>
Mon, 27 Sep 2010 19:28:59 +0000 (21:28 +0200)
Sync lib/tdb_validate.c with the change in current master.
Change tdb_validate_open() to always use O_RDWR instead of O_RDONLY,
as (from the bug report): "db_check() will always return failure for a read-only database.
Silently, without any log output, when _tdb_lockall() fails."

Jeremy.
(cherry picked from commit 39cb903463d8a3fcabd9e148112bf5cf81744130)

source3/lib/tdb_validate.c

index a1fb1850db88502949d6f865282909eb8bad66f5..b4d0365dd4fd4fdf684b8fb47ecb764b840729fa 100644 (file)
@@ -192,7 +192,7 @@ int tdb_validate_open(const char *tdb_path, tdb_validate_data_func validate_fn)
 
        DEBUG(5, ("tdb_validate_open called for tdb '%s'\n", tdb_path));
 
-       tdb = tdb_open_log(tdb_path, 0, TDB_DEFAULT, O_RDONLY, 0);
+       tdb = tdb_open_log(tdb_path, 0, TDB_DEFAULT, O_RDWR, 0);
        if (!tdb) {
                DEBUG(1, ("Error opening tdb %s\n", tdb_path));
                return ret;