diff options
author | Andrew Tridgell <tridge@samba.org> | 2005-04-30 09:47:32 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:16:23 -0500 |
commit | 68269bde7c0588a4202103b582ee78049fe89332 (patch) | |
tree | f071b2af5e10a49f079f7e878d65ac4c950495c9 /source4/torture | |
parent | 98549af7bf1932bbc78a07053f193b24bd8685f7 (diff) | |
download | samba-68269bde7c0588a4202103b582ee78049fe89332.tar.gz samba-68269bde7c0588a4202103b582ee78049fe89332.tar.bz2 samba-68269bde7c0588a4202103b582ee78049fe89332.zip |
r6529: fixed locktest with new credentials code
(This used to be commit 70b4a687c01a05b752438f39146ad0a240c976d5)
Diffstat (limited to 'source4/torture')
-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); } + |