summaryrefslogtreecommitdiff
path: root/source3/rpc_parse
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2006-09-23 18:24:03 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:01:04 -0500
commitb9b964a360b3319a2170bf3ed8ca94190195a691 (patch)
treec50faea9b6886f6560b744f923e16530ed733b1c /source3/rpc_parse
parent35a852150198e057b7e8a6463db16443d9ff2e40 (diff)
downloadsamba-b9b964a360b3319a2170bf3ed8ca94190195a691.tar.gz
samba-b9b964a360b3319a2170bf3ed8ca94190195a691.tar.bz2
samba-b9b964a360b3319a2170bf3ed8ca94190195a691.zip
r18846: Fix the same bug Volker noticed when marshalling/unmarshalling
SEC_ACE. "type" is also an enum that may be any size. Treat as a uint8. Jeremy. (This used to be commit fd97f48ba38cb6a737302dac5cf23239ce7059cc)
Diffstat (limited to 'source3/rpc_parse')
-rw-r--r--source3/rpc_parse/parse_sec.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/source3/rpc_parse/parse_sec.c b/source3/rpc_parse/parse_sec.c
index be789b2ef5..bc33062264 100644
--- a/source3/rpc_parse/parse_sec.c
+++ b/source3/rpc_parse/parse_sec.c
@@ -53,6 +53,7 @@ BOOL sec_io_ace(const char *desc, SEC_ACE *psa, prs_struct *ps, int depth)
{
uint32 old_offset;
uint32 offset_ace_size;
+ uint8 type;
if (psa == NULL)
return False;
@@ -62,9 +63,17 @@ BOOL sec_io_ace(const char *desc, SEC_ACE *psa, prs_struct *ps, int depth)
old_offset = prs_offset(ps);
- if(!prs_uint8("type ", ps, depth, (uint8*)&psa->type))
+ if (MARSHALLING(ps)) {
+ type = (uint8)psa->type;
+ }
+
+ if(!prs_uint8("type ", ps, depth, &type))
return False;
+ if (UNMARSHALLING(ps)) {
+ psa->type = (enum security_ace_type)type;
+ }
+
if(!prs_uint8("flags", ps, depth, &psa->flags))
return False;