ipc.c :
[kai/samba.git] / source3 / lsaparse.c
index 70d4f493800e16c348be1979449964607b094aa9..b515901ab54bc0d744ec82c589c7708911949814 100644 (file)
 extern int DEBUGLEVEL;
 
 
+/*******************************************************************
+reads or writes an LSA_R_OPEN_POL structure.
+********************************************************************/
+char* lsa_io_r_open_pol(BOOL io, LSA_R_OPEN_POL *r_p, char *q, char *base, int align)
+{
+       if (r_p == NULL) return NULL;
+
+       q = smb_io_pol_hnd(io, &(r_p->pol), q, base, align);
+
+       RW_IVAL(io, q, r_p->status, 0); q += 4;
+
+       return q;
+}
+
 /*******************************************************************
 reads or writes an LSA_Q_QUERY_INFO structure.
 ********************************************************************/
@@ -31,6 +45,8 @@ char* lsa_io_q_query(BOOL io, LSA_Q_QUERY_INFO *q_q, char *q, char *base, int al
 {
        if (q_q == NULL) return NULL;
 
+       q = smb_io_pol_hnd(io, &(q_q->pol), q, base, align);
+
        RW_SVAL(io, q, q_q->info_class, 0); q += 2;
 
        return q;
@@ -228,7 +244,7 @@ char* lsa_io_r_req_chal(BOOL io, LSA_R_REQ_CHAL *r_c, char *q, char *base, int a
 /*******************************************************************
 reads or writes a structure.
 ********************************************************************/
-char* lsa_io_q_auth2(BOOL io, LSA_Q_AUTH_2 *q_a, char *q, char *base, int align)
+char* lsa_io_q_auth_2(BOOL io, LSA_Q_AUTH_2 *q_a, char *q, char *base, int align)
 {
        if (q_a == NULL) return NULL;
 
@@ -283,7 +299,7 @@ char* lsa_io_r_srv_pwset(BOOL io, LSA_R_SRV_PWSET *r_s, char *q, char *base, int
 
        q = align_offset(q, base, align);
     
-       q = smb_io_chal(io, &(r_s->srv_chal), q, base, align); /* server challenge */
+       q = smb_io_cred(io, &(r_s->srv_cred), q, base, align); /* server challenge */
 
        RW_IVAL(io, q, r_s->status, 0); q += 4;
 
@@ -336,8 +352,8 @@ char* lsa_io_user_info(BOOL io, LSA_USER_INFO *usr, char *q, char *base, int ali
        RW_IVAL(io, q, usr->buffer_dom_id, 0); q += 4; /* undocumented logon domain id pointer */
        RW_PCVAL(io, q, usr->padding, 40); q += 40; /* unused padding bytes? */
 
-       RW_IVAL(io, q, usr->num_sids, 0); q += 4; /* 0 - num_sids */
-       RW_IVAL(io, q, usr->buffer_sids, 0); q += 4; /* NULL - undocumented pointer to SIDs. */
+       RW_IVAL(io, q, usr->num_other_sids, 0); q += 4; /* 0 - num_sids */
+       RW_IVAL(io, q, usr->buffer_other_sids, 0); q += 4; /* NULL - undocumented pointer to SIDs. */
        
        q = smb_io_unistr2(io, &(usr->uni_user_name)   , q, base, align); /* username unicode string */
        q = smb_io_unistr2(io, &(usr->uni_full_name)   , q, base, align); /* user's full name unicode string */
@@ -355,10 +371,13 @@ char* lsa_io_user_info(BOOL io, LSA_USER_INFO *usr, char *q, char *base, int ali
        q = smb_io_unistr2(io, &( usr->uni_logon_srv), q, base, align); /* logon server unicode string */
        q = smb_io_unistr2(io, &( usr->uni_logon_dom), q, base, align); /* logon domain unicode string */
 
-       q = smb_io_dom_sid(io, &(usr->undoc_dom_sids[0]), q, base, align); /* undocumented - domain SIDs */
-       q = smb_io_dom_sid(io, &(usr->undoc_dom_sids[1]), q, base, align); /* undocumented - domain SIDs */
        q = smb_io_dom_sid(io, &(usr->dom_sid), q, base, align);           /* domain SID */
 
+       for (i = 0; i < usr->num_other_sids; i++)
+       {
+               q = smb_io_dom_sid(io, &(usr->other_sids[i]), q, base, align); /* other domain SIDs */
+       }
+
        return q;
 }
 
@@ -389,7 +408,10 @@ char* lsa_io_r_sam_logon(BOOL io, LSA_R_SAM_LOGON *r_l, char *q, char *base, int
        q = smb_io_cred(io, &(r_l->srv_creds), q, base, align); /* server credentials.  server time stamp appears to be ignored. */
 
        RW_IVAL(io, q, r_l->buffer_user, 0); q += 4;
-       q = lsa_io_user_info(io, &(r_l->user), q, base, align);
+       if (r_l->buffer_user != 0)
+       {
+               q = lsa_io_user_info(io, r_l->user, q, base, align);
+       }
 
        RW_IVAL(io, q, r_l->auth_resp, 0); q += 4; /* 1 - Authoritative response; 0 - Non-Auth? */
 
@@ -444,5 +466,3 @@ reads or writes a structure.
        return q;
 }
 #endif
-
-