summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2007-05-31 17:59:04 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:23:02 -0500
commit97a164ba96d48a81d5e24dda6b866a4d78ea1a78 (patch)
treec796745013a8bae5105b17761b6cc9af895030ed /source3
parent1a13bb5112dc51d6d7da801e9a7dd2655f067a6f (diff)
downloadsamba-97a164ba96d48a81d5e24dda6b866a4d78ea1a78.tar.gz
samba-97a164ba96d48a81d5e24dda6b866a4d78ea1a78.tar.bz2
samba-97a164ba96d48a81d5e24dda6b866a4d78ea1a78.zip
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)
Diffstat (limited to 'source3')
-rw-r--r--source3/Makefile.in3
-rw-r--r--source3/configure.in6
-rw-r--r--source3/include/includes.h1
-rw-r--r--source3/include/rpc_eventlog.h12
-rw-r--r--source3/include/rpc_svcctl.h11
-rw-r--r--source3/rpc_parse/parse_eventlog.c39
-rw-r--r--source3/rpc_server/srv_eventlog.c46
-rw-r--r--source3/rpc_server/srv_eventlog_nt.c145
-rw-r--r--source3/rpc_server/srv_pipe.c4
9 files changed, 171 insertions, 96 deletions
diff --git a/source3/Makefile.in b/source3/Makefile.in
index 49005f46e3..5b0587c8b7 100644
--- a/source3/Makefile.in
+++ b/source3/Makefile.in
@@ -395,7 +395,8 @@ RPC_DFS_OBJ = librpc/gen_ndr/srv_dfs.o rpc_server/srv_dfs_nt.o
RPC_SPOOLSS_OBJ = rpc_server/srv_spoolss.o rpc_server/srv_spoolss_nt.o
-RPC_EVENTLOG_OBJ = rpc_server/srv_eventlog.o rpc_server/srv_eventlog_nt.o rpc_server/srv_eventlog_lib.o
+RPC_EVENTLOG_OBJ = rpc_server/srv_eventlog.o rpc_server/srv_eventlog_nt.o \
+ rpc_server/srv_eventlog_lib.o librpc/gen_ndr/srv_eventlog.o
RPC_PIPE_OBJ = rpc_server/srv_pipe_hnd.o \
rpc_server/srv_pipe.o rpc_server/srv_lsa_hnd.o
diff --git a/source3/configure.in b/source3/configure.in
index cdf34d9fff..63e343f43f 100644
--- a/source3/configure.in
+++ b/source3/configure.in
@@ -692,7 +692,7 @@ AC_SUBST(DYNEXP)
dnl Add modules that have to be built by default here
dnl These have to be built static:
-default_static_modules="pdb_smbpasswd pdb_tdbsam rpc_lsa rpc_samr rpc_winreg rpc_initshutdown rpc_lsa_ds rpc_wkssvc rpc_svcctl rpc_ntsvcs rpc_net rpc_netdfs rpc_srvsvc rpc_spoolss rpc_eventlog rpc_unixinfo rpc_epmapper auth_sam auth_unix auth_winbind auth_server auth_domain auth_builtin vfs_default nss_info_template"
+default_static_modules="pdb_smbpasswd pdb_tdbsam rpc_lsa rpc_samr rpc_winreg rpc_initshutdown rpc_lsa_ds rpc_wkssvc rpc_svcctl2 rpc_ntsvcs rpc_net rpc_netdfs rpc_srvsvc rpc_spoolss rpc_eventlog2 rpc_unixinfo rpc_epmapper auth_sam auth_unix auth_winbind auth_server auth_domain auth_builtin vfs_default nss_info_template"
dnl These are preferably build shared, and static if dlopen() is not available
default_shared_modules="vfs_recycle vfs_audit vfs_extd_audit vfs_full_audit vfs_netatalk vfs_fake_perms vfs_default_quota vfs_readonly vfs_cap vfs_expand_msdfs vfs_shadow_copy charset_CP850 charset_CP437 auth_script vfs_readahead"
@@ -6277,13 +6277,13 @@ SMB_MODULE(rpc_winreg, \$(RPC_REG_OBJ), "bin/librpc_winreg.$SHLIBEXT", RPC)
SMB_MODULE(rpc_initshutdown, \$(RPC_INITSHUTDOWN_OBJ), "bin/librpc_initshutdown.$SHLIBEXT", RPC)
SMB_MODULE(rpc_lsa_ds, \$(RPC_LSA_DS_OBJ), "bin/librpc_lsa_ds.$SHLIBEXT", RPC)
SMB_MODULE(rpc_wkssvc, \$(RPC_WKS_OBJ), "bin/librpc_wkssvc.$SHLIBEXT", RPC)
-SMB_MODULE(rpc_svcctl, \$(RPC_SVCCTL_OBJ), "bin/librpc_svcctl.$SHLIBEXT", RPC)
+SMB_MODULE(rpc_svcctl2, \$(RPC_SVCCTL_OBJ), "bin/librpc_svcctl2.$SHLIBEXT", RPC)
SMB_MODULE(rpc_ntsvcs, \$(RPC_NTSVCS_OBJ), "bin/librpc_ntsvcs.$SHLIBEXT", RPC)
SMB_MODULE(rpc_net, \$(RPC_NETLOG_OBJ), "bin/librpc_NETLOGON.$SHLIBEXT", RPC)
SMB_MODULE(rpc_netdfs, \$(RPC_DFS_OBJ), "bin/librpc_netdfs.$SHLIBEXT", RPC)
SMB_MODULE(rpc_srvsvc, \$(RPC_SVC_OBJ), "bin/librpc_srvsvc.$SHLIBEXT", RPC)
SMB_MODULE(rpc_spoolss, \$(RPC_SPOOLSS_OBJ), "bin/librpc_spoolss.$SHLIBEXT", RPC)
-SMB_MODULE(rpc_eventlog, \$(RPC_EVENTLOG_OBJ), "bin/librpc_eventlog.$SHLIBEXT", RPC)
+SMB_MODULE(rpc_eventlog2, \$(RPC_EVENTLOG_OBJ), "bin/librpc_eventlog2.$SHLIBEXT", RPC)
SMB_MODULE(rpc_samr, \$(RPC_SAMR_OBJ), "bin/librpc_samr.$SHLIBEXT", RPC)
SMB_MODULE(rpc_rpcecho, \$(RPC_ECHO_OBJ), "bin/librpc_echo.$SHLIBEXT", RPC)
SMB_MODULE(rpc_unixinfo, \$(RPC_UNIXINFO_OBJ), "bin/librpc_unixinfo.$SHLIBEXT", RPC)
diff --git a/source3/include/includes.h b/source3/include/includes.h
index e3e24eff07..d1cd27585e 100644
--- a/source3/include/includes.h
+++ b/source3/include/includes.h
@@ -782,6 +782,7 @@ enum flush_reason_enum {
#include "librpc/gen_ndr/srv_echo.h"
#include "librpc/gen_ndr/srv_svcctl.h"
#include "librpc/gen_ndr/srv_lsa.h"
+#include "librpc/gen_ndr/srv_eventlog.h"
/***** automatically generated prototypes *****/
#ifndef NO_PROTO_H
diff --git a/source3/include/rpc_eventlog.h b/source3/include/rpc_eventlog.h
index 94a5915292..547568e93b 100644
--- a/source3/include/rpc_eventlog.h
+++ b/source3/include/rpc_eventlog.h
@@ -84,18 +84,6 @@ typedef struct {
typedef struct {
POLICY_HND handle;
-} EVENTLOG_Q_CLOSE_EVENTLOG;
-
-typedef struct {
- POLICY_HND handle;
- NTSTATUS status;
-} EVENTLOG_R_CLOSE_EVENTLOG;
-
-
-/***********************************/
-
-typedef struct {
- POLICY_HND handle;
} EVENTLOG_Q_GET_NUM_RECORDS;
typedef struct {
diff --git a/source3/include/rpc_svcctl.h b/source3/include/rpc_svcctl.h
index 8ca5e1772b..f4bf509f7c 100644
--- a/source3/include/rpc_svcctl.h
+++ b/source3/include/rpc_svcctl.h
@@ -202,17 +202,6 @@ typedef struct _ServiceInfo {
/**************************/
typedef struct {
- POLICY_HND handle;
-} SVCCTL_Q_CLOSE_SERVICE;
-
-typedef struct {
- POLICY_HND handle;
- WERROR status;
-} SVCCTL_R_CLOSE_SERVICE;
-
-/**************************/
-
-typedef struct {
UNISTR2 *servername;
UNISTR2 *database;
uint32 access;
diff --git a/source3/rpc_parse/parse_eventlog.c b/source3/rpc_parse/parse_eventlog.c
index 436f35aff6..2c2ce12acb 100644
--- a/source3/rpc_parse/parse_eventlog.c
+++ b/source3/rpc_parse/parse_eventlog.c
@@ -174,45 +174,6 @@ BOOL eventlog_io_r_get_oldest_entry(const char *desc, EVENTLOG_R_GET_OLDEST_ENTR
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,
prs_struct *ps, int depth)
{
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);
diff --git a/source3/rpc_server/srv_eventlog_nt.c b/source3/rpc_server/srv_eventlog_nt.c
index 753772642a..85990055dd 100644
--- a/source3/rpc_server/srv_eventlog_nt.c
+++ b/source3/rpc_server/srv_eventlog_nt.c
@@ -658,11 +658,9 @@ NTSTATUS _eventlog_clear_eventlog( pipes_struct * p,
/********************************************************************
********************************************************************/
-NTSTATUS _eventlog_close_eventlog( pipes_struct * p,
- EVENTLOG_Q_CLOSE_EVENTLOG * q_u,
- EVENTLOG_R_CLOSE_EVENTLOG * r_u )
+NTSTATUS _eventlog_CloseEventLog( pipes_struct * p, struct eventlog_CloseEventLog *r )
{
- return elog_close( p, &q_u->handle );
+ return elog_close( p, r->in.handle );
}
/********************************************************************
@@ -801,3 +799,142 @@ NTSTATUS _eventlog_get_num_records( pipes_struct * p,
return NT_STATUS_OK;
}
+
+NTSTATUS _eventlog_ClearEventLogW(pipes_struct *p, struct eventlog_ClearEventLogW *r)
+{
+ p->rng_fault_state = True;
+ return NT_STATUS_NOT_IMPLEMENTED;
+}
+
+NTSTATUS _eventlog_BackupEventLogW(pipes_struct *p, struct eventlog_BackupEventLogW *r)
+{
+ p->rng_fault_state = True;
+ return NT_STATUS_NOT_IMPLEMENTED;
+}
+
+NTSTATUS _eventlog_DeregisterEventSource(pipes_struct *p, struct eventlog_DeregisterEventSource *r)
+{
+ p->rng_fault_state = True;
+ return NT_STATUS_NOT_IMPLEMENTED;
+}
+
+NTSTATUS _eventlog_GetNumRecords(pipes_struct *p, struct eventlog_GetNumRecords *r)
+{
+ p->rng_fault_state = True;
+ return NT_STATUS_NOT_IMPLEMENTED;
+}
+
+NTSTATUS _eventlog_GetOldestRecord(pipes_struct *p, struct eventlog_GetOldestRecord *r)
+{
+ p->rng_fault_state = True;
+ return NT_STATUS_NOT_IMPLEMENTED;
+}
+
+NTSTATUS _eventlog_ChangeNotify(pipes_struct *p, struct eventlog_ChangeNotify *r)
+{
+ p->rng_fault_state = True;
+ return NT_STATUS_NOT_IMPLEMENTED;
+}
+
+NTSTATUS _eventlog_OpenEventLogW(pipes_struct *p, struct eventlog_OpenEventLogW *r)
+{
+ p->rng_fault_state = True;
+ return NT_STATUS_NOT_IMPLEMENTED;
+}
+
+NTSTATUS _eventlog_RegisterEventSourceW(pipes_struct *p, struct eventlog_RegisterEventSourceW *r)
+{
+ p->rng_fault_state = True;
+ return NT_STATUS_NOT_IMPLEMENTED;
+}
+
+NTSTATUS _eventlog_OpenBackupEventLogW(pipes_struct *p, struct eventlog_OpenBackupEventLogW *r)
+{
+ p->rng_fault_state = True;
+ return NT_STATUS_NOT_IMPLEMENTED;
+}
+
+NTSTATUS _eventlog_ReadEventLogW(pipes_struct *p, struct eventlog_ReadEventLogW *r)
+{
+ p->rng_fault_state = True;
+ return NT_STATUS_NOT_IMPLEMENTED;
+}
+
+NTSTATUS _eventlog_ReportEventW(pipes_struct *p, struct eventlog_ReportEventW *r)
+{
+ p->rng_fault_state = True;
+ return NT_STATUS_NOT_IMPLEMENTED;
+}
+
+NTSTATUS _eventlog_ClearEventLogA(pipes_struct *p, struct eventlog_ClearEventLogA *r)
+{
+ p->rng_fault_state = True;
+ return NT_STATUS_NOT_IMPLEMENTED;
+}
+
+NTSTATUS _eventlog_BackupEventLogA(pipes_struct *p, struct eventlog_BackupEventLogA *r)
+{
+ p->rng_fault_state = True;
+ return NT_STATUS_NOT_IMPLEMENTED;
+}
+
+NTSTATUS _eventlog_OpenEventLogA(pipes_struct *p, struct eventlog_OpenEventLogA *r)
+{
+ p->rng_fault_state = True;
+ return NT_STATUS_NOT_IMPLEMENTED;
+}
+
+NTSTATUS _eventlog_RegisterEventSourceA(pipes_struct *p, struct eventlog_RegisterEventSourceA *r)
+{
+ p->rng_fault_state = True;
+ return NT_STATUS_NOT_IMPLEMENTED;
+}
+
+NTSTATUS _eventlog_OpenBackupEventLogA(pipes_struct *p, struct eventlog_OpenBackupEventLogA *r)
+{
+ p->rng_fault_state = True;
+ return NT_STATUS_NOT_IMPLEMENTED;
+}
+
+NTSTATUS _eventlog_ReadEventLogA(pipes_struct *p, struct eventlog_ReadEventLogA *r)
+{
+ p->rng_fault_state = True;
+ return NT_STATUS_NOT_IMPLEMENTED;
+}
+
+NTSTATUS _eventlog_ReportEventA(pipes_struct *p, struct eventlog_ReportEventA *r)
+{
+ p->rng_fault_state = True;
+ return NT_STATUS_NOT_IMPLEMENTED;
+}
+
+NTSTATUS _eventlog_RegisterClusterSvc(pipes_struct *p, struct eventlog_RegisterClusterSvc *r)
+{
+ p->rng_fault_state = True;
+ return NT_STATUS_NOT_IMPLEMENTED;
+}
+
+NTSTATUS _eventlog_DeregisterClusterSvc(pipes_struct *p, struct eventlog_DeregisterClusterSvc *r)
+{
+ p->rng_fault_state = True;
+ return NT_STATUS_NOT_IMPLEMENTED;
+}
+
+NTSTATUS _eventlog_WriteClusterEvents(pipes_struct *p, struct eventlog_WriteClusterEvents *r)
+{
+ p->rng_fault_state = True;
+ return NT_STATUS_NOT_IMPLEMENTED;
+}
+
+NTSTATUS _eventlog_GetLogIntormation(pipes_struct *p, struct eventlog_GetLogIntormation *r)
+{
+ p->rng_fault_state = True;
+ return NT_STATUS_NOT_IMPLEMENTED;
+}
+
+NTSTATUS _eventlog_FlushEventLog(pipes_struct *p, struct eventlog_FlushEventLog *r)
+{
+ p->rng_fault_state = True;
+ return NT_STATUS_NOT_IMPLEMENTED;
+}
+
diff --git a/source3/rpc_server/srv_pipe.c b/source3/rpc_server/srv_pipe.c
index 83c059d36c..8aab80db72 100644
--- a/source3/rpc_server/srv_pipe.c
+++ b/source3/rpc_server/srv_pipe.c
@@ -2380,10 +2380,10 @@ void get_pipe_fns( int idx, struct api_struct **fns, int *n_fns )
netdfs_get_pipe_fns( &cmds, &n_cmds );
break;
case PI_SVCCTL:
- svcctl_get_pipe_fns( &cmds, &n_cmds );
+ svcctl2_get_pipe_fns( &cmds, &n_cmds );
break;
case PI_EVENTLOG:
- eventlog_get_pipe_fns( &cmds, &n_cmds );
+ eventlog2_get_pipe_fns( &cmds, &n_cmds );
break;
case PI_UNIXINFO:
unixinfo_get_pipe_fns( &cmds, &n_cmds );