2006-09-13 16:28:25 +00:00
/*
* Unix SMB / CIFS implementation .
* server auto - generated by pidl . DO NOT MODIFY !
*/
# include "includes.h"
# include "librpc/gen_ndr/srv_lsa.h"
2007-10-18 17:40:25 -07:00
static bool api_lsa_Close ( pipes_struct * p )
2006-09-13 16:28:25 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-13 16:28:25 +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-13 16:28:25 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct lsa_Close * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_lsarpc . calls [ NDR_LSA_CLOSE ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct lsa_Close ) ;
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-13 16:28:25 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
pull = ndr_pull_init_blob ( & blob , r ) ;
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-13 16:28:25 +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-13 16:28:25 +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 ( lsa_Close , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
ZERO_STRUCT ( r - > out ) ;
r - > out . handle = r - > in . handle ;
r - > out . result = _lsa_Close ( 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 ( lsa_Close , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
push = ndr_push_init_ctx ( r ) ;
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_lsa_Delete ( pipes_struct * p )
2006-09-13 16:28:25 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-13 16:28:25 +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-13 16:28:25 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct lsa_Delete * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_lsarpc . calls [ NDR_LSA_DELETE ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct lsa_Delete ) ;
2007-08-21 14:06:46 +00:00
if ( r = = NULL ) {
2008-01-09 12:28:44 +01:00
return false ;
2006-09-13 16:28:25 +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
2007-08-21 14:06:46 +00:00
pull = ndr_pull_init_blob ( & blob , r ) ;
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-13 16:28:25 +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-13 16:28:25 +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 ( lsa_Delete , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
r - > out . result = _lsa_Delete ( 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 ( lsa_Delete , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
push = ndr_push_init_ctx ( r ) ;
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_lsa_EnumPrivs ( pipes_struct * p )
2006-09-13 16:28:25 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-13 16:28:25 +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-13 16:28:25 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct lsa_EnumPrivs * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_lsarpc . calls [ NDR_LSA_ENUMPRIVS ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct lsa_EnumPrivs ) ;
2007-08-21 14:06:46 +00:00
if ( r = = NULL ) {
2008-01-09 12:28:44 +01:00
return false ;
2006-09-13 16:28:25 +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
2007-08-21 14:06:46 +00:00
pull = ndr_pull_init_blob ( & blob , r ) ;
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-13 16:28:25 +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-13 16:28:25 +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 ( lsa_EnumPrivs , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
ZERO_STRUCT ( r - > out ) ;
r - > out . resume_handle = r - > in . resume_handle ;
r - > out . privs = talloc_zero ( r , struct lsa_PrivArray ) ;
if ( r - > out . privs = = NULL ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-14 14:51:16 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
r - > out . result = _lsa_EnumPrivs ( 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 ( lsa_EnumPrivs , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
push = ndr_push_init_ctx ( r ) ;
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_lsa_QuerySecurity ( pipes_struct * p )
2006-09-13 16:28:25 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-13 16:28:25 +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-13 16:28:25 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct lsa_QuerySecurity * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_lsarpc . calls [ NDR_LSA_QUERYSECURITY ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct lsa_QuerySecurity ) ;
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-13 16:28:25 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
pull = ndr_pull_init_blob ( & blob , r ) ;
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-13 16:28:25 +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-13 16:28:25 +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 ( lsa_QuerySecurity , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
ZERO_STRUCT ( r - > out ) ;
2008-02-04 21:12:12 +01:00
r - > out . sdbuf = talloc_zero ( r , struct sec_desc_buf * ) ;
2007-08-21 14:06:46 +00:00
if ( r - > out . sdbuf = = NULL ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-14 14:51:16 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
r - > out . result = _lsa_QuerySecurity ( 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 ( lsa_QuerySecurity , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
push = ndr_push_init_ctx ( r ) ;
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_lsa_SetSecObj ( pipes_struct * p )
2006-09-13 16:28:25 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-13 16:28:25 +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-13 16:28:25 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct lsa_SetSecObj * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_lsarpc . calls [ NDR_LSA_SETSECOBJ ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct lsa_SetSecObj ) ;
2007-08-21 14:06:46 +00:00
if ( r = = NULL ) {
2008-01-09 12:28:44 +01:00
return false ;
2006-09-13 16:28:25 +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
2007-08-21 14:06:46 +00:00
pull = ndr_pull_init_blob ( & blob , r ) ;
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-13 16:28:25 +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-13 16:28:25 +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 ( lsa_SetSecObj , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
r - > out . result = _lsa_SetSecObj ( 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 ( lsa_SetSecObj , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
push = ndr_push_init_ctx ( r ) ;
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_lsa_ChangePassword ( pipes_struct * p )
2006-09-13 16:28:25 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-13 16:28:25 +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-13 16:28:25 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct lsa_ChangePassword * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_lsarpc . calls [ NDR_LSA_CHANGEPASSWORD ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct lsa_ChangePassword ) ;
2007-08-21 14:06:46 +00:00
if ( r = = NULL ) {
2008-01-09 12:28:44 +01:00
return false ;
2006-09-13 16:28:25 +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
2007-08-21 14:06:46 +00:00
pull = ndr_pull_init_blob ( & blob , r ) ;
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-13 16:28:25 +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-13 16:28:25 +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 ( lsa_ChangePassword , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
r - > out . result = _lsa_ChangePassword ( 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 ( lsa_ChangePassword , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
push = ndr_push_init_ctx ( r ) ;
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_lsa_OpenPolicy ( pipes_struct * p )
2006-09-13 16:28:25 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-13 16:28:25 +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-13 16:28:25 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct lsa_OpenPolicy * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_lsarpc . calls [ NDR_LSA_OPENPOLICY ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct lsa_OpenPolicy ) ;
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-13 16:28:25 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
pull = ndr_pull_init_blob ( & blob , r ) ;
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-13 16:28:25 +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-13 16:28:25 +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 ( lsa_OpenPolicy , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
ZERO_STRUCT ( r - > out ) ;
r - > out . handle = talloc_zero ( r , struct policy_handle ) ;
if ( r - > out . handle = = NULL ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-14 14:51:16 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
r - > out . result = _lsa_OpenPolicy ( 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 ( lsa_OpenPolicy , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
push = ndr_push_init_ctx ( r ) ;
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_lsa_QueryInfoPolicy ( pipes_struct * p )
2006-09-13 16:28:25 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-13 16:28:25 +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-13 16:28:25 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct lsa_QueryInfoPolicy * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_lsarpc . calls [ NDR_LSA_QUERYINFOPOLICY ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct lsa_QueryInfoPolicy ) ;
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-13 16:28:25 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
pull = ndr_pull_init_blob ( & blob , r ) ;
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-13 16:28:25 +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-13 16:28:25 +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 ( lsa_QueryInfoPolicy , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
ZERO_STRUCT ( r - > out ) ;
2008-02-08 09:46:57 +01:00
r - > out . info = talloc_zero ( r , union lsa_PolicyInformation * ) ;
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-14 14:51:16 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
r - > out . result = _lsa_QueryInfoPolicy ( 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 ( lsa_QueryInfoPolicy , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
push = ndr_push_init_ctx ( r ) ;
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_lsa_SetInfoPolicy ( pipes_struct * p )
2006-09-13 16:28:25 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-13 16:28:25 +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-13 16:28:25 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct lsa_SetInfoPolicy * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_lsarpc . calls [ NDR_LSA_SETINFOPOLICY ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct lsa_SetInfoPolicy ) ;
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-13 16:28:25 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
pull = ndr_pull_init_blob ( & blob , r ) ;
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-13 16:28:25 +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-13 16:28:25 +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 ( lsa_SetInfoPolicy , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
r - > out . result = _lsa_SetInfoPolicy ( 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 ( lsa_SetInfoPolicy , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
push = ndr_push_init_ctx ( r ) ;
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_lsa_ClearAuditLog ( pipes_struct * p )
2006-09-13 16:28:25 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-13 16:28:25 +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-13 16:28:25 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct lsa_ClearAuditLog * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_lsarpc . calls [ NDR_LSA_CLEARAUDITLOG ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct lsa_ClearAuditLog ) ;
2007-08-21 14:06:46 +00:00
if ( r = = NULL ) {
2008-01-09 12:28:44 +01:00
return false ;
2006-09-13 16:28:25 +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
2007-08-21 14:06:46 +00:00
pull = ndr_pull_init_blob ( & blob , r ) ;
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-13 16:28:25 +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-13 16:28:25 +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 ( lsa_ClearAuditLog , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
r - > out . result = _lsa_ClearAuditLog ( 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 ( lsa_ClearAuditLog , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
push = ndr_push_init_ctx ( r ) ;
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_lsa_CreateAccount ( pipes_struct * p )
2006-09-13 16:28:25 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-13 16:28:25 +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-13 16:28:25 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct lsa_CreateAccount * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_lsarpc . calls [ NDR_LSA_CREATEACCOUNT ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct lsa_CreateAccount ) ;
2007-08-21 14:06:46 +00:00
if ( r = = NULL ) {
2008-01-09 12:28:44 +01:00
return false ;
2006-09-13 16:28:25 +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
2007-08-21 14:06:46 +00:00
pull = ndr_pull_init_blob ( & blob , r ) ;
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-13 16:28:25 +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-13 16:28:25 +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 ( lsa_CreateAccount , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
ZERO_STRUCT ( r - > out ) ;
2008-02-09 01:33:47 +01:00
r - > out . acct_handle = talloc_zero ( r , struct policy_handle ) ;
2007-08-21 14:06:46 +00:00
if ( r - > out . acct_handle = = NULL ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-14 14:51:16 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
r - > out . result = _lsa_CreateAccount ( 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 ( lsa_CreateAccount , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
push = ndr_push_init_ctx ( r ) ;
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_lsa_EnumAccounts ( pipes_struct * p )
2006-09-13 16:28:25 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-13 16:28:25 +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-13 16:28:25 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct lsa_EnumAccounts * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_lsarpc . calls [ NDR_LSA_ENUMACCOUNTS ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct lsa_EnumAccounts ) ;
2007-08-21 14:06:46 +00:00
if ( r = = NULL ) {
2008-01-09 12:28:44 +01:00
return false ;
2006-09-13 16:28:25 +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
2007-08-21 14:06:46 +00:00
pull = ndr_pull_init_blob ( & blob , r ) ;
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-13 16:28:25 +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-13 16:28:25 +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 ( lsa_EnumAccounts , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
ZERO_STRUCT ( r - > out ) ;
r - > out . resume_handle = r - > in . resume_handle ;
r - > out . sids = talloc_zero ( r , struct lsa_SidArray ) ;
if ( r - > out . sids = = NULL ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-14 14:51:16 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
r - > out . result = _lsa_EnumAccounts ( 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 ( lsa_EnumAccounts , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
push = ndr_push_init_ctx ( r ) ;
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_lsa_CreateTrustedDomain ( pipes_struct * p )
2006-09-13 16:28:25 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-13 16:28:25 +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-13 16:28:25 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct lsa_CreateTrustedDomain * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_lsarpc . calls [ NDR_LSA_CREATETRUSTEDDOMAIN ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct lsa_CreateTrustedDomain ) ;
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-13 16:28:25 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
pull = ndr_pull_init_blob ( & blob , r ) ;
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-13 16:28:25 +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-13 16:28:25 +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 ( lsa_CreateTrustedDomain , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
ZERO_STRUCT ( r - > out ) ;
r - > out . trustdom_handle = talloc_zero ( r , struct policy_handle ) ;
if ( r - > out . trustdom_handle = = NULL ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-14 14:51:16 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
r - > out . result = _lsa_CreateTrustedDomain ( 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 ( lsa_CreateTrustedDomain , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
push = ndr_push_init_ctx ( r ) ;
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_lsa_EnumTrustDom ( pipes_struct * p )
2006-09-13 16:28:25 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-13 16:28:25 +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-13 16:28:25 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct lsa_EnumTrustDom * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_lsarpc . calls [ NDR_LSA_ENUMTRUSTDOM ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct lsa_EnumTrustDom ) ;
2007-08-21 14:06:46 +00:00
if ( r = = NULL ) {
2008-01-09 12:28:44 +01:00
return false ;
2006-09-13 16:28:25 +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
2007-08-21 14:06:46 +00:00
pull = ndr_pull_init_blob ( & blob , r ) ;
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-13 16:28:25 +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-13 16:28:25 +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 ( lsa_EnumTrustDom , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
ZERO_STRUCT ( r - > out ) ;
r - > out . resume_handle = r - > in . resume_handle ;
r - > out . domains = talloc_zero ( r , struct lsa_DomainList ) ;
if ( r - > out . domains = = NULL ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-14 14:51:16 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
r - > out . result = _lsa_EnumTrustDom ( 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 ( lsa_EnumTrustDom , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
push = ndr_push_init_ctx ( r ) ;
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_lsa_LookupNames ( pipes_struct * p )
2006-09-13 16:28:25 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-13 16:28:25 +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-13 16:28:25 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct lsa_LookupNames * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_lsarpc . calls [ NDR_LSA_LOOKUPNAMES ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct lsa_LookupNames ) ;
2007-08-21 14:06:46 +00:00
if ( r = = NULL ) {
2008-01-09 12:28:44 +01:00
return false ;
2006-09-13 16:28:25 +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
2007-08-21 14:06:46 +00:00
pull = ndr_pull_init_blob ( & blob , r ) ;
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-13 16:28:25 +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-13 16:28:25 +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 ( lsa_LookupNames , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
ZERO_STRUCT ( r - > out ) ;
2008-02-17 20:10:54 +01:00
r - > out . domains = talloc_zero ( r , struct lsa_RefDomainList * ) ;
2007-08-21 14:06:46 +00:00
if ( r - > out . domains = = NULL ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-14 14:51:16 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
r - > out . sids = r - > in . sids ;
r - > out . count = r - > in . count ;
r - > out . result = _lsa_LookupNames ( 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 ( lsa_LookupNames , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
push = ndr_push_init_ctx ( r ) ;
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_lsa_LookupSids ( pipes_struct * p )
2006-09-13 16:28:25 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-13 16:28:25 +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-13 16:28:25 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct lsa_LookupSids * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_lsarpc . calls [ NDR_LSA_LOOKUPSIDS ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct lsa_LookupSids ) ;
2007-08-21 14:06:46 +00:00
if ( r = = NULL ) {
2008-01-09 12:28:44 +01:00
return false ;
2006-09-13 16:28:25 +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
2007-08-21 14:06:46 +00:00
pull = ndr_pull_init_blob ( & blob , r ) ;
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-13 16:28:25 +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-13 16:28:25 +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 ( lsa_LookupSids , r ) ;
2008-01-09 12:28:44 +01:00
}
ZERO_STRUCT ( r - > out ) ;
2008-02-17 20:10:54 +01:00
r - > out . domains = talloc_zero ( r , struct lsa_RefDomainList * ) ;
2007-08-21 14:06:46 +00:00
if ( r - > out . domains = = NULL ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-14 14:51:16 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
r - > out . names = r - > in . names ;
r - > out . count = r - > in . count ;
r - > out . result = _lsa_LookupSids ( 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 ( lsa_LookupSids , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
push = ndr_push_init_ctx ( r ) ;
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_lsa_CreateSecret ( pipes_struct * p )
2006-09-13 16:28:25 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-13 16:28:25 +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-13 16:28:25 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct lsa_CreateSecret * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_lsarpc . calls [ NDR_LSA_CREATESECRET ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct lsa_CreateSecret ) ;
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-13 16:28:25 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
pull = ndr_pull_init_blob ( & blob , r ) ;
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-13 16:28:25 +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-13 16:28:25 +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 ( lsa_CreateSecret , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
ZERO_STRUCT ( r - > out ) ;
r - > out . sec_handle = talloc_zero ( r , struct policy_handle ) ;
if ( r - > out . sec_handle = = NULL ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-14 14:51:16 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
r - > out . result = _lsa_CreateSecret ( 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 ( lsa_CreateSecret , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
push = ndr_push_init_ctx ( r ) ;
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_lsa_OpenAccount ( pipes_struct * p )
2006-09-13 16:28:25 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-13 16:28:25 +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-13 16:28:25 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct lsa_OpenAccount * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_lsarpc . calls [ NDR_LSA_OPENACCOUNT ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct lsa_OpenAccount ) ;
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-13 16:28:25 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
pull = ndr_pull_init_blob ( & blob , r ) ;
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-13 16:28:25 +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-13 16:28:25 +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 ( lsa_OpenAccount , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
ZERO_STRUCT ( r - > out ) ;
2008-02-09 01:33:47 +01:00
r - > out . acct_handle = talloc_zero ( r , struct policy_handle ) ;
2007-08-21 14:06:46 +00:00
if ( r - > out . acct_handle = = NULL ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-14 14:51:16 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
r - > out . result = _lsa_OpenAccount ( 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 ( lsa_OpenAccount , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
push = ndr_push_init_ctx ( r ) ;
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_lsa_EnumPrivsAccount ( pipes_struct * p )
2006-09-13 16:28:25 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-13 16:28:25 +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-13 16:28:25 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct lsa_EnumPrivsAccount * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_lsarpc . calls [ NDR_LSA_ENUMPRIVSACCOUNT ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct lsa_EnumPrivsAccount ) ;
2007-08-21 14:06:46 +00:00
if ( r = = NULL ) {
2008-01-09 12:28:44 +01:00
return false ;
2006-09-13 16:28:25 +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
2007-08-21 14:06:46 +00:00
pull = ndr_pull_init_blob ( & blob , r ) ;
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-13 16:28:25 +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-13 16:28:25 +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 ( lsa_EnumPrivsAccount , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
ZERO_STRUCT ( r - > out ) ;
2008-02-14 01:55:22 +01:00
r - > out . privs = talloc_zero ( r , struct lsa_PrivilegeSet * ) ;
2007-08-21 14:06:46 +00:00
if ( r - > out . privs = = NULL ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-14 14:51:16 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
r - > out . result = _lsa_EnumPrivsAccount ( 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 ( lsa_EnumPrivsAccount , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
push = ndr_push_init_ctx ( r ) ;
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_lsa_AddPrivilegesToAccount ( pipes_struct * p )
2006-09-13 16:28:25 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-13 16:28:25 +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-13 16:28:25 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct lsa_AddPrivilegesToAccount * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_lsarpc . calls [ NDR_LSA_ADDPRIVILEGESTOACCOUNT ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct lsa_AddPrivilegesToAccount ) ;
2007-08-21 14:06:46 +00:00
if ( r = = NULL ) {
2008-01-09 12:28:44 +01:00
return false ;
2006-09-13 16:28:25 +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
2007-08-21 14:06:46 +00:00
pull = ndr_pull_init_blob ( & blob , r ) ;
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-13 16:28:25 +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-13 16:28:25 +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 ( lsa_AddPrivilegesToAccount , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
r - > out . result = _lsa_AddPrivilegesToAccount ( 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 ( lsa_AddPrivilegesToAccount , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
push = ndr_push_init_ctx ( r ) ;
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_lsa_RemovePrivilegesFromAccount ( pipes_struct * p )
2006-09-13 16:28:25 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-13 16:28:25 +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-13 16:28:25 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct lsa_RemovePrivilegesFromAccount * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_lsarpc . calls [ NDR_LSA_REMOVEPRIVILEGESFROMACCOUNT ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct lsa_RemovePrivilegesFromAccount ) ;
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-13 16:28:25 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
pull = ndr_pull_init_blob ( & blob , r ) ;
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-13 16:28:25 +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-13 16:28:25 +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 ( lsa_RemovePrivilegesFromAccount , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
r - > out . result = _lsa_RemovePrivilegesFromAccount ( 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 ( lsa_RemovePrivilegesFromAccount , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
push = ndr_push_init_ctx ( r ) ;
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_lsa_GetQuotasForAccount ( pipes_struct * p )
2006-09-13 16:28:25 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-13 16:28:25 +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-13 16:28:25 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct lsa_GetQuotasForAccount * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_lsarpc . calls [ NDR_LSA_GETQUOTASFORACCOUNT ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct lsa_GetQuotasForAccount ) ;
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-13 16:28:25 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
pull = ndr_pull_init_blob ( & blob , r ) ;
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-13 16:28:25 +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-13 16:28:25 +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 ( lsa_GetQuotasForAccount , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
r - > out . result = _lsa_GetQuotasForAccount ( 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 ( lsa_GetQuotasForAccount , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
push = ndr_push_init_ctx ( r ) ;
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_lsa_SetQuotasForAccount ( pipes_struct * p )
2006-09-13 16:28:25 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-13 16:28:25 +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-13 16:28:25 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct lsa_SetQuotasForAccount * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_lsarpc . calls [ NDR_LSA_SETQUOTASFORACCOUNT ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct lsa_SetQuotasForAccount ) ;
2007-08-21 14:06:46 +00:00
if ( r = = NULL ) {
2008-01-09 12:28:44 +01:00
return false ;
2006-09-13 16:28:25 +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
2007-08-21 14:06:46 +00:00
pull = ndr_pull_init_blob ( & blob , r ) ;
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-13 16:28:25 +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-13 16:28:25 +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 ( lsa_SetQuotasForAccount , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
r - > out . result = _lsa_SetQuotasForAccount ( 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 ( lsa_SetQuotasForAccount , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
push = ndr_push_init_ctx ( r ) ;
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_lsa_GetSystemAccessAccount ( pipes_struct * p )
2006-09-13 16:28:25 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-13 16:28:25 +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-13 16:28:25 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct lsa_GetSystemAccessAccount * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_lsarpc . calls [ NDR_LSA_GETSYSTEMACCESSACCOUNT ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct lsa_GetSystemAccessAccount ) ;
2007-08-21 14:06:46 +00:00
if ( r = = NULL ) {
2008-01-09 12:28:44 +01:00
return false ;
2006-09-13 16:28:25 +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
2007-08-21 14:06:46 +00:00
pull = ndr_pull_init_blob ( & blob , r ) ;
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-13 16:28:25 +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-13 16:28:25 +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 ( lsa_GetSystemAccessAccount , r ) ;
2008-01-09 12:28:44 +01:00
}
2008-02-08 22:54:28 +01:00
ZERO_STRUCT ( r - > out ) ;
r - > out . access_mask = talloc_zero ( r , uint32_t ) ;
if ( r - > out . access_mask = = NULL ) {
talloc_free ( r ) ;
return false ;
}
2007-08-21 14:06:46 +00:00
r - > out . result = _lsa_GetSystemAccessAccount ( 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 ( lsa_GetSystemAccessAccount , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
push = ndr_push_init_ctx ( r ) ;
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_lsa_SetSystemAccessAccount ( pipes_struct * p )
2006-09-13 16:28:25 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-13 16:28:25 +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-13 16:28:25 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct lsa_SetSystemAccessAccount * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_lsarpc . calls [ NDR_LSA_SETSYSTEMACCESSACCOUNT ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct lsa_SetSystemAccessAccount ) ;
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-13 16:28:25 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
pull = ndr_pull_init_blob ( & blob , r ) ;
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-13 16:28:25 +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-13 16:28:25 +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 ( lsa_SetSystemAccessAccount , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
r - > out . result = _lsa_SetSystemAccessAccount ( 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 ( lsa_SetSystemAccessAccount , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
push = ndr_push_init_ctx ( r ) ;
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_lsa_OpenTrustedDomain ( pipes_struct * p )
2006-09-13 16:28:25 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-13 16:28:25 +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-13 16:28:25 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct lsa_OpenTrustedDomain * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_lsarpc . calls [ NDR_LSA_OPENTRUSTEDDOMAIN ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct lsa_OpenTrustedDomain ) ;
2007-08-21 14:06:46 +00:00
if ( r = = NULL ) {
2008-01-09 12:28:44 +01:00
return false ;
2006-09-13 16:28:25 +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
2007-08-21 14:06:46 +00:00
pull = ndr_pull_init_blob ( & blob , r ) ;
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-13 16:28:25 +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-13 16:28:25 +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 ( lsa_OpenTrustedDomain , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
ZERO_STRUCT ( r - > out ) ;
r - > out . trustdom_handle = talloc_zero ( r , struct policy_handle ) ;
if ( r - > out . trustdom_handle = = NULL ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-14 14:51:16 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
r - > out . result = _lsa_OpenTrustedDomain ( 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 ( lsa_OpenTrustedDomain , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
push = ndr_push_init_ctx ( r ) ;
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_lsa_QueryTrustedDomainInfo ( pipes_struct * p )
2006-09-13 16:28:25 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-13 16:28:25 +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-13 16:28:25 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct lsa_QueryTrustedDomainInfo * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_lsarpc . calls [ NDR_LSA_QUERYTRUSTEDDOMAININFO ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct lsa_QueryTrustedDomainInfo ) ;
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-13 16:28:25 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
pull = ndr_pull_init_blob ( & blob , r ) ;
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-13 16:28:25 +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-13 16:28:25 +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 ( lsa_QueryTrustedDomainInfo , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
ZERO_STRUCT ( r - > out ) ;
2008-04-08 22:58:16 +02:00
r - > out . info = talloc_zero ( r , union lsa_TrustedDomainInfo * ) ;
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-14 14:51:16 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
r - > out . result = _lsa_QueryTrustedDomainInfo ( 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 ( lsa_QueryTrustedDomainInfo , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
push = ndr_push_init_ctx ( r ) ;
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_lsa_SetInformationTrustedDomain ( pipes_struct * p )
2006-09-13 16:28:25 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-13 16:28:25 +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-13 16:28:25 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct lsa_SetInformationTrustedDomain * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_lsarpc . calls [ NDR_LSA_SETINFORMATIONTRUSTEDDOMAIN ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct lsa_SetInformationTrustedDomain ) ;
2007-08-21 14:06:46 +00:00
if ( r = = NULL ) {
2008-01-09 12:28:44 +01:00
return false ;
2006-09-13 16:28:25 +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
2007-08-21 14:06:46 +00:00
pull = ndr_pull_init_blob ( & blob , r ) ;
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-13 16:28:25 +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-13 16:28:25 +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 ( lsa_SetInformationTrustedDomain , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
r - > out . result = _lsa_SetInformationTrustedDomain ( 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 ( lsa_SetInformationTrustedDomain , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
push = ndr_push_init_ctx ( r ) ;
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_lsa_OpenSecret ( pipes_struct * p )
2006-09-13 16:28:25 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-13 16:28:25 +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-13 16:28:25 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct lsa_OpenSecret * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_lsarpc . calls [ NDR_LSA_OPENSECRET ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct lsa_OpenSecret ) ;
2007-08-21 14:06:46 +00:00
if ( r = = NULL ) {
2008-01-09 12:28:44 +01:00
return false ;
2006-09-13 16:28:25 +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
2007-08-21 14:06:46 +00:00
pull = ndr_pull_init_blob ( & blob , r ) ;
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-13 16:28:25 +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-13 16:28:25 +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 ( lsa_OpenSecret , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
ZERO_STRUCT ( r - > out ) ;
r - > out . sec_handle = talloc_zero ( r , struct policy_handle ) ;
if ( r - > out . sec_handle = = NULL ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-14 14:51:16 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
r - > out . result = _lsa_OpenSecret ( 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 ( lsa_OpenSecret , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
push = ndr_push_init_ctx ( r ) ;
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_lsa_SetSecret ( pipes_struct * p )
2006-09-13 16:28:25 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-13 16:28:25 +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-13 16:28:25 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct lsa_SetSecret * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_lsarpc . calls [ NDR_LSA_SETSECRET ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct lsa_SetSecret ) ;
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-13 16:28:25 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
pull = ndr_pull_init_blob ( & blob , r ) ;
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-13 16:28:25 +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-13 16:28:25 +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 ( lsa_SetSecret , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
r - > out . result = _lsa_SetSecret ( 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 ( lsa_SetSecret , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
push = ndr_push_init_ctx ( r ) ;
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_lsa_QuerySecret ( pipes_struct * p )
2006-09-13 16:28:25 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-13 16:28:25 +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-13 16:28:25 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct lsa_QuerySecret * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_lsarpc . calls [ NDR_LSA_QUERYSECRET ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct lsa_QuerySecret ) ;
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-13 16:28:25 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
pull = ndr_pull_init_blob ( & blob , r ) ;
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-13 16:28:25 +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-13 16:28:25 +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 ( lsa_QuerySecret , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
ZERO_STRUCT ( r - > out ) ;
r - > out . new_val = r - > in . new_val ;
r - > out . new_mtime = r - > in . new_mtime ;
r - > out . old_val = r - > in . old_val ;
r - > out . old_mtime = r - > in . old_mtime ;
r - > out . result = _lsa_QuerySecret ( 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 ( lsa_QuerySecret , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
push = ndr_push_init_ctx ( r ) ;
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_lsa_LookupPrivValue ( pipes_struct * p )
2006-09-13 16:28:25 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-13 16:28:25 +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-13 16:28:25 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct lsa_LookupPrivValue * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_lsarpc . calls [ NDR_LSA_LOOKUPPRIVVALUE ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct lsa_LookupPrivValue ) ;
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-13 16:28:25 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
pull = ndr_pull_init_blob ( & blob , r ) ;
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-13 16:28:25 +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-13 16:28:25 +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 ( lsa_LookupPrivValue , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
ZERO_STRUCT ( r - > out ) ;
r - > out . luid = talloc_zero ( r , struct lsa_LUID ) ;
if ( r - > out . luid = = NULL ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-14 14:51:16 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
r - > out . result = _lsa_LookupPrivValue ( 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 ( lsa_LookupPrivValue , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
push = ndr_push_init_ctx ( r ) ;
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_lsa_LookupPrivName ( pipes_struct * p )
2006-09-13 16:28:25 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-13 16:28:25 +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-13 16:28:25 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct lsa_LookupPrivName * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_lsarpc . calls [ NDR_LSA_LOOKUPPRIVNAME ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct lsa_LookupPrivName ) ;
2007-08-21 14:06:46 +00:00
if ( r = = NULL ) {
2008-01-09 12:28:44 +01:00
return false ;
2006-09-13 16:28:25 +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
2007-08-21 14:06:46 +00:00
pull = ndr_pull_init_blob ( & blob , r ) ;
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-13 16:28:25 +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-13 16:28:25 +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 ( lsa_LookupPrivName , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
ZERO_STRUCT ( r - > out ) ;
2008-04-08 23:04:22 +02:00
r - > out . name = talloc_zero ( r , struct lsa_StringLarge * ) ;
2007-08-21 14:06:46 +00:00
if ( r - > out . name = = NULL ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-14 14:51:16 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
r - > out . result = _lsa_LookupPrivName ( 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 ( lsa_LookupPrivName , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
push = ndr_push_init_ctx ( r ) ;
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_lsa_LookupPrivDisplayName ( pipes_struct * p )
2006-09-13 16:28:25 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-13 16:28:25 +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-13 16:28:25 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct lsa_LookupPrivDisplayName * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_lsarpc . calls [ NDR_LSA_LOOKUPPRIVDISPLAYNAME ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct lsa_LookupPrivDisplayName ) ;
2007-08-21 14:06:46 +00:00
if ( r = = NULL ) {
2008-01-09 12:28:44 +01:00
return false ;
2006-09-13 16:28:25 +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
2007-08-21 14:06:46 +00:00
pull = ndr_pull_init_blob ( & blob , r ) ;
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-13 16:28:25 +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-13 16:28:25 +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 ( lsa_LookupPrivDisplayName , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
ZERO_STRUCT ( r - > out ) ;
2008-02-11 17:56:22 +01:00
r - > out . disp_name = talloc_zero ( r , struct lsa_StringLarge * ) ;
2007-08-21 14:06:46 +00:00
if ( r - > out . disp_name = = NULL ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-14 14:51:16 +00:00
}
2008-01-09 12:28:44 +01:00
2008-02-11 17:56:22 +01:00
r - > out . returned_language_id = talloc_zero ( r , uint16_t ) ;
if ( r - > out . returned_language_id = = NULL ) {
talloc_free ( r ) ;
return false ;
}
2007-08-21 14:06:46 +00:00
r - > out . result = _lsa_LookupPrivDisplayName ( 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 ( lsa_LookupPrivDisplayName , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
push = ndr_push_init_ctx ( r ) ;
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_lsa_DeleteObject ( pipes_struct * p )
2006-09-13 16:28:25 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-13 16:28:25 +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-13 16:28:25 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct lsa_DeleteObject * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_lsarpc . calls [ NDR_LSA_DELETEOBJECT ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct lsa_DeleteObject ) ;
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-13 16:28:25 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
pull = ndr_pull_init_blob ( & blob , r ) ;
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-13 16:28:25 +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-13 16:28:25 +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 ( lsa_DeleteObject , r ) ;
2008-01-09 12:28:44 +01:00
}
2008-02-04 22:04:36 +01:00
ZERO_STRUCT ( r - > out ) ;
r - > out . handle = r - > in . handle ;
2007-08-21 14:06:46 +00:00
r - > out . result = _lsa_DeleteObject ( 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 ( lsa_DeleteObject , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
push = ndr_push_init_ctx ( r ) ;
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_lsa_EnumAccountsWithUserRight ( pipes_struct * p )
2006-09-13 16:28:25 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-13 16:28:25 +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-13 16:28:25 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct lsa_EnumAccountsWithUserRight * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_lsarpc . calls [ NDR_LSA_ENUMACCOUNTSWITHUSERRIGHT ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct lsa_EnumAccountsWithUserRight ) ;
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-13 16:28:25 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
pull = ndr_pull_init_blob ( & blob , r ) ;
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-13 16:28:25 +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-13 16:28:25 +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 ( lsa_EnumAccountsWithUserRight , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
ZERO_STRUCT ( r - > out ) ;
r - > out . sids = talloc_zero ( r , struct lsa_SidArray ) ;
if ( r - > out . sids = = NULL ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-14 14:51:16 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
r - > out . result = _lsa_EnumAccountsWithUserRight ( 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 ( lsa_EnumAccountsWithUserRight , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
push = ndr_push_init_ctx ( r ) ;
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_lsa_EnumAccountRights ( pipes_struct * p )
2006-09-13 16:28:25 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-13 16:28:25 +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-13 16:28:25 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct lsa_EnumAccountRights * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_lsarpc . calls [ NDR_LSA_ENUMACCOUNTRIGHTS ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct lsa_EnumAccountRights ) ;
2007-08-21 14:06:46 +00:00
if ( r = = NULL ) {
2008-01-09 12:28:44 +01:00
return false ;
2006-09-13 16:28:25 +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
2007-08-21 14:06:46 +00:00
pull = ndr_pull_init_blob ( & blob , r ) ;
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-13 16:28:25 +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-13 16:28:25 +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 ( lsa_EnumAccountRights , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
ZERO_STRUCT ( r - > out ) ;
r - > out . rights = talloc_zero ( r , struct lsa_RightSet ) ;
if ( r - > out . rights = = NULL ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-14 14:51:16 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
r - > out . result = _lsa_EnumAccountRights ( 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 ( lsa_EnumAccountRights , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
push = ndr_push_init_ctx ( r ) ;
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_lsa_AddAccountRights ( pipes_struct * p )
2006-09-13 16:28:25 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-13 16:28:25 +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-13 16:28:25 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct lsa_AddAccountRights * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_lsarpc . calls [ NDR_LSA_ADDACCOUNTRIGHTS ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct lsa_AddAccountRights ) ;
2007-08-21 14:06:46 +00:00
if ( r = = NULL ) {
2008-01-09 12:28:44 +01:00
return false ;
2006-09-13 16:28:25 +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
2007-08-21 14:06:46 +00:00
pull = ndr_pull_init_blob ( & blob , r ) ;
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-13 16:28:25 +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-13 16:28:25 +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 ( lsa_AddAccountRights , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
r - > out . result = _lsa_AddAccountRights ( 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 ( lsa_AddAccountRights , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
push = ndr_push_init_ctx ( r ) ;
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_lsa_RemoveAccountRights ( pipes_struct * p )
2006-09-13 16:28:25 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-13 16:28:25 +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-13 16:28:25 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct lsa_RemoveAccountRights * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_lsarpc . calls [ NDR_LSA_REMOVEACCOUNTRIGHTS ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct lsa_RemoveAccountRights ) ;
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-13 16:28:25 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
pull = ndr_pull_init_blob ( & blob , r ) ;
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-13 16:28:25 +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-13 16:28:25 +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 ( lsa_RemoveAccountRights , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
r - > out . result = _lsa_RemoveAccountRights ( 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 ( lsa_RemoveAccountRights , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
push = ndr_push_init_ctx ( r ) ;
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_lsa_QueryTrustedDomainInfoBySid ( pipes_struct * p )
2006-09-13 16:28:25 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-13 16:28:25 +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-13 16:28:25 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct lsa_QueryTrustedDomainInfoBySid * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_lsarpc . calls [ NDR_LSA_QUERYTRUSTEDDOMAININFOBYSID ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct lsa_QueryTrustedDomainInfoBySid ) ;
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-13 16:28:25 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
pull = ndr_pull_init_blob ( & blob , r ) ;
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-13 16:28:25 +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-13 16:28:25 +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 ( lsa_QueryTrustedDomainInfoBySid , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
ZERO_STRUCT ( r - > out ) ;
2008-04-08 22:54:18 +02:00
r - > out . info = talloc_zero ( r , union lsa_TrustedDomainInfo * ) ;
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-14 14:51:16 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
r - > out . result = _lsa_QueryTrustedDomainInfoBySid ( 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 ( lsa_QueryTrustedDomainInfoBySid , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
push = ndr_push_init_ctx ( r ) ;
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_lsa_SetTrustedDomainInfo ( pipes_struct * p )
2006-09-13 16:28:25 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-13 16:28:25 +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-13 16:28:25 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct lsa_SetTrustedDomainInfo * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_lsarpc . calls [ NDR_LSA_SETTRUSTEDDOMAININFO ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct lsa_SetTrustedDomainInfo ) ;
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-13 16:28:25 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
pull = ndr_pull_init_blob ( & blob , r ) ;
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-13 16:28:25 +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-13 16:28:25 +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 ( lsa_SetTrustedDomainInfo , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
r - > out . result = _lsa_SetTrustedDomainInfo ( 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 ( lsa_SetTrustedDomainInfo , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
push = ndr_push_init_ctx ( r ) ;
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_lsa_DeleteTrustedDomain ( pipes_struct * p )
2006-09-13 16:28:25 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-13 16:28:25 +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-13 16:28:25 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct lsa_DeleteTrustedDomain * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_lsarpc . calls [ NDR_LSA_DELETETRUSTEDDOMAIN ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct lsa_DeleteTrustedDomain ) ;
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-13 16:28:25 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
pull = ndr_pull_init_blob ( & blob , r ) ;
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-13 16:28:25 +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-13 16:28:25 +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 ( lsa_DeleteTrustedDomain , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
r - > out . result = _lsa_DeleteTrustedDomain ( 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 ( lsa_DeleteTrustedDomain , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
push = ndr_push_init_ctx ( r ) ;
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_lsa_StorePrivateData ( pipes_struct * p )
2006-09-13 16:28:25 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-13 16:28:25 +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-13 16:28:25 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct lsa_StorePrivateData * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_lsarpc . calls [ NDR_LSA_STOREPRIVATEDATA ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct lsa_StorePrivateData ) ;
2007-08-21 14:06:46 +00:00
if ( r = = NULL ) {
2008-01-09 12:28:44 +01:00
return false ;
2006-09-13 16:28:25 +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
2007-08-21 14:06:46 +00:00
pull = ndr_pull_init_blob ( & blob , r ) ;
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-13 16:28:25 +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-13 16:28:25 +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 ( lsa_StorePrivateData , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
r - > out . result = _lsa_StorePrivateData ( 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 ( lsa_StorePrivateData , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
push = ndr_push_init_ctx ( r ) ;
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_lsa_RetrievePrivateData ( pipes_struct * p )
2006-09-13 16:28:25 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-13 16:28:25 +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-13 16:28:25 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct lsa_RetrievePrivateData * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_lsarpc . calls [ NDR_LSA_RETRIEVEPRIVATEDATA ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct lsa_RetrievePrivateData ) ;
2007-08-21 14:06:46 +00:00
if ( r = = NULL ) {
2008-01-09 12:28:44 +01:00
return false ;
2006-09-13 16:28:25 +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
2007-08-21 14:06:46 +00:00
pull = ndr_pull_init_blob ( & blob , r ) ;
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-13 16:28:25 +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-13 16:28:25 +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 ( lsa_RetrievePrivateData , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
r - > out . result = _lsa_RetrievePrivateData ( 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 ( lsa_RetrievePrivateData , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
push = ndr_push_init_ctx ( r ) ;
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_lsa_OpenPolicy2 ( pipes_struct * p )
2006-09-13 16:28:25 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-13 16:28:25 +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-13 16:28:25 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct lsa_OpenPolicy2 * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_lsarpc . calls [ NDR_LSA_OPENPOLICY2 ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct lsa_OpenPolicy2 ) ;
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-13 16:28:25 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
pull = ndr_pull_init_blob ( & blob , r ) ;
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-13 16:28:25 +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-13 16:28:25 +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 ( lsa_OpenPolicy2 , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
ZERO_STRUCT ( r - > out ) ;
r - > out . handle = talloc_zero ( r , struct policy_handle ) ;
if ( r - > out . handle = = NULL ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-14 14:51:16 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
r - > out . result = _lsa_OpenPolicy2 ( 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 ( lsa_OpenPolicy2 , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
push = ndr_push_init_ctx ( r ) ;
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_lsa_GetUserName ( pipes_struct * p )
2006-09-13 16:28:25 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-13 16:28:25 +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-13 16:28:25 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct lsa_GetUserName * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_lsarpc . calls [ NDR_LSA_GETUSERNAME ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct lsa_GetUserName ) ;
2007-08-21 14:06:46 +00:00
if ( r = = NULL ) {
2008-01-09 12:28:44 +01:00
return false ;
2006-09-13 16:28:25 +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
2007-08-21 14:06:46 +00:00
pull = ndr_pull_init_blob ( & blob , r ) ;
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-13 16:28:25 +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-13 16:28:25 +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 ( lsa_GetUserName , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
ZERO_STRUCT ( r - > out ) ;
r - > out . account_name = r - > in . account_name ;
r - > out . authority_name = r - > in . authority_name ;
r - > out . result = _lsa_GetUserName ( 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 ( lsa_GetUserName , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
push = ndr_push_init_ctx ( r ) ;
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_lsa_QueryInfoPolicy2 ( pipes_struct * p )
2006-09-13 16:28:25 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-13 16:28:25 +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-13 16:28:25 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct lsa_QueryInfoPolicy2 * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_lsarpc . calls [ NDR_LSA_QUERYINFOPOLICY2 ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct lsa_QueryInfoPolicy2 ) ;
2007-08-21 14:06:46 +00:00
if ( r = = NULL ) {
2008-01-09 12:28:44 +01:00
return false ;
2006-09-13 16:28:25 +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
2007-08-21 14:06:46 +00:00
pull = ndr_pull_init_blob ( & blob , r ) ;
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-13 16:28:25 +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-13 16:28:25 +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 ( lsa_QueryInfoPolicy2 , r ) ;
2008-01-09 12:28:44 +01:00
}
ZERO_STRUCT ( r - > out ) ;
2008-02-08 09:46:57 +01:00
r - > out . info = talloc_zero ( r , union lsa_PolicyInformation * ) ;
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-14 14:51:16 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
r - > out . result = _lsa_QueryInfoPolicy2 ( 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 ( lsa_QueryInfoPolicy2 , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
push = ndr_push_init_ctx ( r ) ;
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_lsa_SetInfoPolicy2 ( pipes_struct * p )
2006-09-13 16:28:25 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-13 16:28:25 +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-13 16:28:25 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct lsa_SetInfoPolicy2 * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_lsarpc . calls [ NDR_LSA_SETINFOPOLICY2 ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct lsa_SetInfoPolicy2 ) ;
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-13 16:28:25 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
pull = ndr_pull_init_blob ( & blob , r ) ;
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-13 16:28:25 +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-13 16:28:25 +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 ( lsa_SetInfoPolicy2 , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
r - > out . result = _lsa_SetInfoPolicy2 ( 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 ( lsa_SetInfoPolicy2 , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
push = ndr_push_init_ctx ( r ) ;
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_lsa_QueryTrustedDomainInfoByName ( pipes_struct * p )
2006-09-13 16:28:25 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-13 16:28:25 +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-13 16:28:25 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct lsa_QueryTrustedDomainInfoByName * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_lsarpc . calls [ NDR_LSA_QUERYTRUSTEDDOMAININFOBYNAME ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct lsa_QueryTrustedDomainInfoByName ) ;
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-13 16:28:25 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
pull = ndr_pull_init_blob ( & blob , r ) ;
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-13 16:28:25 +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-13 16:28:25 +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 ( lsa_QueryTrustedDomainInfoByName , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
ZERO_STRUCT ( r - > out ) ;
2008-04-08 22:54:18 +02:00
r - > out . info = talloc_zero ( r , union lsa_TrustedDomainInfo * ) ;
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-14 14:51:16 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
r - > out . result = _lsa_QueryTrustedDomainInfoByName ( 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 ( lsa_QueryTrustedDomainInfoByName , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
push = ndr_push_init_ctx ( r ) ;
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_lsa_SetTrustedDomainInfoByName ( pipes_struct * p )
2006-09-13 16:28:25 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-13 16:28:25 +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-13 16:28:25 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct lsa_SetTrustedDomainInfoByName * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_lsarpc . calls [ NDR_LSA_SETTRUSTEDDOMAININFOBYNAME ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct lsa_SetTrustedDomainInfoByName ) ;
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-13 16:28:25 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
pull = ndr_pull_init_blob ( & blob , r ) ;
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-13 16:28:25 +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-13 16:28:25 +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 ( lsa_SetTrustedDomainInfoByName , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
r - > out . result = _lsa_SetTrustedDomainInfoByName ( 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 ( lsa_SetTrustedDomainInfoByName , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
push = ndr_push_init_ctx ( r ) ;
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_lsa_EnumTrustedDomainsEx ( pipes_struct * p )
2006-09-13 16:28:25 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-13 16:28:25 +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-13 16:28:25 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct lsa_EnumTrustedDomainsEx * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_lsarpc . calls [ NDR_LSA_ENUMTRUSTEDDOMAINSEX ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct lsa_EnumTrustedDomainsEx ) ;
2007-08-21 14:06:46 +00:00
if ( r = = NULL ) {
2008-01-09 12:28:44 +01:00
return false ;
2006-09-13 16:28:25 +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
2007-08-21 14:06:46 +00:00
pull = ndr_pull_init_blob ( & blob , r ) ;
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-13 16:28:25 +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-13 16:28:25 +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 ( lsa_EnumTrustedDomainsEx , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
ZERO_STRUCT ( r - > out ) ;
r - > out . resume_handle = r - > in . resume_handle ;
r - > out . domains = talloc_zero ( r , struct lsa_DomainListEx ) ;
if ( r - > out . domains = = NULL ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-14 14:51:16 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
r - > out . result = _lsa_EnumTrustedDomainsEx ( 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 ( lsa_EnumTrustedDomainsEx , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
push = ndr_push_init_ctx ( r ) ;
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_lsa_CreateTrustedDomainEx ( pipes_struct * p )
2006-09-13 16:28:25 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-13 16:28:25 +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-13 16:28:25 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct lsa_CreateTrustedDomainEx * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_lsarpc . calls [ NDR_LSA_CREATETRUSTEDDOMAINEX ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct lsa_CreateTrustedDomainEx ) ;
2007-08-21 14:06:46 +00:00
if ( r = = NULL ) {
2008-01-09 12:28:44 +01:00
return false ;
2006-09-13 16:28:25 +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
2007-08-21 14:06:46 +00:00
pull = ndr_pull_init_blob ( & blob , r ) ;
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-13 16:28:25 +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-13 16:28:25 +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 ( lsa_CreateTrustedDomainEx , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
r - > out . result = _lsa_CreateTrustedDomainEx ( 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 ( lsa_CreateTrustedDomainEx , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
push = ndr_push_init_ctx ( r ) ;
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_lsa_CloseTrustedDomainEx ( pipes_struct * p )
2006-09-13 16:28:25 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-13 16:28:25 +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-13 16:28:25 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct lsa_CloseTrustedDomainEx * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_lsarpc . calls [ NDR_LSA_CLOSETRUSTEDDOMAINEX ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct lsa_CloseTrustedDomainEx ) ;
2007-08-21 14:06:46 +00:00
if ( r = = NULL ) {
2008-01-09 12:28:44 +01:00
return false ;
2006-09-13 16:28:25 +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
2007-08-21 14:06:46 +00:00
pull = ndr_pull_init_blob ( & blob , r ) ;
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-13 16:28:25 +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-13 16:28:25 +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 ( lsa_CloseTrustedDomainEx , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
ZERO_STRUCT ( r - > out ) ;
r - > out . handle = r - > in . handle ;
r - > out . result = _lsa_CloseTrustedDomainEx ( 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 ( lsa_CloseTrustedDomainEx , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
push = ndr_push_init_ctx ( r ) ;
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_lsa_QueryDomainInformationPolicy ( pipes_struct * p )
2006-09-13 16:28:25 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-13 16:28:25 +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-13 16:28:25 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct lsa_QueryDomainInformationPolicy * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_lsarpc . calls [ NDR_LSA_QUERYDOMAININFORMATIONPOLICY ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct lsa_QueryDomainInformationPolicy ) ;
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-13 16:28:25 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
pull = ndr_pull_init_blob ( & blob , r ) ;
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-13 16:28:25 +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-13 16:28:25 +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 ( lsa_QueryDomainInformationPolicy , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
ZERO_STRUCT ( r - > out ) ;
2008-04-08 22:54:18 +02:00
r - > out . info = talloc_zero ( r , union lsa_DomainInformationPolicy * ) ;
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-14 14:51:16 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
r - > out . result = _lsa_QueryDomainInformationPolicy ( 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 ( lsa_QueryDomainInformationPolicy , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
push = ndr_push_init_ctx ( r ) ;
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_lsa_SetDomainInformationPolicy ( pipes_struct * p )
2006-09-13 16:28:25 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-13 16:28:25 +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-13 16:28:25 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct lsa_SetDomainInformationPolicy * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_lsarpc . calls [ NDR_LSA_SETDOMAININFORMATIONPOLICY ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct lsa_SetDomainInformationPolicy ) ;
2007-08-21 14:06:46 +00:00
if ( r = = NULL ) {
2008-01-09 12:28:44 +01:00
return false ;
2006-09-13 16:28:25 +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
2007-08-21 14:06:46 +00:00
pull = ndr_pull_init_blob ( & blob , r ) ;
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-13 16:28:25 +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-13 16:28:25 +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 ( lsa_SetDomainInformationPolicy , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
r - > out . result = _lsa_SetDomainInformationPolicy ( 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 ( lsa_SetDomainInformationPolicy , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
push = ndr_push_init_ctx ( r ) ;
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_lsa_OpenTrustedDomainByName ( pipes_struct * p )
2006-09-13 16:28:25 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-13 16:28:25 +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-13 16:28:25 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct lsa_OpenTrustedDomainByName * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_lsarpc . calls [ NDR_LSA_OPENTRUSTEDDOMAINBYNAME ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct lsa_OpenTrustedDomainByName ) ;
2007-08-21 14:06:46 +00:00
if ( r = = NULL ) {
2008-01-09 12:28:44 +01:00
return false ;
2006-09-13 16:28:25 +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
2007-08-21 14:06:46 +00:00
pull = ndr_pull_init_blob ( & blob , r ) ;
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-13 16:28:25 +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-13 16:28:25 +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 ( lsa_OpenTrustedDomainByName , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
ZERO_STRUCT ( r - > out ) ;
r - > out . trustdom_handle = talloc_zero ( r , struct policy_handle ) ;
if ( r - > out . trustdom_handle = = NULL ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-14 14:51:16 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
r - > out . result = _lsa_OpenTrustedDomainByName ( 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 ( lsa_OpenTrustedDomainByName , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
push = ndr_push_init_ctx ( r ) ;
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_lsa_TestCall ( pipes_struct * p )
2006-09-13 16:28:25 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-13 16:28:25 +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-13 16:28:25 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct lsa_TestCall * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_lsarpc . calls [ NDR_LSA_TESTCALL ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct lsa_TestCall ) ;
2007-08-21 14:06:46 +00:00
if ( r = = NULL ) {
2008-01-09 12:28:44 +01:00
return false ;
2006-09-13 16:28:25 +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
2007-08-21 14:06:46 +00:00
pull = ndr_pull_init_blob ( & blob , r ) ;
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-13 16:28:25 +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-13 16:28:25 +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 ( lsa_TestCall , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
r - > out . result = _lsa_TestCall ( 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 ( lsa_TestCall , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
push = ndr_push_init_ctx ( r ) ;
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_lsa_LookupSids2 ( pipes_struct * p )
2006-09-13 16:28:25 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-13 16:28:25 +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-13 16:28:25 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct lsa_LookupSids2 * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_lsarpc . calls [ NDR_LSA_LOOKUPSIDS2 ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct lsa_LookupSids2 ) ;
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-13 16:28:25 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
pull = ndr_pull_init_blob ( & blob , r ) ;
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-13 16:28:25 +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-13 16:28:25 +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 ( lsa_LookupSids2 , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
ZERO_STRUCT ( r - > out ) ;
2008-02-17 20:10:54 +01:00
r - > out . domains = talloc_zero ( r , struct lsa_RefDomainList * ) ;
2007-08-21 14:06:46 +00:00
if ( r - > out . domains = = NULL ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-14 14:51:16 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
r - > out . names = r - > in . names ;
r - > out . count = r - > in . count ;
r - > out . result = _lsa_LookupSids2 ( 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 ( lsa_LookupSids2 , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
push = ndr_push_init_ctx ( r ) ;
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_lsa_LookupNames2 ( pipes_struct * p )
2006-09-13 16:28:25 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-13 16:28:25 +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-13 16:28:25 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct lsa_LookupNames2 * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_lsarpc . calls [ NDR_LSA_LOOKUPNAMES2 ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct lsa_LookupNames2 ) ;
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-13 16:28:25 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
pull = ndr_pull_init_blob ( & blob , r ) ;
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-13 16:28:25 +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-13 16:28:25 +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 ( lsa_LookupNames2 , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
ZERO_STRUCT ( r - > out ) ;
2008-02-17 20:10:54 +01:00
r - > out . domains = talloc_zero ( r , struct lsa_RefDomainList * ) ;
2007-08-21 14:06:46 +00:00
if ( r - > out . domains = = NULL ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-14 14:51:16 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
r - > out . sids = r - > in . sids ;
r - > out . count = r - > in . count ;
r - > out . result = _lsa_LookupNames2 ( 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 ( lsa_LookupNames2 , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
push = ndr_push_init_ctx ( r ) ;
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_lsa_CreateTrustedDomainEx2 ( pipes_struct * p )
2006-09-13 16:28:25 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-13 16:28:25 +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-13 16:28:25 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct lsa_CreateTrustedDomainEx2 * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_lsarpc . calls [ NDR_LSA_CREATETRUSTEDDOMAINEX2 ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct lsa_CreateTrustedDomainEx2 ) ;
2007-08-21 14:06:46 +00:00
if ( r = = NULL ) {
2008-01-09 12:28:44 +01:00
return false ;
2006-09-13 16:28:25 +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
2007-08-21 14:06:46 +00:00
pull = ndr_pull_init_blob ( & blob , r ) ;
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-13 16:28:25 +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-13 16:28:25 +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 ( lsa_CreateTrustedDomainEx2 , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
r - > out . result = _lsa_CreateTrustedDomainEx2 ( 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 ( lsa_CreateTrustedDomainEx2 , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
push = ndr_push_init_ctx ( r ) ;
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_lsa_CREDRWRITE ( pipes_struct * p )
2006-09-13 16:28:25 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-13 16:28:25 +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-13 16:28:25 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct lsa_CREDRWRITE * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_lsarpc . calls [ NDR_LSA_CREDRWRITE ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct lsa_CREDRWRITE ) ;
2007-08-21 14:06:46 +00:00
if ( r = = NULL ) {
2008-01-09 12:28:44 +01:00
return false ;
2006-09-13 16:28:25 +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
2007-08-21 14:06:46 +00:00
pull = ndr_pull_init_blob ( & blob , r ) ;
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-13 16:28:25 +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-13 16:28:25 +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 ( lsa_CREDRWRITE , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
r - > out . result = _lsa_CREDRWRITE ( 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 ( lsa_CREDRWRITE , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
push = ndr_push_init_ctx ( r ) ;
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_lsa_CREDRREAD ( pipes_struct * p )
2006-09-13 16:28:25 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-13 16:28:25 +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-13 16:28:25 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct lsa_CREDRREAD * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_lsarpc . calls [ NDR_LSA_CREDRREAD ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct lsa_CREDRREAD ) ;
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-13 16:28:25 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
pull = ndr_pull_init_blob ( & blob , r ) ;
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-13 16:28:25 +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-13 16:28:25 +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 ( lsa_CREDRREAD , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
r - > out . result = _lsa_CREDRREAD ( 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 ( lsa_CREDRREAD , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
push = ndr_push_init_ctx ( r ) ;
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_lsa_CREDRENUMERATE ( pipes_struct * p )
2006-09-13 16:28:25 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-13 16:28:25 +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-13 16:28:25 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct lsa_CREDRENUMERATE * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_lsarpc . calls [ NDR_LSA_CREDRENUMERATE ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct lsa_CREDRENUMERATE ) ;
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-13 16:28:25 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
pull = ndr_pull_init_blob ( & blob , r ) ;
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-13 16:28:25 +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-13 16:28:25 +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 ( lsa_CREDRENUMERATE , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
r - > out . result = _lsa_CREDRENUMERATE ( 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 ( lsa_CREDRENUMERATE , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
push = ndr_push_init_ctx ( r ) ;
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_lsa_CREDRWRITEDOMAINCREDENTIALS ( pipes_struct * p )
2006-09-13 16:28:25 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-13 16:28:25 +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-13 16:28:25 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct lsa_CREDRWRITEDOMAINCREDENTIALS * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_lsarpc . calls [ NDR_LSA_CREDRWRITEDOMAINCREDENTIALS ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct lsa_CREDRWRITEDOMAINCREDENTIALS ) ;
2007-08-21 14:06:46 +00:00
if ( r = = NULL ) {
2008-01-09 12:28:44 +01:00
return false ;
2006-09-13 16:28:25 +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
2007-08-21 14:06:46 +00:00
pull = ndr_pull_init_blob ( & blob , r ) ;
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-13 16:28:25 +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-13 16:28:25 +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 ( lsa_CREDRWRITEDOMAINCREDENTIALS , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
r - > out . result = _lsa_CREDRWRITEDOMAINCREDENTIALS ( 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 ( lsa_CREDRWRITEDOMAINCREDENTIALS , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
push = ndr_push_init_ctx ( r ) ;
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_lsa_CREDRREADDOMAINCREDENTIALS ( pipes_struct * p )
2006-09-13 16:28:25 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-13 16:28:25 +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-13 16:28:25 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct lsa_CREDRREADDOMAINCREDENTIALS * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_lsarpc . calls [ NDR_LSA_CREDRREADDOMAINCREDENTIALS ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct lsa_CREDRREADDOMAINCREDENTIALS ) ;
2007-08-21 14:06:46 +00:00
if ( r = = NULL ) {
2008-01-09 12:28:44 +01:00
return false ;
2006-09-13 16:28:25 +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
2007-08-21 14:06:46 +00:00
pull = ndr_pull_init_blob ( & blob , r ) ;
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-13 16:28:25 +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-13 16:28:25 +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 ( lsa_CREDRREADDOMAINCREDENTIALS , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
r - > out . result = _lsa_CREDRREADDOMAINCREDENTIALS ( 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 ( lsa_CREDRREADDOMAINCREDENTIALS , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
push = ndr_push_init_ctx ( r ) ;
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_lsa_CREDRDELETE ( pipes_struct * p )
2006-09-13 16:28:25 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-13 16:28:25 +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-13 16:28:25 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct lsa_CREDRDELETE * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_lsarpc . calls [ NDR_LSA_CREDRDELETE ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct lsa_CREDRDELETE ) ;
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-13 16:28:25 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
pull = ndr_pull_init_blob ( & blob , r ) ;
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-13 16:28:25 +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-13 16:28:25 +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 ( lsa_CREDRDELETE , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
r - > out . result = _lsa_CREDRDELETE ( 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 ( lsa_CREDRDELETE , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
push = ndr_push_init_ctx ( r ) ;
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_lsa_CREDRGETTARGETINFO ( pipes_struct * p )
2006-09-13 16:28:25 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-13 16:28:25 +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-13 16:28:25 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct lsa_CREDRGETTARGETINFO * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_lsarpc . calls [ NDR_LSA_CREDRGETTARGETINFO ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct lsa_CREDRGETTARGETINFO ) ;
2007-08-21 14:06:46 +00:00
if ( r = = NULL ) {
2008-01-09 12:28:44 +01:00
return false ;
2006-09-13 16:28:25 +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
2007-08-21 14:06:46 +00:00
pull = ndr_pull_init_blob ( & blob , r ) ;
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-13 16:28:25 +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-13 16:28:25 +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 ( lsa_CREDRGETTARGETINFO , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
r - > out . result = _lsa_CREDRGETTARGETINFO ( 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 ( lsa_CREDRGETTARGETINFO , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
push = ndr_push_init_ctx ( r ) ;
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_lsa_CREDRPROFILELOADED ( pipes_struct * p )
2006-09-13 16:28:25 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-13 16:28:25 +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-13 16:28:25 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct lsa_CREDRPROFILELOADED * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_lsarpc . calls [ NDR_LSA_CREDRPROFILELOADED ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct lsa_CREDRPROFILELOADED ) ;
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-13 16:28:25 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
pull = ndr_pull_init_blob ( & blob , r ) ;
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-13 16:28:25 +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-13 16:28:25 +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 ( lsa_CREDRPROFILELOADED , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
r - > out . result = _lsa_CREDRPROFILELOADED ( 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 ( lsa_CREDRPROFILELOADED , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
push = ndr_push_init_ctx ( r ) ;
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_lsa_LookupNames3 ( pipes_struct * p )
2006-09-13 16:28:25 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-13 16:28:25 +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-13 16:28:25 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct lsa_LookupNames3 * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_lsarpc . calls [ NDR_LSA_LOOKUPNAMES3 ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct lsa_LookupNames3 ) ;
2007-08-21 14:06:46 +00:00
if ( r = = NULL ) {
2008-01-09 12:28:44 +01:00
return false ;
2006-09-13 16:28:25 +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
2007-08-21 14:06:46 +00:00
pull = ndr_pull_init_blob ( & blob , r ) ;
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-13 16:28:25 +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-13 16:28:25 +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 ( lsa_LookupNames3 , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
ZERO_STRUCT ( r - > out ) ;
2008-02-18 16:52:56 +01:00
r - > out . domains = talloc_zero ( r , struct lsa_RefDomainList * ) ;
2007-08-21 14:06:46 +00:00
if ( r - > out . domains = = NULL ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-14 14:51:16 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
r - > out . sids = r - > in . sids ;
r - > out . count = r - > in . count ;
r - > out . result = _lsa_LookupNames3 ( 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 ( lsa_LookupNames3 , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
push = ndr_push_init_ctx ( r ) ;
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_lsa_CREDRGETSESSIONTYPES ( pipes_struct * p )
2006-09-13 16:28:25 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-13 16:28:25 +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-13 16:28:25 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct lsa_CREDRGETSESSIONTYPES * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_lsarpc . calls [ NDR_LSA_CREDRGETSESSIONTYPES ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct lsa_CREDRGETSESSIONTYPES ) ;
2007-08-21 14:06:46 +00:00
if ( r = = NULL ) {
2008-01-09 12:28:44 +01:00
return false ;
2006-09-13 16:28:25 +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
2007-08-21 14:06:46 +00:00
pull = ndr_pull_init_blob ( & blob , r ) ;
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-13 16:28:25 +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-13 16:28:25 +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 ( lsa_CREDRGETSESSIONTYPES , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
r - > out . result = _lsa_CREDRGETSESSIONTYPES ( 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 ( lsa_CREDRGETSESSIONTYPES , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
push = ndr_push_init_ctx ( r ) ;
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_lsa_LSARREGISTERAUDITEVENT ( pipes_struct * p )
2006-09-13 16:28:25 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-13 16:28:25 +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-13 16:28:25 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct lsa_LSARREGISTERAUDITEVENT * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_lsarpc . calls [ NDR_LSA_LSARREGISTERAUDITEVENT ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct lsa_LSARREGISTERAUDITEVENT ) ;
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-13 16:28:25 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
pull = ndr_pull_init_blob ( & blob , r ) ;
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-13 16:28:25 +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-13 16:28:25 +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 ( lsa_LSARREGISTERAUDITEVENT , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
r - > out . result = _lsa_LSARREGISTERAUDITEVENT ( 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 ( lsa_LSARREGISTERAUDITEVENT , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
push = ndr_push_init_ctx ( r ) ;
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_lsa_LSARGENAUDITEVENT ( pipes_struct * p )
2006-09-13 16:28:25 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-13 16:28:25 +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-13 16:28:25 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct lsa_LSARGENAUDITEVENT * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_lsarpc . calls [ NDR_LSA_LSARGENAUDITEVENT ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct lsa_LSARGENAUDITEVENT ) ;
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-13 16:28:25 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
pull = ndr_pull_init_blob ( & blob , r ) ;
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-13 16:28:25 +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-13 16:28:25 +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 ( lsa_LSARGENAUDITEVENT , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
r - > out . result = _lsa_LSARGENAUDITEVENT ( 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 ( lsa_LSARGENAUDITEVENT , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
push = ndr_push_init_ctx ( r ) ;
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_lsa_LSARUNREGISTERAUDITEVENT ( pipes_struct * p )
2006-09-13 16:28:25 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-13 16:28:25 +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-13 16:28:25 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct lsa_LSARUNREGISTERAUDITEVENT * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_lsarpc . calls [ NDR_LSA_LSARUNREGISTERAUDITEVENT ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct lsa_LSARUNREGISTERAUDITEVENT ) ;
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-13 16:28:25 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
pull = ndr_pull_init_blob ( & blob , r ) ;
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-13 16:28:25 +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-13 16:28:25 +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 ( lsa_LSARUNREGISTERAUDITEVENT , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
r - > out . result = _lsa_LSARUNREGISTERAUDITEVENT ( 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 ( lsa_LSARUNREGISTERAUDITEVENT , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
push = ndr_push_init_ctx ( r ) ;
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2008-01-16 16:31:49 +01:00
static bool api_lsa_lsaRQueryForestTrustInformation ( pipes_struct * p )
2006-09-13 16:28:25 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-13 16:28:25 +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-13 16:28:25 +00:00
DATA_BLOB blob ;
2008-01-16 16:31:49 +01:00
struct lsa_lsaRQueryForestTrustInformation * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_lsarpc . calls [ NDR_LSA_LSARQUERYFORESTTRUSTINFORMATION ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct lsa_lsaRQueryForestTrustInformation ) ;
2007-08-21 14:06:46 +00:00
if ( r = = NULL ) {
2008-01-09 12:28:44 +01:00
return false ;
2006-09-13 16:28:25 +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
2007-08-21 14:06:46 +00:00
pull = ndr_pull_init_blob ( & blob , r ) ;
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-13 16:28:25 +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-13 16:28:25 +00:00
}
2008-01-09 12:28:44 +01:00
if ( DEBUGLEVEL > = 10 ) {
2008-01-16 16:31:49 +01:00
NDR_PRINT_IN_DEBUG ( lsa_lsaRQueryForestTrustInformation , r ) ;
2008-01-09 12:28:44 +01:00
}
2008-01-16 16:31:49 +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 = _lsa_lsaRQueryForestTrustInformation ( 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-16 16:31:49 +01:00
NDR_PRINT_OUT_DEBUG ( lsa_lsaRQueryForestTrustInformation , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
push = ndr_push_init_ctx ( r ) ;
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_lsa_LSARSETFORESTTRUSTINFORMATION ( pipes_struct * p )
2006-09-13 16:28:25 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-13 16:28:25 +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-13 16:28:25 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct lsa_LSARSETFORESTTRUSTINFORMATION * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_lsarpc . calls [ NDR_LSA_LSARSETFORESTTRUSTINFORMATION ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct lsa_LSARSETFORESTTRUSTINFORMATION ) ;
2007-08-21 14:06:46 +00:00
if ( r = = NULL ) {
2008-01-09 12:28:44 +01:00
return false ;
2006-09-13 16:28:25 +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
2007-08-21 14:06:46 +00:00
pull = ndr_pull_init_blob ( & blob , r ) ;
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-13 16:28:25 +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-13 16:28:25 +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 ( lsa_LSARSETFORESTTRUSTINFORMATION , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
r - > out . result = _lsa_LSARSETFORESTTRUSTINFORMATION ( 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 ( lsa_LSARSETFORESTTRUSTINFORMATION , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
push = ndr_push_init_ctx ( r ) ;
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_lsa_CREDRRENAME ( pipes_struct * p )
2006-09-13 16:28:25 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-13 16:28:25 +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-13 16:28:25 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct lsa_CREDRRENAME * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_lsarpc . calls [ NDR_LSA_CREDRRENAME ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct lsa_CREDRRENAME ) ;
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-13 16:28:25 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
pull = ndr_pull_init_blob ( & blob , r ) ;
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-13 16:28:25 +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-13 16:28:25 +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 ( lsa_CREDRRENAME , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
r - > out . result = _lsa_CREDRRENAME ( 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 ( lsa_CREDRRENAME , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
push = ndr_push_init_ctx ( r ) ;
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_lsa_LookupSids3 ( pipes_struct * p )
2006-09-13 16:28:25 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-13 16:28:25 +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-13 16:28:25 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct lsa_LookupSids3 * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_lsarpc . calls [ NDR_LSA_LOOKUPSIDS3 ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct lsa_LookupSids3 ) ;
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-13 16:28:25 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
pull = ndr_pull_init_blob ( & blob , r ) ;
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-13 16:28:25 +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-13 16:28:25 +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 ( lsa_LookupSids3 , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
ZERO_STRUCT ( r - > out ) ;
2008-02-17 20:10:54 +01:00
r - > out . domains = talloc_zero ( r , struct lsa_RefDomainList * ) ;
2007-08-21 14:06:46 +00:00
if ( r - > out . domains = = NULL ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-14 14:51:16 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
r - > out . names = r - > in . names ;
r - > out . count = r - > in . count ;
r - > out . result = _lsa_LookupSids3 ( 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 ( lsa_LookupSids3 , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
push = ndr_push_init_ctx ( r ) ;
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_lsa_LookupNames4 ( pipes_struct * p )
2006-09-13 16:28:25 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-13 16:28:25 +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-13 16:28:25 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct lsa_LookupNames4 * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_lsarpc . calls [ NDR_LSA_LOOKUPNAMES4 ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct lsa_LookupNames4 ) ;
2007-08-21 14:06:46 +00:00
if ( r = = NULL ) {
2008-01-09 12:28:44 +01:00
return false ;
2006-09-13 16:28:25 +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
2007-08-21 14:06:46 +00:00
pull = ndr_pull_init_blob ( & blob , r ) ;
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-13 16:28:25 +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-13 16:28:25 +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 ( lsa_LookupNames4 , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
ZERO_STRUCT ( r - > out ) ;
2008-02-18 16:52:56 +01:00
r - > out . domains = talloc_zero ( r , struct lsa_RefDomainList * ) ;
2007-08-21 14:06:46 +00:00
if ( r - > out . domains = = NULL ) {
talloc_free ( r ) ;
2008-01-09 12:28:44 +01:00
return false ;
2006-09-14 14:51:16 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
r - > out . sids = r - > in . sids ;
r - > out . count = r - > in . count ;
r - > out . result = _lsa_LookupNames4 ( 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 ( lsa_LookupNames4 , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
push = ndr_push_init_ctx ( r ) ;
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_lsa_LSAROPENPOLICYSCE ( pipes_struct * p )
2006-09-13 16:28:25 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-13 16:28:25 +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-13 16:28:25 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct lsa_LSAROPENPOLICYSCE * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_lsarpc . calls [ NDR_LSA_LSAROPENPOLICYSCE ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct lsa_LSAROPENPOLICYSCE ) ;
2007-08-21 14:06:46 +00:00
if ( r = = NULL ) {
2008-01-09 12:28:44 +01:00
return false ;
2006-09-13 16:28:25 +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
2007-08-21 14:06:46 +00:00
pull = ndr_pull_init_blob ( & blob , r ) ;
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-13 16:28:25 +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-13 16:28:25 +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 ( lsa_LSAROPENPOLICYSCE , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
r - > out . result = _lsa_LSAROPENPOLICYSCE ( 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 ( lsa_LSAROPENPOLICYSCE , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
push = ndr_push_init_ctx ( r ) ;
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_lsa_LSARADTREGISTERSECURITYEVENTSOURCE ( pipes_struct * p )
2006-09-13 16:28:25 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-13 16:28:25 +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-13 16:28:25 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct lsa_LSARADTREGISTERSECURITYEVENTSOURCE * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_lsarpc . calls [ NDR_LSA_LSARADTREGISTERSECURITYEVENTSOURCE ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct lsa_LSARADTREGISTERSECURITYEVENTSOURCE ) ;
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-13 16:28:25 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
pull = ndr_pull_init_blob ( & blob , r ) ;
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-13 16:28:25 +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-13 16:28:25 +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 ( lsa_LSARADTREGISTERSECURITYEVENTSOURCE , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
r - > out . result = _lsa_LSARADTREGISTERSECURITYEVENTSOURCE ( 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 ( lsa_LSARADTREGISTERSECURITYEVENTSOURCE , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
push = ndr_push_init_ctx ( r ) ;
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE ( pipes_struct * p )
2006-09-13 16:28:25 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-13 16:28:25 +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-13 16:28:25 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_lsarpc . calls [ NDR_LSA_LSARADTUNREGISTERSECURITYEVENTSOURCE ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE ) ;
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-13 16:28:25 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
pull = ndr_pull_init_blob ( & blob , r ) ;
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-13 16:28:25 +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-13 16:28:25 +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 ( lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
r - > out . result = _lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE ( 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 ( lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
push = ndr_push_init_ctx ( r ) ;
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2007-10-18 17:40:25 -07:00
static bool api_lsa_LSARADTREPORTSECURITYEVENT ( pipes_struct * p )
2006-09-13 16:28:25 +00:00
{
2007-08-21 14:06:46 +00:00
const struct ndr_interface_call * call ;
2006-09-13 16:28:25 +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-13 16:28:25 +00:00
DATA_BLOB blob ;
2007-08-21 14:06:46 +00:00
struct lsa_LSARADTREPORTSECURITYEVENT * r ;
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
call = & ndr_table_lsarpc . calls [ NDR_LSA_LSARADTREPORTSECURITYEVENT ] ;
2008-01-09 12:28:44 +01:00
2008-02-11 09:15:30 +01:00
r = talloc ( talloc_tos ( ) , struct lsa_LSARADTREPORTSECURITYEVENT ) ;
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-13 16:28:25 +00:00
}
2008-01-09 12:28:44 +01:00
2007-08-21 14:06:46 +00:00
pull = ndr_pull_init_blob ( & blob , r ) ;
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-13 16:28:25 +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-13 16:28:25 +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 ( lsa_LSARADTREPORTSECURITYEVENT , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
r - > out . result = _lsa_LSARADTREPORTSECURITYEVENT ( 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 ( lsa_LSARADTREPORTSECURITYEVENT , r ) ;
2008-01-09 12:28:44 +01:00
}
2007-08-21 14:06:46 +00:00
push = ndr_push_init_ctx ( r ) ;
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
2008-01-09 12:28:44 +01:00
2006-09-13 16:28:25 +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-13 16:28:25 +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-13 16:28:25 +00:00
}
/* Tables */
static struct api_struct api_lsarpc_cmds [ ] =
{
2007-08-19 22:10:11 +00:00
{ " LSA_CLOSE " , NDR_LSA_CLOSE , api_lsa_Close } ,
{ " LSA_DELETE " , NDR_LSA_DELETE , api_lsa_Delete } ,
{ " LSA_ENUMPRIVS " , NDR_LSA_ENUMPRIVS , api_lsa_EnumPrivs } ,
{ " LSA_QUERYSECURITY " , NDR_LSA_QUERYSECURITY , api_lsa_QuerySecurity } ,
{ " LSA_SETSECOBJ " , NDR_LSA_SETSECOBJ , api_lsa_SetSecObj } ,
{ " LSA_CHANGEPASSWORD " , NDR_LSA_CHANGEPASSWORD , api_lsa_ChangePassword } ,
{ " LSA_OPENPOLICY " , NDR_LSA_OPENPOLICY , api_lsa_OpenPolicy } ,
{ " LSA_QUERYINFOPOLICY " , NDR_LSA_QUERYINFOPOLICY , api_lsa_QueryInfoPolicy } ,
{ " LSA_SETINFOPOLICY " , NDR_LSA_SETINFOPOLICY , api_lsa_SetInfoPolicy } ,
{ " LSA_CLEARAUDITLOG " , NDR_LSA_CLEARAUDITLOG , api_lsa_ClearAuditLog } ,
{ " LSA_CREATEACCOUNT " , NDR_LSA_CREATEACCOUNT , api_lsa_CreateAccount } ,
{ " LSA_ENUMACCOUNTS " , NDR_LSA_ENUMACCOUNTS , api_lsa_EnumAccounts } ,
{ " LSA_CREATETRUSTEDDOMAIN " , NDR_LSA_CREATETRUSTEDDOMAIN , api_lsa_CreateTrustedDomain } ,
{ " LSA_ENUMTRUSTDOM " , NDR_LSA_ENUMTRUSTDOM , api_lsa_EnumTrustDom } ,
{ " LSA_LOOKUPNAMES " , NDR_LSA_LOOKUPNAMES , api_lsa_LookupNames } ,
{ " LSA_LOOKUPSIDS " , NDR_LSA_LOOKUPSIDS , api_lsa_LookupSids } ,
{ " LSA_CREATESECRET " , NDR_LSA_CREATESECRET , api_lsa_CreateSecret } ,
{ " LSA_OPENACCOUNT " , NDR_LSA_OPENACCOUNT , api_lsa_OpenAccount } ,
{ " LSA_ENUMPRIVSACCOUNT " , NDR_LSA_ENUMPRIVSACCOUNT , api_lsa_EnumPrivsAccount } ,
{ " LSA_ADDPRIVILEGESTOACCOUNT " , NDR_LSA_ADDPRIVILEGESTOACCOUNT , api_lsa_AddPrivilegesToAccount } ,
{ " LSA_REMOVEPRIVILEGESFROMACCOUNT " , NDR_LSA_REMOVEPRIVILEGESFROMACCOUNT , api_lsa_RemovePrivilegesFromAccount } ,
{ " LSA_GETQUOTASFORACCOUNT " , NDR_LSA_GETQUOTASFORACCOUNT , api_lsa_GetQuotasForAccount } ,
{ " LSA_SETQUOTASFORACCOUNT " , NDR_LSA_SETQUOTASFORACCOUNT , api_lsa_SetQuotasForAccount } ,
{ " LSA_GETSYSTEMACCESSACCOUNT " , NDR_LSA_GETSYSTEMACCESSACCOUNT , api_lsa_GetSystemAccessAccount } ,
{ " LSA_SETSYSTEMACCESSACCOUNT " , NDR_LSA_SETSYSTEMACCESSACCOUNT , api_lsa_SetSystemAccessAccount } ,
{ " LSA_OPENTRUSTEDDOMAIN " , NDR_LSA_OPENTRUSTEDDOMAIN , api_lsa_OpenTrustedDomain } ,
{ " LSA_QUERYTRUSTEDDOMAININFO " , NDR_LSA_QUERYTRUSTEDDOMAININFO , api_lsa_QueryTrustedDomainInfo } ,
{ " LSA_SETINFORMATIONTRUSTEDDOMAIN " , NDR_LSA_SETINFORMATIONTRUSTEDDOMAIN , api_lsa_SetInformationTrustedDomain } ,
{ " LSA_OPENSECRET " , NDR_LSA_OPENSECRET , api_lsa_OpenSecret } ,
{ " LSA_SETSECRET " , NDR_LSA_SETSECRET , api_lsa_SetSecret } ,
{ " LSA_QUERYSECRET " , NDR_LSA_QUERYSECRET , api_lsa_QuerySecret } ,
{ " LSA_LOOKUPPRIVVALUE " , NDR_LSA_LOOKUPPRIVVALUE , api_lsa_LookupPrivValue } ,
{ " LSA_LOOKUPPRIVNAME " , NDR_LSA_LOOKUPPRIVNAME , api_lsa_LookupPrivName } ,
{ " LSA_LOOKUPPRIVDISPLAYNAME " , NDR_LSA_LOOKUPPRIVDISPLAYNAME , api_lsa_LookupPrivDisplayName } ,
{ " LSA_DELETEOBJECT " , NDR_LSA_DELETEOBJECT , api_lsa_DeleteObject } ,
{ " LSA_ENUMACCOUNTSWITHUSERRIGHT " , NDR_LSA_ENUMACCOUNTSWITHUSERRIGHT , api_lsa_EnumAccountsWithUserRight } ,
{ " LSA_ENUMACCOUNTRIGHTS " , NDR_LSA_ENUMACCOUNTRIGHTS , api_lsa_EnumAccountRights } ,
{ " LSA_ADDACCOUNTRIGHTS " , NDR_LSA_ADDACCOUNTRIGHTS , api_lsa_AddAccountRights } ,
{ " LSA_REMOVEACCOUNTRIGHTS " , NDR_LSA_REMOVEACCOUNTRIGHTS , api_lsa_RemoveAccountRights } ,
{ " LSA_QUERYTRUSTEDDOMAININFOBYSID " , NDR_LSA_QUERYTRUSTEDDOMAININFOBYSID , api_lsa_QueryTrustedDomainInfoBySid } ,
{ " LSA_SETTRUSTEDDOMAININFO " , NDR_LSA_SETTRUSTEDDOMAININFO , api_lsa_SetTrustedDomainInfo } ,
{ " LSA_DELETETRUSTEDDOMAIN " , NDR_LSA_DELETETRUSTEDDOMAIN , api_lsa_DeleteTrustedDomain } ,
{ " LSA_STOREPRIVATEDATA " , NDR_LSA_STOREPRIVATEDATA , api_lsa_StorePrivateData } ,
{ " LSA_RETRIEVEPRIVATEDATA " , NDR_LSA_RETRIEVEPRIVATEDATA , api_lsa_RetrievePrivateData } ,
{ " LSA_OPENPOLICY2 " , NDR_LSA_OPENPOLICY2 , api_lsa_OpenPolicy2 } ,
{ " LSA_GETUSERNAME " , NDR_LSA_GETUSERNAME , api_lsa_GetUserName } ,
{ " LSA_QUERYINFOPOLICY2 " , NDR_LSA_QUERYINFOPOLICY2 , api_lsa_QueryInfoPolicy2 } ,
{ " LSA_SETINFOPOLICY2 " , NDR_LSA_SETINFOPOLICY2 , api_lsa_SetInfoPolicy2 } ,
{ " LSA_QUERYTRUSTEDDOMAININFOBYNAME " , NDR_LSA_QUERYTRUSTEDDOMAININFOBYNAME , api_lsa_QueryTrustedDomainInfoByName } ,
{ " LSA_SETTRUSTEDDOMAININFOBYNAME " , NDR_LSA_SETTRUSTEDDOMAININFOBYNAME , api_lsa_SetTrustedDomainInfoByName } ,
{ " LSA_ENUMTRUSTEDDOMAINSEX " , NDR_LSA_ENUMTRUSTEDDOMAINSEX , api_lsa_EnumTrustedDomainsEx } ,
{ " LSA_CREATETRUSTEDDOMAINEX " , NDR_LSA_CREATETRUSTEDDOMAINEX , api_lsa_CreateTrustedDomainEx } ,
{ " LSA_CLOSETRUSTEDDOMAINEX " , NDR_LSA_CLOSETRUSTEDDOMAINEX , api_lsa_CloseTrustedDomainEx } ,
{ " LSA_QUERYDOMAININFORMATIONPOLICY " , NDR_LSA_QUERYDOMAININFORMATIONPOLICY , api_lsa_QueryDomainInformationPolicy } ,
{ " LSA_SETDOMAININFORMATIONPOLICY " , NDR_LSA_SETDOMAININFORMATIONPOLICY , api_lsa_SetDomainInformationPolicy } ,
{ " LSA_OPENTRUSTEDDOMAINBYNAME " , NDR_LSA_OPENTRUSTEDDOMAINBYNAME , api_lsa_OpenTrustedDomainByName } ,
{ " LSA_TESTCALL " , NDR_LSA_TESTCALL , api_lsa_TestCall } ,
{ " LSA_LOOKUPSIDS2 " , NDR_LSA_LOOKUPSIDS2 , api_lsa_LookupSids2 } ,
{ " LSA_LOOKUPNAMES2 " , NDR_LSA_LOOKUPNAMES2 , api_lsa_LookupNames2 } ,
{ " LSA_CREATETRUSTEDDOMAINEX2 " , NDR_LSA_CREATETRUSTEDDOMAINEX2 , api_lsa_CreateTrustedDomainEx2 } ,
{ " LSA_CREDRWRITE " , NDR_LSA_CREDRWRITE , api_lsa_CREDRWRITE } ,
{ " LSA_CREDRREAD " , NDR_LSA_CREDRREAD , api_lsa_CREDRREAD } ,
{ " LSA_CREDRENUMERATE " , NDR_LSA_CREDRENUMERATE , api_lsa_CREDRENUMERATE } ,
{ " LSA_CREDRWRITEDOMAINCREDENTIALS " , NDR_LSA_CREDRWRITEDOMAINCREDENTIALS , api_lsa_CREDRWRITEDOMAINCREDENTIALS } ,
{ " LSA_CREDRREADDOMAINCREDENTIALS " , NDR_LSA_CREDRREADDOMAINCREDENTIALS , api_lsa_CREDRREADDOMAINCREDENTIALS } ,
{ " LSA_CREDRDELETE " , NDR_LSA_CREDRDELETE , api_lsa_CREDRDELETE } ,
{ " LSA_CREDRGETTARGETINFO " , NDR_LSA_CREDRGETTARGETINFO , api_lsa_CREDRGETTARGETINFO } ,
{ " LSA_CREDRPROFILELOADED " , NDR_LSA_CREDRPROFILELOADED , api_lsa_CREDRPROFILELOADED } ,
{ " LSA_LOOKUPNAMES3 " , NDR_LSA_LOOKUPNAMES3 , api_lsa_LookupNames3 } ,
{ " LSA_CREDRGETSESSIONTYPES " , NDR_LSA_CREDRGETSESSIONTYPES , api_lsa_CREDRGETSESSIONTYPES } ,
{ " LSA_LSARREGISTERAUDITEVENT " , NDR_LSA_LSARREGISTERAUDITEVENT , api_lsa_LSARREGISTERAUDITEVENT } ,
{ " LSA_LSARGENAUDITEVENT " , NDR_LSA_LSARGENAUDITEVENT , api_lsa_LSARGENAUDITEVENT } ,
{ " LSA_LSARUNREGISTERAUDITEVENT " , NDR_LSA_LSARUNREGISTERAUDITEVENT , api_lsa_LSARUNREGISTERAUDITEVENT } ,
2008-01-16 16:31:49 +01:00
{ " LSA_LSARQUERYFORESTTRUSTINFORMATION " , NDR_LSA_LSARQUERYFORESTTRUSTINFORMATION , api_lsa_lsaRQueryForestTrustInformation } ,
2007-08-19 22:10:11 +00:00
{ " LSA_LSARSETFORESTTRUSTINFORMATION " , NDR_LSA_LSARSETFORESTTRUSTINFORMATION , api_lsa_LSARSETFORESTTRUSTINFORMATION } ,
{ " LSA_CREDRRENAME " , NDR_LSA_CREDRRENAME , api_lsa_CREDRRENAME } ,
{ " LSA_LOOKUPSIDS3 " , NDR_LSA_LOOKUPSIDS3 , api_lsa_LookupSids3 } ,
{ " LSA_LOOKUPNAMES4 " , NDR_LSA_LOOKUPNAMES4 , api_lsa_LookupNames4 } ,
{ " LSA_LSAROPENPOLICYSCE " , NDR_LSA_LSAROPENPOLICYSCE , api_lsa_LSAROPENPOLICYSCE } ,
{ " LSA_LSARADTREGISTERSECURITYEVENTSOURCE " , NDR_LSA_LSARADTREGISTERSECURITYEVENTSOURCE , api_lsa_LSARADTREGISTERSECURITYEVENTSOURCE } ,
{ " LSA_LSARADTUNREGISTERSECURITYEVENTSOURCE " , NDR_LSA_LSARADTUNREGISTERSECURITYEVENTSOURCE , api_lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE } ,
{ " LSA_LSARADTREPORTSECURITYEVENT " , NDR_LSA_LSARADTREPORTSECURITYEVENT , api_lsa_LSARADTREPORTSECURITYEVENT } ,
2006-09-13 16:28:25 +00:00
} ;
void lsarpc_get_pipe_fns ( struct api_struct * * fns , int * n_fns )
{
* fns = api_lsarpc_cmds ;
* n_fns = sizeof ( api_lsarpc_cmds ) / sizeof ( struct api_struct ) ;
}
2006-09-14 14:51:16 +00:00
NTSTATUS rpc_lsarpc_init ( void )
2006-09-13 16:28:25 +00:00
{
return rpc_pipe_register_commands ( SMB_RPC_INTERFACE_VERSION , " lsarpc " , " lsarpc " , api_lsarpc_cmds , sizeof ( api_lsarpc_cmds ) / sizeof ( struct api_struct ) ) ;
}