diff options
author | Andrew Tridgell <tridge@samba.org> | 2003-08-13 16:04:21 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2003-08-13 16:04:21 +0000 |
commit | 75c0125fb71b0562e7bdd85c391764796b5f12f6 (patch) | |
tree | b589d2e6bbc2c517a3f79790d0ed309ef79f7507 /source4/torture/torture.c | |
parent | a3b86fe170beb70ffab8585a276ca1648fffd454 (diff) | |
download | samba-75c0125fb71b0562e7bdd85c391764796b5f12f6.tar.gz samba-75c0125fb71b0562e7bdd85c391764796b5f12f6.tar.bz2 samba-75c0125fb71b0562e7bdd85c391764796b5f12f6.zip |
- added SMBntrename test suite
- allow username of form DOMAIN\username or DOMAIN/username
- added ntrename to gentest
(This used to be commit 2b464472c17b791eb5b117f89d5aaea2bf60f6ad)
Diffstat (limited to 'source4/torture/torture.c')
-rw-r--r-- | source4/torture/torture.c | 46 |
1 files changed, 24 insertions, 22 deletions
diff --git a/source4/torture/torture.c b/source4/torture/torture.c index 05a2979dd1..a43db896e0 100644 --- a/source4/torture/torture.c +++ b/source4/torture/torture.c @@ -106,6 +106,7 @@ BOOL torture_open_connection(struct cli_state **c) username, lp_workgroup(), password, flags, &retry); if (!NT_STATUS_IS_OK(status)) { + printf("Failed to open connection - %s\n", nt_errstr(status)); return False; } @@ -3986,6 +3987,25 @@ static BOOL run_test(const char *name) } +/* + parse a username%password +*/ +static void parse_user(const char *user) +{ + char *username, *password, *p; + + username = strdup(user); + p = strchr_m(username,'%'); + if (p) { + *p = 0; + password = strdup(p+1); + } + + lp_set_cmdline("torture:username", username); + lp_set_cmdline("torture:password", password); +} + + static void usage(void) { int i; @@ -4030,9 +4050,8 @@ static void usage(void) int opt, i; char *p; int gotuser = 0; - int gotpass = 0; BOOL correct = True; - char *host, *share, *username, *password; + char *host, *share, *username; setup_logging("smbtorture", DEBUG_STDOUT); @@ -4129,15 +4148,7 @@ static void usage(void) break; case 'U': gotuser = 1; - username = strdup(optarg); - p = strchr_m(username,'%'); - if (p) { - *p = 0; - password = strdup(p+1); - gotpass = 1; - } - lp_set_cmdline("torture:username", username); - lp_set_cmdline("torture:password", password); + parse_user(optarg); break; case 'f': torture_failures = atoi(optarg); @@ -4152,18 +4163,9 @@ static void usage(void) } } - if(use_kerberos && !gotuser) gotpass = True; - - while (!gotpass) { - p = getpass("Password:"); - if (p) { - lp_set_cmdline("torture:password", p); - gotpass = 1; - } - } - printf("host=%s share=%s user=%s myname=%s\n", - host, share, username, lp_netbios_name()); + host, share, lp_parm_string(-1, "torture", "username"), + lp_netbios_name()); if (argc == optind) { printf("You must specify a test to run, or 'ALL'\n"); |