2006-09-19 01:27:20 +00:00
/*
* Unix SMB / CIFS implementation .
* server auto - generated by pidl . DO NOT MODIFY !
*/
# include "includes.h"
2008-12-16 16:32:18 +01:00
# include "../librpc/gen_ndr/srv_netlogon.h"
2006-09-19 01:27:20 +00:00
2007-10-18 17:40:25 -07:00
static bool api_netr_LogonUasLogon ( pipes_struct * p )
2006-09-19 01:27:20 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-19 01:27:20 +00:00
struct ndr_pull * pull ;
struct ndr_push * push ;
2007-11-09 14:38:47 +01:00
enum ndr_err_code ndr_err ;
2006-09-19 01:27:20 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct netr_LogonUasLogon * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_netlogon . calls [ NDR_NETR_LOGONUASLOGON ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct netr_LogonUasLogon ) ;
2007-08-21 14:06:46 +00:00
if ( r = = NULL ) {
2008-01-09 12:28:44 +01:00
return false ;
2007-08-21 14:06:46 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
if ( ! prs_data_blob ( & p - > in_data . data , & blob , r ) ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2008-09-23 20:59:30 +02:00
pull = ndr_pull_init_blob ( & blob , r , NULL ) ;
2006-10-10 07:55:46 +00:00
if ( pull = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-19 01:27:20 +00:00
pull - > flags | = LIBNDR_FLAG_REF_ALLOC ;
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_pull ( pull , NDR_IN , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_IN_DEBUG ( netr_LogonUasLogon , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
ZERO_STRUCT ( r - > out ) ;
2008-10-29 02:44:59 +01:00
r - > out . info = talloc_zero ( r , struct netr_UasInfo * ) ;
2007-08-21 14:06:46 +00:00
if ( r - > out . info = = NULL ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
r - > out . result = _netr_LogonUasLogon ( p , r ) ;
2008-01-09 12:28:44 +01:00
2006-10-10 07:55:46 +00:00
if ( p - > rng_fault_state ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
/* Return true here, srv_pipe_hnd.c will take care */
return true ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_OUT_DEBUG ( netr_LogonUasLogon , r ) ;
2008-01-09 12:28:44 +01:00
}
2008-10-12 19:05:46 +02:00
push = ndr_push_init_ctx ( r , NULL ) ;
2006-09-19 01:27:20 +00:00
if ( push = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_push ( push , NDR_OUT , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-19 01:27:20 +00:00
blob = ndr_push_blob ( push ) ;
2008-01-09 12:28:44 +01:00
if ( ! prs_copy_data_in ( & p - > out_data . rdata , ( const char * ) blob . data , ( uint32_t ) blob . length ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return true ;
2006-09-19 01:27:20 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_netr_LogonUasLogoff ( pipes_struct * p )
2006-09-19 01:27:20 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-19 01:27:20 +00:00
struct ndr_pull * pull ;
struct ndr_push * push ;
2007-11-09 14:38:47 +01:00
enum ndr_err_code ndr_err ;
2006-09-19 01:27:20 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct netr_LogonUasLogoff * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_netlogon . calls [ NDR_NETR_LOGONUASLOGOFF ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct netr_LogonUasLogoff ) ;
2007-08-21 14:06:46 +00:00
if ( r = = NULL ) {
2008-01-09 12:28:44 +01:00
return false ;
2007-08-21 14:06:46 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
if ( ! prs_data_blob ( & p - > in_data . data , & blob , r ) ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2008-09-23 20:59:30 +02:00
pull = ndr_pull_init_blob ( & blob , r , NULL ) ;
2006-10-10 07:55:46 +00:00
if ( pull = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-19 01:27:20 +00:00
pull - > flags | = LIBNDR_FLAG_REF_ALLOC ;
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_pull ( pull , NDR_IN , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_IN_DEBUG ( netr_LogonUasLogoff , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
ZERO_STRUCT ( r - > out ) ;
r - > out . info = talloc_zero ( r , struct netr_UasLogoffInfo ) ;
if ( r - > out . info = = NULL ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
r - > out . result = _netr_LogonUasLogoff ( p , r ) ;
2008-01-09 12:28:44 +01:00
2006-10-10 07:55:46 +00:00
if ( p - > rng_fault_state ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
/* Return true here, srv_pipe_hnd.c will take care */
return true ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_OUT_DEBUG ( netr_LogonUasLogoff , r ) ;
2008-01-09 12:28:44 +01:00
}
2008-10-12 19:05:46 +02:00
push = ndr_push_init_ctx ( r , NULL ) ;
2006-09-19 01:27:20 +00:00
if ( push = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_push ( push , NDR_OUT , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-19 01:27:20 +00:00
blob = ndr_push_blob ( push ) ;
2008-01-09 12:28:44 +01:00
if ( ! prs_copy_data_in ( & p - > out_data . rdata , ( const char * ) blob . data , ( uint32_t ) blob . length ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return true ;
2006-09-19 01:27:20 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_netr_LogonSamLogon ( pipes_struct * p )
2006-09-19 01:27:20 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-19 01:27:20 +00:00
struct ndr_pull * pull ;
struct ndr_push * push ;
2007-11-09 14:38:47 +01:00
enum ndr_err_code ndr_err ;
2006-09-19 01:27:20 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct netr_LogonSamLogon * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_netlogon . calls [ NDR_NETR_LOGONSAMLOGON ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct netr_LogonSamLogon ) ;
2007-08-21 14:06:46 +00:00
if ( r = = NULL ) {
2008-01-09 12:28:44 +01:00
return false ;
2007-08-21 14:06:46 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
if ( ! prs_data_blob ( & p - > in_data . data , & blob , r ) ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2008-09-23 20:59:30 +02:00
pull = ndr_pull_init_blob ( & blob , r , NULL ) ;
2006-10-10 07:55:46 +00:00
if ( pull = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-19 01:27:20 +00:00
pull - > flags | = LIBNDR_FLAG_REF_ALLOC ;
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_pull ( pull , NDR_IN , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_IN_DEBUG ( netr_LogonSamLogon , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
ZERO_STRUCT ( r - > out ) ;
r - > out . return_authenticator = r - > in . return_authenticator ;
r - > out . validation = talloc_zero ( r , union netr_Validation ) ;
if ( r - > out . validation = = NULL ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
r - > out . authoritative = talloc_zero ( r , uint8_t ) ;
if ( r - > out . authoritative = = NULL ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
r - > out . result = _netr_LogonSamLogon ( p , r ) ;
2008-01-09 12:28:44 +01:00
2006-10-10 07:55:46 +00:00
if ( p - > rng_fault_state ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
/* Return true here, srv_pipe_hnd.c will take care */
return true ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_OUT_DEBUG ( netr_LogonSamLogon , r ) ;
2008-01-09 12:28:44 +01:00
}
2008-10-12 19:05:46 +02:00
push = ndr_push_init_ctx ( r , NULL ) ;
2006-09-19 01:27:20 +00:00
if ( push = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_push ( push , NDR_OUT , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-19 01:27:20 +00:00
blob = ndr_push_blob ( push ) ;
2008-01-09 12:28:44 +01:00
if ( ! prs_copy_data_in ( & p - > out_data . rdata , ( const char * ) blob . data , ( uint32_t ) blob . length ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return true ;
2006-09-19 01:27:20 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_netr_LogonSamLogoff ( pipes_struct * p )
2006-09-19 01:27:20 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-19 01:27:20 +00:00
struct ndr_pull * pull ;
struct ndr_push * push ;
2007-11-09 14:38:47 +01:00
enum ndr_err_code ndr_err ;
2006-09-19 01:27:20 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct netr_LogonSamLogoff * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_netlogon . calls [ NDR_NETR_LOGONSAMLOGOFF ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct netr_LogonSamLogoff ) ;
2007-08-21 14:06:46 +00:00
if ( r = = NULL ) {
2008-01-09 12:28:44 +01:00
return false ;
2007-08-21 14:06:46 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
if ( ! prs_data_blob ( & p - > in_data . data , & blob , r ) ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2008-09-23 20:59:30 +02:00
pull = ndr_pull_init_blob ( & blob , r , NULL ) ;
2006-10-10 07:55:46 +00:00
if ( pull = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-19 01:27:20 +00:00
pull - > flags | = LIBNDR_FLAG_REF_ALLOC ;
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_pull ( pull , NDR_IN , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_IN_DEBUG ( netr_LogonSamLogoff , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
ZERO_STRUCT ( r - > out ) ;
r - > out . return_authenticator = r - > in . return_authenticator ;
r - > out . result = _netr_LogonSamLogoff ( p , r ) ;
2008-01-09 12:28:44 +01:00
2006-10-10 07:55:46 +00:00
if ( p - > rng_fault_state ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
/* Return true here, srv_pipe_hnd.c will take care */
return true ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_OUT_DEBUG ( netr_LogonSamLogoff , r ) ;
2008-01-09 12:28:44 +01:00
}
2008-10-12 19:05:46 +02:00
push = ndr_push_init_ctx ( r , NULL ) ;
2006-09-19 01:27:20 +00:00
if ( push = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_push ( push , NDR_OUT , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-19 01:27:20 +00:00
blob = ndr_push_blob ( push ) ;
2008-01-09 12:28:44 +01:00
if ( ! prs_copy_data_in ( & p - > out_data . rdata , ( const char * ) blob . data , ( uint32_t ) blob . length ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return true ;
2006-09-19 01:27:20 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_netr_ServerReqChallenge ( pipes_struct * p )
2006-09-19 01:27:20 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-19 01:27:20 +00:00
struct ndr_pull * pull ;
struct ndr_push * push ;
2007-11-09 14:38:47 +01:00
enum ndr_err_code ndr_err ;
2006-09-19 01:27:20 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct netr_ServerReqChallenge * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_netlogon . calls [ NDR_NETR_SERVERREQCHALLENGE ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct netr_ServerReqChallenge ) ;
2007-08-21 14:06:46 +00:00
if ( r = = NULL ) {
2008-01-09 12:28:44 +01:00
return false ;
2007-08-21 14:06:46 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
if ( ! prs_data_blob ( & p - > in_data . data , & blob , r ) ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2008-09-23 20:59:30 +02:00
pull = ndr_pull_init_blob ( & blob , r , NULL ) ;
2006-10-10 07:55:46 +00:00
if ( pull = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-19 01:27:20 +00:00
pull - > flags | = LIBNDR_FLAG_REF_ALLOC ;
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_pull ( pull , NDR_IN , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_IN_DEBUG ( netr_ServerReqChallenge , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
ZERO_STRUCT ( r - > out ) ;
2008-02-15 23:32:02 +01:00
r - > out . return_credentials = talloc_zero ( r , struct netr_Credential ) ;
if ( r - > out . return_credentials = = NULL ) {
talloc_free ( r ) ;
return false ;
}
2007-08-21 14:06:46 +00:00
r - > out . result = _netr_ServerReqChallenge ( p , r ) ;
2008-01-09 12:28:44 +01:00
2006-10-10 07:55:46 +00:00
if ( p - > rng_fault_state ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
/* Return true here, srv_pipe_hnd.c will take care */
return true ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_OUT_DEBUG ( netr_ServerReqChallenge , r ) ;
2008-01-09 12:28:44 +01:00
}
2008-10-12 19:05:46 +02:00
push = ndr_push_init_ctx ( r , NULL ) ;
2006-09-19 01:27:20 +00:00
if ( push = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_push ( push , NDR_OUT , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-19 01:27:20 +00:00
blob = ndr_push_blob ( push ) ;
2008-01-09 12:28:44 +01:00
if ( ! prs_copy_data_in ( & p - > out_data . rdata , ( const char * ) blob . data , ( uint32_t ) blob . length ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return true ;
2006-09-19 01:27:20 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_netr_ServerAuthenticate ( pipes_struct * p )
2006-09-19 01:27:20 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-19 01:27:20 +00:00
struct ndr_pull * pull ;
struct ndr_push * push ;
2007-11-09 14:38:47 +01:00
enum ndr_err_code ndr_err ;
2006-09-19 01:27:20 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct netr_ServerAuthenticate * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_netlogon . calls [ NDR_NETR_SERVERAUTHENTICATE ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct netr_ServerAuthenticate ) ;
2007-08-21 14:06:46 +00:00
if ( r = = NULL ) {
2008-01-09 12:28:44 +01:00
return false ;
2007-08-21 14:06:46 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
if ( ! prs_data_blob ( & p - > in_data . data , & blob , r ) ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2008-09-23 20:59:30 +02:00
pull = ndr_pull_init_blob ( & blob , r , NULL ) ;
2006-10-10 07:55:46 +00:00
if ( pull = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-19 01:27:20 +00:00
pull - > flags | = LIBNDR_FLAG_REF_ALLOC ;
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_pull ( pull , NDR_IN , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_IN_DEBUG ( netr_ServerAuthenticate , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
ZERO_STRUCT ( r - > out ) ;
2008-02-15 23:32:02 +01:00
r - > out . return_credentials = talloc_zero ( r , struct netr_Credential ) ;
if ( r - > out . return_credentials = = NULL ) {
talloc_free ( r ) ;
return false ;
}
2007-08-21 14:06:46 +00:00
r - > out . result = _netr_ServerAuthenticate ( p , r ) ;
2008-01-09 12:28:44 +01:00
2006-10-10 07:55:46 +00:00
if ( p - > rng_fault_state ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
/* Return true here, srv_pipe_hnd.c will take care */
return true ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_OUT_DEBUG ( netr_ServerAuthenticate , r ) ;
2008-01-09 12:28:44 +01:00
}
2008-10-12 19:05:46 +02:00
push = ndr_push_init_ctx ( r , NULL ) ;
2006-09-19 01:27:20 +00:00
if ( push = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_push ( push , NDR_OUT , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-19 01:27:20 +00:00
blob = ndr_push_blob ( push ) ;
2008-01-09 12:28:44 +01:00
if ( ! prs_copy_data_in ( & p - > out_data . rdata , ( const char * ) blob . data , ( uint32_t ) blob . length ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return true ;
2006-09-19 01:27:20 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_netr_ServerPasswordSet ( pipes_struct * p )
2006-09-19 01:27:20 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-19 01:27:20 +00:00
struct ndr_pull * pull ;
struct ndr_push * push ;
2007-11-09 14:38:47 +01:00
enum ndr_err_code ndr_err ;
2006-09-19 01:27:20 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct netr_ServerPasswordSet * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_netlogon . calls [ NDR_NETR_SERVERPASSWORDSET ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct netr_ServerPasswordSet ) ;
2007-08-21 14:06:46 +00:00
if ( r = = NULL ) {
2008-01-09 12:28:44 +01:00
return false ;
2007-08-21 14:06:46 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
if ( ! prs_data_blob ( & p - > in_data . data , & blob , r ) ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2008-09-23 20:59:30 +02:00
pull = ndr_pull_init_blob ( & blob , r , NULL ) ;
2006-10-10 07:55:46 +00:00
if ( pull = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-19 01:27:20 +00:00
pull - > flags | = LIBNDR_FLAG_REF_ALLOC ;
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_pull ( pull , NDR_IN , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_IN_DEBUG ( netr_ServerPasswordSet , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
ZERO_STRUCT ( r - > out ) ;
r - > out . return_authenticator = talloc_zero ( r , struct netr_Authenticator ) ;
if ( r - > out . return_authenticator = = NULL ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
r - > out . result = _netr_ServerPasswordSet ( p , r ) ;
2008-01-09 12:28:44 +01:00
2006-10-10 07:55:46 +00:00
if ( p - > rng_fault_state ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
/* Return true here, srv_pipe_hnd.c will take care */
return true ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_OUT_DEBUG ( netr_ServerPasswordSet , r ) ;
2008-01-09 12:28:44 +01:00
}
2008-10-12 19:05:46 +02:00
push = ndr_push_init_ctx ( r , NULL ) ;
2006-09-19 01:27:20 +00:00
if ( push = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_push ( push , NDR_OUT , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-19 01:27:20 +00:00
blob = ndr_push_blob ( push ) ;
2008-01-09 12:28:44 +01:00
if ( ! prs_copy_data_in ( & p - > out_data . rdata , ( const char * ) blob . data , ( uint32_t ) blob . length ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return true ;
2006-09-19 01:27:20 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_netr_DatabaseDeltas ( pipes_struct * p )
2006-09-19 01:27:20 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-19 01:27:20 +00:00
struct ndr_pull * pull ;
struct ndr_push * push ;
2007-11-09 14:38:47 +01:00
enum ndr_err_code ndr_err ;
2006-09-19 01:27:20 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct netr_DatabaseDeltas * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_netlogon . calls [ NDR_NETR_DATABASEDELTAS ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct netr_DatabaseDeltas ) ;
2007-08-21 14:06:46 +00:00
if ( r = = NULL ) {
2008-01-09 12:28:44 +01:00
return false ;
2007-08-21 14:06:46 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
if ( ! prs_data_blob ( & p - > in_data . data , & blob , r ) ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2008-09-23 20:59:30 +02:00
pull = ndr_pull_init_blob ( & blob , r , NULL ) ;
2006-10-10 07:55:46 +00:00
if ( pull = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-19 01:27:20 +00:00
pull - > flags | = LIBNDR_FLAG_REF_ALLOC ;
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_pull ( pull , NDR_IN , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_IN_DEBUG ( netr_DatabaseDeltas , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
ZERO_STRUCT ( r - > out ) ;
r - > out . return_authenticator = r - > in . return_authenticator ;
r - > out . sequence_num = r - > in . sequence_num ;
2008-02-15 14:04:08 +01:00
r - > out . delta_enum_array = talloc_zero ( r , struct netr_DELTA_ENUM_ARRAY * ) ;
2007-08-21 14:06:46 +00:00
if ( r - > out . delta_enum_array = = NULL ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
r - > out . result = _netr_DatabaseDeltas ( p , r ) ;
2008-01-09 12:28:44 +01:00
2006-10-10 07:55:46 +00:00
if ( p - > rng_fault_state ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
/* Return true here, srv_pipe_hnd.c will take care */
return true ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_OUT_DEBUG ( netr_DatabaseDeltas , r ) ;
2008-01-09 12:28:44 +01:00
}
2008-10-12 19:05:46 +02:00
push = ndr_push_init_ctx ( r , NULL ) ;
2006-09-19 01:27:20 +00:00
if ( push = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_push ( push , NDR_OUT , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-19 01:27:20 +00:00
blob = ndr_push_blob ( push ) ;
2008-01-09 12:28:44 +01:00
if ( ! prs_copy_data_in ( & p - > out_data . rdata , ( const char * ) blob . data , ( uint32_t ) blob . length ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return true ;
2006-09-19 01:27:20 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_netr_DatabaseSync ( pipes_struct * p )
2006-09-19 01:27:20 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-19 01:27:20 +00:00
struct ndr_pull * pull ;
struct ndr_push * push ;
2007-11-09 14:38:47 +01:00
enum ndr_err_code ndr_err ;
2006-09-19 01:27:20 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct netr_DatabaseSync * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_netlogon . calls [ NDR_NETR_DATABASESYNC ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct netr_DatabaseSync ) ;
2007-08-21 14:06:46 +00:00
if ( r = = NULL ) {
2008-01-09 12:28:44 +01:00
return false ;
2007-08-21 14:06:46 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
if ( ! prs_data_blob ( & p - > in_data . data , & blob , r ) ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2008-09-23 20:59:30 +02:00
pull = ndr_pull_init_blob ( & blob , r , NULL ) ;
2006-10-10 07:55:46 +00:00
if ( pull = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-19 01:27:20 +00:00
pull - > flags | = LIBNDR_FLAG_REF_ALLOC ;
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_pull ( pull , NDR_IN , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_IN_DEBUG ( netr_DatabaseSync , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
ZERO_STRUCT ( r - > out ) ;
r - > out . return_authenticator = r - > in . return_authenticator ;
r - > out . sync_context = r - > in . sync_context ;
2008-10-29 02:44:59 +01:00
r - > out . delta_enum_array = talloc_zero ( r , struct netr_DELTA_ENUM_ARRAY * ) ;
2007-08-21 14:06:46 +00:00
if ( r - > out . delta_enum_array = = NULL ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
r - > out . result = _netr_DatabaseSync ( p , r ) ;
2008-01-09 12:28:44 +01:00
2006-10-10 07:55:46 +00:00
if ( p - > rng_fault_state ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
/* Return true here, srv_pipe_hnd.c will take care */
return true ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_OUT_DEBUG ( netr_DatabaseSync , r ) ;
2008-01-09 12:28:44 +01:00
}
2008-10-12 19:05:46 +02:00
push = ndr_push_init_ctx ( r , NULL ) ;
2006-09-19 01:27:20 +00:00
if ( push = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_push ( push , NDR_OUT , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-19 01:27:20 +00:00
blob = ndr_push_blob ( push ) ;
2008-01-09 12:28:44 +01:00
if ( ! prs_copy_data_in ( & p - > out_data . rdata , ( const char * ) blob . data , ( uint32_t ) blob . length ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return true ;
2006-09-19 01:27:20 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_netr_AccountDeltas ( pipes_struct * p )
2006-09-19 01:27:20 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-19 01:27:20 +00:00
struct ndr_pull * pull ;
struct ndr_push * push ;
2007-11-09 14:38:47 +01:00
enum ndr_err_code ndr_err ;
2006-09-19 01:27:20 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct netr_AccountDeltas * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_netlogon . calls [ NDR_NETR_ACCOUNTDELTAS ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct netr_AccountDeltas ) ;
2007-08-21 14:06:46 +00:00
if ( r = = NULL ) {
2008-01-09 12:28:44 +01:00
return false ;
2007-08-21 14:06:46 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
if ( ! prs_data_blob ( & p - > in_data . data , & blob , r ) ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2008-09-23 20:59:30 +02:00
pull = ndr_pull_init_blob ( & blob , r , NULL ) ;
2006-10-10 07:55:46 +00:00
if ( pull = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-19 01:27:20 +00:00
pull - > flags | = LIBNDR_FLAG_REF_ALLOC ;
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_pull ( pull , NDR_IN , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_IN_DEBUG ( netr_AccountDeltas , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
ZERO_STRUCT ( r - > out ) ;
r - > out . return_authenticator = r - > in . return_authenticator ;
r - > out . buffer = talloc_zero ( r , struct netr_AccountBuffer ) ;
if ( r - > out . buffer = = NULL ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
r - > out . count_returned = talloc_zero ( r , uint32_t ) ;
if ( r - > out . count_returned = = NULL ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
r - > out . total_entries = talloc_zero ( r , uint32_t ) ;
if ( r - > out . total_entries = = NULL ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
r - > out . recordid = talloc_zero ( r , struct netr_UAS_INFO_0 ) ;
if ( r - > out . recordid = = NULL ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
r - > out . result = _netr_AccountDeltas ( p , r ) ;
2008-01-09 12:28:44 +01:00
2006-10-10 07:55:46 +00:00
if ( p - > rng_fault_state ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
/* Return true here, srv_pipe_hnd.c will take care */
return true ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_OUT_DEBUG ( netr_AccountDeltas , r ) ;
2008-01-09 12:28:44 +01:00
}
2008-10-12 19:05:46 +02:00
push = ndr_push_init_ctx ( r , NULL ) ;
2006-09-19 01:27:20 +00:00
if ( push = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_push ( push , NDR_OUT , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-19 01:27:20 +00:00
blob = ndr_push_blob ( push ) ;
2008-01-09 12:28:44 +01:00
if ( ! prs_copy_data_in ( & p - > out_data . rdata , ( const char * ) blob . data , ( uint32_t ) blob . length ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return true ;
2006-09-19 01:27:20 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_netr_AccountSync ( pipes_struct * p )
2006-09-19 01:27:20 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-19 01:27:20 +00:00
struct ndr_pull * pull ;
struct ndr_push * push ;
2007-11-09 14:38:47 +01:00
enum ndr_err_code ndr_err ;
2006-09-19 01:27:20 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct netr_AccountSync * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_netlogon . calls [ NDR_NETR_ACCOUNTSYNC ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct netr_AccountSync ) ;
2007-08-21 14:06:46 +00:00
if ( r = = NULL ) {
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
if ( ! prs_data_blob ( & p - > in_data . data , & blob , r ) ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2007-08-21 14:06:46 +00:00
}
2008-01-09 12:28:44 +01:00
2008-09-23 20:59:30 +02:00
pull = ndr_pull_init_blob ( & blob , r , NULL ) ;
2006-10-10 07:55:46 +00:00
if ( pull = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-19 01:27:20 +00:00
pull - > flags | = LIBNDR_FLAG_REF_ALLOC ;
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_pull ( pull , NDR_IN , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_IN_DEBUG ( netr_AccountSync , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
ZERO_STRUCT ( r - > out ) ;
r - > out . return_authenticator = r - > in . return_authenticator ;
2008-11-19 22:00:43 +01:00
r - > out . recordid = r - > in . recordid ;
2007-08-21 14:06:46 +00:00
r - > out . buffer = talloc_zero ( r , struct netr_AccountBuffer ) ;
if ( r - > out . buffer = = NULL ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
r - > out . count_returned = talloc_zero ( r , uint32_t ) ;
if ( r - > out . count_returned = = NULL ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
r - > out . total_entries = talloc_zero ( r , uint32_t ) ;
if ( r - > out . total_entries = = NULL ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
r - > out . next_reference = talloc_zero ( r , uint32_t ) ;
if ( r - > out . next_reference = = NULL ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
r - > out . result = _netr_AccountSync ( p , r ) ;
2008-01-09 12:28:44 +01:00
2006-10-10 07:55:46 +00:00
if ( p - > rng_fault_state ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
/* Return true here, srv_pipe_hnd.c will take care */
return true ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_OUT_DEBUG ( netr_AccountSync , r ) ;
2008-01-09 12:28:44 +01:00
}
2008-10-12 19:05:46 +02:00
push = ndr_push_init_ctx ( r , NULL ) ;
2006-09-19 01:27:20 +00:00
if ( push = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_push ( push , NDR_OUT , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-19 01:27:20 +00:00
blob = ndr_push_blob ( push ) ;
2008-01-09 12:28:44 +01:00
if ( ! prs_copy_data_in ( & p - > out_data . rdata , ( const char * ) blob . data , ( uint32_t ) blob . length ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return true ;
2006-09-19 01:27:20 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_netr_GetDcName ( pipes_struct * p )
2006-09-19 01:27:20 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-19 01:27:20 +00:00
struct ndr_pull * pull ;
struct ndr_push * push ;
2007-11-09 14:38:47 +01:00
enum ndr_err_code ndr_err ;
2006-09-19 01:27:20 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct netr_GetDcName * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_netlogon . calls [ NDR_NETR_GETDCNAME ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct netr_GetDcName ) ;
2007-08-21 14:06:46 +00:00
if ( r = = NULL ) {
2008-01-09 12:28:44 +01:00
return false ;
2007-08-21 14:06:46 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
if ( ! prs_data_blob ( & p - > in_data . data , & blob , r ) ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2008-09-23 20:59:30 +02:00
pull = ndr_pull_init_blob ( & blob , r , NULL ) ;
2006-10-10 07:55:46 +00:00
if ( pull = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-19 01:27:20 +00:00
pull - > flags | = LIBNDR_FLAG_REF_ALLOC ;
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_pull ( pull , NDR_IN , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_IN_DEBUG ( netr_GetDcName , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
ZERO_STRUCT ( r - > out ) ;
r - > out . dcname = talloc_zero ( r , const char * ) ;
if ( r - > out . dcname = = NULL ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
r - > out . result = _netr_GetDcName ( p , r ) ;
2008-01-09 12:28:44 +01:00
2006-10-10 07:55:46 +00:00
if ( p - > rng_fault_state ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
/* Return true here, srv_pipe_hnd.c will take care */
return true ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_OUT_DEBUG ( netr_GetDcName , r ) ;
2008-01-09 12:28:44 +01:00
}
2008-10-12 19:05:46 +02:00
push = ndr_push_init_ctx ( r , NULL ) ;
2006-09-19 01:27:20 +00:00
if ( push = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_push ( push , NDR_OUT , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-19 01:27:20 +00:00
blob = ndr_push_blob ( push ) ;
2008-01-09 12:28:44 +01:00
if ( ! prs_copy_data_in ( & p - > out_data . rdata , ( const char * ) blob . data , ( uint32_t ) blob . length ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return true ;
2006-09-19 01:27:20 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_netr_LogonControl ( pipes_struct * p )
2006-09-19 01:27:20 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-19 01:27:20 +00:00
struct ndr_pull * pull ;
struct ndr_push * push ;
2007-11-09 14:38:47 +01:00
enum ndr_err_code ndr_err ;
2006-09-19 01:27:20 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct netr_LogonControl * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_netlogon . calls [ NDR_NETR_LOGONCONTROL ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct netr_LogonControl ) ;
2007-08-21 14:06:46 +00:00
if ( r = = NULL ) {
2008-01-09 12:28:44 +01:00
return false ;
2007-08-21 14:06:46 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
if ( ! prs_data_blob ( & p - > in_data . data , & blob , r ) ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2008-09-23 20:59:30 +02:00
pull = ndr_pull_init_blob ( & blob , r , NULL ) ;
2006-10-10 07:55:46 +00:00
if ( pull = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-19 01:27:20 +00:00
pull - > flags | = LIBNDR_FLAG_REF_ALLOC ;
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_pull ( pull , NDR_IN , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_IN_DEBUG ( netr_LogonControl , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
ZERO_STRUCT ( r - > out ) ;
2009-06-12 12:38:22 +02:00
r - > out . query = talloc_zero ( r , union netr_CONTROL_QUERY_INFORMATION ) ;
if ( r - > out . query = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
r - > out . result = _netr_LogonControl ( p , r ) ;
2008-01-09 12:28:44 +01:00
2006-10-10 07:55:46 +00:00
if ( p - > rng_fault_state ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
/* Return true here, srv_pipe_hnd.c will take care */
return true ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_OUT_DEBUG ( netr_LogonControl , r ) ;
2008-01-09 12:28:44 +01:00
}
2008-10-12 19:05:46 +02:00
push = ndr_push_init_ctx ( r , NULL ) ;
2006-09-19 01:27:20 +00:00
if ( push = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_push ( push , NDR_OUT , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-19 01:27:20 +00:00
blob = ndr_push_blob ( push ) ;
2008-01-09 12:28:44 +01:00
if ( ! prs_copy_data_in ( & p - > out_data . rdata , ( const char * ) blob . data , ( uint32_t ) blob . length ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return true ;
2006-09-19 01:27:20 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_netr_GetAnyDCName ( pipes_struct * p )
2006-09-19 01:27:20 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-19 01:27:20 +00:00
struct ndr_pull * pull ;
struct ndr_push * push ;
2007-11-09 14:38:47 +01:00
enum ndr_err_code ndr_err ;
2006-09-19 01:27:20 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct netr_GetAnyDCName * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_netlogon . calls [ NDR_NETR_GETANYDCNAME ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct netr_GetAnyDCName ) ;
2007-08-21 14:06:46 +00:00
if ( r = = NULL ) {
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
if ( ! prs_data_blob ( & p - > in_data . data , & blob , r ) ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2007-08-21 14:06:46 +00:00
}
2008-01-09 12:28:44 +01:00
2008-09-23 20:59:30 +02:00
pull = ndr_pull_init_blob ( & blob , r , NULL ) ;
2006-10-10 07:55:46 +00:00
if ( pull = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-19 01:27:20 +00:00
pull - > flags | = LIBNDR_FLAG_REF_ALLOC ;
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_pull ( pull , NDR_IN , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_IN_DEBUG ( netr_GetAnyDCName , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
ZERO_STRUCT ( r - > out ) ;
r - > out . dcname = talloc_zero ( r , const char * ) ;
if ( r - > out . dcname = = NULL ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
r - > out . result = _netr_GetAnyDCName ( p , r ) ;
2008-01-09 12:28:44 +01:00
2006-10-10 07:55:46 +00:00
if ( p - > rng_fault_state ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
/* Return true here, srv_pipe_hnd.c will take care */
return true ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_OUT_DEBUG ( netr_GetAnyDCName , r ) ;
2008-01-09 12:28:44 +01:00
}
2008-10-12 19:05:46 +02:00
push = ndr_push_init_ctx ( r , NULL ) ;
2006-09-19 01:27:20 +00:00
if ( push = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_push ( push , NDR_OUT , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-19 01:27:20 +00:00
blob = ndr_push_blob ( push ) ;
2008-01-09 12:28:44 +01:00
if ( ! prs_copy_data_in ( & p - > out_data . rdata , ( const char * ) blob . data , ( uint32_t ) blob . length ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return true ;
2006-09-19 01:27:20 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_netr_LogonControl2 ( pipes_struct * p )
2006-09-19 01:27:20 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-19 01:27:20 +00:00
struct ndr_pull * pull ;
struct ndr_push * push ;
2007-11-09 14:38:47 +01:00
enum ndr_err_code ndr_err ;
2006-09-19 01:27:20 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct netr_LogonControl2 * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_netlogon . calls [ NDR_NETR_LOGONCONTROL2 ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct netr_LogonControl2 ) ;
2007-08-21 14:06:46 +00:00
if ( r = = NULL ) {
2008-01-09 12:28:44 +01:00
return false ;
2007-08-21 14:06:46 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
if ( ! prs_data_blob ( & p - > in_data . data , & blob , r ) ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2008-09-23 20:59:30 +02:00
pull = ndr_pull_init_blob ( & blob , r , NULL ) ;
2006-10-10 07:55:46 +00:00
if ( pull = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-19 01:27:20 +00:00
pull - > flags | = LIBNDR_FLAG_REF_ALLOC ;
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_pull ( pull , NDR_IN , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_IN_DEBUG ( netr_LogonControl2 , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
ZERO_STRUCT ( r - > out ) ;
r - > out . query = talloc_zero ( r , union netr_CONTROL_QUERY_INFORMATION ) ;
if ( r - > out . query = = NULL ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
r - > out . result = _netr_LogonControl2 ( p , r ) ;
2008-01-09 12:28:44 +01:00
2006-10-10 07:55:46 +00:00
if ( p - > rng_fault_state ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
/* Return true here, srv_pipe_hnd.c will take care */
return true ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_OUT_DEBUG ( netr_LogonControl2 , r ) ;
2008-01-09 12:28:44 +01:00
}
2008-10-12 19:05:46 +02:00
push = ndr_push_init_ctx ( r , NULL ) ;
2006-09-19 01:27:20 +00:00
if ( push = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_push ( push , NDR_OUT , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-19 01:27:20 +00:00
blob = ndr_push_blob ( push ) ;
2008-01-09 12:28:44 +01:00
if ( ! prs_copy_data_in ( & p - > out_data . rdata , ( const char * ) blob . data , ( uint32_t ) blob . length ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return true ;
2006-09-19 01:27:20 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_netr_ServerAuthenticate2 ( pipes_struct * p )
2006-09-19 01:27:20 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-19 01:27:20 +00:00
struct ndr_pull * pull ;
struct ndr_push * push ;
2007-11-09 14:38:47 +01:00
enum ndr_err_code ndr_err ;
2006-09-19 01:27:20 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct netr_ServerAuthenticate2 * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_netlogon . calls [ NDR_NETR_SERVERAUTHENTICATE2 ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct netr_ServerAuthenticate2 ) ;
2007-08-21 14:06:46 +00:00
if ( r = = NULL ) {
2008-01-09 12:28:44 +01:00
return false ;
2007-08-21 14:06:46 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
if ( ! prs_data_blob ( & p - > in_data . data , & blob , r ) ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2008-09-23 20:59:30 +02:00
pull = ndr_pull_init_blob ( & blob , r , NULL ) ;
2006-10-10 07:55:46 +00:00
if ( pull = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-19 01:27:20 +00:00
pull - > flags | = LIBNDR_FLAG_REF_ALLOC ;
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_pull ( pull , NDR_IN , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_IN_DEBUG ( netr_ServerAuthenticate2 , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
ZERO_STRUCT ( r - > out ) ;
2008-11-19 22:00:43 +01:00
r - > out . negotiate_flags = r - > in . negotiate_flags ;
2008-02-15 23:32:02 +01:00
r - > out . return_credentials = talloc_zero ( r , struct netr_Credential ) ;
if ( r - > out . return_credentials = = NULL ) {
talloc_free ( r ) ;
return false ;
}
2007-08-21 14:06:46 +00:00
r - > out . result = _netr_ServerAuthenticate2 ( p , r ) ;
2008-01-09 12:28:44 +01:00
2006-10-10 07:55:46 +00:00
if ( p - > rng_fault_state ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
/* Return true here, srv_pipe_hnd.c will take care */
return true ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_OUT_DEBUG ( netr_ServerAuthenticate2 , r ) ;
2008-01-09 12:28:44 +01:00
}
2008-10-12 19:05:46 +02:00
push = ndr_push_init_ctx ( r , NULL ) ;
2006-09-19 01:27:20 +00:00
if ( push = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_push ( push , NDR_OUT , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-19 01:27:20 +00:00
blob = ndr_push_blob ( push ) ;
2008-01-09 12:28:44 +01:00
if ( ! prs_copy_data_in ( & p - > out_data . rdata , ( const char * ) blob . data , ( uint32_t ) blob . length ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return true ;
2006-09-19 01:27:20 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_netr_DatabaseSync2 ( pipes_struct * p )
2006-09-19 01:27:20 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-19 01:27:20 +00:00
struct ndr_pull * pull ;
struct ndr_push * push ;
2007-11-09 14:38:47 +01:00
enum ndr_err_code ndr_err ;
2006-09-19 01:27:20 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct netr_DatabaseSync2 * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_netlogon . calls [ NDR_NETR_DATABASESYNC2 ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct netr_DatabaseSync2 ) ;
2007-08-21 14:06:46 +00:00
if ( r = = NULL ) {
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
if ( ! prs_data_blob ( & p - > in_data . data , & blob , r ) ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2007-08-21 14:06:46 +00:00
}
2008-01-09 12:28:44 +01:00
2008-09-23 20:59:30 +02:00
pull = ndr_pull_init_blob ( & blob , r , NULL ) ;
2006-10-10 07:55:46 +00:00
if ( pull = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-19 01:27:20 +00:00
pull - > flags | = LIBNDR_FLAG_REF_ALLOC ;
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_pull ( pull , NDR_IN , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_IN_DEBUG ( netr_DatabaseSync2 , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
ZERO_STRUCT ( r - > out ) ;
r - > out . return_authenticator = r - > in . return_authenticator ;
r - > out . sync_context = r - > in . sync_context ;
2008-02-15 14:08:24 +01:00
r - > out . delta_enum_array = talloc_zero ( r , struct netr_DELTA_ENUM_ARRAY * ) ;
2007-08-21 14:06:46 +00:00
if ( r - > out . delta_enum_array = = NULL ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
r - > out . result = _netr_DatabaseSync2 ( p , r ) ;
2008-01-09 12:28:44 +01:00
2006-10-10 07:55:46 +00:00
if ( p - > rng_fault_state ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
/* Return true here, srv_pipe_hnd.c will take care */
return true ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_OUT_DEBUG ( netr_DatabaseSync2 , r ) ;
2008-01-09 12:28:44 +01:00
}
2008-10-12 19:05:46 +02:00
push = ndr_push_init_ctx ( r , NULL ) ;
2006-09-19 01:27:20 +00:00
if ( push = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_push ( push , NDR_OUT , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-19 01:27:20 +00:00
blob = ndr_push_blob ( push ) ;
2008-01-09 12:28:44 +01:00
if ( ! prs_copy_data_in ( & p - > out_data . rdata , ( const char * ) blob . data , ( uint32_t ) blob . length ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return true ;
2006-09-19 01:27:20 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_netr_DatabaseRedo ( pipes_struct * p )
2006-09-19 01:27:20 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-19 01:27:20 +00:00
struct ndr_pull * pull ;
struct ndr_push * push ;
2007-11-09 14:38:47 +01:00
enum ndr_err_code ndr_err ;
2006-09-19 01:27:20 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct netr_DatabaseRedo * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_netlogon . calls [ NDR_NETR_DATABASEREDO ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct netr_DatabaseRedo ) ;
2007-08-21 14:06:46 +00:00
if ( r = = NULL ) {
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
if ( ! prs_data_blob ( & p - > in_data . data , & blob , r ) ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2007-08-21 14:06:46 +00:00
}
2008-01-09 12:28:44 +01:00
2008-09-23 20:59:30 +02:00
pull = ndr_pull_init_blob ( & blob , r , NULL ) ;
2006-10-10 07:55:46 +00:00
if ( pull = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-19 01:27:20 +00:00
pull - > flags | = LIBNDR_FLAG_REF_ALLOC ;
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_pull ( pull , NDR_IN , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_IN_DEBUG ( netr_DatabaseRedo , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
ZERO_STRUCT ( r - > out ) ;
r - > out . return_authenticator = r - > in . return_authenticator ;
2008-11-04 02:46:41 +01:00
r - > out . delta_enum_array = talloc_zero ( r , struct netr_DELTA_ENUM_ARRAY * ) ;
2007-08-21 14:06:46 +00:00
if ( r - > out . delta_enum_array = = NULL ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
r - > out . result = _netr_DatabaseRedo ( p , r ) ;
2008-01-09 12:28:44 +01:00
2006-10-10 07:55:46 +00:00
if ( p - > rng_fault_state ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
/* Return true here, srv_pipe_hnd.c will take care */
return true ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_OUT_DEBUG ( netr_DatabaseRedo , r ) ;
2008-01-09 12:28:44 +01:00
}
2008-10-12 19:05:46 +02:00
push = ndr_push_init_ctx ( r , NULL ) ;
2006-09-19 01:27:20 +00:00
if ( push = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_push ( push , NDR_OUT , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-19 01:27:20 +00:00
blob = ndr_push_blob ( push ) ;
2008-01-09 12:28:44 +01:00
if ( ! prs_copy_data_in ( & p - > out_data . rdata , ( const char * ) blob . data , ( uint32_t ) blob . length ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return true ;
2006-09-19 01:27:20 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_netr_LogonControl2Ex ( pipes_struct * p )
2006-09-19 01:27:20 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-19 01:27:20 +00:00
struct ndr_pull * pull ;
struct ndr_push * push ;
2007-11-09 14:38:47 +01:00
enum ndr_err_code ndr_err ;
2006-09-19 01:27:20 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct netr_LogonControl2Ex * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_netlogon . calls [ NDR_NETR_LOGONCONTROL2EX ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct netr_LogonControl2Ex ) ;
2007-08-21 14:06:46 +00:00
if ( r = = NULL ) {
2008-01-09 12:28:44 +01:00
return false ;
2007-08-21 14:06:46 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
if ( ! prs_data_blob ( & p - > in_data . data , & blob , r ) ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2008-09-23 20:59:30 +02:00
pull = ndr_pull_init_blob ( & blob , r , NULL ) ;
2006-10-10 07:55:46 +00:00
if ( pull = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-19 01:27:20 +00:00
pull - > flags | = LIBNDR_FLAG_REF_ALLOC ;
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_pull ( pull , NDR_IN , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_IN_DEBUG ( netr_LogonControl2Ex , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
ZERO_STRUCT ( r - > out ) ;
r - > out . query = talloc_zero ( r , union netr_CONTROL_QUERY_INFORMATION ) ;
if ( r - > out . query = = NULL ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
r - > out . result = _netr_LogonControl2Ex ( p , r ) ;
2008-01-09 12:28:44 +01:00
2006-10-10 07:55:46 +00:00
if ( p - > rng_fault_state ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
/* Return true here, srv_pipe_hnd.c will take care */
return true ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_OUT_DEBUG ( netr_LogonControl2Ex , r ) ;
2008-01-09 12:28:44 +01:00
}
2008-10-12 19:05:46 +02:00
push = ndr_push_init_ctx ( r , NULL ) ;
2006-09-19 01:27:20 +00:00
if ( push = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_push ( push , NDR_OUT , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-19 01:27:20 +00:00
blob = ndr_push_blob ( push ) ;
2008-01-09 12:28:44 +01:00
if ( ! prs_copy_data_in ( & p - > out_data . rdata , ( const char * ) blob . data , ( uint32_t ) blob . length ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return true ;
2006-09-19 01:27:20 +00:00
}
2008-01-17 10:00:37 +01:00
static bool api_netr_NetrEnumerateTrustedDomains ( pipes_struct * p )
2006-09-19 01:27:20 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-19 01:27:20 +00:00
struct ndr_pull * pull ;
struct ndr_push * push ;
2007-11-09 14:38:47 +01:00
enum ndr_err_code ndr_err ;
2006-09-19 01:27:20 +00:00
DATA_BLOB blob ;
2008-01-17 10:00:37 +01:00
struct netr_NetrEnumerateTrustedDomains * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_netlogon . calls [ NDR_NETR_NETRENUMERATETRUSTEDDOMAINS ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct netr_NetrEnumerateTrustedDomains ) ;
2007-08-21 14:06:46 +00:00
if ( r = = NULL ) {
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
if ( ! prs_data_blob ( & p - > in_data . data , & blob , r ) ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2007-08-21 14:06:46 +00:00
}
2008-01-09 12:28:44 +01:00
2008-09-23 20:59:30 +02:00
pull = ndr_pull_init_blob ( & blob , r , NULL ) ;
2006-10-10 07:55:46 +00:00
if ( pull = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-19 01:27:20 +00:00
pull - > flags | = LIBNDR_FLAG_REF_ALLOC ;
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_pull ( pull , NDR_IN , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2008-01-17 10:00:37 +01:00
NDR_PRINT_IN_DEBUG ( netr_NetrEnumerateTrustedDomains , r ) ;
2008-01-09 12:28:44 +01:00
}
2008-01-17 10:00:37 +01:00
ZERO_STRUCT ( r - > out ) ;
r - > out . trusted_domains_blob = talloc_zero ( r , struct netr_Blob ) ;
if ( r - > out . trusted_domains_blob = = NULL ) {
talloc_free ( r ) ;
return false ;
}
r - > out . result = _netr_NetrEnumerateTrustedDomains ( p , r ) ;
2008-01-09 12:28:44 +01:00
2006-10-10 07:55:46 +00:00
if ( p - > rng_fault_state ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
/* Return true here, srv_pipe_hnd.c will take care */
return true ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2008-01-17 10:00:37 +01:00
NDR_PRINT_OUT_DEBUG ( netr_NetrEnumerateTrustedDomains , r ) ;
2008-01-09 12:28:44 +01:00
}
2008-10-12 19:05:46 +02:00
push = ndr_push_init_ctx ( r , NULL ) ;
2006-09-19 01:27:20 +00:00
if ( push = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_push ( push , NDR_OUT , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-19 01:27:20 +00:00
blob = ndr_push_blob ( push ) ;
2008-01-09 12:28:44 +01:00
if ( ! prs_copy_data_in ( & p - > out_data . rdata , ( const char * ) blob . data , ( uint32_t ) blob . length ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return true ;
2006-09-19 01:27:20 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_netr_DsRGetDCName ( pipes_struct * p )
2006-09-19 01:27:20 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-19 01:27:20 +00:00
struct ndr_pull * pull ;
struct ndr_push * push ;
2007-11-09 14:38:47 +01:00
enum ndr_err_code ndr_err ;
2006-09-19 01:27:20 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct netr_DsRGetDCName * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_netlogon . calls [ NDR_NETR_DSRGETDCNAME ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct netr_DsRGetDCName ) ;
2007-08-21 14:06:46 +00:00
if ( r = = NULL ) {
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
if ( ! prs_data_blob ( & p - > in_data . data , & blob , r ) ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2007-08-21 14:06:46 +00:00
}
2008-01-09 12:28:44 +01:00
2008-09-23 20:59:30 +02:00
pull = ndr_pull_init_blob ( & blob , r , NULL ) ;
2006-10-10 07:55:46 +00:00
if ( pull = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-19 01:27:20 +00:00
pull - > flags | = LIBNDR_FLAG_REF_ALLOC ;
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_pull ( pull , NDR_IN , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_IN_DEBUG ( netr_DsRGetDCName , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
ZERO_STRUCT ( r - > out ) ;
2008-02-08 23:37:45 +01:00
r - > out . info = talloc_zero ( r , struct netr_DsRGetDCNameInfo * ) ;
2007-08-21 14:06:46 +00:00
if ( r - > out . info = = NULL ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
r - > out . result = _netr_DsRGetDCName ( p , r ) ;
2008-01-09 12:28:44 +01:00
2006-10-10 07:55:46 +00:00
if ( p - > rng_fault_state ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
/* Return true here, srv_pipe_hnd.c will take care */
return true ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_OUT_DEBUG ( netr_DsRGetDCName , r ) ;
2008-01-09 12:28:44 +01:00
}
2008-10-12 19:05:46 +02:00
push = ndr_push_init_ctx ( r , NULL ) ;
2006-09-19 01:27:20 +00:00
if ( push = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_push ( push , NDR_OUT , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-19 01:27:20 +00:00
blob = ndr_push_blob ( push ) ;
2008-01-09 12:28:44 +01:00
if ( ! prs_copy_data_in ( & p - > out_data . rdata , ( const char * ) blob . data , ( uint32_t ) blob . length ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return true ;
2006-09-19 01:27:20 +00:00
}
2009-02-16 10:59:45 +01:00
static bool api_netr_LogonGetCapabilities ( pipes_struct * p )
2006-09-19 01:27:20 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-19 01:27:20 +00:00
struct ndr_pull * pull ;
struct ndr_push * push ;
2007-11-09 14:38:47 +01:00
enum ndr_err_code ndr_err ;
2006-09-19 01:27:20 +00:00
DATA_BLOB blob ;
2009-02-16 10:59:45 +01:00
struct netr_LogonGetCapabilities * r ;
2008-01-09 12:28:44 +01:00
2009-02-16 10:59:45 +01:00
call = & ndr_table_netlogon . calls [ NDR_NETR_LOGONGETCAPABILITIES ] ;
2008-01-09 12:28:44 +01:00
2009-02-16 10:59:45 +01:00
r = talloc ( talloc_tos ( ) , struct netr_LogonGetCapabilities ) ;
2007-08-21 14:06:46 +00:00
if ( r = = NULL ) {
2008-01-09 12:28:44 +01:00
return false ;
2007-08-21 14:06:46 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
if ( ! prs_data_blob ( & p - > in_data . data , & blob , r ) ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2008-09-23 20:59:30 +02:00
pull = ndr_pull_init_blob ( & blob , r , NULL ) ;
2006-10-10 07:55:46 +00:00
if ( pull = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-19 01:27:20 +00:00
pull - > flags | = LIBNDR_FLAG_REF_ALLOC ;
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_pull ( pull , NDR_IN , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2009-02-16 10:59:45 +01:00
NDR_PRINT_IN_DEBUG ( netr_LogonGetCapabilities , r ) ;
2008-01-09 12:28:44 +01:00
}
2009-02-16 10:59:45 +01:00
ZERO_STRUCT ( r - > out ) ;
r - > out . return_authenticator = r - > in . return_authenticator ;
r - > out . capabilities = talloc_zero ( r , union netr_Capabilities ) ;
if ( r - > out . capabilities = = NULL ) {
talloc_free ( r ) ;
return false ;
}
r - > out . result = _netr_LogonGetCapabilities ( p , r ) ;
2008-01-09 12:28:44 +01:00
2006-10-10 07:55:46 +00:00
if ( p - > rng_fault_state ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
/* Return true here, srv_pipe_hnd.c will take care */
return true ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2009-02-16 10:59:45 +01:00
NDR_PRINT_OUT_DEBUG ( netr_LogonGetCapabilities , r ) ;
2008-01-09 12:28:44 +01:00
}
2008-10-12 19:05:46 +02:00
push = ndr_push_init_ctx ( r , NULL ) ;
2006-09-19 01:27:20 +00:00
if ( push = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_push ( push , NDR_OUT , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-19 01:27:20 +00:00
blob = ndr_push_blob ( push ) ;
2008-01-09 12:28:44 +01:00
if ( ! prs_copy_data_in ( & p - > out_data . rdata , ( const char * ) blob . data , ( uint32_t ) blob . length ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return true ;
2006-09-19 01:27:20 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_netr_NETRLOGONSETSERVICEBITS ( pipes_struct * p )
2006-09-19 01:27:20 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-19 01:27:20 +00:00
struct ndr_pull * pull ;
struct ndr_push * push ;
2007-11-09 14:38:47 +01:00
enum ndr_err_code ndr_err ;
2006-09-19 01:27:20 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct netr_NETRLOGONSETSERVICEBITS * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_netlogon . calls [ NDR_NETR_NETRLOGONSETSERVICEBITS ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct netr_NETRLOGONSETSERVICEBITS ) ;
2007-08-21 14:06:46 +00:00
if ( r = = NULL ) {
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
if ( ! prs_data_blob ( & p - > in_data . data , & blob , r ) ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2007-08-21 14:06:46 +00:00
}
2008-01-09 12:28:44 +01:00
2008-09-23 20:59:30 +02:00
pull = ndr_pull_init_blob ( & blob , r , NULL ) ;
2006-10-10 07:55:46 +00:00
if ( pull = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-19 01:27:20 +00:00
pull - > flags | = LIBNDR_FLAG_REF_ALLOC ;
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_pull ( pull , NDR_IN , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_IN_DEBUG ( netr_NETRLOGONSETSERVICEBITS , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
r - > out . result = _netr_NETRLOGONSETSERVICEBITS ( p , r ) ;
2008-01-09 12:28:44 +01:00
2006-10-10 07:55:46 +00:00
if ( p - > rng_fault_state ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
/* Return true here, srv_pipe_hnd.c will take care */
return true ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_OUT_DEBUG ( netr_NETRLOGONSETSERVICEBITS , r ) ;
2008-01-09 12:28:44 +01:00
}
2008-10-12 19:05:46 +02:00
push = ndr_push_init_ctx ( r , NULL ) ;
2006-09-19 01:27:20 +00:00
if ( push = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_push ( push , NDR_OUT , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-19 01:27:20 +00:00
blob = ndr_push_blob ( push ) ;
2008-01-09 12:28:44 +01:00
if ( ! prs_copy_data_in ( & p - > out_data . rdata , ( const char * ) blob . data , ( uint32_t ) blob . length ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return true ;
2006-09-19 01:27:20 +00:00
}
2008-01-24 23:37:57 +01:00
static bool api_netr_LogonGetTrustRid ( pipes_struct * p )
2006-09-19 01:27:20 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-19 01:27:20 +00:00
struct ndr_pull * pull ;
struct ndr_push * push ;
2007-11-09 14:38:47 +01:00
enum ndr_err_code ndr_err ;
2006-09-19 01:27:20 +00:00
DATA_BLOB blob ;
2008-01-24 23:37:57 +01:00
struct netr_LogonGetTrustRid * r ;
2008-01-09 12:28:44 +01:00
2008-01-24 23:37:57 +01:00
call = & ndr_table_netlogon . calls [ NDR_NETR_LOGONGETTRUSTRID ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct netr_LogonGetTrustRid ) ;
2007-08-21 14:06:46 +00:00
if ( r = = NULL ) {
2008-01-09 12:28:44 +01:00
return false ;
2007-08-21 14:06:46 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
if ( ! prs_data_blob ( & p - > in_data . data , & blob , r ) ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2008-09-23 20:59:30 +02:00
pull = ndr_pull_init_blob ( & blob , r , NULL ) ;
2006-10-10 07:55:46 +00:00
if ( pull = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-19 01:27:20 +00:00
pull - > flags | = LIBNDR_FLAG_REF_ALLOC ;
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_pull ( pull , NDR_IN , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2008-01-24 23:37:57 +01:00
NDR_PRINT_IN_DEBUG ( netr_LogonGetTrustRid , r ) ;
2008-01-09 12:28:44 +01:00
}
2008-01-24 23:37:57 +01:00
ZERO_STRUCT ( r - > out ) ;
r - > out . rid = talloc_zero ( r , uint32_t ) ;
if ( r - > out . rid = = NULL ) {
talloc_free ( r ) ;
return false ;
}
r - > out . result = _netr_LogonGetTrustRid ( p , r ) ;
2008-01-09 12:28:44 +01:00
2006-10-10 07:55:46 +00:00
if ( p - > rng_fault_state ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
/* Return true here, srv_pipe_hnd.c will take care */
return true ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2008-01-24 23:37:57 +01:00
NDR_PRINT_OUT_DEBUG ( netr_LogonGetTrustRid , r ) ;
2008-01-09 12:28:44 +01:00
}
2008-10-12 19:05:46 +02:00
push = ndr_push_init_ctx ( r , NULL ) ;
2006-09-19 01:27:20 +00:00
if ( push = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_push ( push , NDR_OUT , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-19 01:27:20 +00:00
blob = ndr_push_blob ( push ) ;
2008-01-09 12:28:44 +01:00
if ( ! prs_copy_data_in ( & p - > out_data . rdata , ( const char * ) blob . data , ( uint32_t ) blob . length ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return true ;
2006-09-19 01:27:20 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_netr_NETRLOGONCOMPUTESERVERDIGEST ( pipes_struct * p )
2006-09-19 01:27:20 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-19 01:27:20 +00:00
struct ndr_pull * pull ;
struct ndr_push * push ;
2007-11-09 14:38:47 +01:00
enum ndr_err_code ndr_err ;
2006-09-19 01:27:20 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct netr_NETRLOGONCOMPUTESERVERDIGEST * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_netlogon . calls [ NDR_NETR_NETRLOGONCOMPUTESERVERDIGEST ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct netr_NETRLOGONCOMPUTESERVERDIGEST ) ;
2007-08-21 14:06:46 +00:00
if ( r = = NULL ) {
2008-01-09 12:28:44 +01:00
return false ;
2007-08-21 14:06:46 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
if ( ! prs_data_blob ( & p - > in_data . data , & blob , r ) ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2008-09-23 20:59:30 +02:00
pull = ndr_pull_init_blob ( & blob , r , NULL ) ;
2006-10-10 07:55:46 +00:00
if ( pull = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-19 01:27:20 +00:00
pull - > flags | = LIBNDR_FLAG_REF_ALLOC ;
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_pull ( pull , NDR_IN , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_IN_DEBUG ( netr_NETRLOGONCOMPUTESERVERDIGEST , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
r - > out . result = _netr_NETRLOGONCOMPUTESERVERDIGEST ( p , r ) ;
2008-01-09 12:28:44 +01:00
2006-10-10 07:55:46 +00:00
if ( p - > rng_fault_state ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
/* Return true here, srv_pipe_hnd.c will take care */
return true ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_OUT_DEBUG ( netr_NETRLOGONCOMPUTESERVERDIGEST , r ) ;
2008-01-09 12:28:44 +01:00
}
2008-10-12 19:05:46 +02:00
push = ndr_push_init_ctx ( r , NULL ) ;
2006-09-19 01:27:20 +00:00
if ( push = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_push ( push , NDR_OUT , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-19 01:27:20 +00:00
blob = ndr_push_blob ( push ) ;
2008-01-09 12:28:44 +01:00
if ( ! prs_copy_data_in ( & p - > out_data . rdata , ( const char * ) blob . data , ( uint32_t ) blob . length ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return true ;
2006-09-19 01:27:20 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_netr_NETRLOGONCOMPUTECLIENTDIGEST ( pipes_struct * p )
2006-09-19 01:27:20 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-19 01:27:20 +00:00
struct ndr_pull * pull ;
struct ndr_push * push ;
2007-11-09 14:38:47 +01:00
enum ndr_err_code ndr_err ;
2006-09-19 01:27:20 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct netr_NETRLOGONCOMPUTECLIENTDIGEST * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_netlogon . calls [ NDR_NETR_NETRLOGONCOMPUTECLIENTDIGEST ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct netr_NETRLOGONCOMPUTECLIENTDIGEST ) ;
2007-08-21 14:06:46 +00:00
if ( r = = NULL ) {
2008-01-09 12:28:44 +01:00
return false ;
2007-08-21 14:06:46 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
if ( ! prs_data_blob ( & p - > in_data . data , & blob , r ) ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2008-09-23 20:59:30 +02:00
pull = ndr_pull_init_blob ( & blob , r , NULL ) ;
2006-10-10 07:55:46 +00:00
if ( pull = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-19 01:27:20 +00:00
pull - > flags | = LIBNDR_FLAG_REF_ALLOC ;
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_pull ( pull , NDR_IN , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_IN_DEBUG ( netr_NETRLOGONCOMPUTECLIENTDIGEST , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
r - > out . result = _netr_NETRLOGONCOMPUTECLIENTDIGEST ( p , r ) ;
2008-01-09 12:28:44 +01:00
2006-10-10 07:55:46 +00:00
if ( p - > rng_fault_state ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
/* Return true here, srv_pipe_hnd.c will take care */
return true ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_OUT_DEBUG ( netr_NETRLOGONCOMPUTECLIENTDIGEST , r ) ;
2008-01-09 12:28:44 +01:00
}
2008-10-12 19:05:46 +02:00
push = ndr_push_init_ctx ( r , NULL ) ;
2006-09-19 01:27:20 +00:00
if ( push = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_push ( push , NDR_OUT , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-19 01:27:20 +00:00
blob = ndr_push_blob ( push ) ;
2008-01-09 12:28:44 +01:00
if ( ! prs_copy_data_in ( & p - > out_data . rdata , ( const char * ) blob . data , ( uint32_t ) blob . length ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return true ;
2006-09-19 01:27:20 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_netr_ServerAuthenticate3 ( pipes_struct * p )
2006-09-19 01:27:20 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-19 01:27:20 +00:00
struct ndr_pull * pull ;
struct ndr_push * push ;
2007-11-09 14:38:47 +01:00
enum ndr_err_code ndr_err ;
2006-09-19 01:27:20 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct netr_ServerAuthenticate3 * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_netlogon . calls [ NDR_NETR_SERVERAUTHENTICATE3 ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct netr_ServerAuthenticate3 ) ;
2007-08-21 14:06:46 +00:00
if ( r = = NULL ) {
2008-01-09 12:28:44 +01:00
return false ;
2007-08-21 14:06:46 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
if ( ! prs_data_blob ( & p - > in_data . data , & blob , r ) ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2008-09-23 20:59:30 +02:00
pull = ndr_pull_init_blob ( & blob , r , NULL ) ;
2006-10-10 07:55:46 +00:00
if ( pull = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-19 01:27:20 +00:00
pull - > flags | = LIBNDR_FLAG_REF_ALLOC ;
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_pull ( pull , NDR_IN , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_IN_DEBUG ( netr_ServerAuthenticate3 , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
ZERO_STRUCT ( r - > out ) ;
2008-11-19 22:00:43 +01:00
r - > out . negotiate_flags = r - > in . negotiate_flags ;
2008-10-29 02:44:59 +01:00
r - > out . return_credentials = talloc_zero ( r , struct netr_Credential ) ;
if ( r - > out . return_credentials = = NULL ) {
talloc_free ( r ) ;
return false ;
}
2007-08-21 14:06:46 +00:00
r - > out . rid = talloc_zero ( r , uint32_t ) ;
if ( r - > out . rid = = NULL ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
r - > out . result = _netr_ServerAuthenticate3 ( p , r ) ;
2008-01-09 12:28:44 +01:00
2006-10-10 07:55:46 +00:00
if ( p - > rng_fault_state ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
/* Return true here, srv_pipe_hnd.c will take care */
return true ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_OUT_DEBUG ( netr_ServerAuthenticate3 , r ) ;
2008-01-09 12:28:44 +01:00
}
2008-10-12 19:05:46 +02:00
push = ndr_push_init_ctx ( r , NULL ) ;
2006-09-19 01:27:20 +00:00
if ( push = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_push ( push , NDR_OUT , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-19 01:27:20 +00:00
blob = ndr_push_blob ( push ) ;
2008-01-09 12:28:44 +01:00
if ( ! prs_copy_data_in ( & p - > out_data . rdata , ( const char * ) blob . data , ( uint32_t ) blob . length ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return true ;
2006-09-19 01:27:20 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_netr_DsRGetDCNameEx ( pipes_struct * p )
2006-09-19 01:27:20 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-19 01:27:20 +00:00
struct ndr_pull * pull ;
struct ndr_push * push ;
2007-11-09 14:38:47 +01:00
enum ndr_err_code ndr_err ;
2006-09-19 01:27:20 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct netr_DsRGetDCNameEx * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_netlogon . calls [ NDR_NETR_DSRGETDCNAMEEX ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct netr_DsRGetDCNameEx ) ;
2007-08-21 14:06:46 +00:00
if ( r = = NULL ) {
2008-01-09 12:28:44 +01:00
return false ;
2007-08-21 14:06:46 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
if ( ! prs_data_blob ( & p - > in_data . data , & blob , r ) ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2008-09-23 20:59:30 +02:00
pull = ndr_pull_init_blob ( & blob , r , NULL ) ;
2006-10-10 07:55:46 +00:00
if ( pull = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-19 01:27:20 +00:00
pull - > flags | = LIBNDR_FLAG_REF_ALLOC ;
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_pull ( pull , NDR_IN , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_IN_DEBUG ( netr_DsRGetDCNameEx , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
ZERO_STRUCT ( r - > out ) ;
2008-01-25 21:15:36 +01:00
r - > out . info = talloc_zero ( r , struct netr_DsRGetDCNameInfo * ) ;
2007-08-21 14:06:46 +00:00
if ( r - > out . info = = NULL ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
r - > out . result = _netr_DsRGetDCNameEx ( p , r ) ;
2008-01-09 12:28:44 +01:00
2006-10-10 07:55:46 +00:00
if ( p - > rng_fault_state ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
/* Return true here, srv_pipe_hnd.c will take care */
return true ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_OUT_DEBUG ( netr_DsRGetDCNameEx , r ) ;
2008-01-09 12:28:44 +01:00
}
2008-10-12 19:05:46 +02:00
push = ndr_push_init_ctx ( r , NULL ) ;
2006-09-19 01:27:20 +00:00
if ( push = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_push ( push , NDR_OUT , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-19 01:27:20 +00:00
blob = ndr_push_blob ( push ) ;
2008-01-09 12:28:44 +01:00
if ( ! prs_copy_data_in ( & p - > out_data . rdata , ( const char * ) blob . data , ( uint32_t ) blob . length ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return true ;
2006-09-19 01:27:20 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_netr_DsRGetSiteName ( pipes_struct * p )
2006-09-19 01:27:20 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-19 01:27:20 +00:00
struct ndr_pull * pull ;
struct ndr_push * push ;
2007-11-09 14:38:47 +01:00
enum ndr_err_code ndr_err ;
2006-09-19 01:27:20 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct netr_DsRGetSiteName * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_netlogon . calls [ NDR_NETR_DSRGETSITENAME ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct netr_DsRGetSiteName ) ;
2007-08-21 14:06:46 +00:00
if ( r = = NULL ) {
2008-01-09 12:28:44 +01:00
return false ;
2007-08-21 14:06:46 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
if ( ! prs_data_blob ( & p - > in_data . data , & blob , r ) ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2008-09-23 20:59:30 +02:00
pull = ndr_pull_init_blob ( & blob , r , NULL ) ;
2006-10-10 07:55:46 +00:00
if ( pull = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-19 01:27:20 +00:00
pull - > flags | = LIBNDR_FLAG_REF_ALLOC ;
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_pull ( pull , NDR_IN , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_IN_DEBUG ( netr_DsRGetSiteName , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
ZERO_STRUCT ( r - > out ) ;
r - > out . site = talloc_zero ( r , const char * ) ;
if ( r - > out . site = = NULL ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
r - > out . result = _netr_DsRGetSiteName ( p , r ) ;
2008-01-09 12:28:44 +01:00
2006-10-10 07:55:46 +00:00
if ( p - > rng_fault_state ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
/* Return true here, srv_pipe_hnd.c will take care */
return true ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_OUT_DEBUG ( netr_DsRGetSiteName , r ) ;
2008-01-09 12:28:44 +01:00
}
2008-10-12 19:05:46 +02:00
push = ndr_push_init_ctx ( r , NULL ) ;
2006-09-19 01:27:20 +00:00
if ( push = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_push ( push , NDR_OUT , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-19 01:27:20 +00:00
blob = ndr_push_blob ( push ) ;
2008-01-09 12:28:44 +01:00
if ( ! prs_copy_data_in ( & p - > out_data . rdata , ( const char * ) blob . data , ( uint32_t ) blob . length ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return true ;
2006-09-19 01:27:20 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_netr_LogonGetDomainInfo ( pipes_struct * p )
2006-09-19 01:27:20 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-19 01:27:20 +00:00
struct ndr_pull * pull ;
struct ndr_push * push ;
2007-11-09 14:38:47 +01:00
enum ndr_err_code ndr_err ;
2006-09-19 01:27:20 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct netr_LogonGetDomainInfo * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_netlogon . calls [ NDR_NETR_LOGONGETDOMAININFO ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct netr_LogonGetDomainInfo ) ;
2007-08-21 14:06:46 +00:00
if ( r = = NULL ) {
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
if ( ! prs_data_blob ( & p - > in_data . data , & blob , r ) ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2007-08-21 14:06:46 +00:00
}
2008-01-09 12:28:44 +01:00
2008-09-23 20:59:30 +02:00
pull = ndr_pull_init_blob ( & blob , r , NULL ) ;
2006-10-10 07:55:46 +00:00
if ( pull = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-19 01:27:20 +00:00
pull - > flags | = LIBNDR_FLAG_REF_ALLOC ;
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_pull ( pull , NDR_IN , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_IN_DEBUG ( netr_LogonGetDomainInfo , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
ZERO_STRUCT ( r - > out ) ;
r - > out . return_authenticator = r - > in . return_authenticator ;
r - > out . info = talloc_zero ( r , union netr_DomainInfo ) ;
if ( r - > out . info = = NULL ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
r - > out . result = _netr_LogonGetDomainInfo ( p , r ) ;
2008-01-09 12:28:44 +01:00
2006-10-10 07:55:46 +00:00
if ( p - > rng_fault_state ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
/* Return true here, srv_pipe_hnd.c will take care */
return true ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_OUT_DEBUG ( netr_LogonGetDomainInfo , r ) ;
2008-01-09 12:28:44 +01:00
}
2008-10-12 19:05:46 +02:00
push = ndr_push_init_ctx ( r , NULL ) ;
2006-09-19 01:27:20 +00:00
if ( push = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_push ( push , NDR_OUT , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-19 01:27:20 +00:00
blob = ndr_push_blob ( push ) ;
2008-01-09 12:28:44 +01:00
if ( ! prs_copy_data_in ( & p - > out_data . rdata , ( const char * ) blob . data , ( uint32_t ) blob . length ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return true ;
2006-09-19 01:27:20 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_netr_ServerPasswordSet2 ( pipes_struct * p )
2006-09-19 01:27:20 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-19 01:27:20 +00:00
struct ndr_pull * pull ;
struct ndr_push * push ;
2007-11-09 14:38:47 +01:00
enum ndr_err_code ndr_err ;
2006-09-19 01:27:20 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct netr_ServerPasswordSet2 * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_netlogon . calls [ NDR_NETR_SERVERPASSWORDSET2 ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct netr_ServerPasswordSet2 ) ;
2007-08-21 14:06:46 +00:00
if ( r = = NULL ) {
2008-01-09 12:28:44 +01:00
return false ;
2007-08-21 14:06:46 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
if ( ! prs_data_blob ( & p - > in_data . data , & blob , r ) ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2008-09-23 20:59:30 +02:00
pull = ndr_pull_init_blob ( & blob , r , NULL ) ;
2006-10-10 07:55:46 +00:00
if ( pull = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-19 01:27:20 +00:00
pull - > flags | = LIBNDR_FLAG_REF_ALLOC ;
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_pull ( pull , NDR_IN , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_IN_DEBUG ( netr_ServerPasswordSet2 , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
ZERO_STRUCT ( r - > out ) ;
r - > out . return_authenticator = talloc_zero ( r , struct netr_Authenticator ) ;
if ( r - > out . return_authenticator = = NULL ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
r - > out . result = _netr_ServerPasswordSet2 ( p , r ) ;
2008-01-09 12:28:44 +01:00
2006-10-10 07:55:46 +00:00
if ( p - > rng_fault_state ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
/* Return true here, srv_pipe_hnd.c will take care */
return true ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_OUT_DEBUG ( netr_ServerPasswordSet2 , r ) ;
2008-01-09 12:28:44 +01:00
}
2008-10-12 19:05:46 +02:00
push = ndr_push_init_ctx ( r , NULL ) ;
2006-09-19 01:27:20 +00:00
if ( push = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_push ( push , NDR_OUT , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-19 01:27:20 +00:00
blob = ndr_push_blob ( push ) ;
2008-01-09 12:28:44 +01:00
if ( ! prs_copy_data_in ( & p - > out_data . rdata , ( const char * ) blob . data , ( uint32_t ) blob . length ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return true ;
2006-09-19 01:27:20 +00:00
}
2008-01-17 10:00:37 +01:00
static bool api_netr_ServerPasswordGet ( pipes_struct * p )
2006-09-19 01:27:20 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-19 01:27:20 +00:00
struct ndr_pull * pull ;
struct ndr_push * push ;
2007-11-09 14:38:47 +01:00
enum ndr_err_code ndr_err ;
2006-09-19 01:27:20 +00:00
DATA_BLOB blob ;
2008-01-17 10:00:37 +01:00
struct netr_ServerPasswordGet * r ;
2008-01-09 12:28:44 +01:00
2008-01-17 10:00:37 +01:00
call = & ndr_table_netlogon . calls [ NDR_NETR_SERVERPASSWORDGET ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct netr_ServerPasswordGet ) ;
2007-08-21 14:06:46 +00:00
if ( r = = NULL ) {
2008-01-09 12:28:44 +01:00
return false ;
2007-08-21 14:06:46 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
if ( ! prs_data_blob ( & p - > in_data . data , & blob , r ) ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2008-09-23 20:59:30 +02:00
pull = ndr_pull_init_blob ( & blob , r , NULL ) ;
2006-10-10 07:55:46 +00:00
if ( pull = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-19 01:27:20 +00:00
pull - > flags | = LIBNDR_FLAG_REF_ALLOC ;
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_pull ( pull , NDR_IN , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2008-01-17 10:00:37 +01:00
NDR_PRINT_IN_DEBUG ( netr_ServerPasswordGet , r ) ;
}
ZERO_STRUCT ( r - > out ) ;
r - > out . return_authenticator = talloc_zero ( r , struct netr_Authenticator ) ;
if ( r - > out . return_authenticator = = NULL ) {
talloc_free ( r ) ;
return false ;
2008-01-09 12:28:44 +01:00
}
2008-01-17 10:00:37 +01:00
r - > out . password = talloc_zero ( r , struct samr_Password ) ;
if ( r - > out . password = = NULL ) {
talloc_free ( r ) ;
return false ;
}
r - > out . result = _netr_ServerPasswordGet ( p , r ) ;
2008-01-09 12:28:44 +01:00
2006-10-10 07:55:46 +00:00
if ( p - > rng_fault_state ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
/* Return true here, srv_pipe_hnd.c will take care */
return true ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2008-01-17 10:00:37 +01:00
NDR_PRINT_OUT_DEBUG ( netr_ServerPasswordGet , r ) ;
2008-01-09 12:28:44 +01:00
}
2008-10-12 19:05:46 +02:00
push = ndr_push_init_ctx ( r , NULL ) ;
2006-09-19 01:27:20 +00:00
if ( push = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_push ( push , NDR_OUT , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-19 01:27:20 +00:00
blob = ndr_push_blob ( push ) ;
2008-01-09 12:28:44 +01:00
if ( ! prs_copy_data_in ( & p - > out_data . rdata , ( const char * ) blob . data , ( uint32_t ) blob . length ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return true ;
2006-09-19 01:27:20 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_netr_NETRLOGONSENDTOSAM ( pipes_struct * p )
2006-09-19 01:27:20 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-19 01:27:20 +00:00
struct ndr_pull * pull ;
struct ndr_push * push ;
2007-11-09 14:38:47 +01:00
enum ndr_err_code ndr_err ;
2006-09-19 01:27:20 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct netr_NETRLOGONSENDTOSAM * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_netlogon . calls [ NDR_NETR_NETRLOGONSENDTOSAM ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct netr_NETRLOGONSENDTOSAM ) ;
2007-08-21 14:06:46 +00:00
if ( r = = NULL ) {
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
if ( ! prs_data_blob ( & p - > in_data . data , & blob , r ) ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2007-08-21 14:06:46 +00:00
}
2008-01-09 12:28:44 +01:00
2008-09-23 20:59:30 +02:00
pull = ndr_pull_init_blob ( & blob , r , NULL ) ;
2006-10-10 07:55:46 +00:00
if ( pull = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-19 01:27:20 +00:00
pull - > flags | = LIBNDR_FLAG_REF_ALLOC ;
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_pull ( pull , NDR_IN , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_IN_DEBUG ( netr_NETRLOGONSENDTOSAM , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
r - > out . result = _netr_NETRLOGONSENDTOSAM ( p , r ) ;
2008-01-09 12:28:44 +01:00
2006-10-10 07:55:46 +00:00
if ( p - > rng_fault_state ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
/* Return true here, srv_pipe_hnd.c will take care */
return true ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_OUT_DEBUG ( netr_NETRLOGONSENDTOSAM , r ) ;
2008-01-09 12:28:44 +01:00
}
2008-10-12 19:05:46 +02:00
push = ndr_push_init_ctx ( r , NULL ) ;
2006-09-19 01:27:20 +00:00
if ( push = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_push ( push , NDR_OUT , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-19 01:27:20 +00:00
blob = ndr_push_blob ( push ) ;
2008-01-09 12:28:44 +01:00
if ( ! prs_copy_data_in ( & p - > out_data . rdata , ( const char * ) blob . data , ( uint32_t ) blob . length ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return true ;
2006-09-19 01:27:20 +00:00
}
2008-01-17 10:00:37 +01:00
static bool api_netr_DsRAddressToSitenamesW ( pipes_struct * p )
2006-09-19 01:27:20 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-19 01:27:20 +00:00
struct ndr_pull * pull ;
struct ndr_push * push ;
2007-11-09 14:38:47 +01:00
enum ndr_err_code ndr_err ;
2006-09-19 01:27:20 +00:00
DATA_BLOB blob ;
2008-01-17 10:00:37 +01:00
struct netr_DsRAddressToSitenamesW * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_netlogon . calls [ NDR_NETR_DSRADDRESSTOSITENAMESW ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct netr_DsRAddressToSitenamesW ) ;
2007-08-21 14:06:46 +00:00
if ( r = = NULL ) {
2008-01-09 12:28:44 +01:00
return false ;
2007-08-21 14:06:46 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
if ( ! prs_data_blob ( & p - > in_data . data , & blob , r ) ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2008-09-23 20:59:30 +02:00
pull = ndr_pull_init_blob ( & blob , r , NULL ) ;
2006-10-10 07:55:46 +00:00
if ( pull = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-19 01:27:20 +00:00
pull - > flags | = LIBNDR_FLAG_REF_ALLOC ;
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_pull ( pull , NDR_IN , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2008-01-17 10:00:37 +01:00
NDR_PRINT_IN_DEBUG ( netr_DsRAddressToSitenamesW , r ) ;
}
ZERO_STRUCT ( r - > out ) ;
r - > out . ctr = talloc_zero ( r , struct netr_DsRAddressToSitenamesWCtr * ) ;
if ( r - > out . ctr = = NULL ) {
talloc_free ( r ) ;
return false ;
2008-01-09 12:28:44 +01:00
}
2008-01-17 10:00:37 +01:00
r - > out . result = _netr_DsRAddressToSitenamesW ( p , r ) ;
2008-01-09 12:28:44 +01:00
2006-10-10 07:55:46 +00:00
if ( p - > rng_fault_state ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
/* Return true here, srv_pipe_hnd.c will take care */
return true ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2008-01-17 10:00:37 +01:00
NDR_PRINT_OUT_DEBUG ( netr_DsRAddressToSitenamesW , r ) ;
2008-01-09 12:28:44 +01:00
}
2008-10-12 19:05:46 +02:00
push = ndr_push_init_ctx ( r , NULL ) ;
2006-09-19 01:27:20 +00:00
if ( push = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_push ( push , NDR_OUT , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-19 01:27:20 +00:00
blob = ndr_push_blob ( push ) ;
2008-01-09 12:28:44 +01:00
if ( ! prs_copy_data_in ( & p - > out_data . rdata , ( const char * ) blob . data , ( uint32_t ) blob . length ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return true ;
2006-09-19 01:27:20 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_netr_DsRGetDCNameEx2 ( pipes_struct * p )
2006-09-19 01:27:20 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-19 01:27:20 +00:00
struct ndr_pull * pull ;
struct ndr_push * push ;
2007-11-09 14:38:47 +01:00
enum ndr_err_code ndr_err ;
2006-09-19 01:27:20 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct netr_DsRGetDCNameEx2 * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_netlogon . calls [ NDR_NETR_DSRGETDCNAMEEX2 ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct netr_DsRGetDCNameEx2 ) ;
2007-08-21 14:06:46 +00:00
if ( r = = NULL ) {
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
if ( ! prs_data_blob ( & p - > in_data . data , & blob , r ) ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2007-08-21 14:06:46 +00:00
}
2008-01-09 12:28:44 +01:00
2008-09-23 20:59:30 +02:00
pull = ndr_pull_init_blob ( & blob , r , NULL ) ;
2006-10-10 07:55:46 +00:00
if ( pull = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-19 01:27:20 +00:00
pull - > flags | = LIBNDR_FLAG_REF_ALLOC ;
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_pull ( pull , NDR_IN , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_IN_DEBUG ( netr_DsRGetDCNameEx2 , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
ZERO_STRUCT ( r - > out ) ;
2008-01-25 21:15:36 +01:00
r - > out . info = talloc_zero ( r , struct netr_DsRGetDCNameInfo * ) ;
2007-08-21 14:06:46 +00:00
if ( r - > out . info = = NULL ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
r - > out . result = _netr_DsRGetDCNameEx2 ( p , r ) ;
2008-01-09 12:28:44 +01:00
2006-10-10 07:55:46 +00:00
if ( p - > rng_fault_state ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
/* Return true here, srv_pipe_hnd.c will take care */
return true ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_OUT_DEBUG ( netr_DsRGetDCNameEx2 , r ) ;
2008-01-09 12:28:44 +01:00
}
2008-10-12 19:05:46 +02:00
push = ndr_push_init_ctx ( r , NULL ) ;
2006-09-19 01:27:20 +00:00
if ( push = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_push ( push , NDR_OUT , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-19 01:27:20 +00:00
blob = ndr_push_blob ( push ) ;
2008-01-09 12:28:44 +01:00
if ( ! prs_copy_data_in ( & p - > out_data . rdata , ( const char * ) blob . data , ( uint32_t ) blob . length ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return true ;
2006-09-19 01:27:20 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN ( pipes_struct * p )
2006-09-19 01:27:20 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-19 01:27:20 +00:00
struct ndr_pull * pull ;
struct ndr_push * push ;
2007-11-09 14:38:47 +01:00
enum ndr_err_code ndr_err ;
2006-09-19 01:27:20 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_netlogon . calls [ NDR_NETR_NETRLOGONGETTIMESERVICEPARENTDOMAIN ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN ) ;
2007-08-21 14:06:46 +00:00
if ( r = = NULL ) {
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
if ( ! prs_data_blob ( & p - > in_data . data , & blob , r ) ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2007-08-21 14:06:46 +00:00
}
2008-01-09 12:28:44 +01:00
2008-09-23 20:59:30 +02:00
pull = ndr_pull_init_blob ( & blob , r , NULL ) ;
2006-10-10 07:55:46 +00:00
if ( pull = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-19 01:27:20 +00:00
pull - > flags | = LIBNDR_FLAG_REF_ALLOC ;
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_pull ( pull , NDR_IN , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_IN_DEBUG ( netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
r - > out . result = _netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN ( p , r ) ;
2008-01-09 12:28:44 +01:00
2006-10-10 07:55:46 +00:00
if ( p - > rng_fault_state ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
/* Return true here, srv_pipe_hnd.c will take care */
return true ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_OUT_DEBUG ( netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN , r ) ;
2008-01-09 12:28:44 +01:00
}
2008-10-12 19:05:46 +02:00
push = ndr_push_init_ctx ( r , NULL ) ;
2006-09-19 01:27:20 +00:00
if ( push = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_push ( push , NDR_OUT , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-19 01:27:20 +00:00
blob = ndr_push_blob ( push ) ;
2008-01-09 12:28:44 +01:00
if ( ! prs_copy_data_in ( & p - > out_data . rdata , ( const char * ) blob . data , ( uint32_t ) blob . length ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return true ;
2006-09-19 01:27:20 +00:00
}
2008-01-17 10:00:37 +01:00
static bool api_netr_NetrEnumerateTrustedDomainsEx ( pipes_struct * p )
2006-09-19 01:27:20 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-19 01:27:20 +00:00
struct ndr_pull * pull ;
struct ndr_push * push ;
2007-11-09 14:38:47 +01:00
enum ndr_err_code ndr_err ;
2006-09-19 01:27:20 +00:00
DATA_BLOB blob ;
2008-01-17 10:00:37 +01:00
struct netr_NetrEnumerateTrustedDomainsEx * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_netlogon . calls [ NDR_NETR_NETRENUMERATETRUSTEDDOMAINSEX ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct netr_NetrEnumerateTrustedDomainsEx ) ;
2007-08-21 14:06:46 +00:00
if ( r = = NULL ) {
2008-01-09 12:28:44 +01:00
return false ;
2007-08-21 14:06:46 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
if ( ! prs_data_blob ( & p - > in_data . data , & blob , r ) ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2008-09-23 20:59:30 +02:00
pull = ndr_pull_init_blob ( & blob , r , NULL ) ;
2006-10-10 07:55:46 +00:00
if ( pull = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-19 01:27:20 +00:00
pull - > flags | = LIBNDR_FLAG_REF_ALLOC ;
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_pull ( pull , NDR_IN , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2008-01-17 10:00:37 +01:00
NDR_PRINT_IN_DEBUG ( netr_NetrEnumerateTrustedDomainsEx , r ) ;
2008-01-09 12:28:44 +01:00
}
2008-01-17 10:00:37 +01:00
ZERO_STRUCT ( r - > out ) ;
r - > out . dom_trust_list = talloc_zero ( r , struct netr_DomainTrustList ) ;
if ( r - > out . dom_trust_list = = NULL ) {
talloc_free ( r ) ;
return false ;
}
r - > out . result = _netr_NetrEnumerateTrustedDomainsEx ( p , r ) ;
2008-01-09 12:28:44 +01:00
2006-10-10 07:55:46 +00:00
if ( p - > rng_fault_state ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
/* Return true here, srv_pipe_hnd.c will take care */
return true ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2008-01-17 10:00:37 +01:00
NDR_PRINT_OUT_DEBUG ( netr_NetrEnumerateTrustedDomainsEx , r ) ;
2008-01-09 12:28:44 +01:00
}
2008-10-12 19:05:46 +02:00
push = ndr_push_init_ctx ( r , NULL ) ;
2006-09-19 01:27:20 +00:00
if ( push = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_push ( push , NDR_OUT , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-19 01:27:20 +00:00
blob = ndr_push_blob ( push ) ;
2008-01-09 12:28:44 +01:00
if ( ! prs_copy_data_in ( & p - > out_data . rdata , ( const char * ) blob . data , ( uint32_t ) blob . length ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return true ;
2006-09-19 01:27:20 +00:00
}
2008-01-17 10:00:37 +01:00
static bool api_netr_DsRAddressToSitenamesExW ( pipes_struct * p )
2006-09-19 01:27:20 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-19 01:27:20 +00:00
struct ndr_pull * pull ;
struct ndr_push * push ;
2007-11-09 14:38:47 +01:00
enum ndr_err_code ndr_err ;
2006-09-19 01:27:20 +00:00
DATA_BLOB blob ;
2008-01-17 10:00:37 +01:00
struct netr_DsRAddressToSitenamesExW * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_netlogon . calls [ NDR_NETR_DSRADDRESSTOSITENAMESEXW ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct netr_DsRAddressToSitenamesExW ) ;
2007-08-21 14:06:46 +00:00
if ( r = = NULL ) {
2008-01-09 12:28:44 +01:00
return false ;
2007-08-21 14:06:46 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
if ( ! prs_data_blob ( & p - > in_data . data , & blob , r ) ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2008-09-23 20:59:30 +02:00
pull = ndr_pull_init_blob ( & blob , r , NULL ) ;
2006-10-10 07:55:46 +00:00
if ( pull = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-19 01:27:20 +00:00
pull - > flags | = LIBNDR_FLAG_REF_ALLOC ;
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_pull ( pull , NDR_IN , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2008-01-17 10:00:37 +01:00
NDR_PRINT_IN_DEBUG ( netr_DsRAddressToSitenamesExW , r ) ;
}
ZERO_STRUCT ( r - > out ) ;
r - > out . ctr = talloc_zero ( r , struct netr_DsRAddressToSitenamesExWCtr * ) ;
if ( r - > out . ctr = = NULL ) {
talloc_free ( r ) ;
return false ;
2008-01-09 12:28:44 +01:00
}
2008-01-17 10:00:37 +01:00
r - > out . result = _netr_DsRAddressToSitenamesExW ( p , r ) ;
2008-01-09 12:28:44 +01:00
2006-10-10 07:55:46 +00:00
if ( p - > rng_fault_state ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
/* Return true here, srv_pipe_hnd.c will take care */
return true ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2008-01-17 10:00:37 +01:00
NDR_PRINT_OUT_DEBUG ( netr_DsRAddressToSitenamesExW , r ) ;
2008-01-09 12:28:44 +01:00
}
2008-10-12 19:05:46 +02:00
push = ndr_push_init_ctx ( r , NULL ) ;
2006-09-19 01:27:20 +00:00
if ( push = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_push ( push , NDR_OUT , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-19 01:27:20 +00:00
blob = ndr_push_blob ( push ) ;
2008-01-09 12:28:44 +01:00
if ( ! prs_copy_data_in ( & p - > out_data . rdata , ( const char * ) blob . data , ( uint32_t ) blob . length ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return true ;
2006-09-19 01:27:20 +00:00
}
2008-01-17 10:00:37 +01:00
static bool api_netr_DsrGetDcSiteCoverageW ( pipes_struct * p )
2006-09-19 01:27:20 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-19 01:27:20 +00:00
struct ndr_pull * pull ;
struct ndr_push * push ;
2007-11-09 14:38:47 +01:00
enum ndr_err_code ndr_err ;
2006-09-19 01:27:20 +00:00
DATA_BLOB blob ;
2008-01-17 10:00:37 +01:00
struct netr_DsrGetDcSiteCoverageW * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_netlogon . calls [ NDR_NETR_DSRGETDCSITECOVERAGEW ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct netr_DsrGetDcSiteCoverageW ) ;
2007-08-21 14:06:46 +00:00
if ( r = = NULL ) {
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
if ( ! prs_data_blob ( & p - > in_data . data , & blob , r ) ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2007-08-21 14:06:46 +00:00
}
2008-01-09 12:28:44 +01:00
2008-09-23 20:59:30 +02:00
pull = ndr_pull_init_blob ( & blob , r , NULL ) ;
2006-10-10 07:55:46 +00:00
if ( pull = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-19 01:27:20 +00:00
pull - > flags | = LIBNDR_FLAG_REF_ALLOC ;
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_pull ( pull , NDR_IN , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2008-01-17 10:00:37 +01:00
NDR_PRINT_IN_DEBUG ( netr_DsrGetDcSiteCoverageW , r ) ;
}
ZERO_STRUCT ( r - > out ) ;
2008-10-27 14:24:46 +01:00
r - > out . ctr = talloc_zero ( r , struct DcSitesCtr * ) ;
2008-01-17 10:00:37 +01:00
if ( r - > out . ctr = = NULL ) {
talloc_free ( r ) ;
return false ;
2008-01-09 12:28:44 +01:00
}
2008-01-17 10:00:37 +01:00
r - > out . result = _netr_DsrGetDcSiteCoverageW ( p , r ) ;
2008-01-09 12:28:44 +01:00
2006-10-10 07:55:46 +00:00
if ( p - > rng_fault_state ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
/* Return true here, srv_pipe_hnd.c will take care */
return true ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2008-01-17 10:00:37 +01:00
NDR_PRINT_OUT_DEBUG ( netr_DsrGetDcSiteCoverageW , r ) ;
2008-01-09 12:28:44 +01:00
}
2008-10-12 19:05:46 +02:00
push = ndr_push_init_ctx ( r , NULL ) ;
2006-09-19 01:27:20 +00:00
if ( push = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_push ( push , NDR_OUT , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-19 01:27:20 +00:00
blob = ndr_push_blob ( push ) ;
2008-01-09 12:28:44 +01:00
if ( ! prs_copy_data_in ( & p - > out_data . rdata , ( const char * ) blob . data , ( uint32_t ) blob . length ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return true ;
2006-09-19 01:27:20 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_netr_LogonSamLogonEx ( pipes_struct * p )
2006-09-19 01:27:20 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-19 01:27:20 +00:00
struct ndr_pull * pull ;
struct ndr_push * push ;
2007-11-09 14:38:47 +01:00
enum ndr_err_code ndr_err ;
2006-09-19 01:27:20 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct netr_LogonSamLogonEx * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_netlogon . calls [ NDR_NETR_LOGONSAMLOGONEX ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct netr_LogonSamLogonEx ) ;
2007-08-21 14:06:46 +00:00
if ( r = = NULL ) {
2008-01-09 12:28:44 +01:00
return false ;
2007-08-21 14:06:46 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
if ( ! prs_data_blob ( & p - > in_data . data , & blob , r ) ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2008-09-23 20:59:30 +02:00
pull = ndr_pull_init_blob ( & blob , r , NULL ) ;
2006-10-10 07:55:46 +00:00
if ( pull = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-19 01:27:20 +00:00
pull - > flags | = LIBNDR_FLAG_REF_ALLOC ;
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_pull ( pull , NDR_IN , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_IN_DEBUG ( netr_LogonSamLogonEx , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
ZERO_STRUCT ( r - > out ) ;
2008-11-19 22:00:43 +01:00
r - > out . flags = r - > in . flags ;
2007-08-21 14:06:46 +00:00
r - > out . validation = talloc_zero ( r , union netr_Validation ) ;
if ( r - > out . validation = = NULL ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
r - > out . authoritative = talloc_zero ( r , uint8_t ) ;
if ( r - > out . authoritative = = NULL ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
r - > out . result = _netr_LogonSamLogonEx ( p , r ) ;
2008-01-09 12:28:44 +01:00
2006-10-10 07:55:46 +00:00
if ( p - > rng_fault_state ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
/* Return true here, srv_pipe_hnd.c will take care */
return true ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_OUT_DEBUG ( netr_LogonSamLogonEx , r ) ;
2008-01-09 12:28:44 +01:00
}
2008-10-12 19:05:46 +02:00
push = ndr_push_init_ctx ( r , NULL ) ;
2006-09-19 01:27:20 +00:00
if ( push = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_push ( push , NDR_OUT , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-19 01:27:20 +00:00
blob = ndr_push_blob ( push ) ;
2008-01-09 12:28:44 +01:00
if ( ! prs_copy_data_in ( & p - > out_data . rdata , ( const char * ) blob . data , ( uint32_t ) blob . length ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return true ;
2006-09-19 01:27:20 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_netr_DsrEnumerateDomainTrusts ( pipes_struct * p )
2006-09-19 01:27:20 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-19 01:27:20 +00:00
struct ndr_pull * pull ;
struct ndr_push * push ;
2007-11-09 14:38:47 +01:00
enum ndr_err_code ndr_err ;
2006-09-19 01:27:20 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct netr_DsrEnumerateDomainTrusts * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_netlogon . calls [ NDR_NETR_DSRENUMERATEDOMAINTRUSTS ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct netr_DsrEnumerateDomainTrusts ) ;
2007-08-21 14:06:46 +00:00
if ( r = = NULL ) {
2008-01-09 12:28:44 +01:00
return false ;
2007-08-21 14:06:46 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
if ( ! prs_data_blob ( & p - > in_data . data , & blob , r ) ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2008-09-23 20:59:30 +02:00
pull = ndr_pull_init_blob ( & blob , r , NULL ) ;
2006-10-10 07:55:46 +00:00
if ( pull = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-19 01:27:20 +00:00
pull - > flags | = LIBNDR_FLAG_REF_ALLOC ;
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_pull ( pull , NDR_IN , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_IN_DEBUG ( netr_DsrEnumerateDomainTrusts , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
ZERO_STRUCT ( r - > out ) ;
2008-01-25 16:33:36 +01:00
r - > out . trusts = talloc_zero ( r , struct netr_DomainTrustList ) ;
2007-08-21 14:06:46 +00:00
if ( r - > out . trusts = = NULL ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
r - > out . result = _netr_DsrEnumerateDomainTrusts ( p , r ) ;
2008-01-09 12:28:44 +01:00
2006-10-10 07:55:46 +00:00
if ( p - > rng_fault_state ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
/* Return true here, srv_pipe_hnd.c will take care */
return true ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_OUT_DEBUG ( netr_DsrEnumerateDomainTrusts , r ) ;
2008-01-09 12:28:44 +01:00
}
2008-10-12 19:05:46 +02:00
push = ndr_push_init_ctx ( r , NULL ) ;
2006-09-19 01:27:20 +00:00
if ( push = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_push ( push , NDR_OUT , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-19 01:27:20 +00:00
blob = ndr_push_blob ( push ) ;
2008-01-09 12:28:44 +01:00
if ( ! prs_copy_data_in ( & p - > out_data . rdata , ( const char * ) blob . data , ( uint32_t ) blob . length ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return true ;
2006-09-19 01:27:20 +00:00
}
2008-01-25 21:15:36 +01:00
static bool api_netr_DsrDeregisterDNSHostRecords ( pipes_struct * p )
2006-09-19 01:27:20 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-19 01:27:20 +00:00
struct ndr_pull * pull ;
struct ndr_push * push ;
2007-11-09 14:38:47 +01:00
enum ndr_err_code ndr_err ;
2006-09-19 01:27:20 +00:00
DATA_BLOB blob ;
2008-01-25 21:15:36 +01:00
struct netr_DsrDeregisterDNSHostRecords * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_netlogon . calls [ NDR_NETR_DSRDEREGISTERDNSHOSTRECORDS ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct netr_DsrDeregisterDNSHostRecords ) ;
2007-08-21 14:06:46 +00:00
if ( r = = NULL ) {
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
if ( ! prs_data_blob ( & p - > in_data . data , & blob , r ) ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2007-08-21 14:06:46 +00:00
}
2008-01-09 12:28:44 +01:00
2008-09-23 20:59:30 +02:00
pull = ndr_pull_init_blob ( & blob , r , NULL ) ;
2006-10-10 07:55:46 +00:00
if ( pull = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-19 01:27:20 +00:00
pull - > flags | = LIBNDR_FLAG_REF_ALLOC ;
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_pull ( pull , NDR_IN , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2008-01-25 21:15:36 +01:00
NDR_PRINT_IN_DEBUG ( netr_DsrDeregisterDNSHostRecords , r ) ;
2008-01-09 12:28:44 +01:00
}
2008-01-25 21:15:36 +01:00
r - > out . result = _netr_DsrDeregisterDNSHostRecords ( p , r ) ;
2008-01-09 12:28:44 +01:00
2006-10-10 07:55:46 +00:00
if ( p - > rng_fault_state ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
/* Return true here, srv_pipe_hnd.c will take care */
return true ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2008-01-25 21:15:36 +01:00
NDR_PRINT_OUT_DEBUG ( netr_DsrDeregisterDNSHostRecords , r ) ;
2008-01-09 12:28:44 +01:00
}
2008-10-12 19:05:46 +02:00
push = ndr_push_init_ctx ( r , NULL ) ;
2006-09-19 01:27:20 +00:00
if ( push = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_push ( push , NDR_OUT , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-19 01:27:20 +00:00
blob = ndr_push_blob ( push ) ;
2008-01-09 12:28:44 +01:00
if ( ! prs_copy_data_in ( & p - > out_data . rdata , ( const char * ) blob . data , ( uint32_t ) blob . length ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return true ;
2006-09-19 01:27:20 +00:00
}
2008-01-17 10:00:37 +01:00
static bool api_netr_ServerTrustPasswordsGet ( pipes_struct * p )
2006-09-19 01:27:20 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-19 01:27:20 +00:00
struct ndr_pull * pull ;
struct ndr_push * push ;
2007-11-09 14:38:47 +01:00
enum ndr_err_code ndr_err ;
2006-09-19 01:27:20 +00:00
DATA_BLOB blob ;
2008-01-17 10:00:37 +01:00
struct netr_ServerTrustPasswordsGet * r ;
2008-01-09 12:28:44 +01:00
2008-01-17 10:00:37 +01:00
call = & ndr_table_netlogon . calls [ NDR_NETR_SERVERTRUSTPASSWORDSGET ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct netr_ServerTrustPasswordsGet ) ;
2007-08-21 14:06:46 +00:00
if ( r = = NULL ) {
2008-01-09 12:28:44 +01:00
return false ;
2007-08-21 14:06:46 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
if ( ! prs_data_blob ( & p - > in_data . data , & blob , r ) ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2008-09-23 20:59:30 +02:00
pull = ndr_pull_init_blob ( & blob , r , NULL ) ;
2006-10-10 07:55:46 +00:00
if ( pull = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-19 01:27:20 +00:00
pull - > flags | = LIBNDR_FLAG_REF_ALLOC ;
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_pull ( pull , NDR_IN , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2008-01-17 10:00:37 +01:00
NDR_PRINT_IN_DEBUG ( netr_ServerTrustPasswordsGet , r ) ;
}
ZERO_STRUCT ( r - > out ) ;
r - > out . return_authenticator = talloc_zero ( r , struct netr_Authenticator ) ;
if ( r - > out . return_authenticator = = NULL ) {
talloc_free ( r ) ;
return false ;
2008-01-09 12:28:44 +01:00
}
2008-01-17 10:00:37 +01:00
r - > out . password = talloc_zero ( r , struct samr_Password ) ;
if ( r - > out . password = = NULL ) {
talloc_free ( r ) ;
return false ;
}
r - > out . password2 = talloc_zero ( r , struct samr_Password ) ;
if ( r - > out . password2 = = NULL ) {
talloc_free ( r ) ;
return false ;
}
r - > out . result = _netr_ServerTrustPasswordsGet ( p , r ) ;
2008-01-09 12:28:44 +01:00
2006-10-10 07:55:46 +00:00
if ( p - > rng_fault_state ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
/* Return true here, srv_pipe_hnd.c will take care */
return true ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2008-01-17 10:00:37 +01:00
NDR_PRINT_OUT_DEBUG ( netr_ServerTrustPasswordsGet , r ) ;
2008-01-09 12:28:44 +01:00
}
2008-10-12 19:05:46 +02:00
push = ndr_push_init_ctx ( r , NULL ) ;
2006-09-19 01:27:20 +00:00
if ( push = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_push ( push , NDR_OUT , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-19 01:27:20 +00:00
blob = ndr_push_blob ( push ) ;
2008-01-09 12:28:44 +01:00
if ( ! prs_copy_data_in ( & p - > out_data . rdata , ( const char * ) blob . data , ( uint32_t ) blob . length ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return true ;
2006-09-19 01:27:20 +00:00
}
2008-01-17 10:00:37 +01:00
static bool api_netr_DsRGetForestTrustInformation ( pipes_struct * p )
2006-09-19 01:27:20 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-19 01:27:20 +00:00
struct ndr_pull * pull ;
struct ndr_push * push ;
2007-11-09 14:38:47 +01:00
enum ndr_err_code ndr_err ;
2006-09-19 01:27:20 +00:00
DATA_BLOB blob ;
2008-01-17 10:00:37 +01:00
struct netr_DsRGetForestTrustInformation * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_netlogon . calls [ NDR_NETR_DSRGETFORESTTRUSTINFORMATION ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct netr_DsRGetForestTrustInformation ) ;
2007-08-21 14:06:46 +00:00
if ( r = = NULL ) {
2008-01-09 12:28:44 +01:00
return false ;
2007-08-21 14:06:46 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
if ( ! prs_data_blob ( & p - > in_data . data , & blob , r ) ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2008-09-23 20:59:30 +02:00
pull = ndr_pull_init_blob ( & blob , r , NULL ) ;
2006-10-10 07:55:46 +00:00
if ( pull = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-19 01:27:20 +00:00
pull - > flags | = LIBNDR_FLAG_REF_ALLOC ;
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_pull ( pull , NDR_IN , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2008-01-17 10:00:37 +01:00
NDR_PRINT_IN_DEBUG ( netr_DsRGetForestTrustInformation , r ) ;
2008-01-09 12:28:44 +01:00
}
2008-01-17 10:00:37 +01:00
ZERO_STRUCT ( r - > out ) ;
r - > out . forest_trust_info = talloc_zero ( r , struct lsa_ForestTrustInformation * ) ;
if ( r - > out . forest_trust_info = = NULL ) {
talloc_free ( r ) ;
return false ;
}
r - > out . result = _netr_DsRGetForestTrustInformation ( p , r ) ;
2008-01-09 12:28:44 +01:00
2006-10-10 07:55:46 +00:00
if ( p - > rng_fault_state ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
/* Return true here, srv_pipe_hnd.c will take care */
return true ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2008-01-17 10:00:37 +01:00
NDR_PRINT_OUT_DEBUG ( netr_DsRGetForestTrustInformation , r ) ;
2008-01-09 12:28:44 +01:00
}
2008-10-12 19:05:46 +02:00
push = ndr_push_init_ctx ( r , NULL ) ;
2006-09-19 01:27:20 +00:00
if ( push = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_push ( push , NDR_OUT , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-19 01:27:20 +00:00
blob = ndr_push_blob ( push ) ;
2008-01-09 12:28:44 +01:00
if ( ! prs_copy_data_in ( & p - > out_data . rdata , ( const char * ) blob . data , ( uint32_t ) blob . length ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return true ;
2006-09-19 01:27:20 +00:00
}
2008-01-17 10:00:37 +01:00
static bool api_netr_GetForestTrustInformation ( pipes_struct * p )
2006-09-19 01:27:20 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-19 01:27:20 +00:00
struct ndr_pull * pull ;
struct ndr_push * push ;
2007-11-09 14:38:47 +01:00
enum ndr_err_code ndr_err ;
2006-09-19 01:27:20 +00:00
DATA_BLOB blob ;
2008-01-17 10:00:37 +01:00
struct netr_GetForestTrustInformation * r ;
2008-01-09 12:28:44 +01:00
2008-01-17 10:00:37 +01:00
call = & ndr_table_netlogon . calls [ NDR_NETR_GETFORESTTRUSTINFORMATION ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct netr_GetForestTrustInformation ) ;
2007-08-21 14:06:46 +00:00
if ( r = = NULL ) {
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
if ( ! prs_data_blob ( & p - > in_data . data , & blob , r ) ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2007-08-21 14:06:46 +00:00
}
2008-01-09 12:28:44 +01:00
2008-09-23 20:59:30 +02:00
pull = ndr_pull_init_blob ( & blob , r , NULL ) ;
2006-10-10 07:55:46 +00:00
if ( pull = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-19 01:27:20 +00:00
pull - > flags | = LIBNDR_FLAG_REF_ALLOC ;
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_pull ( pull , NDR_IN , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2008-01-17 10:00:37 +01:00
NDR_PRINT_IN_DEBUG ( netr_GetForestTrustInformation , r ) ;
}
ZERO_STRUCT ( r - > out ) ;
r - > out . return_authenticator = talloc_zero ( r , struct netr_Authenticator ) ;
if ( r - > out . return_authenticator = = NULL ) {
talloc_free ( r ) ;
return false ;
}
r - > out . forest_trust_info = talloc_zero ( r , struct lsa_ForestTrustInformation * ) ;
if ( r - > out . forest_trust_info = = NULL ) {
talloc_free ( r ) ;
return false ;
2008-01-09 12:28:44 +01:00
}
2008-01-17 10:00:37 +01:00
r - > out . result = _netr_GetForestTrustInformation ( p , r ) ;
2008-01-09 12:28:44 +01:00
2006-10-10 07:55:46 +00:00
if ( p - > rng_fault_state ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
/* Return true here, srv_pipe_hnd.c will take care */
return true ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2008-01-17 10:00:37 +01:00
NDR_PRINT_OUT_DEBUG ( netr_GetForestTrustInformation , r ) ;
2008-01-09 12:28:44 +01:00
}
2008-10-12 19:05:46 +02:00
push = ndr_push_init_ctx ( r , NULL ) ;
2006-09-19 01:27:20 +00:00
if ( push = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_push ( push , NDR_OUT , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-19 01:27:20 +00:00
blob = ndr_push_blob ( push ) ;
2008-01-09 12:28:44 +01:00
if ( ! prs_copy_data_in ( & p - > out_data . rdata , ( const char * ) blob . data , ( uint32_t ) blob . length ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return true ;
2006-09-19 01:27:20 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_netr_LogonSamLogonWithFlags ( pipes_struct * p )
2006-09-19 01:27:20 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-19 01:27:20 +00:00
struct ndr_pull * pull ;
struct ndr_push * push ;
2007-11-09 14:38:47 +01:00
enum ndr_err_code ndr_err ;
2006-09-19 01:27:20 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct netr_LogonSamLogonWithFlags * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_netlogon . calls [ NDR_NETR_LOGONSAMLOGONWITHFLAGS ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct netr_LogonSamLogonWithFlags ) ;
2007-08-21 14:06:46 +00:00
if ( r = = NULL ) {
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
if ( ! prs_data_blob ( & p - > in_data . data , & blob , r ) ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2007-08-21 14:06:46 +00:00
}
2008-01-09 12:28:44 +01:00
2008-09-23 20:59:30 +02:00
pull = ndr_pull_init_blob ( & blob , r , NULL ) ;
2006-10-10 07:55:46 +00:00
if ( pull = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-19 01:27:20 +00:00
pull - > flags | = LIBNDR_FLAG_REF_ALLOC ;
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_pull ( pull , NDR_IN , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_IN_DEBUG ( netr_LogonSamLogonWithFlags , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
ZERO_STRUCT ( r - > out ) ;
r - > out . return_authenticator = r - > in . return_authenticator ;
2008-11-19 22:00:43 +01:00
r - > out . flags = r - > in . flags ;
2007-08-21 14:06:46 +00:00
r - > out . validation = talloc_zero ( r , union netr_Validation ) ;
if ( r - > out . validation = = NULL ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
r - > out . authoritative = talloc_zero ( r , uint8_t ) ;
if ( r - > out . authoritative = = NULL ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
r - > out . result = _netr_LogonSamLogonWithFlags ( p , r ) ;
2008-01-09 12:28:44 +01:00
2006-10-10 07:55:46 +00:00
if ( p - > rng_fault_state ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
/* Return true here, srv_pipe_hnd.c will take care */
return true ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 14:06:46 +00:00
NDR_PRINT_OUT_DEBUG ( netr_LogonSamLogonWithFlags , r ) ;
2008-01-09 12:28:44 +01:00
}
2008-10-12 19:05:46 +02:00
push = ndr_push_init_ctx ( r , NULL ) ;
2006-09-19 01:27:20 +00:00
if ( push = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_push ( push , NDR_OUT , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-19 01:27:20 +00:00
blob = ndr_push_blob ( push ) ;
2008-01-09 12:28:44 +01:00
if ( ! prs_copy_data_in ( & p - > out_data . rdata , ( const char * ) blob . data , ( uint32_t ) blob . length ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return true ;
2006-09-19 01:27:20 +00:00
}
2008-12-10 02:53:36 +01:00
static bool api_netr_ServerGetTrustInfo ( pipes_struct * p )
2006-09-19 01:27:20 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-19 01:27:20 +00:00
struct ndr_pull * pull ;
struct ndr_push * push ;
2007-11-09 14:38:47 +01:00
enum ndr_err_code ndr_err ;
2006-09-19 01:27:20 +00:00
DATA_BLOB blob ;
2008-12-10 02:53:36 +01:00
struct netr_ServerGetTrustInfo * r ;
2008-01-09 12:28:44 +01:00
2008-12-10 02:53:36 +01:00
call = & ndr_table_netlogon . calls [ NDR_NETR_SERVERGETTRUSTINFO ] ;
2008-01-09 12:28:44 +01:00
2008-12-10 02:53:36 +01:00
r = talloc ( talloc_tos ( ) , struct netr_ServerGetTrustInfo ) ;
2007-08-21 14:06:46 +00:00
if ( r = = NULL ) {
2008-01-09 12:28:44 +01:00
return false ;
2007-08-21 14:06:46 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
if ( ! prs_data_blob ( & p - > in_data . data , & blob , r ) ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2008-09-23 20:59:30 +02:00
pull = ndr_pull_init_blob ( & blob , r , NULL ) ;
2006-10-10 07:55:46 +00:00
if ( pull = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-19 01:27:20 +00:00
pull - > flags | = LIBNDR_FLAG_REF_ALLOC ;
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_pull ( pull , NDR_IN , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2008-12-10 02:53:36 +01:00
NDR_PRINT_IN_DEBUG ( netr_ServerGetTrustInfo , r ) ;
2008-01-09 12:28:44 +01:00
}
2008-12-10 02:53:36 +01:00
ZERO_STRUCT ( r - > out ) ;
r - > out . return_authenticator = talloc_zero ( r , struct netr_Authenticator ) ;
if ( r - > out . return_authenticator = = NULL ) {
talloc_free ( r ) ;
return false ;
}
r - > out . new_owf_password = talloc_zero ( r , struct samr_Password ) ;
if ( r - > out . new_owf_password = = NULL ) {
talloc_free ( r ) ;
return false ;
}
r - > out . old_owf_password = talloc_zero ( r , struct samr_Password ) ;
if ( r - > out . old_owf_password = = NULL ) {
talloc_free ( r ) ;
return false ;
}
r - > out . trust_info = talloc_zero ( r , struct netr_TrustInfo * ) ;
if ( r - > out . trust_info = = NULL ) {
talloc_free ( r ) ;
return false ;
}
r - > out . result = _netr_ServerGetTrustInfo ( p , r ) ;
2008-01-09 12:28:44 +01:00
2006-10-10 07:55:46 +00:00
if ( p - > rng_fault_state ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
/* Return true here, srv_pipe_hnd.c will take care */
return true ;
2006-10-10 07:55:46 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2008-12-10 02:53:36 +01:00
NDR_PRINT_OUT_DEBUG ( netr_ServerGetTrustInfo , r ) ;
2008-01-09 12:28:44 +01:00
}
2008-10-12 19:05:46 +02:00
push = ndr_push_init_ctx ( r , NULL ) ;
2006-09-19 01:27:20 +00:00
if ( push = = NULL ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-11-09 14:38:47 +01:00
ndr_err = call - > ndr_push ( push , NDR_OUT , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-19 01:27:20 +00:00
blob = ndr_push_blob ( push ) ;
2008-01-09 12:28:44 +01:00
if ( ! prs_copy_data_in ( & p - > out_data . rdata , ( const char * ) blob . data , ( uint32_t ) blob . length ) ) {
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return true ;
2006-09-19 01:27:20 +00:00
}
/* Tables */
static struct api_struct api_netlogon_cmds [ ] =
{
2007-08-19 22:10:11 +00:00
{ " NETR_LOGONUASLOGON " , NDR_NETR_LOGONUASLOGON , api_netr_LogonUasLogon } ,
{ " NETR_LOGONUASLOGOFF " , NDR_NETR_LOGONUASLOGOFF , api_netr_LogonUasLogoff } ,
{ " NETR_LOGONSAMLOGON " , NDR_NETR_LOGONSAMLOGON , api_netr_LogonSamLogon } ,
{ " NETR_LOGONSAMLOGOFF " , NDR_NETR_LOGONSAMLOGOFF , api_netr_LogonSamLogoff } ,
{ " NETR_SERVERREQCHALLENGE " , NDR_NETR_SERVERREQCHALLENGE , api_netr_ServerReqChallenge } ,
{ " NETR_SERVERAUTHENTICATE " , NDR_NETR_SERVERAUTHENTICATE , api_netr_ServerAuthenticate } ,
{ " NETR_SERVERPASSWORDSET " , NDR_NETR_SERVERPASSWORDSET , api_netr_ServerPasswordSet } ,
{ " NETR_DATABASEDELTAS " , NDR_NETR_DATABASEDELTAS , api_netr_DatabaseDeltas } ,
{ " NETR_DATABASESYNC " , NDR_NETR_DATABASESYNC , api_netr_DatabaseSync } ,
{ " NETR_ACCOUNTDELTAS " , NDR_NETR_ACCOUNTDELTAS , api_netr_AccountDeltas } ,
{ " NETR_ACCOUNTSYNC " , NDR_NETR_ACCOUNTSYNC , api_netr_AccountSync } ,
{ " NETR_GETDCNAME " , NDR_NETR_GETDCNAME , api_netr_GetDcName } ,
{ " NETR_LOGONCONTROL " , NDR_NETR_LOGONCONTROL , api_netr_LogonControl } ,
{ " NETR_GETANYDCNAME " , NDR_NETR_GETANYDCNAME , api_netr_GetAnyDCName } ,
{ " NETR_LOGONCONTROL2 " , NDR_NETR_LOGONCONTROL2 , api_netr_LogonControl2 } ,
{ " NETR_SERVERAUTHENTICATE2 " , NDR_NETR_SERVERAUTHENTICATE2 , api_netr_ServerAuthenticate2 } ,
{ " NETR_DATABASESYNC2 " , NDR_NETR_DATABASESYNC2 , api_netr_DatabaseSync2 } ,
{ " NETR_DATABASEREDO " , NDR_NETR_DATABASEREDO , api_netr_DatabaseRedo } ,
{ " NETR_LOGONCONTROL2EX " , NDR_NETR_LOGONCONTROL2EX , api_netr_LogonControl2Ex } ,
2008-01-17 10:00:37 +01:00
{ " NETR_NETRENUMERATETRUSTEDDOMAINS " , NDR_NETR_NETRENUMERATETRUSTEDDOMAINS , api_netr_NetrEnumerateTrustedDomains } ,
2007-08-19 22:10:11 +00:00
{ " NETR_DSRGETDCNAME " , NDR_NETR_DSRGETDCNAME , api_netr_DsRGetDCName } ,
2009-02-16 10:59:45 +01:00
{ " NETR_LOGONGETCAPABILITIES " , NDR_NETR_LOGONGETCAPABILITIES , api_netr_LogonGetCapabilities } ,
2007-08-19 22:10:11 +00:00
{ " NETR_NETRLOGONSETSERVICEBITS " , NDR_NETR_NETRLOGONSETSERVICEBITS , api_netr_NETRLOGONSETSERVICEBITS } ,
2008-01-24 23:37:57 +01:00
{ " NETR_LOGONGETTRUSTRID " , NDR_NETR_LOGONGETTRUSTRID , api_netr_LogonGetTrustRid } ,
2007-08-19 22:10:11 +00:00
{ " NETR_NETRLOGONCOMPUTESERVERDIGEST " , NDR_NETR_NETRLOGONCOMPUTESERVERDIGEST , api_netr_NETRLOGONCOMPUTESERVERDIGEST } ,
{ " NETR_NETRLOGONCOMPUTECLIENTDIGEST " , NDR_NETR_NETRLOGONCOMPUTECLIENTDIGEST , api_netr_NETRLOGONCOMPUTECLIENTDIGEST } ,
{ " NETR_SERVERAUTHENTICATE3 " , NDR_NETR_SERVERAUTHENTICATE3 , api_netr_ServerAuthenticate3 } ,
{ " NETR_DSRGETDCNAMEEX " , NDR_NETR_DSRGETDCNAMEEX , api_netr_DsRGetDCNameEx } ,
{ " NETR_DSRGETSITENAME " , NDR_NETR_DSRGETSITENAME , api_netr_DsRGetSiteName } ,
{ " NETR_LOGONGETDOMAININFO " , NDR_NETR_LOGONGETDOMAININFO , api_netr_LogonGetDomainInfo } ,
{ " NETR_SERVERPASSWORDSET2 " , NDR_NETR_SERVERPASSWORDSET2 , api_netr_ServerPasswordSet2 } ,
2008-01-17 10:00:37 +01:00
{ " NETR_SERVERPASSWORDGET " , NDR_NETR_SERVERPASSWORDGET , api_netr_ServerPasswordGet } ,
2007-08-19 22:10:11 +00:00
{ " NETR_NETRLOGONSENDTOSAM " , NDR_NETR_NETRLOGONSENDTOSAM , api_netr_NETRLOGONSENDTOSAM } ,
2008-01-17 10:00:37 +01:00
{ " NETR_DSRADDRESSTOSITENAMESW " , NDR_NETR_DSRADDRESSTOSITENAMESW , api_netr_DsRAddressToSitenamesW } ,
2007-08-19 22:10:11 +00:00
{ " NETR_DSRGETDCNAMEEX2 " , NDR_NETR_DSRGETDCNAMEEX2 , api_netr_DsRGetDCNameEx2 } ,
{ " NETR_NETRLOGONGETTIMESERVICEPARENTDOMAIN " , NDR_NETR_NETRLOGONGETTIMESERVICEPARENTDOMAIN , api_netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN } ,
2008-01-17 10:00:37 +01:00
{ " NETR_NETRENUMERATETRUSTEDDOMAINSEX " , NDR_NETR_NETRENUMERATETRUSTEDDOMAINSEX , api_netr_NetrEnumerateTrustedDomainsEx } ,
{ " NETR_DSRADDRESSTOSITENAMESEXW " , NDR_NETR_DSRADDRESSTOSITENAMESEXW , api_netr_DsRAddressToSitenamesExW } ,
{ " NETR_DSRGETDCSITECOVERAGEW " , NDR_NETR_DSRGETDCSITECOVERAGEW , api_netr_DsrGetDcSiteCoverageW } ,
2007-08-19 22:10:11 +00:00
{ " NETR_LOGONSAMLOGONEX " , NDR_NETR_LOGONSAMLOGONEX , api_netr_LogonSamLogonEx } ,
{ " NETR_DSRENUMERATEDOMAINTRUSTS " , NDR_NETR_DSRENUMERATEDOMAINTRUSTS , api_netr_DsrEnumerateDomainTrusts } ,
2008-01-25 21:15:36 +01:00
{ " NETR_DSRDEREGISTERDNSHOSTRECORDS " , NDR_NETR_DSRDEREGISTERDNSHOSTRECORDS , api_netr_DsrDeregisterDNSHostRecords } ,
2008-01-17 10:00:37 +01:00
{ " NETR_SERVERTRUSTPASSWORDSGET " , NDR_NETR_SERVERTRUSTPASSWORDSGET , api_netr_ServerTrustPasswordsGet } ,
{ " NETR_DSRGETFORESTTRUSTINFORMATION " , NDR_NETR_DSRGETFORESTTRUSTINFORMATION , api_netr_DsRGetForestTrustInformation } ,
{ " NETR_GETFORESTTRUSTINFORMATION " , NDR_NETR_GETFORESTTRUSTINFORMATION , api_netr_GetForestTrustInformation } ,
2007-08-19 22:10:11 +00:00
{ " NETR_LOGONSAMLOGONWITHFLAGS " , NDR_NETR_LOGONSAMLOGONWITHFLAGS , api_netr_LogonSamLogonWithFlags } ,
2008-12-10 02:53:36 +01:00
{ " NETR_SERVERGETTRUSTINFO " , NDR_NETR_SERVERGETTRUSTINFO , api_netr_ServerGetTrustInfo } ,
2006-09-19 01:27:20 +00:00
} ;
void netlogon_get_pipe_fns ( struct api_struct * * fns , int * n_fns )
{
* fns = api_netlogon_cmds ;
* n_fns = sizeof ( api_netlogon_cmds ) / sizeof ( struct api_struct ) ;
}
2009-01-21 14:05:51 +01:00
NTSTATUS rpc_netlogon_dispatch ( struct rpc_pipe_client * cli , TALLOC_CTX * mem_ctx , const struct ndr_interface_table * table , uint32_t opnum , void * _r )
{
if ( cli - > pipes_struct = = NULL ) {
return NT_STATUS_INVALID_PARAMETER ;
}
switch ( opnum )
{
case NDR_NETR_LOGONUASLOGON : {
2009-01-22 01:19:38 +01:00
struct netr_LogonUasLogon * r = ( struct netr_LogonUasLogon * ) _r ;
2009-01-21 14:05:51 +01:00
ZERO_STRUCT ( r - > out ) ;
r - > out . info = talloc_zero ( mem_ctx , struct netr_UasInfo * ) ;
if ( r - > out . info = = NULL ) {
return NT_STATUS_NO_MEMORY ;
}
r - > out . result = _netr_LogonUasLogon ( cli - > pipes_struct , r ) ;
return NT_STATUS_OK ;
}
case NDR_NETR_LOGONUASLOGOFF : {
2009-01-22 01:19:38 +01:00
struct netr_LogonUasLogoff * r = ( struct netr_LogonUasLogoff * ) _r ;
2009-01-21 14:05:51 +01:00
ZERO_STRUCT ( r - > out ) ;
r - > out . info = talloc_zero ( mem_ctx , struct netr_UasLogoffInfo ) ;
if ( r - > out . info = = NULL ) {
return NT_STATUS_NO_MEMORY ;
}
r - > out . result = _netr_LogonUasLogoff ( cli - > pipes_struct , r ) ;
return NT_STATUS_OK ;
}
case NDR_NETR_LOGONSAMLOGON : {
2009-01-22 01:19:38 +01:00
struct netr_LogonSamLogon * r = ( struct netr_LogonSamLogon * ) _r ;
2009-01-21 14:05:51 +01:00
ZERO_STRUCT ( r - > out ) ;
r - > out . return_authenticator = r - > in . return_authenticator ;
r - > out . validation = talloc_zero ( mem_ctx , union netr_Validation ) ;
if ( r - > out . validation = = NULL ) {
return NT_STATUS_NO_MEMORY ;
}
r - > out . authoritative = talloc_zero ( mem_ctx , uint8_t ) ;
if ( r - > out . authoritative = = NULL ) {
return NT_STATUS_NO_MEMORY ;
}
r - > out . result = _netr_LogonSamLogon ( cli - > pipes_struct , r ) ;
return NT_STATUS_OK ;
}
case NDR_NETR_LOGONSAMLOGOFF : {
2009-01-22 01:19:38 +01:00
struct netr_LogonSamLogoff * r = ( struct netr_LogonSamLogoff * ) _r ;
2009-01-21 14:05:51 +01:00
ZERO_STRUCT ( r - > out ) ;
r - > out . return_authenticator = r - > in . return_authenticator ;
r - > out . result = _netr_LogonSamLogoff ( cli - > pipes_struct , r ) ;
return NT_STATUS_OK ;
}
case NDR_NETR_SERVERREQCHALLENGE : {
2009-01-22 01:19:38 +01:00
struct netr_ServerReqChallenge * r = ( struct netr_ServerReqChallenge * ) _r ;
2009-01-21 14:05:51 +01:00
ZERO_STRUCT ( r - > out ) ;
r - > out . return_credentials = talloc_zero ( mem_ctx , struct netr_Credential ) ;
if ( r - > out . return_credentials = = NULL ) {
return NT_STATUS_NO_MEMORY ;
}
r - > out . result = _netr_ServerReqChallenge ( cli - > pipes_struct , r ) ;
return NT_STATUS_OK ;
}
case NDR_NETR_SERVERAUTHENTICATE : {
2009-01-22 01:19:38 +01:00
struct netr_ServerAuthenticate * r = ( struct netr_ServerAuthenticate * ) _r ;
2009-01-21 14:05:51 +01:00
ZERO_STRUCT ( r - > out ) ;
r - > out . return_credentials = talloc_zero ( mem_ctx , struct netr_Credential ) ;
if ( r - > out . return_credentials = = NULL ) {
return NT_STATUS_NO_MEMORY ;
}
r - > out . result = _netr_ServerAuthenticate ( cli - > pipes_struct , r ) ;
return NT_STATUS_OK ;
}
case NDR_NETR_SERVERPASSWORDSET : {
2009-01-22 01:19:38 +01:00
struct netr_ServerPasswordSet * r = ( struct netr_ServerPasswordSet * ) _r ;
2009-01-21 14:05:51 +01:00
ZERO_STRUCT ( r - > out ) ;
r - > out . return_authenticator = talloc_zero ( mem_ctx , struct netr_Authenticator ) ;
if ( r - > out . return_authenticator = = NULL ) {
return NT_STATUS_NO_MEMORY ;
}
r - > out . result = _netr_ServerPasswordSet ( cli - > pipes_struct , r ) ;
return NT_STATUS_OK ;
}
case NDR_NETR_DATABASEDELTAS : {
2009-01-22 01:19:38 +01:00
struct netr_DatabaseDeltas * r = ( struct netr_DatabaseDeltas * ) _r ;
2009-01-21 14:05:51 +01:00
ZERO_STRUCT ( r - > out ) ;
r - > out . return_authenticator = r - > in . return_authenticator ;
r - > out . sequence_num = r - > in . sequence_num ;
r - > out . delta_enum_array = talloc_zero ( mem_ctx , struct netr_DELTA_ENUM_ARRAY * ) ;
if ( r - > out . delta_enum_array = = NULL ) {
return NT_STATUS_NO_MEMORY ;
}
r - > out . result = _netr_DatabaseDeltas ( cli - > pipes_struct , r ) ;
return NT_STATUS_OK ;
}
case NDR_NETR_DATABASESYNC : {
2009-01-22 01:19:38 +01:00
struct netr_DatabaseSync * r = ( struct netr_DatabaseSync * ) _r ;
2009-01-21 14:05:51 +01:00
ZERO_STRUCT ( r - > out ) ;
r - > out . return_authenticator = r - > in . return_authenticator ;
r - > out . sync_context = r - > in . sync_context ;
r - > out . delta_enum_array = talloc_zero ( mem_ctx , struct netr_DELTA_ENUM_ARRAY * ) ;
if ( r - > out . delta_enum_array = = NULL ) {
return NT_STATUS_NO_MEMORY ;
}
r - > out . result = _netr_DatabaseSync ( cli - > pipes_struct , r ) ;
return NT_STATUS_OK ;
}
case NDR_NETR_ACCOUNTDELTAS : {
2009-01-22 01:19:38 +01:00
struct netr_AccountDeltas * r = ( struct netr_AccountDeltas * ) _r ;
2009-01-21 14:05:51 +01:00
ZERO_STRUCT ( r - > out ) ;
r - > out . return_authenticator = r - > in . return_authenticator ;
r - > out . buffer = talloc_zero ( mem_ctx , struct netr_AccountBuffer ) ;
if ( r - > out . buffer = = NULL ) {
return NT_STATUS_NO_MEMORY ;
}
r - > out . count_returned = talloc_zero ( mem_ctx , uint32_t ) ;
if ( r - > out . count_returned = = NULL ) {
return NT_STATUS_NO_MEMORY ;
}
r - > out . total_entries = talloc_zero ( mem_ctx , uint32_t ) ;
if ( r - > out . total_entries = = NULL ) {
return NT_STATUS_NO_MEMORY ;
}
r - > out . recordid = talloc_zero ( mem_ctx , struct netr_UAS_INFO_0 ) ;
if ( r - > out . recordid = = NULL ) {
return NT_STATUS_NO_MEMORY ;
}
r - > out . result = _netr_AccountDeltas ( cli - > pipes_struct , r ) ;
return NT_STATUS_OK ;
}
case NDR_NETR_ACCOUNTSYNC : {
2009-01-22 01:19:38 +01:00
struct netr_AccountSync * r = ( struct netr_AccountSync * ) _r ;
2009-01-21 14:05:51 +01:00
ZERO_STRUCT ( r - > out ) ;
r - > out . return_authenticator = r - > in . return_authenticator ;
r - > out . recordid = r - > in . recordid ;
r - > out . buffer = talloc_zero ( mem_ctx , struct netr_AccountBuffer ) ;
if ( r - > out . buffer = = NULL ) {
return NT_STATUS_NO_MEMORY ;
}
r - > out . count_returned = talloc_zero ( mem_ctx , uint32_t ) ;
if ( r - > out . count_returned = = NULL ) {
return NT_STATUS_NO_MEMORY ;
}
r - > out . total_entries = talloc_zero ( mem_ctx , uint32_t ) ;
if ( r - > out . total_entries = = NULL ) {
return NT_STATUS_NO_MEMORY ;
}
r - > out . next_reference = talloc_zero ( mem_ctx , uint32_t ) ;
if ( r - > out . next_reference = = NULL ) {
return NT_STATUS_NO_MEMORY ;
}
r - > out . result = _netr_AccountSync ( cli - > pipes_struct , r ) ;
return NT_STATUS_OK ;
}
case NDR_NETR_GETDCNAME : {
2009-01-22 01:19:38 +01:00
struct netr_GetDcName * r = ( struct netr_GetDcName * ) _r ;
2009-01-21 14:05:51 +01:00
ZERO_STRUCT ( r - > out ) ;
r - > out . dcname = talloc_zero ( mem_ctx , const char * ) ;
if ( r - > out . dcname = = NULL ) {
return NT_STATUS_NO_MEMORY ;
}
r - > out . result = _netr_GetDcName ( cli - > pipes_struct , r ) ;
return NT_STATUS_OK ;
}
case NDR_NETR_LOGONCONTROL : {
2009-01-22 01:19:38 +01:00
struct netr_LogonControl * r = ( struct netr_LogonControl * ) _r ;
2009-01-21 14:05:51 +01:00
ZERO_STRUCT ( r - > out ) ;
2009-06-12 12:38:22 +02:00
r - > out . query = talloc_zero ( mem_ctx , union netr_CONTROL_QUERY_INFORMATION ) ;
if ( r - > out . query = = NULL ) {
2009-01-21 14:05:51 +01:00
return NT_STATUS_NO_MEMORY ;
}
r - > out . result = _netr_LogonControl ( cli - > pipes_struct , r ) ;
return NT_STATUS_OK ;
}
case NDR_NETR_GETANYDCNAME : {
2009-01-22 01:19:38 +01:00
struct netr_GetAnyDCName * r = ( struct netr_GetAnyDCName * ) _r ;
2009-01-21 14:05:51 +01:00
ZERO_STRUCT ( r - > out ) ;
r - > out . dcname = talloc_zero ( mem_ctx , const char * ) ;
if ( r - > out . dcname = = NULL ) {
return NT_STATUS_NO_MEMORY ;
}
r - > out . result = _netr_GetAnyDCName ( cli - > pipes_struct , r ) ;
return NT_STATUS_OK ;
}
case NDR_NETR_LOGONCONTROL2 : {
2009-01-22 01:19:38 +01:00
struct netr_LogonControl2 * r = ( struct netr_LogonControl2 * ) _r ;
2009-01-21 14:05:51 +01:00
ZERO_STRUCT ( r - > out ) ;
r - > out . query = talloc_zero ( mem_ctx , union netr_CONTROL_QUERY_INFORMATION ) ;
if ( r - > out . query = = NULL ) {
return NT_STATUS_NO_MEMORY ;
}
r - > out . result = _netr_LogonControl2 ( cli - > pipes_struct , r ) ;
return NT_STATUS_OK ;
}
case NDR_NETR_SERVERAUTHENTICATE2 : {
2009-01-22 01:19:38 +01:00
struct netr_ServerAuthenticate2 * r = ( struct netr_ServerAuthenticate2 * ) _r ;
2009-01-21 14:05:51 +01:00
ZERO_STRUCT ( r - > out ) ;
r - > out . negotiate_flags = r - > in . negotiate_flags ;
r - > out . return_credentials = talloc_zero ( mem_ctx , struct netr_Credential ) ;
if ( r - > out . return_credentials = = NULL ) {
return NT_STATUS_NO_MEMORY ;
}
r - > out . result = _netr_ServerAuthenticate2 ( cli - > pipes_struct , r ) ;
return NT_STATUS_OK ;
}
case NDR_NETR_DATABASESYNC2 : {
2009-01-22 01:19:38 +01:00
struct netr_DatabaseSync2 * r = ( struct netr_DatabaseSync2 * ) _r ;
2009-01-21 14:05:51 +01:00
ZERO_STRUCT ( r - > out ) ;
r - > out . return_authenticator = r - > in . return_authenticator ;
r - > out . sync_context = r - > in . sync_context ;
r - > out . delta_enum_array = talloc_zero ( mem_ctx , struct netr_DELTA_ENUM_ARRAY * ) ;
if ( r - > out . delta_enum_array = = NULL ) {
return NT_STATUS_NO_MEMORY ;
}
r - > out . result = _netr_DatabaseSync2 ( cli - > pipes_struct , r ) ;
return NT_STATUS_OK ;
}
case NDR_NETR_DATABASEREDO : {
2009-01-22 01:19:38 +01:00
struct netr_DatabaseRedo * r = ( struct netr_DatabaseRedo * ) _r ;
2009-01-21 14:05:51 +01:00
ZERO_STRUCT ( r - > out ) ;
r - > out . return_authenticator = r - > in . return_authenticator ;
r - > out . delta_enum_array = talloc_zero ( mem_ctx , struct netr_DELTA_ENUM_ARRAY * ) ;
if ( r - > out . delta_enum_array = = NULL ) {
return NT_STATUS_NO_MEMORY ;
}
r - > out . result = _netr_DatabaseRedo ( cli - > pipes_struct , r ) ;
return NT_STATUS_OK ;
}
case NDR_NETR_LOGONCONTROL2EX : {
2009-01-22 01:19:38 +01:00
struct netr_LogonControl2Ex * r = ( struct netr_LogonControl2Ex * ) _r ;
2009-01-21 14:05:51 +01:00
ZERO_STRUCT ( r - > out ) ;
r - > out . query = talloc_zero ( mem_ctx , union netr_CONTROL_QUERY_INFORMATION ) ;
if ( r - > out . query = = NULL ) {
return NT_STATUS_NO_MEMORY ;
}
r - > out . result = _netr_LogonControl2Ex ( cli - > pipes_struct , r ) ;
return NT_STATUS_OK ;
}
case NDR_NETR_NETRENUMERATETRUSTEDDOMAINS : {
2009-01-22 01:19:38 +01:00
struct netr_NetrEnumerateTrustedDomains * r = ( struct netr_NetrEnumerateTrustedDomains * ) _r ;
2009-01-21 14:05:51 +01:00
ZERO_STRUCT ( r - > out ) ;
r - > out . trusted_domains_blob = talloc_zero ( mem_ctx , struct netr_Blob ) ;
if ( r - > out . trusted_domains_blob = = NULL ) {
return NT_STATUS_NO_MEMORY ;
}
r - > out . result = _netr_NetrEnumerateTrustedDomains ( cli - > pipes_struct , r ) ;
return NT_STATUS_OK ;
}
case NDR_NETR_DSRGETDCNAME : {
2009-01-22 01:19:38 +01:00
struct netr_DsRGetDCName * r = ( struct netr_DsRGetDCName * ) _r ;
2009-01-21 14:05:51 +01:00
ZERO_STRUCT ( r - > out ) ;
r - > out . info = talloc_zero ( mem_ctx , struct netr_DsRGetDCNameInfo * ) ;
if ( r - > out . info = = NULL ) {
return NT_STATUS_NO_MEMORY ;
}
r - > out . result = _netr_DsRGetDCName ( cli - > pipes_struct , r ) ;
return NT_STATUS_OK ;
}
2009-02-16 10:59:45 +01:00
case NDR_NETR_LOGONGETCAPABILITIES : {
struct netr_LogonGetCapabilities * r = ( struct netr_LogonGetCapabilities * ) _r ;
ZERO_STRUCT ( r - > out ) ;
r - > out . return_authenticator = r - > in . return_authenticator ;
r - > out . capabilities = talloc_zero ( mem_ctx , union netr_Capabilities ) ;
if ( r - > out . capabilities = = NULL ) {
return NT_STATUS_NO_MEMORY ;
}
r - > out . result = _netr_LogonGetCapabilities ( cli - > pipes_struct , r ) ;
2009-01-21 14:05:51 +01:00
return NT_STATUS_OK ;
}
case NDR_NETR_NETRLOGONSETSERVICEBITS : {
2009-01-22 01:19:38 +01:00
struct netr_NETRLOGONSETSERVICEBITS * r = ( struct netr_NETRLOGONSETSERVICEBITS * ) _r ;
2009-01-21 14:05:51 +01:00
r - > out . result = _netr_NETRLOGONSETSERVICEBITS ( cli - > pipes_struct , r ) ;
return NT_STATUS_OK ;
}
case NDR_NETR_LOGONGETTRUSTRID : {
2009-01-22 01:19:38 +01:00
struct netr_LogonGetTrustRid * r = ( struct netr_LogonGetTrustRid * ) _r ;
2009-01-21 14:05:51 +01:00
ZERO_STRUCT ( r - > out ) ;
r - > out . rid = talloc_zero ( mem_ctx , uint32_t ) ;
if ( r - > out . rid = = NULL ) {
return NT_STATUS_NO_MEMORY ;
}
r - > out . result = _netr_LogonGetTrustRid ( cli - > pipes_struct , r ) ;
return NT_STATUS_OK ;
}
case NDR_NETR_NETRLOGONCOMPUTESERVERDIGEST : {
2009-01-22 01:19:38 +01:00
struct netr_NETRLOGONCOMPUTESERVERDIGEST * r = ( struct netr_NETRLOGONCOMPUTESERVERDIGEST * ) _r ;
2009-01-21 14:05:51 +01:00
r - > out . result = _netr_NETRLOGONCOMPUTESERVERDIGEST ( cli - > pipes_struct , r ) ;
return NT_STATUS_OK ;
}
case NDR_NETR_NETRLOGONCOMPUTECLIENTDIGEST : {
2009-01-22 01:19:38 +01:00
struct netr_NETRLOGONCOMPUTECLIENTDIGEST * r = ( struct netr_NETRLOGONCOMPUTECLIENTDIGEST * ) _r ;
2009-01-21 14:05:51 +01:00
r - > out . result = _netr_NETRLOGONCOMPUTECLIENTDIGEST ( cli - > pipes_struct , r ) ;
return NT_STATUS_OK ;
}
case NDR_NETR_SERVERAUTHENTICATE3 : {
2009-01-22 01:19:38 +01:00
struct netr_ServerAuthenticate3 * r = ( struct netr_ServerAuthenticate3 * ) _r ;
2009-01-21 14:05:51 +01:00
ZERO_STRUCT ( r - > out ) ;
r - > out . negotiate_flags = r - > in . negotiate_flags ;
r - > out . return_credentials = talloc_zero ( mem_ctx , struct netr_Credential ) ;
if ( r - > out . return_credentials = = NULL ) {
return NT_STATUS_NO_MEMORY ;
}
r - > out . rid = talloc_zero ( mem_ctx , uint32_t ) ;
if ( r - > out . rid = = NULL ) {
return NT_STATUS_NO_MEMORY ;
}
r - > out . result = _netr_ServerAuthenticate3 ( cli - > pipes_struct , r ) ;
return NT_STATUS_OK ;
}
case NDR_NETR_DSRGETDCNAMEEX : {
2009-01-22 01:19:38 +01:00
struct netr_DsRGetDCNameEx * r = ( struct netr_DsRGetDCNameEx * ) _r ;
2009-01-21 14:05:51 +01:00
ZERO_STRUCT ( r - > out ) ;
r - > out . info = talloc_zero ( mem_ctx , struct netr_DsRGetDCNameInfo * ) ;
if ( r - > out . info = = NULL ) {
return NT_STATUS_NO_MEMORY ;
}
r - > out . result = _netr_DsRGetDCNameEx ( cli - > pipes_struct , r ) ;
return NT_STATUS_OK ;
}
case NDR_NETR_DSRGETSITENAME : {
2009-01-22 01:19:38 +01:00
struct netr_DsRGetSiteName * r = ( struct netr_DsRGetSiteName * ) _r ;
2009-01-21 14:05:51 +01:00
ZERO_STRUCT ( r - > out ) ;
r - > out . site = talloc_zero ( mem_ctx , const char * ) ;
if ( r - > out . site = = NULL ) {
return NT_STATUS_NO_MEMORY ;
}
r - > out . result = _netr_DsRGetSiteName ( cli - > pipes_struct , r ) ;
return NT_STATUS_OK ;
}
case NDR_NETR_LOGONGETDOMAININFO : {
2009-01-22 01:19:38 +01:00
struct netr_LogonGetDomainInfo * r = ( struct netr_LogonGetDomainInfo * ) _r ;
2009-01-21 14:05:51 +01:00
ZERO_STRUCT ( r - > out ) ;
r - > out . return_authenticator = r - > in . return_authenticator ;
r - > out . info = talloc_zero ( mem_ctx , union netr_DomainInfo ) ;
if ( r - > out . info = = NULL ) {
return NT_STATUS_NO_MEMORY ;
}
r - > out . result = _netr_LogonGetDomainInfo ( cli - > pipes_struct , r ) ;
return NT_STATUS_OK ;
}
case NDR_NETR_SERVERPASSWORDSET2 : {
2009-01-22 01:19:38 +01:00
struct netr_ServerPasswordSet2 * r = ( struct netr_ServerPasswordSet2 * ) _r ;
2009-01-21 14:05:51 +01:00
ZERO_STRUCT ( r - > out ) ;
r - > out . return_authenticator = talloc_zero ( mem_ctx , struct netr_Authenticator ) ;
if ( r - > out . return_authenticator = = NULL ) {
return NT_STATUS_NO_MEMORY ;
}
r - > out . result = _netr_ServerPasswordSet2 ( cli - > pipes_struct , r ) ;
return NT_STATUS_OK ;
}
case NDR_NETR_SERVERPASSWORDGET : {
2009-01-22 01:19:38 +01:00
struct netr_ServerPasswordGet * r = ( struct netr_ServerPasswordGet * ) _r ;
2009-01-21 14:05:51 +01:00
ZERO_STRUCT ( r - > out ) ;
r - > out . return_authenticator = talloc_zero ( mem_ctx , struct netr_Authenticator ) ;
if ( r - > out . return_authenticator = = NULL ) {
return NT_STATUS_NO_MEMORY ;
}
r - > out . password = talloc_zero ( mem_ctx , struct samr_Password ) ;
if ( r - > out . password = = NULL ) {
return NT_STATUS_NO_MEMORY ;
}
r - > out . result = _netr_ServerPasswordGet ( cli - > pipes_struct , r ) ;
return NT_STATUS_OK ;
}
case NDR_NETR_NETRLOGONSENDTOSAM : {
2009-01-22 01:19:38 +01:00
struct netr_NETRLOGONSENDTOSAM * r = ( struct netr_NETRLOGONSENDTOSAM * ) _r ;
2009-01-21 14:05:51 +01:00
r - > out . result = _netr_NETRLOGONSENDTOSAM ( cli - > pipes_struct , r ) ;
return NT_STATUS_OK ;
}
case NDR_NETR_DSRADDRESSTOSITENAMESW : {
2009-01-22 01:19:38 +01:00
struct netr_DsRAddressToSitenamesW * r = ( struct netr_DsRAddressToSitenamesW * ) _r ;
2009-01-21 14:05:51 +01:00
ZERO_STRUCT ( r - > out ) ;
r - > out . ctr = talloc_zero ( mem_ctx , struct netr_DsRAddressToSitenamesWCtr * ) ;
if ( r - > out . ctr = = NULL ) {
return NT_STATUS_NO_MEMORY ;
}
r - > out . result = _netr_DsRAddressToSitenamesW ( cli - > pipes_struct , r ) ;
return NT_STATUS_OK ;
}
case NDR_NETR_DSRGETDCNAMEEX2 : {
2009-01-22 01:19:38 +01:00
struct netr_DsRGetDCNameEx2 * r = ( struct netr_DsRGetDCNameEx2 * ) _r ;
2009-01-21 14:05:51 +01:00
ZERO_STRUCT ( r - > out ) ;
r - > out . info = talloc_zero ( mem_ctx , struct netr_DsRGetDCNameInfo * ) ;
if ( r - > out . info = = NULL ) {
return NT_STATUS_NO_MEMORY ;
}
r - > out . result = _netr_DsRGetDCNameEx2 ( cli - > pipes_struct , r ) ;
return NT_STATUS_OK ;
}
case NDR_NETR_NETRLOGONGETTIMESERVICEPARENTDOMAIN : {
2009-01-22 01:19:38 +01:00
struct netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN * r = ( struct netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN * ) _r ;
2009-01-21 14:05:51 +01:00
r - > out . result = _netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN ( cli - > pipes_struct , r ) ;
return NT_STATUS_OK ;
}
case NDR_NETR_NETRENUMERATETRUSTEDDOMAINSEX : {
2009-01-22 01:19:38 +01:00
struct netr_NetrEnumerateTrustedDomainsEx * r = ( struct netr_NetrEnumerateTrustedDomainsEx * ) _r ;
2009-01-21 14:05:51 +01:00
ZERO_STRUCT ( r - > out ) ;
r - > out . dom_trust_list = talloc_zero ( mem_ctx , struct netr_DomainTrustList ) ;
if ( r - > out . dom_trust_list = = NULL ) {
return NT_STATUS_NO_MEMORY ;
}
r - > out . result = _netr_NetrEnumerateTrustedDomainsEx ( cli - > pipes_struct , r ) ;
return NT_STATUS_OK ;
}
case NDR_NETR_DSRADDRESSTOSITENAMESEXW : {
2009-01-22 01:19:38 +01:00
struct netr_DsRAddressToSitenamesExW * r = ( struct netr_DsRAddressToSitenamesExW * ) _r ;
2009-01-21 14:05:51 +01:00
ZERO_STRUCT ( r - > out ) ;
r - > out . ctr = talloc_zero ( mem_ctx , struct netr_DsRAddressToSitenamesExWCtr * ) ;
if ( r - > out . ctr = = NULL ) {
return NT_STATUS_NO_MEMORY ;
}
r - > out . result = _netr_DsRAddressToSitenamesExW ( cli - > pipes_struct , r ) ;
return NT_STATUS_OK ;
}
case NDR_NETR_DSRGETDCSITECOVERAGEW : {
2009-01-22 01:19:38 +01:00
struct netr_DsrGetDcSiteCoverageW * r = ( struct netr_DsrGetDcSiteCoverageW * ) _r ;
2009-01-21 14:05:51 +01:00
ZERO_STRUCT ( r - > out ) ;
r - > out . ctr = talloc_zero ( mem_ctx , struct DcSitesCtr * ) ;
if ( r - > out . ctr = = NULL ) {
return NT_STATUS_NO_MEMORY ;
}
r - > out . result = _netr_DsrGetDcSiteCoverageW ( cli - > pipes_struct , r ) ;
return NT_STATUS_OK ;
}
case NDR_NETR_LOGONSAMLOGONEX : {
2009-01-22 01:19:38 +01:00
struct netr_LogonSamLogonEx * r = ( struct netr_LogonSamLogonEx * ) _r ;
2009-01-21 14:05:51 +01:00
ZERO_STRUCT ( r - > out ) ;
r - > out . flags = r - > in . flags ;
r - > out . validation = talloc_zero ( mem_ctx , union netr_Validation ) ;
if ( r - > out . validation = = NULL ) {
return NT_STATUS_NO_MEMORY ;
}
r - > out . authoritative = talloc_zero ( mem_ctx , uint8_t ) ;
if ( r - > out . authoritative = = NULL ) {
return NT_STATUS_NO_MEMORY ;
}
r - > out . result = _netr_LogonSamLogonEx ( cli - > pipes_struct , r ) ;
return NT_STATUS_OK ;
}
case NDR_NETR_DSRENUMERATEDOMAINTRUSTS : {
2009-01-22 01:19:38 +01:00
struct netr_DsrEnumerateDomainTrusts * r = ( struct netr_DsrEnumerateDomainTrusts * ) _r ;
2009-01-21 14:05:51 +01:00
ZERO_STRUCT ( r - > out ) ;
r - > out . trusts = talloc_zero ( mem_ctx , struct netr_DomainTrustList ) ;
if ( r - > out . trusts = = NULL ) {
return NT_STATUS_NO_MEMORY ;
}
r - > out . result = _netr_DsrEnumerateDomainTrusts ( cli - > pipes_struct , r ) ;
return NT_STATUS_OK ;
}
case NDR_NETR_DSRDEREGISTERDNSHOSTRECORDS : {
2009-01-22 01:19:38 +01:00
struct netr_DsrDeregisterDNSHostRecords * r = ( struct netr_DsrDeregisterDNSHostRecords * ) _r ;
2009-01-21 14:05:51 +01:00
r - > out . result = _netr_DsrDeregisterDNSHostRecords ( cli - > pipes_struct , r ) ;
return NT_STATUS_OK ;
}
case NDR_NETR_SERVERTRUSTPASSWORDSGET : {
2009-01-22 01:19:38 +01:00
struct netr_ServerTrustPasswordsGet * r = ( struct netr_ServerTrustPasswordsGet * ) _r ;
2009-01-21 14:05:51 +01:00
ZERO_STRUCT ( r - > out ) ;
r - > out . return_authenticator = talloc_zero ( mem_ctx , struct netr_Authenticator ) ;
if ( r - > out . return_authenticator = = NULL ) {
return NT_STATUS_NO_MEMORY ;
}
r - > out . password = talloc_zero ( mem_ctx , struct samr_Password ) ;
if ( r - > out . password = = NULL ) {
return NT_STATUS_NO_MEMORY ;
}
r - > out . password2 = talloc_zero ( mem_ctx , struct samr_Password ) ;
if ( r - > out . password2 = = NULL ) {
return NT_STATUS_NO_MEMORY ;
}
r - > out . result = _netr_ServerTrustPasswordsGet ( cli - > pipes_struct , r ) ;
return NT_STATUS_OK ;
}
case NDR_NETR_DSRGETFORESTTRUSTINFORMATION : {
2009-01-22 01:19:38 +01:00
struct netr_DsRGetForestTrustInformation * r = ( struct netr_DsRGetForestTrustInformation * ) _r ;
2009-01-21 14:05:51 +01:00
ZERO_STRUCT ( r - > out ) ;
r - > out . forest_trust_info = talloc_zero ( mem_ctx , struct lsa_ForestTrustInformation * ) ;
if ( r - > out . forest_trust_info = = NULL ) {
return NT_STATUS_NO_MEMORY ;
}
r - > out . result = _netr_DsRGetForestTrustInformation ( cli - > pipes_struct , r ) ;
return NT_STATUS_OK ;
}
case NDR_NETR_GETFORESTTRUSTINFORMATION : {
2009-01-22 01:19:38 +01:00
struct netr_GetForestTrustInformation * r = ( struct netr_GetForestTrustInformation * ) _r ;
2009-01-21 14:05:51 +01:00
ZERO_STRUCT ( r - > out ) ;
r - > out . return_authenticator = talloc_zero ( mem_ctx , struct netr_Authenticator ) ;
if ( r - > out . return_authenticator = = NULL ) {
return NT_STATUS_NO_MEMORY ;
}
r - > out . forest_trust_info = talloc_zero ( mem_ctx , struct lsa_ForestTrustInformation * ) ;
if ( r - > out . forest_trust_info = = NULL ) {
return NT_STATUS_NO_MEMORY ;
}
r - > out . result = _netr_GetForestTrustInformation ( cli - > pipes_struct , r ) ;
return NT_STATUS_OK ;
}
case NDR_NETR_LOGONSAMLOGONWITHFLAGS : {
2009-01-22 01:19:38 +01:00
struct netr_LogonSamLogonWithFlags * r = ( struct netr_LogonSamLogonWithFlags * ) _r ;
2009-01-21 14:05:51 +01:00
ZERO_STRUCT ( r - > out ) ;
r - > out . return_authenticator = r - > in . return_authenticator ;
r - > out . flags = r - > in . flags ;
r - > out . validation = talloc_zero ( mem_ctx , union netr_Validation ) ;
if ( r - > out . validation = = NULL ) {
return NT_STATUS_NO_MEMORY ;
}
r - > out . authoritative = talloc_zero ( mem_ctx , uint8_t ) ;
if ( r - > out . authoritative = = NULL ) {
return NT_STATUS_NO_MEMORY ;
}
r - > out . result = _netr_LogonSamLogonWithFlags ( cli - > pipes_struct , r ) ;
return NT_STATUS_OK ;
}
case NDR_NETR_SERVERGETTRUSTINFO : {
2009-01-22 01:19:38 +01:00
struct netr_ServerGetTrustInfo * r = ( struct netr_ServerGetTrustInfo * ) _r ;
2009-01-21 14:05:51 +01:00
ZERO_STRUCT ( r - > out ) ;
r - > out . return_authenticator = talloc_zero ( mem_ctx , struct netr_Authenticator ) ;
if ( r - > out . return_authenticator = = NULL ) {
return NT_STATUS_NO_MEMORY ;
}
r - > out . new_owf_password = talloc_zero ( mem_ctx , struct samr_Password ) ;
if ( r - > out . new_owf_password = = NULL ) {
return NT_STATUS_NO_MEMORY ;
}
r - > out . old_owf_password = talloc_zero ( mem_ctx , struct samr_Password ) ;
if ( r - > out . old_owf_password = = NULL ) {
return NT_STATUS_NO_MEMORY ;
}
r - > out . trust_info = talloc_zero ( mem_ctx , struct netr_TrustInfo * ) ;
if ( r - > out . trust_info = = NULL ) {
return NT_STATUS_NO_MEMORY ;
}
r - > out . result = _netr_ServerGetTrustInfo ( cli - > pipes_struct , r ) ;
return NT_STATUS_OK ;
}
default :
return NT_STATUS_NOT_IMPLEMENTED ;
}
}
2006-09-19 01:27:20 +00:00
NTSTATUS rpc_netlogon_init ( void )
{
2009-01-06 23:29:25 +01:00
return rpc_srv_register ( SMB_RPC_INTERFACE_VERSION , " netlogon " , " netlogon " , & ndr_table_netlogon , api_netlogon_cmds , sizeof ( api_netlogon_cmds ) / sizeof ( struct api_struct ) ) ;
2006-09-19 01:27:20 +00:00
}