summaryrefslogtreecommitdiff
path: root/source3/tdb/tdbtool.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2000-01-02 23:00:27 +0000
committerAndrew Tridgell <tridge@samba.org>2000-01-02 23:00:27 +0000
commit9a781a8c6de9513ba5f4cafef41379fae96807c1 (patch)
treed9bd28fba6ccdaabe43d2183200310cb6bc4d283 /source3/tdb/tdbtool.c
parent321983bb6b68b5fe18f1021dc5851ce3bb0de625 (diff)
downloadsamba-9a781a8c6de9513ba5f4cafef41379fae96807c1.tar.gz
samba-9a781a8c6de9513ba5f4cafef41379fae96807c1.tar.bz2
samba-9a781a8c6de9513ba5f4cafef41379fae96807c1.zip
- added tdb_flags option to tdb_open()
- added TDB_CLEAR_IF_FIRST flag to clear the database if this is the first attached process. Useful for non-persistent databases like our locking area (this will also make upgrades to new database layouts easier) - use lock_path() in a couple of places - leave connections database open while smbd running - cleaned up some tdb code a little, using macros for constants (This used to be commit 00e9da3ca577527db392aced62f02c69cfee8f4f)
Diffstat (limited to 'source3/tdb/tdbtool.c')
-rw-r--r--source3/tdb/tdbtool.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/source3/tdb/tdbtool.c b/source3/tdb/tdbtool.c
index 5eb410d418..428bae84c2 100644
--- a/source3/tdb/tdbtool.c
+++ b/source3/tdb/tdbtool.c
@@ -41,7 +41,8 @@ static void create_tdb(void)
return;
}
if (tdb) tdb_close(tdb);
- tdb = tdb_open(tok, 0, O_RDWR | O_CREAT | O_TRUNC, 0600);
+ tdb = tdb_open(tok, 0, TDB_CLEAR_IF_FIRST,
+ O_RDWR | O_CREAT | O_TRUNC, 0600);
}
static void open_tdb(void)
@@ -52,7 +53,7 @@ static void open_tdb(void)
return;
}
if (tdb) tdb_close(tdb);
- tdb = tdb_open(tok, 0, O_RDWR, 0600);
+ tdb = tdb_open(tok, 0, 0, O_RDWR, 0600);
}
static void insert_tdb(void)