From 68269bde7c0588a4202103b582ee78049fe89332 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 30 Apr 2005 09:47:32 +0000 Subject: r6529: fixed locktest with new credentials code (This used to be commit 70b4a687c01a05b752438f39146ad0a240c976d5) --- source4/torture/locktest.c | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) (limited to 'source4') diff --git a/source4/torture/locktest.c b/source4/torture/locktest.c index fe5dfe5178..a655125344 100644 --- a/source4/torture/locktest.c +++ b/source4/torture/locktest.c @@ -454,7 +454,8 @@ static void usage(void) { char *share[NSERVERS]; int opt; - int seed, server, i; + int seed, server; + int username_count=0; setlinebuf(stdout); @@ -480,15 +481,21 @@ static void usage(void) servers[0] = cli_credentials_init(talloc_autofree_context()); servers[1] = cli_credentials_init(talloc_autofree_context()); + cli_credentials_guess(servers[0]); + cli_credentials_guess(servers[1]); seed = time(NULL); while ((opt = getopt(argc, argv, "U:s:ho:aAW:OR:B:M:EZW:")) != EOF) { switch (opt) { case 'U': - i = servers[0]->username?1:0; - cli_credentials_parse_string(servers[i], optarg, CRED_SPECIFIED); - + if (username_count == 2) { + usage(); + exit(1); + } + cli_credentials_parse_string(servers[username_count], + optarg, CRED_SPECIFIED); + username_count++; break; case 'R': lock_range = strtol(optarg, NULL, 0); @@ -535,13 +542,12 @@ static void usage(void) } } - if (!servers[0]->username) { + if (username_count == 0) { usage(); return -1; } - if (!servers[1]->username) { - servers[1]->username = servers[0]->username; - servers[1]->password = servers[0]->password; + if (username_count == 1) { + servers[1] = servers[0]; } locktest_init_subsystems; @@ -557,3 +563,4 @@ static void usage(void) return(0); } + -- cgit