summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2008-06-24 14:18:55 +0200
committerVolker Lendecke <vl@samba.org>2008-06-26 13:13:22 +0200
commitd331624fdfe9fc72f1da7fd01c59a1a20cf1c7d7 (patch)
tree2c5abd6a0f47e68519987f92a4ac6a9fbfb818d0
parenta8a0dd4241d3717b9b7273ac44de08c24835eeef (diff)
downloadsamba-d331624fdfe9fc72f1da7fd01c59a1a20cf1c7d7.tar.gz
samba-d331624fdfe9fc72f1da7fd01c59a1a20cf1c7d7.tar.bz2
samba-d331624fdfe9fc72f1da7fd01c59a1a20cf1c7d7.zip
Add server_info to pipes_struct
(This used to be commit d621867bb8767e1c4236d28dd9294a61db6cbb10)
-rw-r--r--source3/auth/auth_util.c16
-rw-r--r--source3/include/ntdomain.h2
-rw-r--r--source3/include/proto.h2
-rw-r--r--source3/rpc_server/srv_pipe.c10
-rw-r--r--source3/rpc_server/srv_pipe_hnd.c9
5 files changed, 39 insertions, 0 deletions
diff --git a/source3/auth/auth_util.c b/source3/auth/auth_util.c
index b1558bceac..998a81b61a 100644
--- a/source3/auth/auth_util.c
+++ b/source3/auth/auth_util.c
@@ -1334,6 +1334,22 @@ struct auth_serversupplied_info *copy_serverinfo(TALLOC_CTX *mem_ctx,
return dst;
}
+/*
+ * Set a new session key. Used in the rpc server where we have to override the
+ * SMB level session key with SystemLibraryDTC
+ */
+
+bool server_info_set_session_key(struct auth_serversupplied_info *info,
+ DATA_BLOB session_key)
+{
+ TALLOC_FREE(info->user_session_key.data);
+
+ info->user_session_key = data_blob_talloc(
+ info, session_key.data, session_key.length);
+
+ return (info->user_session_key.data != NULL);
+}
+
static auth_serversupplied_info *guest_info = NULL;
bool init_guest_info(void)
diff --git a/source3/include/ntdomain.h b/source3/include/ntdomain.h
index caf7e3431c..352d17bd3b 100644
--- a/source3/include/ntdomain.h
+++ b/source3/include/ntdomain.h
@@ -215,6 +215,8 @@ typedef struct pipes_struct {
uint16 vuid; /* points to the unauthenticated user that opened this pipe. */
+ struct auth_serversupplied_info *server_info;
+
fstring name;
fstring pipe_srv_name;
diff --git a/source3/include/proto.h b/source3/include/proto.h
index 1eb5fbda03..6525b838f1 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -122,6 +122,8 @@ NTSTATUS make_serverinfo_from_username(TALLOC_CTX *mem_ctx,
struct auth_serversupplied_info *copy_serverinfo(TALLOC_CTX *mem_ctx,
auth_serversupplied_info *src);
bool init_guest_info(void);
+bool server_info_set_session_key(struct auth_serversupplied_info *info,
+ DATA_BLOB session_key);
NTSTATUS make_server_info_guest(TALLOC_CTX *mem_ctx,
auth_serversupplied_info **server_info);
bool copy_current_user(struct current_user *dst, struct current_user *src);
diff --git a/source3/rpc_server/srv_pipe.c b/source3/rpc_server/srv_pipe.c
index 0987a420d5..04d18d51c9 100644
--- a/source3/rpc_server/srv_pipe.c
+++ b/source3/rpc_server/srv_pipe.c
@@ -694,6 +694,16 @@ static bool pipe_ntlmssp_verify_final(pipes_struct *p, DATA_BLOB *p_resp_blob)
return False;
}
+ TALLOC_FREE(p->server_info);
+
+ p->server_info = copy_serverinfo(p, a->server_info);
+ if (p->server_info == NULL) {
+ DEBUG(0, ("copy_serverinfo failed\n"));
+ return false;
+ }
+
+ server_info_set_session_key(p->server_info, p->session_key);
+
return True;
}
diff --git a/source3/rpc_server/srv_pipe_hnd.c b/source3/rpc_server/srv_pipe_hnd.c
index 1feed1550c..9a57a1bdb3 100644
--- a/source3/rpc_server/srv_pipe_hnd.c
+++ b/source3/rpc_server/srv_pipe_hnd.c
@@ -314,6 +314,15 @@ static void *make_internal_rpc_pipe_p(const char *pipe_name,
return NULL;
}
+ p->server_info = copy_serverinfo(p, conn->server_info);
+ if (p->server_info == NULL) {
+ DEBUG(0, ("open_rpc_pipe_p: copy_serverinfo failed\n"));
+ talloc_destroy(p->mem_ctx);
+ close_policy_by_pipe(p);
+ TALLOC_FREE(p);
+ return NULL;
+ }
+
DLIST_ADD(InternalPipes, p);
memcpy(p->client_address, conn->client_address,