static fstring password;
static fstring username;
static int got_pass;
+static struct cli_credentials *test_creds;
static int max_protocol = -1;
static bool showall = False;
static bool old_list = False;
return NULL;
}
- if (!got_pass) {
- char pwd[256] = {0};
- int rc;
-
- rc = samba_getpass("Password: ", pwd, sizeof(pwd), false, false);
- if (rc == 0) {
- fstrcpy(password, pass);
- }
- }
-
- status = cli_session_setup(c, username,
- password,
- lp_workgroup());
+ status = cli_session_setup_creds(c, test_creds);
if (!NT_STATUS_IS_OK(status)) {
DEBUG(0, ("session setup failed: %s\n", nt_errstr(status)));
return NULL;
max_protocol = lp_client_max_protocol();
+ if (!got_pass) {
+ char pwd[256] = {0};
+ int rc;
+
+ rc = samba_getpass("Password: ", pwd, sizeof(pwd), false, false);
+ if (rc == 0) {
+ fstrcpy(password, pass);
+ }
+ }
+
+ test_creds = cli_session_creds_init(frame,
+ username,
+ lp_workgroup(),
+ NULL, /* realm */
+ password,
+ false, /* use_kerberos */
+ false, /* fallback_after_kerberos */
+ false, /* use_ccache */
+ false); /* password_is_nt_hash */
+ if (test_creds == NULL) {
+ d_printf("cli_session_creds_init() failed.\n");
+ exit(1);
+ }
+
cli = connect_one(share);
if (!cli) {
DEBUG(0,("Failed to connect to %s\n", share));