summaryrefslogtreecommitdiff
path: root/source3/rpc_parse
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2005-04-05 17:49:16 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:56:29 -0500
commitb4c720412978c0a49e11846c7cfe553d055cca1f (patch)
tree116877fbe698b0a9babb1faacab28d1b83bc1225 /source3/rpc_parse
parent78355805efb1e8e3ef9a5073841275ffa80da77a (diff)
downloadsamba-b4c720412978c0a49e11846c7cfe553d055cca1f.tar.gz
samba-b4c720412978c0a49e11846c7cfe553d055cca1f.tar.bz2
samba-b4c720412978c0a49e11846c7cfe553d055cca1f.zip
r6218: * fix a segv in EnumPrinters():rpc_buffer_alloc when the caller does not provide an
RPC_BUFFER in the request * add initial (but wire untested) support for RegRestoreKey() (This used to be commit 22855c7aae940cc4082c231a470f612b8fc6fa0d)
Diffstat (limited to 'source3/rpc_parse')
-rw-r--r--source3/rpc_parse/parse_buffer.c5
-rw-r--r--source3/rpc_parse/parse_reg.c48
2 files changed, 53 insertions, 0 deletions
diff --git a/source3/rpc_parse/parse_buffer.c b/source3/rpc_parse/parse_buffer.c
index ea72df8db4..a48d5cfa98 100644
--- a/source3/rpc_parse/parse_buffer.c
+++ b/source3/rpc_parse/parse_buffer.c
@@ -134,6 +134,11 @@ BOOL rpcbuf_alloc_size(RPC_BUFFER *buffer, uint32 buffer_size)
uint32 extra_space;
uint32 old_offset;
+ /* if we don't need anything. don't do anything */
+
+ if ( buffer_size == 0x0 )
+ return True;
+
ps= &buffer->prs;
/* damn, I'm doing the reverse operation of prs_grow() :) */
diff --git a/source3/rpc_parse/parse_reg.c b/source3/rpc_parse/parse_reg.c
index fabffd2b6d..09e19bf701 100644
--- a/source3/rpc_parse/parse_reg.c
+++ b/source3/rpc_parse/parse_reg.c
@@ -572,6 +572,54 @@ BOOL reg_io_r_getversion(const char *desc, REG_R_GETVERSION *r_u, prs_struct *p
reads or writes a structure.
********************************************************************/
+BOOL reg_io_q_restore_key(const char *desc, REG_Q_RESTORE_KEY *q_u, prs_struct *ps, int depth)
+{
+ if ( !q_u )
+ return False;
+
+ prs_debug(ps, depth, desc, "reg_io_q_restore_key");
+ depth++;
+
+ if(!prs_align(ps))
+ return False;
+
+ if(!smb_io_pol_hnd("", &q_u->pol, ps, depth))
+ return False;
+
+ if(!prs_unistr4("filename", ps, depth, &q_u->filename))
+ return False;
+
+ if(!prs_uint32("flags", ps, depth, &q_u->flags))
+ return False;
+
+ return True;
+}
+
+/*******************************************************************
+reads or writes a structure.
+********************************************************************/
+
+BOOL reg_io_r_restore_key(const char *desc, REG_R_RESTORE_KEY *r_u, prs_struct *ps, int depth)
+{
+ if ( !r_u )
+ return False;
+
+ prs_debug(ps, depth, desc, "reg_io_r_restore_key");
+ depth++;
+
+ if(!prs_align(ps))
+ return False;
+
+ if(!prs_werror("status" , ps, depth, &r_u->status))
+ return False;
+
+ return True;
+}
+
+/*******************************************************************
+reads or writes a structure.
+********************************************************************/
+
BOOL reg_io_q_save_key(const char *desc, REG_Q_SAVE_KEY *q_u, prs_struct *ps, int depth)
{
if ( !q_u )