mirror of
https://github.com/samba-team/samba.git
synced 2025-10-25 19:33:18 +03:00
s3:libsmb: store the remote_realm on the cli_state
metze
This commit is contained in:
@@ -124,6 +124,7 @@ struct cli_state {
|
||||
struct sockaddr_storage local_ss;
|
||||
struct sockaddr_storage remote_ss;
|
||||
const char *remote_name;
|
||||
const char *remote_realm;
|
||||
struct tevent_req *read_smb_req;
|
||||
struct tevent_queue *outgoing;
|
||||
struct tevent_req **pending;
|
||||
|
||||
@@ -2871,7 +2871,7 @@ NTSTATUS cli_connect_nb(const char *host, const struct sockaddr_storage *dest_ss
|
||||
goto fail;
|
||||
}
|
||||
|
||||
cli = cli_state_create(NULL, fd, desthost, signing_state);
|
||||
cli = cli_state_create(NULL, fd, desthost, NULL, signing_state);
|
||||
if (cli == NULL) {
|
||||
goto fail;
|
||||
}
|
||||
|
||||
@@ -164,6 +164,7 @@ NTSTATUS cli_init_creds(struct cli_state *cli, const char *username, const char
|
||||
struct cli_state *cli_state_create(TALLOC_CTX *mem_ctx,
|
||||
int fd,
|
||||
const char *remote_name,
|
||||
const char *remote_realm,
|
||||
int signing_state)
|
||||
{
|
||||
struct cli_state *cli = NULL;
|
||||
@@ -243,6 +244,13 @@ struct cli_state *cli_state_create(TALLOC_CTX *mem_ctx,
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (remote_realm) {
|
||||
cli->conn.remote_realm = talloc_strdup(cli, remote_realm);
|
||||
if (cli->conn.remote_realm == NULL) {
|
||||
goto error;
|
||||
}
|
||||
}
|
||||
|
||||
cli->conn.fd = fd;
|
||||
|
||||
ss_length = sizeof(cli->conn.local_ss);
|
||||
@@ -381,6 +389,11 @@ const char *cli_state_remote_name(struct cli_state *cli)
|
||||
return cli->conn.remote_name;
|
||||
}
|
||||
|
||||
const char *cli_state_remote_realm(struct cli_state *cli)
|
||||
{
|
||||
return cli->conn.remote_realm;
|
||||
}
|
||||
|
||||
uint16_t cli_state_get_vc_num(struct cli_state *cli)
|
||||
{
|
||||
return cli->smb1.vc_num;
|
||||
|
||||
@@ -162,6 +162,7 @@ NTSTATUS cli_init_creds(struct cli_state *cli, const char *username, const char
|
||||
struct cli_state *cli_state_create(TALLOC_CTX *mem_ctx,
|
||||
int fd,
|
||||
const char *remote_name,
|
||||
const char *remote_realm,
|
||||
int signing_state);
|
||||
bool cli_state_encryption_on(struct cli_state *cli);
|
||||
void cli_nt_pipes_close(struct cli_state *cli);
|
||||
@@ -170,6 +171,7 @@ void cli_sockopt(struct cli_state *cli, const char *options);
|
||||
const struct sockaddr_storage *cli_state_local_sockaddr(struct cli_state *cli);
|
||||
const struct sockaddr_storage *cli_state_remote_sockaddr(struct cli_state *cli);
|
||||
const char *cli_state_remote_name(struct cli_state *cli);
|
||||
const char *cli_state_remote_realm(struct cli_state *cli);
|
||||
uint16_t cli_state_get_vc_num(struct cli_state *cli);
|
||||
uint16 cli_setpid(struct cli_state *cli, uint16 pid);
|
||||
uint16_t cli_getpid(struct cli_state *cli);
|
||||
|
||||
@@ -806,7 +806,9 @@ static NTSTATUS cm_prepare_connection(const struct winbindd_domain *domain,
|
||||
goto done;
|
||||
}
|
||||
|
||||
*cli = cli_state_create(NULL, sockfd, controller, Undefined);
|
||||
*cli = cli_state_create(NULL, sockfd,
|
||||
controller, domain->alt_name,
|
||||
Undefined);
|
||||
if (*cli == NULL) {
|
||||
DEBUG(1, ("Could not cli_initialize\n"));
|
||||
result = NT_STATUS_NO_MEMORY;
|
||||
|
||||
Reference in New Issue
Block a user