diff options
Diffstat (limited to 'source3/rpc_parse')
-rw-r--r-- | source3/rpc_parse/parse_at.c | 2 | ||||
-rw-r--r-- | source3/rpc_parse/parse_creds.c | 87 | ||||
-rw-r--r-- | source3/rpc_parse/parse_net.c | 4 | ||||
-rw-r--r-- | source3/rpc_parse/parse_prs.c | 92 | ||||
-rw-r--r-- | source3/rpc_parse/parse_rpc.c | 4 | ||||
-rw-r--r-- | source3/rpc_parse/parse_samr.c | 34 | ||||
-rw-r--r-- | source3/rpc_parse/parse_spoolss.c | 2 | ||||
-rw-r--r-- | source3/rpc_parse/parse_srv.c | 15 |
8 files changed, 160 insertions, 80 deletions
diff --git a/source3/rpc_parse/parse_at.c b/source3/rpc_parse/parse_at.c index 87507230c0..a03a8cfad9 100644 --- a/source3/rpc_parse/parse_at.c +++ b/source3/rpc_parse/parse_at.c @@ -221,14 +221,12 @@ BOOL at_io_r_enum_jobs(char *desc, AT_R_ENUM_JOBS *r_e, prs_struct *ps, int dept for (i = 0; i < r_e->num_entries2; i++) { - prs_grow(ps); prs_uint32("jobid", ps, depth, &(r_e->info[i].jobid)); at_io_job_info("", &(r_e->info[i].info), ps, depth); } for (i = 0; i < r_e->num_entries2; i++) { - prs_grow(ps); smb_io_unistr2("", &(r_e->command[i]), r_e->info[i].info.ptr_command, ps, depth); } diff --git a/source3/rpc_parse/parse_creds.c b/source3/rpc_parse/parse_creds.c index 127557d1b8..c661d5a3c6 100644 --- a/source3/rpc_parse/parse_creds.c +++ b/source3/rpc_parse/parse_creds.c @@ -30,13 +30,19 @@ extern int DEBUGLEVEL; /******************************************************************* makes a CREDS_UNIX structure. ********************************************************************/ -BOOL make_creds_unix(CREDS_UNIX *r_u, const char* user_name) +BOOL make_creds_unix(CREDS_UNIX *r_u, const char* user_name, + const char* requested_name, + const char* real_name, + BOOL guest) { if (r_u == NULL) return False; DEBUG(5,("make_creds_unix\n")); - fstrcpy(r_u->user_name, user_name); + fstrcpy(r_u->user_name , user_name); + fstrcpy(r_u->requested_name, requested_name); + fstrcpy(r_u->real_name , real_name); + r_u->guest = guest; return True; } @@ -54,7 +60,11 @@ BOOL creds_io_unix(char *desc, CREDS_UNIX *r_u, prs_struct *ps, int depth) prs_align(ps); prs_string("user_name", ps, depth, r_u->user_name, strlen(r_u->user_name), sizeof(r_u->user_name)); prs_align(ps); - + prs_string("requested_name", ps, depth, r_u->requested_name, strlen(r_u->requested_name), sizeof(r_u->requested_name)); + prs_align(ps); + prs_string("real_name", ps, depth, r_u->real_name, strlen(r_u->real_name), sizeof(r_u->real_name)); + prs_align(ps); + prs_uint32("guest", ps, depth, &(r_u->guest)); return True; } @@ -70,8 +80,9 @@ void creds_free_unix(CREDS_UNIX *r_u) makes a CREDS_UNIX_SEC structure. ********************************************************************/ BOOL make_creds_unix_sec(CREDS_UNIX_SEC *r_u, - uint32 uid, uint32 gid, uint32 num_grps, uint32 *grps) + uint32 uid, uint32 gid, uint32 num_grps, gid_t *grps) { + int i; if (r_u == NULL) return False; DEBUG(5,("make_creds_unix_sec\n")); @@ -79,7 +90,16 @@ BOOL make_creds_unix_sec(CREDS_UNIX_SEC *r_u, r_u->uid = uid; r_u->gid = gid; r_u->num_grps = num_grps; - r_u->grps = grps; + r_u->grps = (uint32*)Realloc(NULL, sizeof(r_u->grps[0]) * + r_u->num_grps); + if (r_u->grps == NULL && num_grps != 0) + { + return False; + } + for (i = 0; i < num_grps; i++) + { + r_u->grps[i] = (gid_t)grps[i]; + } return True; } @@ -114,7 +134,6 @@ BOOL creds_io_unix_sec(char *desc, CREDS_UNIX_SEC *r_u, prs_struct *ps, int dept } for (i = 0; i < r_u->num_grps; i++) { - prs_grow(ps); prs_uint32("", ps, depth, &(r_u->grps[i])); } return True; @@ -134,10 +153,39 @@ void creds_free_unix_sec(CREDS_UNIX_SEC *r_u) } /******************************************************************* +makes a CREDS_NT_SEC structure. +********************************************************************/ +BOOL make_creds_nt_sec(CREDS_NT_SEC *r_u, + DOM_SID *sid, uint32 num_grps, uint32 *grps) +{ + int i; + if (r_u == NULL) return False; + + DEBUG(5,("make_creds_unix_sec\n")); + + sid_copy(&r_u->sid, sid); + r_u->num_grps = num_grps; + r_u->grp_rids = (uint32*)Realloc(NULL, sizeof(r_u->grp_rids[0]) * + r_u->num_grps); + + if (r_u->grp_rids == NULL && num_grps != 0) + { + return False; + } + for (i = 0; i < num_grps; i++) + { + r_u->grp_rids[i] = grps[i]; + } + + return True; +} + +/******************************************************************* reads or writes a structure. ********************************************************************/ BOOL creds_io_nt_sec(char *desc, CREDS_NT_SEC *r_u, prs_struct *ps, int depth) { + int i; if (r_u == NULL) return False; prs_debug(ps, depth, desc, "creds_io_nt"); @@ -148,8 +196,22 @@ BOOL creds_io_nt_sec(char *desc, CREDS_NT_SEC *r_u, prs_struct *ps, int depth) smb_io_dom_sid ("sid", &r_u->sid, ps, depth); prs_align(ps); - sec_io_desc_buf("sd ", &r_u->sd , ps, depth); - prs_align(ps); + prs_uint32("num_grps", ps, depth, &(r_u->num_grps)); + if (r_u->num_grps != 0) + { + r_u->grp_rids = (uint32*)Realloc(r_u->grp_rids, + sizeof(r_u->grp_rids[0]) * + r_u->num_grps); + if (r_u->grp_rids == NULL) + { + creds_free_nt_sec(r_u); + return False; + } + } + for (i = 0; i < r_u->num_grps; i++) + { + prs_uint32("", ps, depth, &(r_u->grp_rids[i])); + } return True; } @@ -159,6 +221,11 @@ frees a structure. ********************************************************************/ void creds_free_nt_sec(CREDS_NT_SEC *r_u) { + if (r_u->grp_rids != NULL) + { + free(r_u->grp_rids); + r_u->grp_rids = NULL; + } } /******************************************************************* @@ -265,6 +332,8 @@ BOOL creds_io_hybrid(char *desc, CREDS_HYBRID *r_u, prs_struct *ps, int depth) prs_uint32("reuse", ps, depth, &(r_u->reuse)); prs_uint32("ptr_ntc", ps, depth, &(r_u->ptr_ntc)); prs_uint32("ptr_uxc", ps, depth, &(r_u->ptr_uxc)); + prs_uint32("ptr_nts", ps, depth, &(r_u->ptr_nts)); + prs_uint32("ptr_uxs", ps, depth, &(r_u->ptr_uxs)); if (r_u->ptr_ntc != 0) { if (!creds_io_nt ("ntc", &r_u->ntc, ps, depth)) return False; @@ -321,7 +390,7 @@ void copy_unix_sec_creds(CREDS_UNIX_SEC *to, const CREDS_UNIX_SEC *from) if (from->num_grps != 0) { - size_t size = to->num_grps * sizeof(to->grps[0]); + size_t size = from->num_grps * sizeof(from->grps[0]); to->grps = (uint32*)malloc(size); if (to->grps == NULL) { diff --git a/source3/rpc_parse/parse_net.c b/source3/rpc_parse/parse_net.c index 455129b6f9..277c2331b4 100644 --- a/source3/rpc_parse/parse_net.c +++ b/source3/rpc_parse/parse_net.c @@ -1669,7 +1669,6 @@ static BOOL net_io_sam_group_mem_info(char *desc, SAM_GROUP_MEM_INFO *info, prs_ for (i = 0; i < info->num_members2; i++) { - prs_grow(ps); slprintf(tmp, sizeof(tmp) - 1, "rids[%02d]", i); prs_uint32(tmp, ps, depth, &(info->rids[i])); } @@ -1688,7 +1687,6 @@ static BOOL net_io_sam_group_mem_info(char *desc, SAM_GROUP_MEM_INFO *info, prs_ for (i = 0; i < info->num_members3; i++) { - prs_grow(ps); slprintf(tmp, sizeof(tmp) - 1, "attribs[%02d]", i); prs_uint32(tmp, ps, depth, &(info->attribs[i])); } @@ -1754,7 +1752,6 @@ static BOOL net_io_sam_alias_mem_info(char *desc, SAM_ALIAS_MEM_INFO *info, prs_ for (i = 0; i < info->num_sids; i++) { - prs_grow(ps); slprintf(tmp, sizeof(tmp) - 1, "ptr_sids[%02d]", i); prs_uint32(tmp, ps, depth, &(info->ptr_sids[i])); } @@ -1765,7 +1762,6 @@ static BOOL net_io_sam_alias_mem_info(char *desc, SAM_ALIAS_MEM_INFO *info, prs_ { if (info->ptr_sids[i] != 0) { - prs_grow(ps); slprintf(tmp, sizeof(tmp) - 1, "sids[%02d]", i); smb_io_dom_sid2(tmp, &(info->sids[i]), ps, depth); } diff --git a/source3/rpc_parse/parse_prs.c b/source3/rpc_parse/parse_prs.c index 4c52e15769..d9c07e3885 100644 --- a/source3/rpc_parse/parse_prs.c +++ b/source3/rpc_parse/parse_prs.c @@ -39,10 +39,11 @@ void prs_debug(prs_struct *ps, int depth, char *desc, char *fn_name) /******************************************************************* debug a parse structure ********************************************************************/ -void prs_debug_out(prs_struct *ps, int level) +void prs_debug_out(prs_struct *ps, char *msg, int level) { - DEBUG(level,("ps: io %s align %d offset %d err %d data %p len %d\n", - BOOLSTR(ps->io), ps->align, ps->offset, ps->error, ps->data, + DEBUG(level,("%s ps: io %s align %d offset %d err %d data %p len %d\n", + msg, BOOLSTR(ps->io), ps->align, ps->offset, ps->error, + ps->data, ps->data != NULL ? mem_buf_len(ps->data) : 0)); } @@ -70,6 +71,22 @@ void prs_init(prs_struct *ps, uint32 size, } /******************************************************************* + copy a parse structure + ********************************************************************/ +BOOL prs_copy(prs_struct *ps, const prs_struct *from) +{ + int len = mem_buf_len(from->data); + prs_init(ps, len, from->align, from->data->margin, from->io); + if (!mem_buf_copy(mem_data(&ps->data, 0), from->data, 0, len)) + { + return False; + } + ps->offset = len; + prs_link(NULL, ps, NULL); + return True; +} + +/******************************************************************* initialise a parse structure ********************************************************************/ void prs_mem_free(prs_struct *ps) @@ -85,6 +102,10 @@ void prs_link(prs_struct *prev, prs_struct *ps, prs_struct *next) ps->data->offset.start = prev != NULL ? prev->data->offset.end : 0; ps->data->offset.end = ps->data->offset.start + ps->offset; ps->data->next = next != NULL ? next->data : NULL; + + DEBUG(150,("prs_link: start %d end %d\n", + ps->data->offset.start, + ps->data->offset.end)); } /******************************************************************* @@ -107,12 +128,31 @@ void prs_align(prs_struct *ps) depends on the data stream mode (io) ********************************************************************/ -BOOL prs_grow(prs_struct *ps) +BOOL prs_grow(prs_struct *ps, uint32 new_size) { if (ps->error) return False; - return mem_grow_data(&(ps->data), ps->io, ps->offset, False); + return mem_grow_data(&(ps->data), ps->io, new_size, False); } +/******************************************************************* + lengthens a buffer by len bytes and copies data into it. + ********************************************************************/ +BOOL prs_append_data(prs_struct *ps, const char *data, int len) +{ + int prev_size = ps->data->data_used; + int new_size = prev_size + len; + char *to; + + mem_realloc_data(ps->data, new_size); + to = mem_data(&ps->data, prev_size); + if (to == NULL || ps->data->data_used != new_size) + { + return False; + } + memcpy(to, data, len); + + return True; +} /******************************************************************* stream a uint8 @@ -121,16 +161,19 @@ BOOL _prs_uint8(char *name, prs_struct *ps, int depth, uint8 *data8) { char *q; if (ps->error) return False; + prs_grow(ps, ps->offset + 1); q = mem_data(&(ps->data), ps->offset); if (q == NULL) { ps->error = True; + prs_debug_out(ps, "_prs_uint8 error", 5); return False; } DBG_RW_CVAL(name, depth, ps->offset, ps->io, q, *data8) ps->offset += 1; + return True; } @@ -141,10 +184,12 @@ BOOL _prs_uint16(char *name, prs_struct *ps, int depth, uint16 *data16) { char *q; if (ps->error) return False; + prs_grow(ps, ps->offset + 2); q = mem_data(&(ps->data), ps->offset); if (q == NULL) { ps->error = True; + prs_debug_out(ps, "_prs_uint16 error", 5); return False; } @@ -165,6 +210,7 @@ BOOL _prs_hash1(prs_struct *ps, uint32 offset, uint8 sess_key[16]) if (q == NULL) { ps->error = True; + prs_debug_out(ps, "_prs_hash1 error", 5); return False; } @@ -188,10 +234,12 @@ BOOL _prs_uint32(char *name, prs_struct *ps, int depth, uint32 *data32) { char *q; if (ps->error) return False; + prs_grow(ps, ps->offset + 4); q = mem_data(&(ps->data), ps->offset); if (q == NULL) { ps->error = True; + prs_debug_out(ps, "_prs_uint32 error", 5); return False; } @@ -211,13 +259,15 @@ BOOL _prs_uint8s(BOOL charmode, char *name, prs_struct *ps, int depth, uint8 *da int end_offset; char *e; if (ps->error) return False; - q = mem_data(&(ps->data), ps->offset); end_offset = ps->offset + len * sizeof(uint8); + prs_grow(ps, end_offset); + q = mem_data(&(ps->data), ps->offset); e = mem_data(&(ps->data), end_offset-1); if (q == NULL || e == NULL) { ps->error = True; + prs_debug_out(ps, "_prs_uint8s error", 5); return False; } @@ -236,13 +286,15 @@ BOOL _prs_uint16s(BOOL charmode, char *name, prs_struct *ps, int depth, uint16 * int end_offset; char *e; if (ps->error) return False; - q = mem_data(&(ps->data), ps->offset); end_offset = ps->offset + len * sizeof(uint16); + prs_grow(ps, end_offset); + q = mem_data(&(ps->data), ps->offset); e = mem_data(&(ps->data), end_offset-1); if (q == NULL || e == NULL) { ps->error = True; + prs_debug_out(ps, "_prs_uint16s error", 5); return False; } @@ -261,13 +313,15 @@ BOOL _prs_uint32s(BOOL charmode, char *name, prs_struct *ps, int depth, uint32 * int end_offset; char *e; if (ps->error) return False; - q = mem_data(&(ps->data), ps->offset); end_offset = ps->offset + len * sizeof(uint32); + prs_grow(ps, end_offset); + q = mem_data(&(ps->data), ps->offset); e = mem_data(&(ps->data), end_offset-1); if (q == NULL || e == NULL) { ps->error = True; + prs_debug_out(ps, "_prs_uint32s error", 5); return False; } @@ -287,13 +341,15 @@ BOOL _prs_buffer2(BOOL charmode, char *name, prs_struct *ps, int depth, BUFFER2 int end_offset; char *e; if (ps->error) return False; + end_offset = ps->offset + str->buf_len * sizeof(uint8); + prs_grow(ps, end_offset); q = mem_data(&(ps->data), ps->offset); - end_offset = ps->offset + str->buf_len; e = mem_data(&(ps->data), end_offset-1); if (q == NULL || e == NULL) { ps->error = True; + prs_debug_out(ps, "_prs_buffer2 error", 5); return False; } @@ -313,13 +369,15 @@ BOOL _prs_string2(BOOL charmode, char *name, prs_struct *ps, int depth, STRING2 int end_offset; char *e; if (ps->error) return False; - q = mem_data(&(ps->data), ps->offset); end_offset = ps->offset + str->str_str_len * sizeof(uint8); + prs_grow(ps, end_offset); + q = mem_data(&(ps->data), ps->offset); e = mem_data(&(ps->data), end_offset-1); if (q == NULL || e == NULL) { ps->error = True; + prs_debug_out(ps, "_prs_string2 error", 5); return False; } @@ -339,13 +397,15 @@ BOOL _prs_unistr2(BOOL charmode, char *name, prs_struct *ps, int depth, UNISTR2 int end_offset; char *e; if (ps->error) return False; - q = mem_data(&(ps->data), ps->offset); end_offset = ps->offset + str->uni_str_len * sizeof(uint16); + prs_grow(ps, end_offset); + q = mem_data(&(ps->data), ps->offset); e = mem_data(&(ps->data), end_offset-1); if (q == NULL || e == NULL) { ps->error = True; + prs_debug_out(ps, "_prs_unistr2 error", 5); return False; } @@ -365,13 +425,15 @@ BOOL _prs_unistr3(BOOL charmode, char *name, UNISTR3 *str, prs_struct *ps, int d int end_offset; char *e; if (ps->error) return False; - q = mem_data(&(ps->data), ps->offset); end_offset = ps->offset + str->uni_str_len * sizeof(uint16); + prs_grow(ps, end_offset); + q = mem_data(&(ps->data), ps->offset); e = mem_data(&(ps->data), end_offset-1); if (q == NULL || e == NULL) { ps->error = True; + prs_debug_out(ps, "_prs_unistr3 error", 5); return False; } @@ -395,10 +457,12 @@ BOOL _prs_unistr(char *name, prs_struct *ps, int depth, UNISTR *str) { char *q; i++; + prs_grow(ps, ps->offset + i*2); q = mem_data(&(ps->data), ps->offset + i*2); if (q == NULL) { ps->error = True; + prs_debug_out(ps, "_prs_unistr error", 5); return False; } RW_SVAL(ps->io, q, str->buffer[i],0); @@ -432,15 +496,19 @@ BOOL _prs_string(char *name, prs_struct *ps, int depth, char *str, uint16 len, u DEBUG(120,("_prs_string: string %s len %d max %d\n", str, len, max_buf_size)); + DEBUG(10,("%s%04x %s: ", tab_depth(depth), ps->offset, name != NULL ? name : "")); + do { char *q; i++; + prs_grow(ps, ps->offset + i); q = mem_data(&(ps->data), ps->offset + i); if (q == NULL) { ps->error = True; + prs_debug_out(ps, "_prs_string error", 5); return False; } diff --git a/source3/rpc_parse/parse_rpc.c b/source3/rpc_parse/parse_rpc.c index 819e441742..ac6ea8ea7e 100644 --- a/source3/rpc_parse/parse_rpc.c +++ b/source3/rpc_parse/parse_rpc.c @@ -270,7 +270,7 @@ creates an RPC_ADDR_STR structure. The name can be null (RPC Alter-Context) ********************************************************************/ -static BOOL make_rpc_addr_str(RPC_ADDR_STR *str, char *name) +static BOOL make_rpc_addr_str(RPC_ADDR_STR *str, const char *name) { if (str == NULL ) return False; if (name == NULL) @@ -434,7 +434,7 @@ jfm: nope two ! The pipe_addr can be NULL ! ********************************************************************/ BOOL make_rpc_hdr_ba(RPC_HDR_BA *rpc, uint16 max_tsize, uint16 max_rsize, uint32 assoc_gid, - char *pipe_addr, + const char *pipe_addr, uint8 num_results, uint16 result, uint16 reason, RPC_IFACE *transfer) { diff --git a/source3/rpc_parse/parse_samr.c b/source3/rpc_parse/parse_samr.c index 8ce5275bae..cedfbdebd3 100644 --- a/source3/rpc_parse/parse_samr.c +++ b/source3/rpc_parse/parse_samr.c @@ -1314,13 +1314,11 @@ BOOL samr_io_r_enum_dom_users(char *desc, SAMR_R_ENUM_DOM_USERS *r_u, prs_struct for (i = 0; i < r_u->num_entries2; i++) { - prs_grow(ps); sam_io_sam_entry("", &(r_u->sam[i]), ps, depth); } for (i = 0; i < r_u->num_entries2; i++) { - prs_grow(ps); smb_io_unistr2("", &(r_u->uni_acct_name[i]), r_u->sam[i].hdr_name.buffer, ps, depth); prs_align(ps); } @@ -1444,13 +1442,11 @@ static BOOL sam_io_sam_dispinfo_1(char *desc, SAM_DISPINFO_1 *sam, uint32 num_en for (i = 0; i < num_entries; i++) { - prs_grow(ps); sam_io_sam_entry1("", &(sam->sam[i]), ps, depth); } for (i = 0; i < num_entries; i++) { - prs_grow(ps); sam_io_sam_str1 ("", &(sam->str[i]), sam->sam[i].hdr_acct_name.buffer, sam->sam[i].hdr_user_name.buffer, @@ -1521,13 +1517,11 @@ static BOOL sam_io_sam_dispinfo_2(char *desc, SAM_DISPINFO_2 *sam, uint32 num_en for (i = 0; i < num_entries; i++) { - prs_grow(ps); sam_io_sam_entry2("", &(sam->sam[i]), ps, depth); } for (i = 0; i < num_entries; i++) { - prs_grow(ps); sam_io_sam_str2 ("", &(sam->str[i]), sam->sam[i].hdr_srv_name.buffer, sam->sam[i].hdr_srv_desc.buffer, @@ -1597,13 +1591,11 @@ static BOOL sam_io_sam_dispinfo_3(char *desc, SAM_DISPINFO_3 *sam, uint32 num_en for (i = 0; i < num_entries; i++) { - prs_grow(ps); sam_io_sam_entry3("", &(sam->sam[i]), ps, depth); } for (i = 0; i < num_entries; i++) { - prs_grow(ps); sam_io_sam_str3 ("", &(sam->str[i]), sam->sam[i].hdr_grp_name.buffer, sam->sam[i].hdr_grp_desc.buffer, @@ -1672,13 +1664,11 @@ static BOOL sam_io_sam_dispinfo_4(char *desc, SAM_DISPINFO_4 *sam, uint32 num_en for (i = 0; i < num_entries; i++) { - prs_grow(ps); sam_io_sam_entry4("", &(sam->sam[i]), ps, depth); } for (i = 0; i < num_entries; i++) { - prs_grow(ps); smb_io_string2("acct_name", &(sam->str[i].acct_name), sam->sam[i].hdr_acct_name.buffer, ps, depth); } @@ -1744,13 +1734,11 @@ static BOOL sam_io_sam_dispinfo_5(char *desc, SAM_DISPINFO_5 *sam, uint32 num_en for (i = 0; i < num_entries; i++) { - prs_grow(ps); sam_io_sam_entry5("", &(sam->sam[i]), ps, depth); } for (i = 0; i < num_entries; i++) { - prs_grow(ps); smb_io_string2("grp_name", &(sam->str[i].grp_name), sam->sam[i].hdr_grp_name.buffer, ps, depth); } @@ -2599,7 +2587,6 @@ BOOL samr_io_r_query_groupmem(char *desc, SAMR_R_QUERY_GROUPMEM *r_u, prs_struc } for (i = 0; i < r_u->num_rids; i++) { - prs_grow(ps); prs_uint32("", ps, depth, &(r_u->rid[i])); } } @@ -2621,7 +2608,6 @@ BOOL samr_io_r_query_groupmem(char *desc, SAMR_R_QUERY_GROUPMEM *r_u, prs_struc } for (i = 0; i < r_u->num_attrs; i++) { - prs_grow(ps); prs_uint32("", ps, depth, &(r_u->attr[i])); } } @@ -2753,7 +2739,6 @@ BOOL samr_io_r_query_usergroups(char *desc, SAMR_R_QUERY_USERGROUPS *r_u, prs_s for (i = 0; i < r_u->num_entries2; i++) { - prs_grow(ps); smb_io_gid("", &(r_u->gid[i]), ps, depth); } } @@ -2903,7 +2888,6 @@ BOOL samr_io_r_enum_domains(char *desc, SAMR_R_ENUM_DOMAINS *r_u, prs_struct *ps { fstring tmp; slprintf(tmp, sizeof(tmp)-1, "dom[%d]", i); - prs_grow(ps); sam_io_sam_entry(tmp, &(r_u->sam[i]), ps, depth); } @@ -2911,7 +2895,6 @@ BOOL samr_io_r_enum_domains(char *desc, SAMR_R_ENUM_DOMAINS *r_u, prs_struct *ps { fstring tmp; slprintf(tmp, sizeof(tmp)-1, "dom[%d]", i); - prs_grow(ps); smb_io_unistr2(tmp, &(r_u->uni_dom_name[i]), r_u->sam[i].hdr_name.buffer, ps, depth); prs_align(ps); } @@ -3066,13 +3049,11 @@ BOOL samr_io_r_enum_dom_groups(char *desc, SAMR_R_ENUM_DOM_GROUPS *r_u, prs_stru for (i = 0; i < r_u->num_entries2; i++) { - prs_grow(ps); sam_io_sam_entry("", &(r_u->sam[i]), ps, depth); } for (i = 0; i < r_u->num_entries2; i++) { - prs_grow(ps); smb_io_unistr2("", &(r_u->uni_grp_name[i]), r_u->sam[i].hdr_name.buffer, ps, depth); prs_align(ps); } @@ -3227,13 +3208,11 @@ BOOL samr_io_r_enum_dom_aliases(char *desc, SAMR_R_ENUM_DOM_ALIASES *r_u, prs_st for (i = 0; i < r_u->num_entries2; i++) { - prs_grow(ps); sam_io_sam_entry("", &(r_u->sam[i]), ps, depth); } for (i = 0; i < r_u->num_entries2; i++) { - prs_grow(ps); smb_io_unistr2("", &(r_u->uni_grp_name[i]), r_u->sam[i].hdr_name.buffer, ps, depth); prs_align(ps); } @@ -3528,7 +3507,6 @@ BOOL samr_io_q_query_useraliases(char *desc, SAMR_Q_QUERY_USERALIASES *q_u, prs { if (q_u->ptr_sid[i] != 0) { - prs_grow(ps); slprintf(tmp, sizeof(tmp)-1, "sid[%02d]", i); smb_io_dom_sid2(tmp, &(q_u->sid[i]), ps, depth); } @@ -3767,7 +3745,6 @@ BOOL samr_io_q_lookup_rids(char *desc, SAMR_Q_LOOKUP_RIDS *q_u, prs_struct *ps, for (i = 0; i < q_u->num_rids2; i++) { - prs_grow(ps); slprintf(tmp, sizeof(tmp) - 1, "rid[%02d] ", i); prs_uint32(tmp, ps, depth, &(q_u->rid[i])); } @@ -3902,13 +3879,11 @@ BOOL samr_io_r_lookup_rids(char *desc, SAMR_R_LOOKUP_RIDS *r_u, prs_struct *ps, } for (i = 0; i < r_u->num_names2; i++) { - prs_grow(ps); slprintf(tmp, sizeof(tmp) - 1, "hdr[%02d] ", i); smb_io_unihdr ("", &(r_u->hdr_name[i]), ps, depth); } for (i = 0; i < r_u->num_names2; i++) { - prs_grow(ps); slprintf(tmp, sizeof(tmp) - 1, "str[%02d] ", i); smb_io_unistr2("", &(r_u->uni_name[i]), r_u->hdr_name[i].buffer, ps, depth); prs_align(ps); @@ -3940,7 +3915,6 @@ BOOL samr_io_r_lookup_rids(char *desc, SAMR_R_LOOKUP_RIDS *r_u, prs_struct *ps, for (i = 0; i < r_u->num_types2; i++) { - prs_grow(ps); slprintf(tmp, sizeof(tmp) - 1, "type[%02d] ", i); prs_uint32(tmp, ps, depth, &(r_u->type[i])); } @@ -4375,13 +4349,11 @@ BOOL samr_io_r_query_aliasmem(char *desc, SAMR_R_QUERY_ALIASMEM *r_u, prs_struc for (i = 0; i < r_u->num_sids1; i++) { - prs_grow(ps); ptr_sid[i] = 1; prs_uint32("", ps, depth, &(ptr_sid[i])); } for (i = 0; i < r_u->num_sids1; i++) { - prs_grow(ps); if (ptr_sid[i] != 0) { smb_io_dom_sid2("", &(r_u->sid[i]), ps, depth); @@ -4450,12 +4422,10 @@ BOOL samr_io_q_lookup_names(char *desc, SAMR_Q_LOOKUP_NAMES *q_u, prs_struct *p for (i = 0; i < q_u->num_names2; i++) { - prs_grow(ps); smb_io_unihdr ("", &(q_u->hdr_name[i]), ps, depth); } for (i = 0; i < q_u->num_names2; i++) { - prs_grow(ps); smb_io_unistr2("", &(q_u->uni_name[i]), q_u->hdr_name[i].buffer, ps, depth); prs_align(ps); } @@ -4541,7 +4511,6 @@ BOOL samr_io_r_lookup_names(char *desc, SAMR_R_LOOKUP_NAMES *r_u, prs_struct *p for (i = 0; i < r_u->num_rids2; i++) { - prs_grow(ps); slprintf(tmp, sizeof(tmp) - 1, "rid[%02d] ", i); prs_uint32(tmp, ps, depth, &(r_u->rid[i])); } @@ -4562,7 +4531,6 @@ BOOL samr_io_r_lookup_names(char *desc, SAMR_R_LOOKUP_NAMES *r_u, prs_struct *p for (i = 0; i < r_u->num_types2; i++) { - prs_grow(ps); slprintf(tmp, sizeof(tmp) - 1, "type[%02d] ", i); prs_uint32(tmp, ps, depth, &(r_u->type[i])); } @@ -6289,13 +6257,11 @@ BOOL samr_io_q_chgpasswd_user(char *desc, SAMR_Q_CHGPASSWD_USER *q_u, prs_struct prs_align(ps); samr_io_enc_passwd("nt_newpass", &(q_u->nt_newpass), ps, depth); - prs_grow(ps); samr_io_enc_hash ("nt_oldhash", &(q_u->nt_oldhash), ps, depth); prs_uint32("unknown", ps, depth, &(q_u->unknown)); samr_io_enc_passwd("lm_newpass", &(q_u->lm_newpass), ps, depth); - prs_grow(ps); samr_io_enc_hash ("lm_oldhash", &(q_u->lm_oldhash), ps, depth); return True; diff --git a/source3/rpc_parse/parse_spoolss.c b/source3/rpc_parse/parse_spoolss.c index d5490553a2..b28b2dcc75 100644 --- a/source3/rpc_parse/parse_spoolss.c +++ b/source3/rpc_parse/parse_spoolss.c @@ -376,14 +376,12 @@ static BOOL smb_io_notify_info(char *desc, SPOOL_NOTIFY_INFO *info, for (i=0;i<info->count;i++) { - prs_grow(ps); smb_io_notify_info_data(desc, &(info->data[i]), ps, depth); } /* now do the strings at the end of the stream */ for (i=0;i<info->count;i++) { - prs_grow(ps); smb_io_notify_info_data_strings(desc, &(info->data[i]), ps, depth); } diff --git a/source3/rpc_parse/parse_srv.c b/source3/rpc_parse/parse_srv.c index 8ad275229e..63d27c8c91 100644 --- a/source3/rpc_parse/parse_srv.c +++ b/source3/rpc_parse/parse_srv.c @@ -129,13 +129,11 @@ static BOOL srv_io_srv_share_info_1(char *desc, SRV_SHARE_INFO_1 *ctr, prs_stru for (i = 0; i < num_entries; i++) { - prs_grow(ps); srv_io_share_info1("", &(ctr->info_1[i]), ps, depth); } for (i = 0; i < num_entries; i++) { - prs_grow(ps); srv_io_share_info1_str("", &(ctr->info_1_str[i]), ps, depth); } @@ -267,13 +265,11 @@ static BOOL srv_io_srv_share_info_2(char *desc, SRV_SHARE_INFO_2 *ctr, prs_stru for (i = 0; i < num_entries; i++) { - prs_grow(ps); if (!srv_io_share_info2("", &(ctr->info_2[i]), ps, depth)) return False; } for (i = 0; i < num_entries; i++) { - prs_grow(ps); if (!srv_io_share_info2_str("", &(ctr->info_2_str[i]), &(ctr->info_2[i]), ps, depth)) return False; } @@ -499,13 +495,11 @@ static BOOL srv_io_srv_sess_info_0(char *desc, SRV_SESS_INFO_0 *ss0, prs_struct for (i = 0; i < num_entries; i++) { - prs_grow(ps); srv_io_sess_info0("", &(ss0->info_0[i]), ps, depth); } for (i = 0; i < num_entries; i++) { - prs_grow(ps); srv_io_sess_info0_str("", &(ss0->info_0_str[i]), &(ss0->info_0[i]), ps, depth); @@ -628,13 +622,11 @@ static BOOL srv_io_srv_sess_info_1(char *desc, SRV_SESS_INFO_1 *ss1, prs_struct for (i = 0; i < num_entries; i++) { - prs_grow(ps); srv_io_sess_info1("", &(ss1->info_1[i]), ps, depth); } for (i = 0; i < num_entries; i++) { - prs_grow(ps); srv_io_sess_info1_str("", &(ss1->info_1_str[i]), &(ss1->info_1[i]), ps, depth); @@ -839,7 +831,6 @@ static BOOL srv_io_srv_conn_info_0(char *desc, SRV_CONN_INFO_0 *ss0, prs_struct for (i = 0; i < num_entries; i++) { - prs_grow(ps); srv_io_conn_info0("", &(ss0->info_0[i]), ps, depth); } @@ -959,13 +950,11 @@ static BOOL srv_io_srv_conn_info_1(char *desc, SRV_CONN_INFO_1 *ss1, prs_struct for (i = 0; i < num_entries; i++) { - prs_grow(ps); srv_io_conn_info1("", &(ss1->info_1[i]), ps, depth); } for (i = 0; i < num_entries; i++) { - prs_grow(ps); srv_io_conn_info1_str("", &(ss1->info_1_str[i]), &(ss1->info_1[i]), ps, depth); @@ -1228,13 +1217,11 @@ static BOOL srv_io_srv_tprt_info_0(char *desc, SRV_TPRT_INFO_0 *tp0, prs_struct for (i = 0; i < num_entries; i++) { - prs_grow(ps); srv_io_tprt_info0("", &(tp0->info_0[i]), ps, depth); } for (i = 0; i < num_entries; i++) { - prs_grow(ps); srv_io_tprt_info0_str("", &(tp0->info_0_str[i]), &(tp0->info_0[i]), ps, depth); @@ -1511,13 +1498,11 @@ static BOOL srv_io_srv_file_info_3(char *desc, SRV_FILE_INFO_3 *fl3, prs_struct for (i = 0; i < num_entries; i++) { - prs_grow(ps); srv_io_file_info3("", &(fl3->info_3[i]), ps, depth); } for (i = 0; i < num_entries; i++) { - prs_grow(ps); srv_io_file_info3_str("", &(fl3->info_3_str[i]), ps, depth); } |