From 2e8ae887857249822b84461fd503105555873508 Mon Sep 17 00:00:00 2001 From: Jean-François Micouleau Date: Thu, 22 Nov 2001 16:12:43 +0000 Subject: add a command to rpcclient: enumprivs J.F. (This used to be commit fa63cb78e326040f68d858d593ba98e06c26c92e) --- source3/rpc_parse/parse_lsa.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'source3/rpc_parse') diff --git a/source3/rpc_parse/parse_lsa.c b/source3/rpc_parse/parse_lsa.c index f69f3ebdef..34feac32a7 100644 --- a/source3/rpc_parse/parse_lsa.c +++ b/source3/rpc_parse/parse_lsa.c @@ -246,11 +246,14 @@ static BOOL lsa_io_obj_attr(char *desc, LSA_OBJ_ATTR *attr, prs_struct *ps, if(!prs_uint32("ptr_sec_qos ", ps, depth, &attr->ptr_sec_qos )) /* security quality of service (pointer) */ return False; + /* code commented out as it's not necessary true (tested with hyena). JFM, 11/22/2001 */ +#if 0 if (attr->len != prs_offset(ps) - start) { DEBUG(3,("lsa_io_obj_attr: length %x does not match size %x\n", attr->len, prs_offset(ps) - start)); return False; } +#endif if (attr->ptr_sec_qos != 0 && attr->sec_qos != NULL) { if(!lsa_io_sec_qos("sec_qos", attr->sec_qos, ps, depth)) @@ -1280,6 +1283,20 @@ BOOL lsa_io_r_open_secret(char *desc, LSA_R_OPEN_SECRET *r_c, prs_struct *ps, in return True; } +/******************************************************************* + Inits an LSA_Q_ENUM_PRIVS structure. +********************************************************************/ + +void init_q_enum_privs(LSA_Q_ENUM_PRIVS *q_q, POLICY_HND *hnd, uint32 enum_context, uint32 pref_max_length) +{ + DEBUG(5, ("init_q_enum_privs\n")); + + memcpy(&q_q->pol, hnd, sizeof(q_q->pol)); + + q_q->enum_context = enum_context; + q_q->pref_max_length = pref_max_length; +} + /******************************************************************* reads or writes a structure. ********************************************************************/ @@ -1382,6 +1399,10 @@ BOOL lsa_io_r_enum_privs(char *desc, LSA_R_ENUM_PRIVS *r_q, prs_struct *ps, int if(!prs_uint32("count1", ps, depth, &r_q->count1)) return False; + if (UNMARSHALLING(ps)) + if (!(r_q->privs = (LSA_PRIV_ENTRY *)prs_alloc_mem(ps, sizeof(LSA_PRIV_ENTRY) * r_q->count1))) + return False; + if (!lsa_io_priv_entries("", r_q->privs, r_q->count1, ps, depth)) return False; } -- cgit