summaryrefslogtreecommitdiff
path: root/lib/tdb/tools
diff options
context:
space:
mode:
authorIra Cooper <ira@wakeful.net>2012-01-06 15:45:06 -0800
committerJeremy Allison <jra@samba.org>2012-01-07 02:18:40 +0100
commiteff69aa0f908f5cb44b3cb846c8a4ada874240fa (patch)
tree586ae48d77537986960e89ace18e7566a91c8b2a /lib/tdb/tools
parentb8b98b8908d52a09a5a6ecc36423dc484813a2d5 (diff)
downloadsamba-eff69aa0f908f5cb44b3cb846c8a4ada874240fa.tar.gz
samba-eff69aa0f908f5cb44b3cb846c8a4ada874240fa.tar.bz2
samba-eff69aa0f908f5cb44b3cb846c8a4ada874240fa.zip
Add "repack" command to tdbtool.
Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Sat Jan 7 02:18:41 CET 2012 on sn-devel-104
Diffstat (limited to 'lib/tdb/tools')
-rw-r--r--lib/tdb/tools/tdbtool.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/tdb/tools/tdbtool.c b/lib/tdb/tools/tdbtool.c
index d93f742d1c..dc5747f87a 100644
--- a/lib/tdb/tools/tdbtool.c
+++ b/lib/tdb/tools/tdbtool.c
@@ -61,6 +61,7 @@ enum commands {
CMD_NEXT,
CMD_SYSTEM,
CMD_CHECK,
+ CMD_REPACK,
CMD_QUIT,
CMD_HELP
};
@@ -98,6 +99,7 @@ COMMAND_TABLE cmd_table[] = {
{"quit", CMD_QUIT},
{"q", CMD_QUIT},
{"!", CMD_SYSTEM},
+ {"repack", CMD_REPACK},
{NULL, CMD_HELP}
};
@@ -203,6 +205,7 @@ static void help(void)
" list : print the database hash table and freelist\n"
" free : print the database freelist\n"
" check : check the integrity of an opened database\n"
+" repack : repack the database\n"
" speed : perform speed tests on the database\n"
" ! command : execute system command\n"
" 1 | first : print the first record\n"
@@ -608,6 +611,10 @@ static int do_command(void)
bIterate = 0;
tdb_transaction_commit(tdb);
return 0;
+ case CMD_REPACK:
+ bIterate = 0;
+ tdb_repack(tdb);
+ return 0;
case CMD_TRANSACTION_CANCEL:
bIterate = 0;
tdb_transaction_cancel(tdb);