diff options
author | Stefan Metzmacher <metze@samba.org> | 2004-05-22 14:40:49 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:53:52 -0500 |
commit | 2941d3233cc6f2cf6f031ee1254610219f12652a (patch) | |
tree | 5b88d6a58b1edd27b333a40ccf2525bc02c12b08 /source4 | |
parent | 1ca75ec3bb5d001958d02a8d05a63c44269e57b8 (diff) | |
download | samba-2941d3233cc6f2cf6f031ee1254610219f12652a.tar.gz samba-2941d3233cc6f2cf6f031ee1254610219f12652a.tar.bz2 samba-2941d3233cc6f2cf6f031ee1254610219f12652a.zip |
r821: prompt user for password if not given by -U user%pass
and not as torture:password in smb.conf
metze
(This used to be commit 9de377a914292be19cdffd1020d613d50df7f4e6)
Diffstat (limited to 'source4')
-rw-r--r-- | source4/torture/torture.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/source4/torture/torture.c b/source4/torture/torture.c index 78674990e8..a3669129de 100644 --- a/source4/torture/torture.c +++ b/source4/torture/torture.c @@ -4128,7 +4128,7 @@ static BOOL run_test(const char *name) */ static void parse_user(const char *user) { - char *username, *password, *p; + char *username, *password = NULL, *p; username = strdup(user); p = strchr_m(username,'%'); @@ -4138,9 +4138,17 @@ static void parse_user(const char *user) } lp_set_cmdline("torture:username", username); - lp_set_cmdline("torture:password", password); -} + if (password) { + lp_set_cmdline("torture:password", password); + } + + if (!lp_parm_string(-1,"torture","password")) { + password = getpass("password:"); + + lp_set_cmdline("torture:password", password); + } +} static void usage(void) { @@ -4310,6 +4318,10 @@ static void usage(void) } } + if (!lp_parm_string(-1,"torture","password")) { + lp_set_cmdline("torture:password", ""); + } + if (argc == optind) { printf("You must specify a test to run, or 'ALL'\n"); } else { |