From 5d1cb8e79edea9e8581d3c2c9dd297310cd9a98c Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Wed, 23 Mar 2005 23:26:33 +0000 Subject: r6014: rather large change set.... pulling back all recent rpc changes from trunk into 3.0. I've tested a compile and so don't think I've missed any files. But if so, just mail me and I'll clean backup in a couple of hours. Changes include \winreg, \eventlog, \svcctl, and general parse_misc.c updates. I am planning on bracketing the event code with an #ifdef ENABLE_EVENTLOG until I finish merging Marcin's changes (very soon). (This used to be commit 4e0ac63c36527cd8c52ef720cae17e84f67e7221) --- source3/rpc_server/srv_eventlog.c | 206 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 206 insertions(+) create mode 100644 source3/rpc_server/srv_eventlog.c (limited to 'source3/rpc_server/srv_eventlog.c') diff --git a/source3/rpc_server/srv_eventlog.c b/source3/rpc_server/srv_eventlog.c new file mode 100644 index 0000000000..07aebcd2fa --- /dev/null +++ b/source3/rpc_server/srv_eventlog.c @@ -0,0 +1,206 @@ +/* + * Unix SMB/CIFS implementation. + * RPC Pipe client / server routines + * Copyright (C) Marcin Krzysztof Porwit 2005. + * + * 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 + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * 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. + */ + +#include "includes.h" + +#undef DBGC_CLASS +#define DBGC_CLASS DBGC_RPC_SRV + +static BOOL api_eventlog_open_eventlog(pipes_struct *p) +{ + EVENTLOG_Q_OPEN_EVENTLOG q_u; + EVENTLOG_R_OPEN_EVENTLOG r_u; + + prs_struct *data = &p->in_data.data; + prs_struct *rdata = &p->out_data.rdata; + + ZERO_STRUCT(q_u); + ZERO_STRUCT(r_u); + + if (!(eventlog_io_q_open_eventlog("", &q_u, data, 0))) { + DEBUG(0, ("eventlog_io_q_open_eventlog: unable to unmarshall EVENTLOG_Q_OPEN_EVENTLOG.\n")); + return False; + } + + r_u.status = _eventlog_open_eventlog(p, &q_u, &r_u); + + if (!(eventlog_io_r_open_eventlog("", &r_u, rdata, 0))) { + DEBUG(0, ("eventlog_io_r_open_eventlog: unable to marshall EVENTLOG_R_OPEN_EVENTLOG.\n")); + return False; + } + + return True; +} + +static BOOL api_eventlog_close_eventlog(pipes_struct *p) +{ + EVENTLOG_Q_CLOSE_EVENTLOG q_u; + EVENTLOG_R_CLOSE_EVENTLOG r_u; + + prs_struct *data = &p->in_data.data; + prs_struct *rdata = &p->out_data.rdata; + + ZERO_STRUCT(q_u); + ZERO_STRUCT(r_u); + + if (!(eventlog_io_q_close_eventlog("", &q_u, data, 0))) { + DEBUG(0, ("eventlog_io_q_close_eventlog: unable to unmarshall EVENTLOG_Q_CLOSE_EVENTLOG.\n")); + return False; + } + + r_u.status = _eventlog_close_eventlog(p, &q_u, &r_u); + + if (!(eventlog_io_r_close_eventlog("", &r_u, rdata, 0))) { + DEBUG(0, ("eventlog_io_r_close_eventlog: unable to marshall EVENTLOG_R_CLOSE_EVENTLOG.\n")); + return False; + } + + return True; +} + +static BOOL api_eventlog_get_num_records(pipes_struct *p) +{ + EVENTLOG_Q_GET_NUM_RECORDS q_u; + EVENTLOG_R_GET_NUM_RECORDS r_u; + + prs_struct *data = &p->in_data.data; + prs_struct *rdata = &p->out_data.rdata; + + ZERO_STRUCT(q_u); + ZERO_STRUCT(r_u); + + if (!(eventlog_io_q_get_num_records("", &q_u, data, 0))) { + DEBUG(0, ("eventlog_io_q_get_num_records: unable to unmarshall EVENTLOG_Q_GET_NUM_RECORDS.\n")); + return False; + } + + r_u.status = _eventlog_get_num_records(p, &q_u, &r_u); + + if (!(eventlog_io_r_get_num_records("", &r_u, rdata, 0))) { + DEBUG(0, ("eventlog_io_r_get_num_records: unable to marshall EVENTLOG_R_GET_NUM_RECORDS.\n")); + return False; + } + + return True; +} + +static BOOL api_eventlog_get_oldest_entry(pipes_struct *p) +{ + EVENTLOG_Q_GET_OLDEST_ENTRY q_u; + EVENTLOG_R_GET_OLDEST_ENTRY r_u; + + prs_struct *data = &p->in_data.data; + prs_struct *rdata = &p->out_data.rdata; + + ZERO_STRUCT(q_u); + ZERO_STRUCT(r_u); + + if (!(eventlog_io_q_get_oldest_entry("", &q_u, data, 0))) { + DEBUG(0, ("eventlog_io_q_get_oldest_entry: unable to unmarshall EVENTLOG_Q_GET_OLDEST_ENTRY.\n")); + return False; + } + + r_u.status = _eventlog_get_oldest_entry(p, &q_u, &r_u); + + if (!(eventlog_io_r_get_oldest_entry("", &r_u, rdata, 0))) { + DEBUG(0, ("eventlog_io_r_get_oldest_entry: unable to marshall EVENTLOG_R_GET_OLDEST_ENTRY.\n")); + return False; + } + + return True; +} + +static BOOL api_eventlog_read_eventlog(pipes_struct *p) +{ + EVENTLOG_Q_READ_EVENTLOG q_u; + EVENTLOG_R_READ_EVENTLOG r_u; + + prs_struct *data = &p->in_data.data; + prs_struct *rdata = &p->out_data.rdata; + + ZERO_STRUCT(q_u); + ZERO_STRUCT(r_u); + + if (!(eventlog_io_q_read_eventlog("", &q_u, data, 0))) { + DEBUG(0, ("eventlog_io_q_read_eventlog: unable to unmarshall EVENTLOG_Q_READ_EVENTLOG.\n")); + return False; + } + + r_u.status = _eventlog_read_eventlog(p, &q_u, &r_u); + + if (!(eventlog_io_r_read_eventlog("", &q_u, &r_u, rdata, 0))) { + DEBUG(0, ("eventlog_io_r_read_eventlog: unable to marshall EVENTLOG_R_READ_EVENTLOG.\n")); + return False; + } + + return True; +} + +static BOOL api_eventlog_clear_eventlog(pipes_struct *p) +{ + EVENTLOG_Q_CLEAR_EVENTLOG q_u; + EVENTLOG_R_CLEAR_EVENTLOG r_u; + + prs_struct *data = &p->in_data.data; + prs_struct *rdata = &p->out_data.rdata; + + ZERO_STRUCT(q_u); + ZERO_STRUCT(r_u); + + if (!(eventlog_io_q_clear_eventlog("", &q_u, data, 0))) { + DEBUG(0, ("eventlog_io_q_clear_eventlog: unable to unmarshall EVENTLOG_Q_CLEAR_EVENTLOG.\n")); + return False; + } + + r_u.status = _eventlog_clear_eventlog(p, &q_u, &r_u); + + if (!(eventlog_io_r_clear_eventlog("", &r_u, rdata, 0))) { + DEBUG(0, ("eventlog_io_q_clear_eventlog: unable to marshall EVENTLOG_Q_CLEAR_EVENTLOG.\n")); + return False; + } + + return True; +} + +/* + \pipe\eventlog commands +*/ +struct api_struct api_eventlog_cmds[] = +{ + {"EVENTLOG_OPENEVENTLOG", EVENTLOG_OPENEVENTLOG, api_eventlog_open_eventlog }, + {"EVENTLOG_CLOSEVENTLOG", EVENTLOG_CLOSEEVENTLOG, api_eventlog_close_eventlog }, + {"EVENTLOG_GETNUMRECORDS", EVENTLOG_GETNUMRECORDS, api_eventlog_get_num_records }, + {"EVENTLOG_GETOLDESTENTRY", EVENTLOG_GETOLDESTENTRY, api_eventlog_get_oldest_entry }, + {"EVENTLOG_READEVENTLOG", EVENTLOG_READEVENTLOG, api_eventlog_read_eventlog }, + {"EVENTLOG_CLEAREVENTLOG", EVENTLOG_CLEAREVENTLOG, api_eventlog_clear_eventlog } +}; + +NTSTATUS rpc_eventlog_init(void) +{ + return rpc_pipe_register_commands(SMB_RPC_INTERFACE_VERSION, + "eventlog", "eventlog", api_eventlog_cmds, + sizeof(api_eventlog_cmds)/sizeof(struct api_struct)); +} + +void eventlog_get_pipe_fns(struct api_struct **fns, int *n_fns) +{ + *fns = api_eventlog_cmds; + *n_fns = sizeof(api_eventlog_cmds) / sizeof(struct api_struct); +} -- cgit From 8387af752f81e26f1c141f6053bf6d106f0af5eb Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Fri, 24 Jun 2005 15:49:02 +0000 Subject: r7880: fix a typo and memleak on failures cases (patch from marcin) (This used to be commit 6ff0fa0b4385481f2212047d80ca17b55d996def) --- source3/rpc_server/srv_eventlog.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/rpc_server/srv_eventlog.c') diff --git a/source3/rpc_server/srv_eventlog.c b/source3/rpc_server/srv_eventlog.c index 07aebcd2fa..65b10e8fe4 100644 --- a/source3/rpc_server/srv_eventlog.c +++ b/source3/rpc_server/srv_eventlog.c @@ -185,7 +185,7 @@ static BOOL api_eventlog_clear_eventlog(pipes_struct *p) struct api_struct api_eventlog_cmds[] = { {"EVENTLOG_OPENEVENTLOG", EVENTLOG_OPENEVENTLOG, api_eventlog_open_eventlog }, - {"EVENTLOG_CLOSEVENTLOG", EVENTLOG_CLOSEEVENTLOG, api_eventlog_close_eventlog }, + {"EVENTLOG_CLOSEEVENTLOG", EVENTLOG_CLOSEEVENTLOG, api_eventlog_close_eventlog }, {"EVENTLOG_GETNUMRECORDS", EVENTLOG_GETNUMRECORDS, api_eventlog_get_num_records }, {"EVENTLOG_GETOLDESTENTRY", EVENTLOG_GETOLDESTENTRY, api_eventlog_get_oldest_entry }, {"EVENTLOG_READEVENTLOG", EVENTLOG_READEVENTLOG, api_eventlog_read_eventlog }, -- cgit From 54abd2aa66069e6baf7769c496f46d9dba18db39 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Fri, 30 Sep 2005 17:13:37 +0000 Subject: r10656: BIG merge from trunk. Features not copied over * \PIPE\unixinfo * winbindd's {group,alias}membership new functions * winbindd's lookupsids() functionality * swat (trunk changes to be reverted as per discussion with Deryck) (This used to be commit 939c3cb5d78e3a2236209b296aa8aba8bdce32d3) --- source3/rpc_server/srv_eventlog.c | 6 ------ 1 file changed, 6 deletions(-) (limited to 'source3/rpc_server/srv_eventlog.c') diff --git a/source3/rpc_server/srv_eventlog.c b/source3/rpc_server/srv_eventlog.c index 65b10e8fe4..ae15d43f4b 100644 --- a/source3/rpc_server/srv_eventlog.c +++ b/source3/rpc_server/srv_eventlog.c @@ -27,7 +27,6 @@ static BOOL api_eventlog_open_eventlog(pipes_struct *p) { EVENTLOG_Q_OPEN_EVENTLOG q_u; EVENTLOG_R_OPEN_EVENTLOG r_u; - prs_struct *data = &p->in_data.data; prs_struct *rdata = &p->out_data.rdata; @@ -53,7 +52,6 @@ static BOOL api_eventlog_close_eventlog(pipes_struct *p) { EVENTLOG_Q_CLOSE_EVENTLOG q_u; EVENTLOG_R_CLOSE_EVENTLOG r_u; - prs_struct *data = &p->in_data.data; prs_struct *rdata = &p->out_data.rdata; @@ -79,7 +77,6 @@ static BOOL api_eventlog_get_num_records(pipes_struct *p) { EVENTLOG_Q_GET_NUM_RECORDS q_u; EVENTLOG_R_GET_NUM_RECORDS r_u; - prs_struct *data = &p->in_data.data; prs_struct *rdata = &p->out_data.rdata; @@ -105,7 +102,6 @@ static BOOL api_eventlog_get_oldest_entry(pipes_struct *p) { EVENTLOG_Q_GET_OLDEST_ENTRY q_u; EVENTLOG_R_GET_OLDEST_ENTRY r_u; - prs_struct *data = &p->in_data.data; prs_struct *rdata = &p->out_data.rdata; @@ -131,7 +127,6 @@ static BOOL api_eventlog_read_eventlog(pipes_struct *p) { EVENTLOG_Q_READ_EVENTLOG q_u; EVENTLOG_R_READ_EVENTLOG r_u; - prs_struct *data = &p->in_data.data; prs_struct *rdata = &p->out_data.rdata; @@ -157,7 +152,6 @@ static BOOL api_eventlog_clear_eventlog(pipes_struct *p) { EVENTLOG_Q_CLEAR_EVENTLOG q_u; EVENTLOG_R_CLEAR_EVENTLOG r_u; - prs_struct *data = &p->in_data.data; prs_struct *rdata = &p->out_data.rdata; -- cgit From 97a164ba96d48a81d5e24dda6b866a4d78ea1a78 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Thu, 31 May 2007 17:59:04 +0000 Subject: r23274: merge CloseEventlog() pidl conversion from 3.0.26 && fix a few init call renames for svcctl in the previous commit (This used to be commit ebcae48ec10fefa74efcc3563cff50e3b9c2388c) --- source3/rpc_server/srv_eventlog.c | 46 +++++++++++++++++++-------------------- 1 file changed, 22 insertions(+), 24 deletions(-) (limited to 'source3/rpc_server/srv_eventlog.c') diff --git a/source3/rpc_server/srv_eventlog.c b/source3/rpc_server/srv_eventlog.c index ae15d43f4b..1492e67109 100644 --- a/source3/rpc_server/srv_eventlog.c +++ b/source3/rpc_server/srv_eventlog.c @@ -1,7 +1,8 @@ /* * Unix SMB/CIFS implementation. * RPC Pipe client / server routines - * Copyright (C) Marcin Krzysztof Porwit 2005. + * Copyright (C) Marcin Krzysztof Porwit 2005. + * Copyright (C) Gerald Carter 2005 - 2007 * * 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 @@ -23,6 +24,23 @@ #undef DBGC_CLASS #define DBGC_CLASS DBGC_RPC_SRV +static BOOL proxy_eventlog_call(pipes_struct *p, uint8 opnum) +{ + struct api_struct *fns; + int n_fns; + + eventlog_get_pipe_fns(&fns, &n_fns); + + if (opnum >= n_fns) + return False; + + if (fns[opnum].opnum != opnum) { + smb_panic("EVENTLOG function table not sorted\n"); + } + + return fns[opnum].fn(p); +} + static BOOL api_eventlog_open_eventlog(pipes_struct *p) { EVENTLOG_Q_OPEN_EVENTLOG q_u; @@ -50,27 +68,7 @@ static BOOL api_eventlog_open_eventlog(pipes_struct *p) static BOOL api_eventlog_close_eventlog(pipes_struct *p) { - EVENTLOG_Q_CLOSE_EVENTLOG q_u; - EVENTLOG_R_CLOSE_EVENTLOG r_u; - prs_struct *data = &p->in_data.data; - prs_struct *rdata = &p->out_data.rdata; - - ZERO_STRUCT(q_u); - ZERO_STRUCT(r_u); - - if (!(eventlog_io_q_close_eventlog("", &q_u, data, 0))) { - DEBUG(0, ("eventlog_io_q_close_eventlog: unable to unmarshall EVENTLOG_Q_CLOSE_EVENTLOG.\n")); - return False; - } - - r_u.status = _eventlog_close_eventlog(p, &q_u, &r_u); - - if (!(eventlog_io_r_close_eventlog("", &r_u, rdata, 0))) { - DEBUG(0, ("eventlog_io_r_close_eventlog: unable to marshall EVENTLOG_R_CLOSE_EVENTLOG.\n")); - return False; - } - - return True; + return proxy_eventlog_call( p, DCERPC_EVENTLOG_CLOSEEVENTLOG ); } static BOOL api_eventlog_get_num_records(pipes_struct *p) @@ -186,14 +184,14 @@ struct api_struct api_eventlog_cmds[] = {"EVENTLOG_CLEAREVENTLOG", EVENTLOG_CLEAREVENTLOG, api_eventlog_clear_eventlog } }; -NTSTATUS rpc_eventlog_init(void) +NTSTATUS rpc_eventlog2_init(void) { return rpc_pipe_register_commands(SMB_RPC_INTERFACE_VERSION, "eventlog", "eventlog", api_eventlog_cmds, sizeof(api_eventlog_cmds)/sizeof(struct api_struct)); } -void eventlog_get_pipe_fns(struct api_struct **fns, int *n_fns) +void eventlog2_get_pipe_fns(struct api_struct **fns, int *n_fns) { *fns = api_eventlog_cmds; *n_fns = sizeof(api_eventlog_cmds) / sizeof(struct api_struct); -- cgit From d824b98f80ba186030cbb70b3a1e5daf80469ecd Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 9 Jul 2007 19:25:36 +0000 Subject: r23779: Change from v2 or later to v3 or later. Jeremy. (This used to be commit 407e6e695b8366369b7c76af1ff76869b45347b3) --- source3/rpc_server/srv_eventlog.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/rpc_server/srv_eventlog.c') diff --git a/source3/rpc_server/srv_eventlog.c b/source3/rpc_server/srv_eventlog.c index 1492e67109..a1acf1f25f 100644 --- a/source3/rpc_server/srv_eventlog.c +++ b/source3/rpc_server/srv_eventlog.c @@ -6,7 +6,7 @@ * * 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, -- cgit From 153cfb9c83534b09f15cc16205d7adb19b394928 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 10 Jul 2007 05:23:25 +0000 Subject: r23801: The FSF has moved around a lot. This fixes their Mass Ave address. (This used to be commit 87c91e4362c51819032bfbebbb273c52e203b227) --- source3/rpc_server/srv_eventlog.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'source3/rpc_server/srv_eventlog.c') diff --git a/source3/rpc_server/srv_eventlog.c b/source3/rpc_server/srv_eventlog.c index a1acf1f25f..34914dc9d2 100644 --- a/source3/rpc_server/srv_eventlog.c +++ b/source3/rpc_server/srv_eventlog.c @@ -15,8 +15,7 @@ * 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 . */ #include "includes.h" -- cgit From 8da26d3f96ac66e3f0be8aaec209867d3f285e49 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Sun, 19 Aug 2007 22:10:11 +0000 Subject: r24561: merge from SAMBA_4_0: rename some DCERPC_ prefixes into NDR_ metze (This used to be commit 8f07b8ab658ae3d63487ca5fb20065318cdd9d0e) --- source3/rpc_server/srv_eventlog.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/rpc_server/srv_eventlog.c') diff --git a/source3/rpc_server/srv_eventlog.c b/source3/rpc_server/srv_eventlog.c index 34914dc9d2..fcba6a1268 100644 --- a/source3/rpc_server/srv_eventlog.c +++ b/source3/rpc_server/srv_eventlog.c @@ -67,7 +67,7 @@ static BOOL api_eventlog_open_eventlog(pipes_struct *p) static BOOL api_eventlog_close_eventlog(pipes_struct *p) { - return proxy_eventlog_call( p, DCERPC_EVENTLOG_CLOSEEVENTLOG ); + return proxy_eventlog_call( p, NDR_EVENTLOG_CLOSEEVENTLOG ); } static BOOL api_eventlog_get_num_records(pipes_struct *p) -- cgit From 30191d1a5704ad2b158386b511558972d539ce47 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 18 Oct 2007 17:40:25 -0700 Subject: RIP BOOL. Convert BOOL -> bool. I found a few interesting bugs in various places whilst doing this (places that assumed BOOL == int). I also need to fix the Samba4 pidl generation (next checkin). Jeremy. (This used to be commit f35a266b3cbb3e5fa6a86be60f34fe340a3ca71f) --- source3/rpc_server/srv_eventlog.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'source3/rpc_server/srv_eventlog.c') diff --git a/source3/rpc_server/srv_eventlog.c b/source3/rpc_server/srv_eventlog.c index fcba6a1268..516ea134f2 100644 --- a/source3/rpc_server/srv_eventlog.c +++ b/source3/rpc_server/srv_eventlog.c @@ -23,7 +23,7 @@ #undef DBGC_CLASS #define DBGC_CLASS DBGC_RPC_SRV -static BOOL proxy_eventlog_call(pipes_struct *p, uint8 opnum) +static bool proxy_eventlog_call(pipes_struct *p, uint8 opnum) { struct api_struct *fns; int n_fns; @@ -40,7 +40,7 @@ static BOOL proxy_eventlog_call(pipes_struct *p, uint8 opnum) return fns[opnum].fn(p); } -static BOOL api_eventlog_open_eventlog(pipes_struct *p) +static bool api_eventlog_open_eventlog(pipes_struct *p) { EVENTLOG_Q_OPEN_EVENTLOG q_u; EVENTLOG_R_OPEN_EVENTLOG r_u; @@ -65,12 +65,12 @@ static BOOL api_eventlog_open_eventlog(pipes_struct *p) return True; } -static BOOL api_eventlog_close_eventlog(pipes_struct *p) +static bool api_eventlog_close_eventlog(pipes_struct *p) { return proxy_eventlog_call( p, NDR_EVENTLOG_CLOSEEVENTLOG ); } -static BOOL api_eventlog_get_num_records(pipes_struct *p) +static bool api_eventlog_get_num_records(pipes_struct *p) { EVENTLOG_Q_GET_NUM_RECORDS q_u; EVENTLOG_R_GET_NUM_RECORDS r_u; @@ -95,7 +95,7 @@ static BOOL api_eventlog_get_num_records(pipes_struct *p) return True; } -static BOOL api_eventlog_get_oldest_entry(pipes_struct *p) +static bool api_eventlog_get_oldest_entry(pipes_struct *p) { EVENTLOG_Q_GET_OLDEST_ENTRY q_u; EVENTLOG_R_GET_OLDEST_ENTRY r_u; @@ -120,7 +120,7 @@ static BOOL api_eventlog_get_oldest_entry(pipes_struct *p) return True; } -static BOOL api_eventlog_read_eventlog(pipes_struct *p) +static bool api_eventlog_read_eventlog(pipes_struct *p) { EVENTLOG_Q_READ_EVENTLOG q_u; EVENTLOG_R_READ_EVENTLOG r_u; @@ -145,7 +145,7 @@ static BOOL api_eventlog_read_eventlog(pipes_struct *p) return True; } -static BOOL api_eventlog_clear_eventlog(pipes_struct *p) +static bool api_eventlog_clear_eventlog(pipes_struct *p) { EVENTLOG_Q_CLEAR_EVENTLOG q_u; EVENTLOG_R_CLEAR_EVENTLOG r_u; -- cgit From 72d0deddc46a12363f930596e1823105caad5f24 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Mon, 4 Feb 2008 10:10:12 +0100 Subject: Use pidl for _eventlog_GetNumRecords(). Guenther (This used to be commit af30a6373e7d85df4bb99e153588498938ddc368) --- source3/rpc_server/srv_eventlog.c | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) (limited to 'source3/rpc_server/srv_eventlog.c') diff --git a/source3/rpc_server/srv_eventlog.c b/source3/rpc_server/srv_eventlog.c index 516ea134f2..96261b5635 100644 --- a/source3/rpc_server/srv_eventlog.c +++ b/source3/rpc_server/srv_eventlog.c @@ -72,27 +72,7 @@ static bool api_eventlog_close_eventlog(pipes_struct *p) static bool api_eventlog_get_num_records(pipes_struct *p) { - EVENTLOG_Q_GET_NUM_RECORDS q_u; - EVENTLOG_R_GET_NUM_RECORDS r_u; - prs_struct *data = &p->in_data.data; - prs_struct *rdata = &p->out_data.rdata; - - ZERO_STRUCT(q_u); - ZERO_STRUCT(r_u); - - if (!(eventlog_io_q_get_num_records("", &q_u, data, 0))) { - DEBUG(0, ("eventlog_io_q_get_num_records: unable to unmarshall EVENTLOG_Q_GET_NUM_RECORDS.\n")); - return False; - } - - r_u.status = _eventlog_get_num_records(p, &q_u, &r_u); - - if (!(eventlog_io_r_get_num_records("", &r_u, rdata, 0))) { - DEBUG(0, ("eventlog_io_r_get_num_records: unable to marshall EVENTLOG_R_GET_NUM_RECORDS.\n")); - return False; - } - - return True; + return proxy_eventlog_call(p, NDR_EVENTLOG_GETNUMRECORDS); } static bool api_eventlog_get_oldest_entry(pipes_struct *p) -- cgit From 8d20f3f9995219ed9459b6c96a2c1285a2b9c204 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Mon, 4 Feb 2008 10:44:51 +0100 Subject: Use pidl for _eventlog_GetOldestRecord(). Guenther (This used to be commit a6a5d99f5206dc4b94f3d0ecceb5198d66afdf41) --- source3/rpc_server/srv_eventlog.c | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) (limited to 'source3/rpc_server/srv_eventlog.c') diff --git a/source3/rpc_server/srv_eventlog.c b/source3/rpc_server/srv_eventlog.c index 96261b5635..c64f97d9b5 100644 --- a/source3/rpc_server/srv_eventlog.c +++ b/source3/rpc_server/srv_eventlog.c @@ -77,27 +77,7 @@ static bool api_eventlog_get_num_records(pipes_struct *p) static bool api_eventlog_get_oldest_entry(pipes_struct *p) { - EVENTLOG_Q_GET_OLDEST_ENTRY q_u; - EVENTLOG_R_GET_OLDEST_ENTRY r_u; - prs_struct *data = &p->in_data.data; - prs_struct *rdata = &p->out_data.rdata; - - ZERO_STRUCT(q_u); - ZERO_STRUCT(r_u); - - if (!(eventlog_io_q_get_oldest_entry("", &q_u, data, 0))) { - DEBUG(0, ("eventlog_io_q_get_oldest_entry: unable to unmarshall EVENTLOG_Q_GET_OLDEST_ENTRY.\n")); - return False; - } - - r_u.status = _eventlog_get_oldest_entry(p, &q_u, &r_u); - - if (!(eventlog_io_r_get_oldest_entry("", &r_u, rdata, 0))) { - DEBUG(0, ("eventlog_io_r_get_oldest_entry: unable to marshall EVENTLOG_R_GET_OLDEST_ENTRY.\n")); - return False; - } - - return True; + return proxy_eventlog_call(p, NDR_EVENTLOG_GETOLDESTRECORD); } static bool api_eventlog_read_eventlog(pipes_struct *p) -- cgit From 48d2990d8c9bfb0037ee2b5386271398ee1492be Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Mon, 4 Feb 2008 10:53:59 +0100 Subject: Use pidl for _eventlog_ClearEventLogW(). Guenther (This used to be commit 70a4ba798cdd3b4daa01c2f6aa693de34288c8b9) --- source3/rpc_server/srv_eventlog.c | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) (limited to 'source3/rpc_server/srv_eventlog.c') diff --git a/source3/rpc_server/srv_eventlog.c b/source3/rpc_server/srv_eventlog.c index c64f97d9b5..38a9baa80d 100644 --- a/source3/rpc_server/srv_eventlog.c +++ b/source3/rpc_server/srv_eventlog.c @@ -107,27 +107,7 @@ static bool api_eventlog_read_eventlog(pipes_struct *p) static bool api_eventlog_clear_eventlog(pipes_struct *p) { - EVENTLOG_Q_CLEAR_EVENTLOG q_u; - EVENTLOG_R_CLEAR_EVENTLOG r_u; - prs_struct *data = &p->in_data.data; - prs_struct *rdata = &p->out_data.rdata; - - ZERO_STRUCT(q_u); - ZERO_STRUCT(r_u); - - if (!(eventlog_io_q_clear_eventlog("", &q_u, data, 0))) { - DEBUG(0, ("eventlog_io_q_clear_eventlog: unable to unmarshall EVENTLOG_Q_CLEAR_EVENTLOG.\n")); - return False; - } - - r_u.status = _eventlog_clear_eventlog(p, &q_u, &r_u); - - if (!(eventlog_io_r_clear_eventlog("", &r_u, rdata, 0))) { - DEBUG(0, ("eventlog_io_q_clear_eventlog: unable to marshall EVENTLOG_Q_CLEAR_EVENTLOG.\n")); - return False; - } - - return True; + return proxy_eventlog_call(p, NDR_EVENTLOG_CLEAREVENTLOGW); } /* -- cgit From 5ab6d66f13c9c11e4757f8d0a476b94116d74069 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Mon, 4 Feb 2008 11:10:18 +0100 Subject: Use pidl for _eventlog_OpenEventLogW(). Guenther (This used to be commit ef293be6cb95225f10e8062b3089dc1bbe5fd013) --- source3/rpc_server/srv_eventlog.c | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) (limited to 'source3/rpc_server/srv_eventlog.c') diff --git a/source3/rpc_server/srv_eventlog.c b/source3/rpc_server/srv_eventlog.c index 38a9baa80d..5679a6acb6 100644 --- a/source3/rpc_server/srv_eventlog.c +++ b/source3/rpc_server/srv_eventlog.c @@ -42,27 +42,7 @@ static bool proxy_eventlog_call(pipes_struct *p, uint8 opnum) static bool api_eventlog_open_eventlog(pipes_struct *p) { - EVENTLOG_Q_OPEN_EVENTLOG q_u; - EVENTLOG_R_OPEN_EVENTLOG r_u; - prs_struct *data = &p->in_data.data; - prs_struct *rdata = &p->out_data.rdata; - - ZERO_STRUCT(q_u); - ZERO_STRUCT(r_u); - - if (!(eventlog_io_q_open_eventlog("", &q_u, data, 0))) { - DEBUG(0, ("eventlog_io_q_open_eventlog: unable to unmarshall EVENTLOG_Q_OPEN_EVENTLOG.\n")); - return False; - } - - r_u.status = _eventlog_open_eventlog(p, &q_u, &r_u); - - if (!(eventlog_io_r_open_eventlog("", &r_u, rdata, 0))) { - DEBUG(0, ("eventlog_io_r_open_eventlog: unable to marshall EVENTLOG_R_OPEN_EVENTLOG.\n")); - return False; - } - - return True; + return proxy_eventlog_call(p, NDR_EVENTLOG_OPENEVENTLOGW); } static bool api_eventlog_close_eventlog(pipes_struct *p) -- cgit From e0f3ea2cbeb61cb02be85d2b315948985bac27a8 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sat, 12 Jul 2008 23:17:23 +0200 Subject: In api_pipe_bind_req(), check for the iface id, not the pipe name This requires to store the rpc_interface in "struct rpc_table" (This used to be commit 654f8de8497aff29f9b1f1822b6a8e734ff329e0) --- source3/rpc_server/srv_eventlog.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source3/rpc_server/srv_eventlog.c') diff --git a/source3/rpc_server/srv_eventlog.c b/source3/rpc_server/srv_eventlog.c index 5679a6acb6..da761c905e 100644 --- a/source3/rpc_server/srv_eventlog.c +++ b/source3/rpc_server/srv_eventlog.c @@ -106,7 +106,8 @@ struct api_struct api_eventlog_cmds[] = NTSTATUS rpc_eventlog2_init(void) { return rpc_pipe_register_commands(SMB_RPC_INTERFACE_VERSION, - "eventlog", "eventlog", api_eventlog_cmds, + "eventlog", "eventlog", &ndr_table_eventlog.syntax_id, + api_eventlog_cmds, sizeof(api_eventlog_cmds)/sizeof(struct api_struct)); } -- cgit