diff options
author | Gerald Carter <jerry@samba.org> | 2005-09-15 18:35:26 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 11:03:39 -0500 |
commit | 9d7a70f3a4fc1ab51eabb7bdc8f7b89a2f67ddbb (patch) | |
tree | 1a550f1dbcfdf2b2245e955b54944aa5b1c845e3 | |
parent | 0c0bea0b5865918bfa3abb45ef6b16e30e163559 (diff) | |
download | samba-9d7a70f3a4fc1ab51eabb7bdc8f7b89a2f67ddbb.tar.gz samba-9d7a70f3a4fc1ab51eabb7bdc8f7b89a2f67ddbb.tar.bz2 samba-9d7a70f3a4fc1ab51eabb7bdc8f7b89a2f67ddbb.zip |
r10243: fix net rpc shutdown (missing alignments and sending an invalid UNISTR4 for this request)
(This used to be commit cf99e1716dfa880f84abc55062389d03fff05509)
-rw-r--r-- | source3/rpc_parse/parse_reg.c | 12 | ||||
-rw-r--r-- | source3/rpc_parse/parse_shutdown.c | 13 |
2 files changed, 20 insertions, 5 deletions
diff --git a/source3/rpc_parse/parse_reg.c b/source3/rpc_parse/parse_reg.c index 332f38ab26..c9e09b6528 100644 --- a/source3/rpc_parse/parse_reg.c +++ b/source3/rpc_parse/parse_reg.c @@ -1484,8 +1484,10 @@ void init_reg_q_shutdown(REG_Q_SHUTDOWN *q_u, const char *msg, q_u->server = TALLOC_P( get_talloc_ctx(), uint16 ); *q_u->server = 0x1; - q_u->message = TALLOC_P( get_talloc_ctx(), UNISTR4 ); - init_unistr4( q_u->message, msg, UNI_FLAGS_NONE ); + if ( msg && *msg ) { + q_u->message = TALLOC_P( get_talloc_ctx(), UNISTR4 ); + init_unistr4( q_u->message, msg, UNI_FLAGS_NONE ); + } q_u->timeout = timeout; @@ -1535,6 +1537,8 @@ BOOL reg_io_q_shutdown(const char *desc, REG_Q_SHUTDOWN *q_u, prs_struct *ps, if (!prs_pointer("server", ps, depth, (void**)&q_u->server, sizeof(uint16), (PRS_POINTER_CAST)prs_uint16)) return False; + if (!prs_align(ps)) + return False; if (!prs_pointer("message", ps, depth, (void**)&q_u->message, sizeof(UNISTR4), (PRS_POINTER_CAST)prs_unistr4)) return False; @@ -1593,6 +1597,8 @@ BOOL reg_io_q_shutdown_ex(const char *desc, REG_Q_SHUTDOWN_EX *q_u, prs_struct * if (!prs_pointer("server", ps, depth, (void**)&q_u->server, sizeof(uint16), (PRS_POINTER_CAST)prs_uint16)) return False; + if (!prs_align(ps)) + return False; if (!prs_pointer("message", ps, depth, (void**)&q_u->message, sizeof(UNISTR4), (PRS_POINTER_CAST)prs_unistr4)) return False; @@ -1666,6 +1672,8 @@ BOOL reg_io_q_abort_shutdown(const char *desc, REG_Q_ABORT_SHUTDOWN *q_u, if (!prs_pointer("server", ps, depth, (void**)&q_u->server, sizeof(uint16), (PRS_POINTER_CAST)prs_uint16)) return False; + if (!prs_align(ps)) + return False; return True; } diff --git a/source3/rpc_parse/parse_shutdown.c b/source3/rpc_parse/parse_shutdown.c index 00daeaaaee..eaed686012 100644 --- a/source3/rpc_parse/parse_shutdown.c +++ b/source3/rpc_parse/parse_shutdown.c @@ -34,8 +34,10 @@ void init_shutdown_q_init(SHUTDOWN_Q_INIT *q_s, const char *msg, q_s->server = TALLOC_P( get_talloc_ctx(), uint16 ); *q_s->server = 0x1; - q_s->message = TALLOC_P( get_talloc_ctx(), UNISTR4 ); - init_unistr4( q_s->message, msg, UNI_FLAGS_NONE ); + if ( msg && *msg ) { + q_s->message = TALLOC_P( get_talloc_ctx(), UNISTR4 ); + init_unistr4( q_s->message, msg, UNI_FLAGS_NONE ); + } q_s->timeout = timeout; @@ -84,6 +86,8 @@ BOOL shutdown_io_q_init(const char *desc, SHUTDOWN_Q_INIT *q_s, prs_struct *ps, if (!prs_pointer("server", ps, depth, (void**)&q_s->server, sizeof(uint16), (PRS_POINTER_CAST)prs_uint16)) return False; + if (!prs_align(ps)) + return False; if (!prs_pointer("message", ps, depth, (void**)&q_s->message, sizeof(UNISTR4), (PRS_POINTER_CAST)prs_unistr4)) return False; @@ -99,7 +103,6 @@ BOOL shutdown_io_q_init(const char *desc, SHUTDOWN_Q_INIT *q_s, prs_struct *ps, if (!prs_uint8("reboot ", ps, depth, &(q_s->reboot))) return False; - return True; } @@ -142,6 +145,8 @@ BOOL shutdown_io_q_init_ex(const char *desc, SHUTDOWN_Q_INIT_EX * q_s, prs_struc if (!prs_pointer("server", ps, depth, (void**)&q_s->server, sizeof(uint16), (PRS_POINTER_CAST)prs_uint16)) return False; + if (!prs_align(ps)) + return False; if (!prs_pointer("message", ps, depth, (void**)&q_s->message, sizeof(UNISTR4), (PRS_POINTER_CAST)prs_unistr4)) return False; @@ -214,6 +219,8 @@ BOOL shutdown_io_q_abort(const char *desc, SHUTDOWN_Q_ABORT *q_s, if (!prs_pointer("server", ps, depth, (void**)&q_s->server, sizeof(uint16), (PRS_POINTER_CAST)prs_uint16)) return False; + if (!prs_align(ps)) + return False; return True; } |