summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/lib/charcnv.c2
-rw-r--r--source3/rpc_parse/parse_sec.c43
2 files changed, 25 insertions, 20 deletions
diff --git a/source3/lib/charcnv.c b/source3/lib/charcnv.c
index a6db286134..d42dc994b0 100644
--- a/source3/lib/charcnv.c
+++ b/source3/lib/charcnv.c
@@ -143,7 +143,7 @@ size_t convert_string(charset_t from, charset_t to,
switch(errno)
{ case EINVAL: reason="Incomplete multibyte sequence"; break;
case E2BIG: reason="No more room";
- DEBUG(0, ("Required %d, available %d\n",
+ DEBUG(0, ("convert_string: Required %d, available %d\n",
srclen, destlen));
/* we are not sure we need srclen bytes,
may be more, may be less.
diff --git a/source3/rpc_parse/parse_sec.c b/source3/rpc_parse/parse_sec.c
index 8ae8264d6d..56eaf4c5b5 100644
--- a/source3/rpc_parse/parse_sec.c
+++ b/source3/rpc_parse/parse_sec.c
@@ -782,64 +782,69 @@ BOOL sec_io_desc(char *desc, SEC_DESC **ppsd, prs_struct *ps, int depth)
if (psd->off_owner_sid != 0) {
+ tmp_offset = ps->data_offset;
+ if(!prs_set_offset(ps, old_offset + psd->off_owner_sid))
+ return False;
+
if (UNMARSHALLING(ps)) {
- if(!prs_set_offset(ps, old_offset + psd->off_owner_sid))
- return False;
/* reading */
if((psd->owner_sid = (DOM_SID *)prs_alloc_mem(ps,sizeof(*psd->owner_sid))) == NULL)
return False;
}
- tmp_offset = ps->data_offset;
- ps->data_offset = psd->off_owner_sid;
-
if(!smb_io_dom_sid("owner_sid ", psd->owner_sid , ps, depth))
return False;
- ps->data_offset = tmp_offset;
- }
+ max_offset = MAX(max_offset, prs_offset(ps));
- max_offset = MAX(max_offset, prs_offset(ps));
+ if (!prs_set_offset(ps,tmp_offset))
+ return False;
+ }
if (psd->off_grp_sid != 0) {
+ tmp_offset = ps->data_offset;
+ if(!prs_set_offset(ps, old_offset + psd->off_grp_sid))
+ return False;
+
if (UNMARSHALLING(ps)) {
/* reading */
- if(!prs_set_offset(ps, old_offset + psd->off_grp_sid))
- return False;
if((psd->grp_sid = (DOM_SID *)prs_alloc_mem(ps,sizeof(*psd->grp_sid))) == NULL)
return False;
}
- tmp_offset = ps->data_offset;
- ps->data_offset = psd->off_grp_sid;
-
if(!smb_io_dom_sid("grp_sid", psd->grp_sid, ps, depth))
return False;
- ps->data_offset = tmp_offset;
- }
+ max_offset = MAX(max_offset, prs_offset(ps));
- max_offset = MAX(max_offset, prs_offset(ps));
+ if (!prs_set_offset(ps,tmp_offset))
+ return False;
+ }
if ((psd->type & SEC_DESC_SACL_PRESENT) && psd->off_sacl) {
+ tmp_offset = ps->data_offset;
if(!prs_set_offset(ps, old_offset + psd->off_sacl))
return False;
if(!sec_io_acl("sacl", &psd->sacl, ps, depth))
return False;
+ max_offset = MAX(max_offset, prs_offset(ps));
+ if (!prs_set_offset(ps,tmp_offset))
+ return False;
}
- max_offset = MAX(max_offset, prs_offset(ps));
if ((psd->type & SEC_DESC_DACL_PRESENT) && psd->off_dacl != 0) {
+ tmp_offset = ps->data_offset;
if(!prs_set_offset(ps, old_offset + psd->off_dacl))
return False;
if(!sec_io_acl("dacl", &psd->dacl, ps, depth))
return False;
+ max_offset = MAX(max_offset, prs_offset(ps));
+ if (!prs_set_offset(ps,tmp_offset))
+ return False;
}
- max_offset = MAX(max_offset, prs_offset(ps));
-
if(!prs_set_offset(ps, max_offset))
return False;
return True;