diff options
author | Gerald Carter <jerry@samba.org> | 2002-06-24 23:04:41 +0000 |
---|---|---|
committer | Gerald Carter <jerry@samba.org> | 2002-06-24 23:04:41 +0000 |
commit | 9d6301dfe0e3001086251e3014be772ae63e4dd1 (patch) | |
tree | d0ebbe68bc9d7095817e74a3709bb1b97c76a1b8 /source3/rpc_parse | |
parent | 96c00daefa18c756b8e7a6163a29b39841bda105 (diff) | |
download | samba-9d6301dfe0e3001086251e3014be772ae63e4dd1.tar.gz samba-9d6301dfe0e3001086251e3014be772ae63e4dd1.tar.bz2 samba-9d6301dfe0e3001086251e3014be772ae63e4dd1.zip |
sync with the sec_desc parsing fix from APP_HEAD. I will probably need
to revisit this some.
(This used to be commit f471c880db8562231f2d6623124d3e9c31559f4c)
Diffstat (limited to 'source3/rpc_parse')
-rw-r--r-- | source3/rpc_parse/parse_sec.c | 27 |
1 files changed, 11 insertions, 16 deletions
diff --git a/source3/rpc_parse/parse_sec.c b/source3/rpc_parse/parse_sec.c index 55e05531cb..07004cda1b 100644 --- a/source3/rpc_parse/parse_sec.c +++ b/source3/rpc_parse/parse_sec.c @@ -365,17 +365,19 @@ size_t sec_desc_size(SEC_DESC *psd) offset = SEC_DESC_HEADER_SIZE; + /* don't align */ + if (psd->owner_sid != NULL) - offset += ((sid_size(psd->owner_sid) + 3) & ~3); + offset += sid_size(psd->owner_sid); if (psd->grp_sid != NULL) - offset += ((sid_size(psd->grp_sid) + 3) & ~3); + offset += sid_size(psd->grp_sid); if (psd->sacl != NULL) - offset += ((psd->sacl->size + 3) & ~3); + offset += psd->sacl->size; if (psd->dacl != NULL) - offset += ((psd->dacl->size + 3) & ~3); + offset += psd->dacl->size; return offset; } @@ -643,7 +645,7 @@ SEC_DESC *make_sec_desc(TALLOC_CTX *ctx, uint16 revision, if (offset == 0) offset = SEC_DESC_HEADER_SIZE; - offset += ((sid_size(dst->owner_sid) + 3) & ~3); + offset += sid_size(dst->owner_sid); } if (dst->grp_sid != NULL) { @@ -651,7 +653,7 @@ SEC_DESC *make_sec_desc(TALLOC_CTX *ctx, uint16 revision, if (offset == 0) offset = SEC_DESC_HEADER_SIZE; - offset += ((sid_size(dst->grp_sid) + 3) & ~3); + offset += sid_size(dst->grp_sid); } if (dst->sacl != NULL) { @@ -659,7 +661,7 @@ SEC_DESC *make_sec_desc(TALLOC_CTX *ctx, uint16 revision, offset_acl = SEC_DESC_HEADER_SIZE; dst->off_sacl = offset_acl; - offset_acl += ((dst->sacl->size + 3) & ~3); + offset_acl += dst->sacl->size; offset += dst->sacl->size; offset_sid += dst->sacl->size; } @@ -670,7 +672,7 @@ SEC_DESC *make_sec_desc(TALLOC_CTX *ctx, uint16 revision, offset_acl = SEC_DESC_HEADER_SIZE; dst->off_dacl = offset_acl; - offset_acl += ((dst->dacl->size + 3) & ~3); + offset_acl += dst->dacl->size; offset += dst->dacl->size; offset_sid += dst->dacl->size; } @@ -752,7 +754,7 @@ BOOL sec_io_desc(char *desc, SEC_DESC **ppsd, prs_struct *ps, int depth) prs_debug(ps, depth, desc, "sec_io_desc"); depth++; -#if 0 /* JERRY */ +#if 0 /* * if alignment is needed, should be done by the the * caller. Not here. This caused me problems when marshalling @@ -823,9 +825,6 @@ BOOL sec_io_desc(char *desc, SEC_DESC **ppsd, prs_struct *ps, int depth) if(!smb_io_dom_sid("grp_sid", psd->grp_sid, ps, depth)) return False; - if(!prs_align(ps)) - return False; - ps->data_offset = tmp_offset; } @@ -836,8 +835,6 @@ BOOL sec_io_desc(char *desc, SEC_DESC **ppsd, prs_struct *ps, int depth) return False; if(!sec_io_acl("sacl", &psd->sacl, ps, depth)) return False; - if(!prs_align(ps)) - return False; } max_offset = MAX(max_offset, prs_offset(ps)); @@ -847,8 +844,6 @@ BOOL sec_io_desc(char *desc, SEC_DESC **ppsd, prs_struct *ps, int depth) return False; if(!sec_io_acl("dacl", &psd->dacl, ps, depth)) return False; - if(!prs_align(ps)) - return False; } max_offset = MAX(max_offset, prs_offset(ps)); |