summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2005-04-30 09:59:17 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:16:23 -0500
commit3f4093de8a5ca656cd184bdd6d2dd3e9d148d069 (patch)
treeef911252fa9e6bb403601e7149b24af6678b39e1
parent7b03af89637bcfad343e4d2aa8aad11fe2bbd55a (diff)
downloadsamba-3f4093de8a5ca656cd184bdd6d2dd3e9d148d069.tar.gz
samba-3f4093de8a5ca656cd184bdd6d2dd3e9d148d069.tar.bz2
samba-3f4093de8a5ca656cd184bdd6d2dd3e9d148d069.zip
r6531: fixed gentest with new credentials code
(This used to be commit 3e610e3952867658a59424301a6ef0573e0a0c1f)
-rw-r--r--source4/torture/gentest.c23
1 files changed, 16 insertions, 7 deletions
diff --git a/source4/torture/gentest.c b/source4/torture/gentest.c
index 3e13bf12c0..fce36188af 100644
--- a/source4/torture/gentest.c
+++ b/source4/torture/gentest.c
@@ -2101,7 +2101,7 @@ static void usage(void)
int main(int argc, char *argv[])
{
int opt;
- int i;
+ int i, username_count=0;
BOOL ret;
setlinebuf(stdout);
@@ -2130,6 +2130,11 @@ static void usage(void)
lp_load(dyn_CONFIGFILE,True,False,False);
load_interfaces();
+ servers[0].credentials = cli_credentials_init(talloc_autofree_context());
+ servers[1].credentials = cli_credentials_init(talloc_autofree_context());
+ cli_credentials_guess(servers[0].credentials);
+ cli_credentials_guess(servers[1].credentials);
+
options.seed = time(NULL);
options.numops = 1000;
options.max_open_handles = 20;
@@ -2138,8 +2143,13 @@ static void usage(void)
while ((opt = getopt(argc, argv, "U:s:o:ad:i:AOhS:LFXC")) != EOF) {
switch (opt) {
case 'U':
- i = servers[0].credentials->username?1:0;
- cli_credentials_parse_string(servers[i].credentials, optarg, CRED_SPECIFIED);
+ if (username_count == 2) {
+ usage();
+ exit(1);
+ }
+ cli_credentials_parse_string(servers[username_count].credentials,
+ optarg, CRED_SPECIFIED);
+ username_count++;
break;
case 'd':
DEBUGLEVEL = atoi(optarg);
@@ -2189,13 +2199,12 @@ static void usage(void)
gentest_init_subsystems;
- if (!servers[0].credentials->username) {
+ if (username_count == 0) {
usage();
return -1;
}
- if (!servers[1].credentials->username) {
- servers[1].credentials->username = servers[0].credentials->username;
- servers[1].credentials->password = servers[0].credentials->password;
+ if (username_count == 1) {
+ servers[1].credentials = servers[0].credentials;
}
printf("seed=%u\n", options.seed);