mirror of
https://github.com/samba-team/samba.git
synced 2025-01-12 09:18:10 +03:00
s3:locktest2: use cli_session_creds_init() directly
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
This commit is contained in:
parent
719a2f5898
commit
2723a8ed89
@ -177,6 +177,11 @@ static struct cli_state *connect_one(char *share)
|
||||
fstring myname;
|
||||
static int count;
|
||||
NTSTATUS nt_status;
|
||||
bool use_kerberos = false;
|
||||
bool fallback_after_kerberos = false;
|
||||
bool use_ccache = false;
|
||||
bool pw_nt_hash = false;
|
||||
struct cli_credentials *creds = NULL;
|
||||
|
||||
fstrcpy(server,share+2);
|
||||
share = strchr_m(server,'\\');
|
||||
@ -196,12 +201,25 @@ static struct cli_state *connect_one(char *share)
|
||||
}
|
||||
}
|
||||
|
||||
creds = cli_session_creds_init(NULL,
|
||||
username,
|
||||
lp_workgroup(),
|
||||
NULL, /* realm (use default) */
|
||||
password,
|
||||
use_kerberos,
|
||||
fallback_after_kerberos,
|
||||
use_ccache,
|
||||
pw_nt_hash);
|
||||
if (creds == NULL) {
|
||||
DEBUG(0, ("cli_session_creds_init failed\n"));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
slprintf(myname,sizeof(myname), "lock-%lu-%u", (unsigned long)getpid(), count++);
|
||||
|
||||
nt_status = cli_full_connection(&c, myname, server_n, NULL, 0, share, "?????",
|
||||
username, lp_workgroup(), password, 0,
|
||||
SMB_SIGNING_DEFAULT);
|
||||
|
||||
nt_status = cli_full_connection_creds(&c, myname, server_n, NULL, 0, share, "?????",
|
||||
creds, 0, SMB_SIGNING_DEFAULT);
|
||||
TALLOC_FREE(creds);
|
||||
if (!NT_STATUS_IS_OK(nt_status)) {
|
||||
DEBUG(0, ("cli_full_connection failed with error %s\n", nt_errstr(nt_status)));
|
||||
return NULL;
|
||||
|
Loading…
Reference in New Issue
Block a user