diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2005-03-21 23:35:58 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:11:09 -0500 |
commit | 13b0776f60f6a0f35a4afc2b3d3c6b5ec9c1ca6a (patch) | |
tree | 8eddfcb0dd18a9cee4c1de4fbd3ee98f05cd27e6 /source4/torture/masktest.c | |
parent | 05bc2d7b2c11a3583a6d1221cfbd618eb6730518 (diff) | |
download | samba-13b0776f60f6a0f35a4afc2b3d3c6b5ec9c1ca6a.tar.gz |
r5929: Use cli_credentials for the SMB functions as well.
Fix a couple of bugs in the new cli_credentials code
(This used to be commit 4ad481cfe5cde514d2ef9646147239f3faaa6173)
Diffstat (limited to 'source4/torture/masktest.c')
-rw-r--r-- | source4/torture/masktest.c | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/source4/torture/masktest.c b/source4/torture/masktest.c index 4c71385ad09..00a0c2688d8 100644 --- a/source4/torture/masktest.c +++ b/source4/torture/masktest.c @@ -25,8 +25,7 @@ #include "libcli/raw/libcliraw.h" #include "system/time.h" -static fstring password; -static fstring username; +static struct cli_credentials credentials; static BOOL showall = False; static BOOL old_list = False; static const char *maskchars = "<>\"?*abc."; @@ -81,8 +80,7 @@ static struct smbcli_state *connect_one(char *share) status = smbcli_full_connection(NULL, &c, "masktest", server, share, NULL, - username, lp_workgroup(), - password); + &credentials); if (!NT_STATUS_IS_OK(status)) { return NULL; @@ -274,7 +272,6 @@ static void usage(void) char *share; struct smbcli_state *cli; int opt; - char *p; int seed; setlinebuf(stdout); @@ -300,9 +297,8 @@ static void usage(void) lp_load(dyn_CONFIGFILE,True,False,False); load_interfaces(); - if (getenv("USER")) { - fstrcpy(username,getenv("USER")); - } + ZERO_STRUCT(credentials); + cli_credentials_guess(&credentials); seed = time(NULL); @@ -326,12 +322,7 @@ static void usage(void) lp_set_cmdline("max protocol", optarg); break; case 'U': - fstrcpy(username,optarg); - p = strchr_m(username,'%'); - if (p) { - *p = 0; - fstrcpy(password, p+1); - } + cli_credentials_parse_string(&credentials, optarg, CRED_SPECIFIED); break; case 's': seed = atoi(optarg); |