summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2002-01-03 22:48:48 +0000
committerJeremy Allison <jra@samba.org>2002-01-03 22:48:48 +0000
commiteca99f5c226f9518d1ab5c0ba3e586e3d59564d7 (patch)
tree6ac655522c7add955591f37295d07b86d8d7ff7e /source3
parentb4e634f43640dd926009bf5020c262490965c501 (diff)
downloadsamba-eca99f5c226f9518d1ab5c0ba3e586e3d59564d7.tar.gz
samba-eca99f5c226f9518d1ab5c0ba3e586e3d59564d7.tar.bz2
samba-eca99f5c226f9518d1ab5c0ba3e586e3d59564d7.zip
Fixed nasty cast of tdb_delete in traversals.
Jeremy. (This used to be commit a0cdec3acc82d1ce0292fadd4b8dac23638450f3)
Diffstat (limited to 'source3')
-rw-r--r--source3/groupdb/mapping.c2
-rw-r--r--source3/intl/lang_tdb.c2
-rw-r--r--source3/lib/account_pol.c2
-rw-r--r--source3/printing/nt_printing.c2
-rw-r--r--source3/printing/printing.c2
-rw-r--r--source3/rpc_server/srv_srvsvc_nt.c2
-rw-r--r--source3/tdb/tdbutil.c11
7 files changed, 17 insertions, 6 deletions
diff --git a/source3/groupdb/mapping.c b/source3/groupdb/mapping.c
index 39445d8d4e..7b44596256 100644
--- a/source3/groupdb/mapping.c
+++ b/source3/groupdb/mapping.c
@@ -161,7 +161,7 @@ BOOL init_group_mapping(void)
/* handle a Samba upgrade */
tdb_lock_bystring(tdb, vstring);
if (tdb_fetch_int(tdb, vstring) != DATABASE_VERSION) {
- tdb_traverse(tdb, (tdb_traverse_func)tdb_delete, NULL);
+ tdb_traverse(tdb, tdb_traverse_delete_fn, NULL);
tdb_store_int(tdb, vstring, DATABASE_VERSION);
}
tdb_unlock_bystring(tdb, vstring);
diff --git a/source3/intl/lang_tdb.c b/source3/intl/lang_tdb.c
index 36f8020bbe..6f9ff9dd65 100644
--- a/source3/intl/lang_tdb.c
+++ b/source3/intl/lang_tdb.c
@@ -44,7 +44,7 @@ static BOOL load_msg(const char *msg_file)
if (tdb_lockall(tdb) != 0) return False;
/* wipe the db */
- tdb_traverse(tdb, (tdb_traverse_func) tdb_delete, NULL);
+ tdb_traverse(tdb, tdb_traverse_delete_fn, NULL);
msgid = NULL;
diff --git a/source3/lib/account_pol.c b/source3/lib/account_pol.c
index 33579108fa..111bf5bb91 100644
--- a/source3/lib/account_pol.c
+++ b/source3/lib/account_pol.c
@@ -44,7 +44,7 @@ BOOL init_account_policy(void)
/* handle a Samba upgrade */
tdb_lock_bystring(tdb, vstring);
if (tdb_fetch_int(tdb, vstring) != DATABASE_VERSION) {
- tdb_traverse(tdb, (tdb_traverse_func)tdb_delete, NULL);
+ tdb_traverse(tdb, tdb_traverse_delete_fn, NULL);
tdb_store_int(tdb, vstring, DATABASE_VERSION);
account_policy_set(AP_MIN_PASSWORD_LEN, MINPASSWDLENGTH); /* 5 chars minimum */
diff --git a/source3/printing/nt_printing.c b/source3/printing/nt_printing.c
index b2e7a096e9..7c56512173 100644
--- a/source3/printing/nt_printing.c
+++ b/source3/printing/nt_printing.c
@@ -269,7 +269,7 @@ BOOL nt_printing_init(void)
if (!upgrade_to_version_2())
return False;
} else
- tdb_traverse(tdb_drivers, (tdb_traverse_func)tdb_delete, NULL);
+ tdb_traverse(tdb_drivers, tdb_traverse_delete_fn, NULL);
tdb_store_int(tdb_drivers, vstring, NTDRIVERS_DATABASE_VERSION);
}
diff --git a/source3/printing/printing.c b/source3/printing/printing.c
index 0a97cb52b3..ab966bd9f2 100644
--- a/source3/printing/printing.c
+++ b/source3/printing/printing.c
@@ -64,7 +64,7 @@ BOOL print_backend_init(void)
/* handle a Samba upgrade */
tdb_lock_bystring(tdb, sversion);
if (tdb_fetch_int(tdb, sversion) != PRINT_DATABASE_VERSION) {
- tdb_traverse(tdb, (tdb_traverse_func)tdb_delete, NULL);
+ tdb_traverse(tdb, tdb_traverse_delete_fn, NULL);
tdb_store_int(tdb, sversion, PRINT_DATABASE_VERSION);
}
tdb_unlock_bystring(tdb, sversion);
diff --git a/source3/rpc_server/srv_srvsvc_nt.c b/source3/rpc_server/srv_srvsvc_nt.c
index 57757e28b5..f37096fec3 100644
--- a/source3/rpc_server/srv_srvsvc_nt.c
+++ b/source3/rpc_server/srv_srvsvc_nt.c
@@ -136,7 +136,7 @@ BOOL share_info_db_init(void)
/* handle a Samba upgrade */
tdb_lock_bystring(share_tdb, vstring);
if (tdb_fetch_int(share_tdb, vstring) != SHARE_DATABASE_VERSION) {
- tdb_traverse(share_tdb, (tdb_traverse_func)tdb_delete, NULL);
+ tdb_traverse(share_tdb, tdb_traverse_delete_fn, NULL);
tdb_store_int(share_tdb, vstring, SHARE_DATABASE_VERSION);
}
tdb_unlock_bystring(share_tdb, vstring);
diff --git a/source3/tdb/tdbutil.c b/source3/tdb/tdbutil.c
index 9e24562118..22ead16e1f 100644
--- a/source3/tdb/tdbutil.c
+++ b/source3/tdb/tdbutil.c
@@ -399,3 +399,14 @@ TDB_CONTEXT *tdb_open_log(char *name, int hash_size, int tdb_flags,
return tdb;
}
+
+
+/****************************************************************************
+ Allow tdb_delete to be used as a tdb_traversal_fn.
+****************************************************************************/
+
+int tdb_traverse_delete_fn(TDB_CONTEXT *the_tdb, TDB_DATA key, TDB_DATA dbuf,
+ void *state)
+{
+ return tdb_delete(the_tdb, key);
+}