summaryrefslogtreecommitdiff
path: root/source3/rpc_parse/parse_sec.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2000-06-07 01:49:23 +0000
committerJeremy Allison <jra@samba.org>2000-06-07 01:49:23 +0000
commit0164047afbd082b0003147845a72ca08b4781b81 (patch)
tree97d07fd0749d687d0838efc2464520b7489128ed /source3/rpc_parse/parse_sec.c
parentd253db1b9a10644940650cc802feb2a509adbaed (diff)
downloadsamba-0164047afbd082b0003147845a72ca08b4781b81.tar.gz
samba-0164047afbd082b0003147845a72ca08b4781b81.tar.bz2
samba-0164047afbd082b0003147845a72ca08b4781b81.zip
Fixing get/set of security descriptors.
Removed ugly hack for NT printing. Fixed up tdb parse stuff memory leaks. Jeremy. (This used to be commit 8ef41f31c53e14ad057d883810a1cd2301fede2a)
Diffstat (limited to 'source3/rpc_parse/parse_sec.c')
-rw-r--r--source3/rpc_parse/parse_sec.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/source3/rpc_parse/parse_sec.c b/source3/rpc_parse/parse_sec.c
index 51cf52f706..25450e0b19 100644
--- a/source3/rpc_parse/parse_sec.c
+++ b/source3/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;
}