This commit was manufactured by cvs2svn to create branch 'SAMBA_3_0'.
[ira/wip.git] / source / rpc_parse / parse_lsa.c
index 56398e7cf06bdcf2b6a8f5eb64f1a1acd2cc390c..0b45c0baf37ae29788bdc6c98456c7645a3e81d0 100644 (file)
@@ -80,7 +80,7 @@ static BOOL lsa_io_trans_name(const char *desc, LSA_TRANS_NAME *trn, prs_struct
 static BOOL lsa_io_dom_r_ref(const char *desc, DOM_R_REF *r_r, prs_struct *ps, 
                             int depth)
 {
-       int i;
+       unsigned int i;
 
        prs_debug(ps, depth, desc, "lsa_io_dom_r_ref");
        depth++;
@@ -531,7 +531,7 @@ BOOL lsa_io_q_enum_trust_dom(const char *desc, LSA_Q_ENUM_TRUST_DOM *q_e,
 void init_r_enum_trust_dom(TALLOC_CTX *ctx, LSA_R_ENUM_TRUST_DOM *r_e, uint32 enum_context,
                           uint32 req_num_domains, uint32 num_domains, TRUSTDOM **td)
 {
-       int i;
+       unsigned int i;
 
         DEBUG(5, ("init_r_enum_trust_dom\n"));
        
@@ -851,7 +851,7 @@ static void init_lsa_sid_enum(TALLOC_CTX *mem_ctx, LSA_SID_ENUM *sen,
 static BOOL lsa_io_sid_enum(const char *desc, LSA_SID_ENUM *sen, prs_struct *ps, 
                            int depth)
 {
-       int i;
+       unsigned int i;
 
        prs_debug(ps, depth, desc, "lsa_io_sid_enum");
        depth++;
@@ -967,7 +967,7 @@ BOOL lsa_io_q_lookup_sids(const char *desc, LSA_Q_LOOKUP_SIDS *q_s, prs_struct *
 static BOOL lsa_io_trans_names(const char *desc, LSA_TRANS_NAME_ENUM *trn,
                 prs_struct *ps, int depth)
 {
-       int i;
+       unsigned int i;
 
        prs_debug(ps, depth, desc, "lsa_io_trans_names");
        depth++;
@@ -1063,7 +1063,7 @@ makes a structure.
 void init_q_lookup_names(TALLOC_CTX *mem_ctx, LSA_Q_LOOKUP_NAMES *q_l, 
                         POLICY_HND *hnd, int num_names, const char **names)
 {
-       int i;
+       unsigned int i;
 
        DEBUG(5, ("init_q_lookup_names\n"));
 
@@ -1102,7 +1102,7 @@ reads or writes a structure.
 BOOL lsa_io_q_lookup_names(const char *desc, LSA_Q_LOOKUP_NAMES *q_r, 
                           prs_struct *ps, int depth)
 {
-       int i;
+       unsigned int i;
 
        prs_debug(ps, depth, desc, "lsa_io_q_lookup_names");
        depth++;
@@ -1166,7 +1166,7 @@ reads or writes a structure.
 BOOL lsa_io_r_lookup_names(const char *desc, LSA_R_LOOKUP_NAMES *r_r, 
                           prs_struct *ps, int depth)
 {
-       int i;
+       unsigned int i;
 
        prs_debug(ps, depth, desc, "lsa_io_r_lookup_names");
        depth++;
@@ -1519,6 +1519,9 @@ BOOL lsa_io_r_priv_get_dispname(const char *desc, LSA_R_PRIV_GET_DISPNAME *r_q,
        return True;
 }
 
+/*
+  initialise a LSA_Q_ENUM_ACCOUNTS structure
+*/
 void init_lsa_q_enum_accounts(LSA_Q_ENUM_ACCOUNTS *trn, POLICY_HND *hnd, uint32 enum_context, uint32 pref_max_length)
 {
        memcpy(&trn->pol, hnd, sizeof(trn->pol));
@@ -1549,6 +1552,7 @@ BOOL lsa_io_q_enum_accounts(const char *desc, LSA_Q_ENUM_ACCOUNTS *q_q, prs_stru
        return True;
 }
 
+
 /*******************************************************************
  Inits an LSA_R_ENUM_PRIVS structure.
 ********************************************************************/
@@ -2236,3 +2240,180 @@ BOOL lsa_io_r_query_info2(const char *desc, LSA_R_QUERY_INFO2 *r_c,
 
        return True;
 }
+
+
+/*******************************************************************
+ Inits an LSA_Q_ENUM_ACCT_RIGHTS structure.
+********************************************************************/
+void init_q_enum_acct_rights(LSA_Q_ENUM_ACCT_RIGHTS *q_q, 
+                            POLICY_HND *hnd, 
+                            uint32 count, 
+                            DOM_SID *sid)
+{
+       DEBUG(5, ("init_q_enum_acct_rights\n"));
+
+       q_q->pol = *hnd;
+       init_dom_sid2(&q_q->sid, sid);
+}
+
+/*******************************************************************
+reads or writes a LSA_Q_ENUM_ACCT_RIGHTS structure.
+********************************************************************/
+BOOL lsa_io_q_enum_acct_rights(const char *desc, LSA_Q_ENUM_ACCT_RIGHTS *q_q, prs_struct *ps, int depth)
+{
+       
+       if (q_q == NULL)
+               return False;
+
+       prs_debug(ps, depth, desc, "lsa_io_q_enum_acct_rights");
+       depth++;
+
+       if (!smb_io_pol_hnd("", &q_q->pol, ps, depth))
+               return False;
+
+       if(!smb_io_dom_sid2("sid", &q_q->sid, ps, depth))
+               return False;
+
+       return True;
+}
+
+
+/*******************************************************************
+reads or writes a LSA_R_ENUM_ACCT_RIGHTS structure.
+********************************************************************/
+BOOL lsa_io_r_enum_acct_rights(const char *desc, LSA_R_ENUM_ACCT_RIGHTS *r_c, prs_struct *ps, int depth)
+{
+       prs_debug(ps, depth, desc, "lsa_io_r_enum_acct_rights");
+       depth++;
+
+       if(!prs_uint32("count   ", ps, depth, &r_c->count))
+               return False;
+
+       if(!smb_io_unistr2_array("rights", &r_c->rights, ps, depth))
+               return False;
+
+       if(!prs_align(ps))
+               return False;
+
+       if(!prs_ntstatus("status", ps, depth, &r_c->status))
+               return False;
+
+       return True;
+}
+
+
+/*******************************************************************
+ Inits an LSA_Q_ADD_ACCT_RIGHTS structure.
+********************************************************************/
+void init_q_add_acct_rights(LSA_Q_ADD_ACCT_RIGHTS *q_q, 
+                           POLICY_HND *hnd, 
+                           DOM_SID *sid,
+                           uint32 count, 
+                           const char **rights)
+{
+       DEBUG(5, ("init_q_add_acct_rights\n"));
+
+       q_q->pol = *hnd;
+       init_dom_sid2(&q_q->sid, sid);
+       init_unistr2_array(&q_q->rights, count, rights);
+       q_q->count = 5;
+}
+
+
+/*******************************************************************
+reads or writes a LSA_Q_ADD_ACCT_RIGHTS structure.
+********************************************************************/
+BOOL lsa_io_q_add_acct_rights(const char *desc, LSA_Q_ADD_ACCT_RIGHTS *q_q, prs_struct *ps, int depth)
+{
+       prs_debug(ps, depth, desc, "lsa_io_q_add_acct_rights");
+       depth++;
+
+       if (!smb_io_pol_hnd("", &q_q->pol, ps, depth))
+               return False;
+
+       if(!smb_io_dom_sid2("sid", &q_q->sid, ps, depth))
+               return False;
+
+       if(!prs_uint32("count", ps, depth, &q_q->rights.count))
+               return False;
+
+       if(!smb_io_unistr2_array("rights", &q_q->rights, ps, depth))
+               return False;
+
+       return True;
+}
+
+/*******************************************************************
+reads or writes a LSA_R_ENUM_ACCT_RIGHTS structure.
+********************************************************************/
+BOOL lsa_io_r_add_acct_rights(const char *desc, LSA_R_ADD_ACCT_RIGHTS *r_c, prs_struct *ps, int depth)
+{
+       prs_debug(ps, depth, desc, "lsa_io_r_add_acct_rights");
+       depth++;
+
+       if(!prs_ntstatus("status", ps, depth, &r_c->status))
+               return False;
+
+       return True;
+}
+
+
+/*******************************************************************
+ Inits an LSA_Q_REMOVE_ACCT_RIGHTS structure.
+********************************************************************/
+void init_q_remove_acct_rights(LSA_Q_REMOVE_ACCT_RIGHTS *q_q, 
+                              POLICY_HND *hnd, 
+                              DOM_SID *sid,
+                              uint32 removeall,
+                              uint32 count, 
+                              const char **rights)
+{
+       DEBUG(5, ("init_q_remove_acct_rights\n"));
+
+       q_q->pol = *hnd;
+       init_dom_sid2(&q_q->sid, sid);
+       q_q->removeall = removeall;
+       init_unistr2_array(&q_q->rights, count, rights);
+       q_q->count = 5;
+}
+
+
+/*******************************************************************
+reads or writes a LSA_Q_REMOVE_ACCT_RIGHTS structure.
+********************************************************************/
+BOOL lsa_io_q_remove_acct_rights(const char *desc, LSA_Q_REMOVE_ACCT_RIGHTS *q_q, prs_struct *ps, int depth)
+{
+       prs_debug(ps, depth, desc, "lsa_io_q_remove_acct_rights");
+       depth++;
+
+       if (!smb_io_pol_hnd("", &q_q->pol, ps, depth))
+               return False;
+
+       if(!smb_io_dom_sid2("sid", &q_q->sid, ps, depth))
+               return False;
+
+       if(!prs_uint32("removeall", ps, depth, &q_q->removeall))
+               return False;
+
+       if(!prs_uint32("count", ps, depth, &q_q->rights.count))
+               return False;
+
+       if(!smb_io_unistr2_array("rights", &q_q->rights, ps, depth))
+               return False;
+
+       return True;
+}
+
+/*******************************************************************
+reads or writes a LSA_R_ENUM_ACCT_RIGHTS structure.
+********************************************************************/
+BOOL lsa_io_r_remove_acct_rights(const char *desc, LSA_R_REMOVE_ACCT_RIGHTS *r_c, prs_struct *ps, int depth)
+{
+       prs_debug(ps, depth, desc, "lsa_io_r_remove_acct_rights");
+       depth++;
+
+       if(!prs_ntstatus("status", ps, depth, &r_c->status))
+               return False;
+
+       return True;
+}