diff options
-rw-r--r-- | source3/lib/debug.c | 12 | ||||
-rw-r--r-- | source3/rpc_server/srv_lsa.c | 17 | ||||
-rw-r--r-- | source3/tdb/tdbtool.c | 21 |
3 files changed, 34 insertions, 16 deletions
diff --git a/source3/lib/debug.c b/source3/lib/debug.c index e7772bbd38..119292b781 100644 --- a/source3/lib/debug.c +++ b/source3/lib/debug.c @@ -135,9 +135,9 @@ char *classname_table[] = { /**************************************************************************** utility access to debug class names's ****************************************************************************/ -char* debug_classname_from_index(int idx) +char* debug_classname_from_index(int ndx) { - return classname_table[idx]; + return classname_table[ndx]; } /**************************************************************************** @@ -162,7 +162,7 @@ parse the debug levels from smbcontrol. Example debug level parameter: ****************************************************************************/ BOOL debug_parse_params(char **params, int *debuglevel_class) { - int i, idx; + int i, ndx; char *class_name; char *class_level; @@ -183,8 +183,8 @@ BOOL debug_parse_params(char **params, int *debuglevel_class) for (; i < DBGC_LAST && params[i]; i++) { if ((class_name=strtok(params[i],":")) && (class_level=strtok(NULL, "\0")) && - ((idx = debug_lookup_classname(class_name)) != -1)) { - debuglevel_class[idx] = atoi(class_level); + ((ndx = debug_lookup_classname(class_name)) != -1)) { + debuglevel_class[ndx] = atoi(class_level); } else { DEBUG(0,("debug_parse_params: unrecognized debug class name or format [%s]\n", params[i])); return False; @@ -208,7 +208,7 @@ BOOL debug_parse_levels(char *params_str) ZERO_ARRAY(params); ZERO_ARRAY(debuglevel_class); - if ( (params[0]=strtok(params_str," ,")) ) { + if ((params[0]=strtok(params_str," ,"))) { for (i=1; i<DBGC_LAST;i++) { if ((params[i]=strtok(NULL," ,"))==NULL) break; diff --git a/source3/rpc_server/srv_lsa.c b/source3/rpc_server/srv_lsa.c index b9b7a0328d..3629bb7d8e 100644 --- a/source3/rpc_server/srv_lsa.c +++ b/source3/rpc_server/srv_lsa.c @@ -90,14 +90,23 @@ static void init_dom_query(DOM_QUERY *d_q, char *dom_name, DOM_SID *dom_sid) { int domlen = (dom_name != NULL) ? strlen(dom_name) : 0; + /* + * I'm not sure why this really odd combination of length + * values works, but it does appear to. I need to look at + * this *much* more closely - but at the moment leave alone + * until it's understood. This allows a W2k client to join + * a domain with both odd and even length names... JRA. + */ + + d_q->uni_dom_str_len = domlen ? ((domlen + 1) * 2) : 0; d_q->uni_dom_max_len = domlen * 2; - d_q->uni_dom_str_len = domlen * 2; - - d_q->buffer_dom_name = dom_name ? 1 : 0; - d_q->buffer_dom_sid = dom_sid ? 1 : 0; + d_q->buffer_dom_name = domlen != 0 ? 1 : 0; /* domain buffer pointer */ + d_q->buffer_dom_sid = dom_sid != NULL ? 1 : 0; /* domain sid pointer */ /* this string is supposed to be character short */ init_unistr2(&d_q->uni_domain_name, dom_name, domlen); + d_q->uni_domain_name.uni_max_len++; + if (dom_sid != NULL) init_dom_sid2(&d_q->dom_sid, dom_sid); } 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(); } |