summaryrefslogtreecommitdiffstats
path: root/source/tdb/tdbtool.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2001-02-13 16:28:48 +0000
committerJeremy Allison <jra@samba.org>2001-02-13 16:28:48 +0000
commit408672d38261e34cc3714200617b35464d88f931 (patch)
tree2ed5e40690e9ce157aceb3fecd0e8d242610464d /source/tdb/tdbtool.c
parenta55a4fea9728550c4d28b05910c0b7d5080714b3 (diff)
downloadsamba-408672d38261e34cc3714200617b35464d88f931.tar.gz
samba-408672d38261e34cc3714200617b35464d88f931.tar.xz
samba-408672d38261e34cc3714200617b35464d88f931.zip
It compiles for me now :-). rpc_server/srv_lsa.c - added fix to allow w2k
clients to join a Samba domain - odd or even domain name length. Needs more testing. Jeremy.
Diffstat (limited to 'source/tdb/tdbtool.c')
-rw-r--r--source/tdb/tdbtool.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/source/tdb/tdbtool.c b/source/tdb/tdbtool.c
index 1b038226d02..27454f73dea 100644
--- a/source/tdb/tdbtool.c
+++ b/source/tdb/tdbtool.c
@@ -89,8 +89,10 @@ tdbtool:
show key : show a record by key
delete key : delete a record by key
free : print the database freelist
- first : print the first record
- next : print the next record
+ 1 | first : print the first record
+ n | next : print the next record
+ q | quit : terminate
+ \\n : repeat 'next' command
");
}
@@ -250,8 +252,10 @@ static void info_tdb(void)
{
int count;
total_bytes = 0;
- count = tdb_traverse(tdb, traverse_fn, NULL);
- printf("%d records totalling %d bytes\n", count, total_bytes);
+ if ((count = tdb_traverse(tdb, traverse_fn, NULL) == -1))
+ printf("Error = %s\n", tdb_errorstr(tdb));
+ else
+ printf("%d records totalling %d bytes\n", count, total_bytes);
}
static char *getline(char *prompt)
@@ -363,11 +367,16 @@ int main(int argc, char *argv[])
info_tdb();
} else if (strcmp(tok, "free") == 0) {
tdb_printfreelist(tdb);
- } else if (strcmp(tok, "first") == 0) {
+ } else if ( (strcmp(tok, "1") == 0) ||
+ (strcmp(tok, "first") == 0)) {
bIterate = 1;
first_record(tdb, &iterate_kbuf);
- } else if (strcmp(tok, "next") == 0) {
+ } else if ((strcmp(tok, "n") == 0) ||
+ (strcmp(tok, "next") == 0)) {
next_record(tdb, &iterate_kbuf);
+ } else if ((strcmp(tok, "q") == 0) ||
+ (strcmp(tok, "quit") == 0)) {
+ break;
} else {
help();
}