diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2005-03-22 19:30:59 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:11:11 -0500 |
commit | 88a5f8b26f4ba2c4d0a01354339a670a5b1c8f3e (patch) | |
tree | 7a1c42b373d19b16f81de680e9b87d51474f8176 /source4/torture/locktest.c | |
parent | 1bb3e99d063332ac9d8af92cb3210465cfa66fb4 (diff) | |
download | samba-88a5f8b26f4ba2c4d0a01354339a670a5b1c8f3e.tar.gz samba-88a5f8b26f4ba2c4d0a01354339a670a5b1c8f3e.tar.xz samba-88a5f8b26f4ba2c4d0a01354339a670a5b1c8f3e.zip |
r5963: Fix parameter passing for gentest and locktest
(This used to be commit 28914c89dc1400d8364c13258ec0e8558acc7dfd)
Diffstat (limited to 'source4/torture/locktest.c')
-rw-r--r-- | source4/torture/locktest.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/source4/torture/locktest.c b/source4/torture/locktest.c index 005f9af71b..4051f9c411 100644 --- a/source4/torture/locktest.c +++ b/source4/torture/locktest.c @@ -47,7 +47,7 @@ static BOOL zero_zero; #define NASTY_POSIX_LOCK_HACK 0 -static struct cli_credentials servers[NSERVERS]; +static struct cli_credentials *servers[NSERVERS]; enum lock_op {OP_LOCK, OP_UNLOCK, OP_REOPEN}; @@ -121,7 +121,7 @@ static struct smbcli_state *connect_one(char *share, int snum) status = smbcli_full_connection(NULL, &c, myname, server, share, NULL, - &servers[snum]); + servers[snum]); if (!NT_STATUS_IS_OK(status)) { sleep(2); } @@ -477,13 +477,16 @@ static void usage(void) lp_load(dyn_CONFIGFILE,True,False,False); load_interfaces(); + servers[0] = cli_credentials_init(talloc_autofree_context()); + servers[1] = cli_credentials_init(talloc_autofree_context()); + 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[0], optarg, CRED_SPECIFIED); + i = servers[0]->username?1:0; + cli_credentials_parse_string(servers[i], optarg, CRED_SPECIFIED); break; case 'R': @@ -531,13 +534,13 @@ static void usage(void) } } - if (!servers[0].username) { + if (!servers[0]->username) { usage(); return -1; } - if (!servers[1].username) { - servers[1].username = servers[0].username; - servers[1].password = servers[0].password; + if (!servers[1]->username) { + servers[1]->username = servers[0]->username; + servers[1]->password = servers[0]->password; } locktest_init_subsystems; |