From 5dd26daad55da89a7a0996caadd1d474f6031001 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Tue, 1 Dec 1998 22:18:48 +0000 Subject: query_aliasmem code. it works (hurrah). (This used to be commit f7f2516df46dde1671235f788f7689c93d9395ae) --- source3/rpc_parse/parse_lsa.c | 89 ++++++++++++++++++++---------------------- source3/rpc_parse/parse_samr.c | 19 +++++---- 2 files changed, 54 insertions(+), 54 deletions(-) (limited to 'source3/rpc_parse') diff --git a/source3/rpc_parse/parse_lsa.c b/source3/rpc_parse/parse_lsa.c index 5adff5256d..7fcdeccec8 100644 --- a/source3/rpc_parse/parse_lsa.c +++ b/source3/rpc_parse/parse_lsa.c @@ -26,8 +26,6 @@ extern int DEBUGLEVEL; -static void lsa_io_trans_names(char *desc, LSA_TRANS_NAME_ENUM *trn, prs_struct *ps, int depth); - /******************************************************************* creates a LSA_TRANS_NAME structure. ********************************************************************/ @@ -562,6 +560,48 @@ static void lsa_io_sid_enum(char *desc, LSA_SID_ENUM *sen, } } +/******************************************************************* +reads or writes a structure. +********************************************************************/ +static void lsa_io_trans_names(char *desc, LSA_TRANS_NAME_ENUM *trn, + prs_struct *ps, int depth) +{ + int i; + + if (trn == NULL) return; + + prs_debug(ps, depth, desc, "lsa_io_trans_names"); + depth++; + + prs_align(ps); + + prs_uint32("num_entries ", ps, depth, &(trn->num_entries)); + prs_uint32("ptr_trans_names", ps, depth, &(trn->ptr_trans_names)); + + if (trn->ptr_trans_names != 0) + { + prs_uint32("num_entries2 ", ps, depth, &(trn->num_entries2)); + SMB_ASSERT_ARRAY(trn->name, trn->num_entries); + + for (i = 0; i < trn->num_entries2; i++) + { + fstring t; + slprintf(t, sizeof(t) - 1, "name[%d] ", i); + + lsa_io_trans_name(t, &(trn->name[i]), ps, depth); /* translated name */ + + } + for (i = 0; i < trn->num_entries2; i++) + { + fstring t; + slprintf(t, sizeof(t) - 1, "name[%d] ", i); + + smb_io_unistr2(t, &(trn->uni_name[i]), trn->name[i].hdr_name.buffer, ps, depth); + prs_align(ps); + } + } +} + /******************************************************************* makes a structure. ********************************************************************/ @@ -576,9 +616,8 @@ void make_q_lookup_sids(LSA_Q_LOOKUP_SIDS *q_l, POLICY_HND *hnd, memcpy(&(q_l->pol), hnd, sizeof(q_l->pol)); make_lsa_sid_enum(&(q_l->sids), num_sids, sids); - q_l->names.num_entries = 0; q_l->names.ptr_trans_names = 0; - q_l->names.num_entries2 = 0; + q_l->names.num_entries = 0; q_l->level.value = level; } @@ -603,48 +642,6 @@ void lsa_io_q_lookup_sids(char *desc, LSA_Q_LOOKUP_SIDS *q_s, prs_struct *ps, in prs_uint32("mapped_count", ps, depth, &(q_s->mapped_count)); } -/******************************************************************* -reads or writes a structure. -********************************************************************/ -static void lsa_io_trans_names(char *desc, LSA_TRANS_NAME_ENUM *trn, - prs_struct *ps, int depth) -{ - int i; - int i2; - - if (trn == NULL) return; - - prs_debug(ps, depth, desc, "lsa_io_trans_names"); - depth++; - - prs_align(ps); - - prs_uint32("num_entries ", ps, depth, &(trn->num_entries)); - prs_uint32("ptr_trans_names", ps, depth, &(trn->ptr_trans_names)); - - if (trn->ptr_trans_names != 0) - { - prs_uint32("num_entries2 ", ps, depth, &(trn->num_entries2)); - - SMB_ASSERT_ARRAY(trn->name, trn->num_entries); - - for (i = 0, i2 = 0; i < trn->num_entries2; i++) - { - fstring t; - slprintf(t, sizeof(t) - 1, "name[%d] ", i); - - lsa_io_trans_name(t, &(trn->name[i]), ps, depth); /* translated name */ - - if (trn->name[i].hdr_name.buffer != 0) - { - smb_io_unistr2(t, &(trn->uni_name[i2]), 1, ps, depth); - prs_align(ps); - i2++; - } - } - } -} - /******************************************************************* reads or writes a structure. ********************************************************************/ diff --git a/source3/rpc_parse/parse_samr.c b/source3/rpc_parse/parse_samr.c index 4fdcf19577..d8bc97d1d3 100644 --- a/source3/rpc_parse/parse_samr.c +++ b/source3/rpc_parse/parse_samr.c @@ -2081,13 +2081,15 @@ void samr_io_r_query_useraliases(char *desc, SAMR_R_QUERY_USERALIASES *r_u, prs /******************************************************************* makes a SAMR_Q_OPEN_ALIAS structure. ********************************************************************/ -void make_samr_q_open_alias(SAMR_Q_OPEN_ALIAS *q_u, +void make_samr_q_open_alias(SAMR_Q_OPEN_ALIAS *q_u, POLICY_HND *pol, uint32 unknown_0, uint32 rid) { if (q_u == NULL) return; DEBUG(5,("make_samr_q_open_alias\n")); + memcpy(&(q_u->dom_pol), pol, sizeof(q_u->dom_pol)); + /* example values: 0x0000 0008 */ q_u->unknown_0 = unknown_0; @@ -2106,6 +2108,8 @@ void samr_io_q_open_alias(char *desc, SAMR_Q_OPEN_ALIAS *q_u, prs_struct *ps, i prs_align(ps); + smb_io_pol_hnd("dom_pol", &(q_u->dom_pol), ps, depth); + prs_uint32("unknown_0", ps, depth, &(q_u->unknown_0)); prs_uint32("rid_alias", ps, depth, &(q_u->rid_alias)); } @@ -2523,7 +2527,7 @@ void samr_io_q_query_aliasmem(char *desc, SAMR_Q_QUERY_ALIASMEM *q_u, prs_struc makes a SAMR_R_QUERY_ALIASMEM structure. ********************************************************************/ void make_samr_r_query_aliasmem(SAMR_R_QUERY_ALIASMEM *r_u, - uint32 num_sids, DOM_SID *sid, uint32 status) + uint32 num_sids, DOM_SID2 *sid, uint32 status) { if (r_u == NULL) return; @@ -2531,9 +2535,9 @@ void make_samr_r_query_aliasmem(SAMR_R_QUERY_ALIASMEM *r_u, if (status == 0x0) { - r_u->num_sids = num_sids; - r_u->ptr = (num_sids != 0) ? 1 : 0; - r_u->num_sids = num_sids; + r_u->num_sids = num_sids; + r_u->ptr = (num_sids != 0) ? 1 : 0; + r_u->num_sids1 = num_sids; r_u->sid = sid; } @@ -2561,12 +2565,11 @@ void samr_io_r_query_aliasmem(char *desc, SAMR_R_QUERY_ALIASMEM *r_u, prs_struc prs_align(ps); + prs_uint32("num_sids ", ps, depth, &(r_u->num_sids)); prs_uint32("ptr", ps, depth, &(r_u->ptr)); if (r_u->ptr != 0) { - prs_uint32("num_sids ", ps, depth, &(r_u->num_sids)); - SMB_ASSERT_ARRAY(ptr_sid, r_u->num_sids); if (r_u->num_sids != 0) @@ -2584,7 +2587,7 @@ void samr_io_r_query_aliasmem(char *desc, SAMR_R_QUERY_ALIASMEM *r_u, prs_struc prs_grow(ps); if (ptr_sid[i] != 0) { - smb_io_dom_sid("", &(r_u->sid[i]), ps, depth); + smb_io_dom_sid2("", &(r_u->sid[i]), ps, depth); } } } -- cgit