*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
+ * the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#include "includes.h"
/********************************************************************
********************************************************************/
-BOOL prs_ev_open_unknown0( const char *desc, prs_struct *ps, int depth, EVENTLOG_OPEN_UNKNOWN0 *u )
+bool prs_ev_open_unknown0( const char *desc, prs_struct *ps, int depth, EVENTLOG_OPEN_UNKNOWN0 *u )
{
if ( !u )
return False;
/********************************************************************
********************************************************************/
-BOOL eventlog_io_q_open_eventlog(const char *desc, EVENTLOG_Q_OPEN_EVENTLOG *q_u,
+bool eventlog_io_q_open_eventlog(const char *desc, EVENTLOG_Q_OPEN_EVENTLOG *q_u,
prs_struct *ps, int depth)
{
if(q_u == NULL)
if(!prs_align(ps))
return False;
- if ( !prs_pointer("", ps, depth, (void**)&q_u->unknown0, sizeof(EVENTLOG_OPEN_UNKNOWN0), (PRS_POINTER_CAST)prs_ev_open_unknown0))
+ if ( !prs_pointer("", ps, depth, (void*)&q_u->unknown0, sizeof(EVENTLOG_OPEN_UNKNOWN0), (PRS_POINTER_CAST)prs_ev_open_unknown0))
return False;
if ( !prs_unistr4("logname", ps, depth, &q_u->logname) )
return True;
}
-BOOL eventlog_io_r_open_eventlog(const char *desc, EVENTLOG_R_OPEN_EVENTLOG *r_u,
+bool eventlog_io_r_open_eventlog(const char *desc, EVENTLOG_R_OPEN_EVENTLOG *r_u,
prs_struct *ps, int depth)
{
if(r_u == NULL)
return True;
}
-BOOL eventlog_io_q_get_num_records(const char *desc, EVENTLOG_Q_GET_NUM_RECORDS *q_u,
+bool eventlog_io_q_get_num_records(const char *desc, EVENTLOG_Q_GET_NUM_RECORDS *q_u,
prs_struct *ps, int depth)
{
if(q_u == NULL)
return True;
}
-BOOL eventlog_io_r_get_num_records(const char *desc, EVENTLOG_R_GET_NUM_RECORDS *r_u,
+bool eventlog_io_r_get_num_records(const char *desc, EVENTLOG_R_GET_NUM_RECORDS *r_u,
prs_struct *ps, int depth)
{
if(r_u == NULL)
return True;
}
-BOOL eventlog_io_q_get_oldest_entry(const char *desc, EVENTLOG_Q_GET_OLDEST_ENTRY *q_u,
+bool eventlog_io_q_get_oldest_entry(const char *desc, EVENTLOG_Q_GET_OLDEST_ENTRY *q_u,
prs_struct *ps, int depth)
{
if(q_u == NULL)
return True;
}
-BOOL eventlog_io_r_get_oldest_entry(const char *desc, EVENTLOG_R_GET_OLDEST_ENTRY *r_u,
+bool eventlog_io_r_get_oldest_entry(const char *desc, EVENTLOG_R_GET_OLDEST_ENTRY *r_u,
prs_struct *ps, int depth)
{
if(r_u == NULL)
return True;
}
-BOOL eventlog_io_q_close_eventlog(const char *desc, EVENTLOG_Q_CLOSE_EVENTLOG *q_u,
- prs_struct *ps, int depth)
-{
- if(q_u == NULL)
- return False;
-
- prs_debug(ps, depth, desc, "eventlog_io_q_close_eventlog");
- depth++;
-
- if(!(prs_align(ps)))
- return False;
-
- if(!(smb_io_pol_hnd("log handle", &(q_u->handle), ps, depth)))
- return False;
-
- return True;
-}
-
-BOOL eventlog_io_r_close_eventlog(const char *desc, EVENTLOG_R_CLOSE_EVENTLOG *r_u,
- prs_struct *ps, int depth)
-{
- if(r_u == NULL)
- return False;
-
- prs_debug(ps, depth, desc, "eventlog_io_r_close_eventlog");
- depth++;
-
- if(!(prs_align(ps)))
- return False;
-
- if(!(smb_io_pol_hnd("log handle", &(r_u->handle), ps, depth)))
- return False;
-
- if(!(prs_ntstatus("status code", ps, depth, &r_u->status)))
- return False;
-
- return True;
-}
-
-BOOL eventlog_io_q_read_eventlog(const char *desc, EVENTLOG_Q_READ_EVENTLOG *q_u,
+bool eventlog_io_q_read_eventlog(const char *desc, EVENTLOG_Q_READ_EVENTLOG *q_u,
prs_struct *ps, int depth)
{
if(q_u == NULL)
DWORD sent_size -- sum of EVENTLOGRECORD lengths if records returned, 0 otherwise
DWORD real_size -- 0 if records returned, otherwise length of next record to be returned
WERROR status */
-BOOL eventlog_io_r_read_eventlog(const char *desc,
+bool eventlog_io_r_read_eventlog(const char *desc,
EVENTLOG_Q_READ_EVENTLOG *q_u,
EVENTLOG_R_READ_EVENTLOG *r_u,
prs_struct *ps,
while(entry != NULL && record_written < record_total)
{
- DEBUG(10, ("eventlog_io_r_read_eventlog: writing record [%d] out of [%d].\n", record_written, record_total));
+ DEBUG(11, ("eventlog_io_r_read_eventlog: writing record [%d] out of [%d].\n", record_written, record_total));
/* Encode the actual eventlog record record */
/* Now pad with whitespace until the end of the response buffer */
- r_u->end_of_entries_padding =
- SMB_CALLOC_ARRAY(uint8,
- q_u->max_read_size - r_u->num_bytes_in_resp);
+ if (q_u->max_read_size - r_u->num_bytes_in_resp) {
+ if (!r_u->end_of_entries_padding) {
+ return False;
+ }
- if(!(prs_uint8s(False, "end of entries padding", ps,
- depth, r_u->end_of_entries_padding,
- (q_u->max_read_size - r_u->num_bytes_in_resp))))
- {
- return False;
- }
+ if(!(prs_uint8s(False, "end of entries padding", ps,
+ depth, r_u->end_of_entries_padding,
+ (q_u->max_read_size - r_u->num_bytes_in_resp)))) {
+ free(r_u->end_of_entries_padding);
+ return False;
+ }
- free(r_u->end_of_entries_padding);
+ free(r_u->end_of_entries_padding);
+ }
/* We had better be DWORD aligned here */
I'm not sure where the \?? is coming from, or why the ${CWD} of the client process
would be added in given that the backup file gets written on the server side. */
-BOOL eventlog_io_q_clear_eventlog(const char *desc, EVENTLOG_Q_CLEAR_EVENTLOG *q_u,
+bool eventlog_io_q_clear_eventlog(const char *desc, EVENTLOG_Q_CLEAR_EVENTLOG *q_u,
prs_struct *ps, int depth)
{
if(q_u == NULL)
}
-BOOL eventlog_io_r_clear_eventlog(const char *desc, EVENTLOG_R_CLEAR_EVENTLOG *r_u,
+bool eventlog_io_r_clear_eventlog(const char *desc, EVENTLOG_R_CLEAR_EVENTLOG *r_u,
prs_struct *ps, int depth)
{
if(r_u == NULL)