diff options
Diffstat (limited to 'source3/rpc_parse')
-rw-r--r-- | source3/rpc_parse/parse_lsa.c | 165 |
1 files changed, 0 insertions, 165 deletions
diff --git a/source3/rpc_parse/parse_lsa.c b/source3/rpc_parse/parse_lsa.c index 12dd6e126b..c4a7c057a6 100644 --- a/source3/rpc_parse/parse_lsa.c +++ b/source3/rpc_parse/parse_lsa.c @@ -216,171 +216,6 @@ void init_lsa_obj_attr(struct lsa_ObjectAttribute *r, } /******************************************************************* -makes an LSA_Q_ENUM_TRUST_DOM structure. -********************************************************************/ -bool init_q_enum_trust_dom(LSA_Q_ENUM_TRUST_DOM * q_e, POLICY_HND *pol, - uint32 enum_context, uint32 preferred_len) -{ - DEBUG(5, ("init_q_enum_trust_dom\n")); - - q_e->pol = *pol; - q_e->enum_context = enum_context; - q_e->preferred_len = preferred_len; - - return True; -} - -/******************************************************************* - Reads or writes an LSA_Q_ENUM_TRUST_DOM structure. -********************************************************************/ - -bool lsa_io_q_enum_trust_dom(const char *desc, LSA_Q_ENUM_TRUST_DOM *q_e, - prs_struct *ps, int depth) -{ - prs_debug(ps, depth, desc, "lsa_io_q_enum_trust_dom"); - depth++; - - if(!smb_io_pol_hnd("", &q_e->pol, ps, depth)) - return False; - - if(!prs_uint32("enum_context ", ps, depth, &q_e->enum_context)) - return False; - if(!prs_uint32("preferred_len", ps, depth, &q_e->preferred_len)) - return False; - - return True; -} - -/******************************************************************* - Inits an LSA_R_ENUM_TRUST_DOM structure. -********************************************************************/ - -void init_r_enum_trust_dom(TALLOC_CTX *ctx, LSA_R_ENUM_TRUST_DOM *out, - uint32 enum_context, uint32 num_domains, - struct trustdom_info **td) -{ - unsigned int i; - - DEBUG(5, ("init_r_enum_trust_dom\n")); - - out->enum_context = enum_context; - out->count = num_domains; - - if ( num_domains != 0 ) { - - /* allocate container memory */ - - out->domlist = TALLOC_P( ctx, DOMAIN_LIST ); - - if ( !out->domlist ) { - out->status = NT_STATUS_NO_MEMORY; - return; - } - - if (out->count) { - out->domlist->domains = TALLOC_ARRAY( ctx, DOMAIN_INFO, - out->count ); - if ( !out->domlist->domains ) { - out->status = NT_STATUS_NO_MEMORY; - return; - } - } else { - out->domlist->domains = NULL; - } - - out->domlist->count = out->count; - - /* initialize the list of domains and their sid */ - - for (i = 0; i < num_domains; i++) { - smb_ucs2_t *name; - if ( !(out->domlist->domains[i].sid = - TALLOC_P(ctx, DOM_SID2)) ) { - out->status = NT_STATUS_NO_MEMORY; - return; - } - - init_dom_sid2(out->domlist->domains[i].sid, - &(td[i])->sid); - if (push_ucs2_talloc(ctx, &name, (td[i])->name) == (size_t)-1){ - out->status = NT_STATUS_NO_MEMORY; - return; - } - init_unistr4_w(ctx, &out->domlist->domains[i].name, - name); - } - } - -} - -/******************************************************************* -********************************************************************/ - -bool lsa_io_domain_list( const char *desc, prs_struct *ps, int depth, DOMAIN_LIST *domlist ) -{ - int i; - - prs_debug(ps, depth, desc, "lsa_io_domain_list"); - depth++; - - if(!prs_uint32("count", ps, depth, &domlist->count)) - return False; - - if ( domlist->count == 0 ) - return True; - - if ( UNMARSHALLING(ps) ) { - if ( !(domlist->domains = PRS_ALLOC_MEM( ps, DOMAIN_INFO, domlist->count )) ) - return False; - } - - /* headers */ - - for ( i=0; i<domlist->count; i++ ) { - if ( !prs_unistr4_hdr("name_header", ps, depth, &domlist->domains[i].name) ) - return False; - if ( !smb_io_dom_sid2_p("sid_header", ps, depth, &domlist->domains[i].sid) ) - return False; - } - - /* data */ - - for ( i=0; i<domlist->count; i++ ) { - if ( !prs_unistr4_str("name", ps, depth, &domlist->domains[i].name) ) - return False; - if( !smb_io_dom_sid2("sid", domlist->domains[i].sid, ps, depth) ) - return False; - } - - return True; -} - -/******************************************************************* - Reads or writes an LSA_R_ENUM_TRUST_DOM structure. -********************************************************************/ - -bool lsa_io_r_enum_trust_dom(const char *desc, LSA_R_ENUM_TRUST_DOM *out, - prs_struct *ps, int depth) -{ - prs_debug(ps, depth, desc, "lsa_io_r_enum_trust_dom"); - depth++; - - if(!prs_uint32("enum_context", ps, depth, &out->enum_context)) - return False; - - if(!prs_uint32("count", ps, depth, &out->count)) - return False; - - if ( !prs_pointer("trusted_domains", ps, depth, (void*)&out->domlist, sizeof(DOMAIN_LIST), (PRS_POINTER_CAST)lsa_io_domain_list)) - return False; - - if(!prs_ntstatus("status", ps, depth, &out->status)) - return False; - - return True; -} - -/******************************************************************* Inits a LSA_SID_ENUM structure. ********************************************************************/ |