diff options
author | Jeremy Allison <jra@samba.org> | 2000-06-07 01:49:23 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2000-06-07 01:49:23 +0000 |
commit | 8ef41f31c53e14ad057d883810a1cd2301fede2a (patch) | |
tree | 5daebb8bd8689710fdaaabfed7d46d2f9e1d47f4 /source/rpc_parse/parse_sec.c | |
parent | 34b63896ab1543936d6b9b382ef6727a161b6bf2 (diff) | |
download | samba-8ef41f31c53e14ad057d883810a1cd2301fede2a.tar.gz samba-8ef41f31c53e14ad057d883810a1cd2301fede2a.tar.xz samba-8ef41f31c53e14ad057d883810a1cd2301fede2a.zip |
Fixing get/set of security descriptors.
Removed ugly hack for NT printing.
Fixed up tdb parse stuff memory leaks.
Jeremy.
Diffstat (limited to 'source/rpc_parse/parse_sec.c')
-rw-r--r-- | source/rpc_parse/parse_sec.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/source/rpc_parse/parse_sec.c b/source/rpc_parse/parse_sec.c index 51cf52f706d..25450e0b193 100644 --- a/source/rpc_parse/parse_sec.c +++ b/source/rpc_parse/parse_sec.c @@ -431,11 +431,16 @@ BOOL sec_io_desc(char *desc, SEC_DESC **ppsd, prs_struct *ps, int depth) psd = *ppsd; - if(UNMARSHALLING(ps) && psd == NULL) { - if((psd = (SEC_DESC *)malloc(sizeof(SEC_DESC))) == NULL) - return False; - ZERO_STRUCTP(psd); - *ppsd = psd; + if (psd == NULL) { + if(UNMARSHALLING(ps)) { + if((psd = (SEC_DESC *)malloc(sizeof(SEC_DESC))) == NULL) + return False; + ZERO_STRUCTP(psd); + *ppsd = psd; + } else { + /* Marshalling - just ignore. */ + return True; + } } prs_debug(ps, depth, desc, "sec_io_desc"); @@ -629,7 +634,7 @@ BOOL sec_io_desc_buf(char *desc, SEC_DESC_BUF **ppsdb, prs_struct *ps, int depth old_offset = prs_offset(ps); /* reading, length is non-zero; writing, descriptor is non-NULL */ - if ((psdb->len != 0 || MARSHALLING(ps)) && psdb->sec != NULL) { + if ((UNMARSHALLING(ps) && psdb->len != 0) || (MARSHALLING(ps) && psdb->sec != NULL)) { if(!sec_io_desc("sec ", &psdb->sec, ps, depth)) return False; } |