#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.";
status = smbcli_full_connection(NULL, &c, "masktest",
server,
share, NULL,
- username, lp_workgroup(),
- password);
+ &credentials);
if (!NT_STATUS_IS_OK(status)) {
return NULL;
char *share;
struct smbcli_state *cli;
int opt;
- char *p;
int seed;
setlinebuf(stdout);
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);
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);