From c9d929af8ba018816df69734bed1c197d0c3b7f2 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 7 Dec 2011 16:03:04 +1100 Subject: s4-lsarpc handle more info levels in SetInfoTrustedDomain calls This uses the very helpful conversion functions written for the s3 lsa server and places these in common. Andrew Bartlett --- source4/rpc_server/lsa/dcesrv_lsa.c | 22 +++++++++++++++++++--- source4/rpc_server/wscript_build | 2 +- 2 files changed, 20 insertions(+), 4 deletions(-) (limited to 'source4') diff --git a/source4/rpc_server/lsa/dcesrv_lsa.c b/source4/rpc_server/lsa/dcesrv_lsa.c index acab1874af..609fb65308 100644 --- a/source4/rpc_server/lsa/dcesrv_lsa.c +++ b/source4/rpc_server/lsa/dcesrv_lsa.c @@ -32,6 +32,7 @@ #include "dsdb/common/util.h" #include "libcli/security/session.h" #include "kdc/kdc-policy.h" +#include "libcli/lsarpc/util_lsarpc.h" /* this type allows us to distinguish handle types @@ -1601,7 +1602,7 @@ static NTSTATUS setInfoTrustedDomain_base(struct dcesrv_call_state *dce_call, uint32_t *enc_types = NULL; DATA_BLOB trustAuthIncoming, trustAuthOutgoing, auth_blob; struct trustDomainPasswords auth_struct; - struct AuthenticationInformationArray *current_passwords = NULL; + struct trustAuthInOutBlob *current_passwords = NULL; NTSTATUS nt_status; struct ldb_message **msgs; struct ldb_message *msg; @@ -1644,8 +1645,23 @@ static NTSTATUS setInfoTrustedDomain_base(struct dcesrv_call_state *dce_call, } if (auth_info) { - /* FIXME: not handled yet */ - return NT_STATUS_INVALID_PARAMETER; + nt_status = auth_info_2_auth_blob(mem_ctx, auth_info, + &trustAuthIncoming, + &trustAuthOutgoing); + if (!NT_STATUS_IS_OK(nt_status)) { + return nt_status; + } + if (trustAuthIncoming.data) { + /* This does the decode of some of this twice, but it is easier that way */ + nt_status = auth_info_2_trustauth_inout(mem_ctx, + auth_info->incoming_count, + auth_info->incoming_current_auth_info, + NULL, + ¤t_passwords); + if (!NT_STATUS_IS_OK(nt_status)) { + return nt_status; + } + } } /* decode auth_info_int if set */ diff --git a/source4/rpc_server/wscript_build b/source4/rpc_server/wscript_build index cf6d71227b..ffdee2394a 100755 --- a/source4/rpc_server/wscript_build +++ b/source4/rpc_server/wscript_build @@ -93,7 +93,7 @@ bld.SAMBA_MODULE('dcerpc_lsarpc', autoproto='lsa/proto.h', subsystem='dcerpc_server', init_function='dcerpc_server_lsa_init', - deps='samdb DCERPC_COMMON ndr-standard LIBCLI_AUTH NDR_DSSETUP com_err security kdc-policy' + deps='samdb DCERPC_COMMON ndr-standard LIBCLI_AUTH NDR_DSSETUP com_err security kdc-policy UTIL_LSARPC' ) -- cgit