From da20d4e5df3c908cc00bf31570892fa5f19853e7 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 13 Feb 2001 16:28:48 +0000 Subject: 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) --- source3/tdb/tdbtool.c | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'source3/tdb/tdbtool.c') 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(); } -- cgit