diff options
Diffstat (limited to 'source4')
-rw-r--r-- | source4/torture/locktest.c | 23 |
1 files changed, 15 insertions, 8 deletions
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); } + |