1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-28 07:21:54 +03:00

r10243: fix net rpc shutdown (missing alignments and sending an invalid UNISTR4 for this request)

This commit is contained in:
Gerald Carter 2005-09-15 18:35:26 +00:00 committed by Gerald (Jerry) Carter
parent e076453cf3
commit cf99e1716d
2 changed files with 20 additions and 5 deletions

View File

@ -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;
}

View File

@ -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;
}