summaryrefslogtreecommitdiff
path: root/source3/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
commitda20d4e5df3c908cc00bf31570892fa5f19853e7 (patch)
tree5e4b59ca754f52845989f62ad25f08233b206ad4 /source3/tdb/tdbtool.c
parent3d528fef2f75e0cb8d7812e164d249226e889f80 (diff)
downloadsamba-da20d4e5df3c908cc00bf31570892fa5f19853e7.tar.gz
samba-da20d4e5df3c908cc00bf31570892fa5f19853e7.tar.bz2
samba-da20d4e5df3c908cc00bf31570892fa5f19853e7.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. (This used to be commit 408672d38261e34cc3714200617b35464d88f931)
Diffstat (limited to 'source3/tdb/tdbtool.c')
-rw-r--r--source3/tdb/tdbtool.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/source3/tdb/tdbtool.c b/source3/tdb/tdbtool.c
index 1b038226d0..27454f73de 100644
--- a/source3/tdb/tdbtool.c
+++ b/source3/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();
}