summaryrefslogtreecommitdiff
path: root/source3/libsmb
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2011-08-09 22:15:23 +0200
committerStefan Metzmacher <metze@samba.org>2011-08-10 11:14:55 +0200
commitc6a3dedd99b57345af1b51bad560709319ec8caa (patch)
tree2175d5aee3f7078eb080cff13032241f6121bc8c /source3/libsmb
parenta7265675d5cd41f05a0ebaba43ad36a389419db2 (diff)
downloadsamba-c6a3dedd99b57345af1b51bad560709319ec8caa.tar.gz
samba-c6a3dedd99b57345af1b51bad560709319ec8caa.tar.bz2
samba-c6a3dedd99b57345af1b51bad560709319ec8caa.zip
s3:libsmb: store the remote_realm on the cli_state
metze
Diffstat (limited to 'source3/libsmb')
-rw-r--r--source3/libsmb/cliconnect.c2
-rw-r--r--source3/libsmb/clientgen.c13
-rw-r--r--source3/libsmb/proto.h2
3 files changed, 16 insertions, 1 deletions
diff --git a/source3/libsmb/cliconnect.c b/source3/libsmb/cliconnect.c
index d91d241eaf..f9e845d4e0 100644
--- a/source3/libsmb/cliconnect.c
+++ b/source3/libsmb/cliconnect.c
@@ -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;
}
diff --git a/source3/libsmb/clientgen.c b/source3/libsmb/clientgen.c
index f9bb781980..4689c7aa63 100644
--- a/source3/libsmb/clientgen.c
+++ b/source3/libsmb/clientgen.c
@@ -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;
diff --git a/source3/libsmb/proto.h b/source3/libsmb/proto.h
index b38903aebb..b1ffb4ff39 100644
--- a/source3/libsmb/proto.h
+++ b/source3/libsmb/proto.h
@@ -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);