summaryrefslogtreecommitdiff
path: root/source3/rpc_server/srv_pipe_hnd.c
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2009-08-31 20:21:40 +0200
committerGünther Deschner <gd@samba.org>2009-09-16 18:00:03 +0200
commit44e44310d1871fe94728573fa162a454caba3d12 (patch)
tree3ccf836b9db26374a5bcea8c16b8253a61776a07 /source3/rpc_server/srv_pipe_hnd.c
parent5ddde4e19dfb6a65d9b5b5cf11d5742e2b82e02b (diff)
downloadsamba-44e44310d1871fe94728573fa162a454caba3d12.tar.gz
samba-44e44310d1871fe94728573fa162a454caba3d12.tar.bz2
samba-44e44310d1871fe94728573fa162a454caba3d12.zip
s3-netlogon: support validation level 6 in netr_SamLogon calls.
Guenther
Diffstat (limited to 'source3/rpc_server/srv_pipe_hnd.c')
-rw-r--r--source3/rpc_server/srv_pipe_hnd.c51
1 files changed, 51 insertions, 0 deletions
diff --git a/source3/rpc_server/srv_pipe_hnd.c b/source3/rpc_server/srv_pipe_hnd.c
index b13e34be07..7711d6ced8 100644
--- a/source3/rpc_server/srv_pipe_hnd.c
+++ b/source3/rpc_server/srv_pipe_hnd.c
@@ -1716,3 +1716,54 @@ NTSTATUS serverinfo_to_SamInfo3(struct auth_serversupplied_info *server_info,
return NT_STATUS_OK;
}
+
+/****************************************************************************
+ inits a netr_SamInfo6 structure from an auth_serversupplied_info. sam6 must
+ already be initialized and is used as the talloc parent for its members.
+*****************************************************************************/
+
+NTSTATUS serverinfo_to_SamInfo6(struct auth_serversupplied_info *server_info,
+ uint8_t *pipe_session_key,
+ size_t pipe_session_key_len,
+ struct netr_SamInfo6 *sam6)
+{
+ NTSTATUS status;
+ struct pdb_domain_info *dominfo;
+
+ if ((pdb_capabilities() & PDB_CAP_ADS) == 0) {
+ DEBUG(10,("Not adding validation info level 6 "
+ "without ADS passdb backend\n"));
+ return NT_STATUS_INVALID_INFO_CLASS;
+ }
+
+ dominfo = pdb_get_domain_info(sam6);
+ if (dominfo == NULL) {
+ return NT_STATUS_NO_MEMORY;
+ }
+
+ status = serverinfo_to_SamInfo_base(sam6,
+ server_info,
+ pipe_session_key,
+ pipe_session_key_len,
+ &sam6->base);
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
+ }
+
+ sam6->sidcount = 0;
+ sam6->sids = NULL;
+
+ sam6->forest.string = talloc_strdup(sam6, dominfo->dns_forest);
+ if (sam6->forest.string == NULL) {
+ return NT_STATUS_NO_MEMORY;
+ }
+
+ sam6->principle.string = talloc_asprintf(sam6, "%s@%s",
+ pdb_get_username(server_info->sam_account),
+ dominfo->dns_domain);
+ if (sam6->principle.string == NULL) {
+ return NT_STATUS_NO_MEMORY;
+ }
+
+ return NT_STATUS_OK;
+}