summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2011-01-05 17:16:46 +0100
committerAndreas Schneider <asn@cryptomilk.org>2011-02-02 12:44:20 +0100
commite3bdfd2d46cb09a42eda1012287bb82af5b8ee9b (patch)
tree850c7215759e545e46e729814db95e377fc4358c /source3/smbd
parent612060d677ac64de1b9261beb2d98496cec2ab46 (diff)
downloadsamba-e3bdfd2d46cb09a42eda1012287bb82af5b8ee9b.tar.gz
samba-e3bdfd2d46cb09a42eda1012287bb82af5b8ee9b.tar.bz2
samba-e3bdfd2d46cb09a42eda1012287bb82af5b8ee9b.zip
s3-smbd: Added a function to setup rpc services.
Move the complete setup of the rpc service to its own file and use callbacks to register at the endpoint mapper.
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/server.c92
1 files changed, 2 insertions, 90 deletions
diff --git a/source3/smbd/server.c b/source3/smbd/server.c
index cd79863506..10e8b62430 100644
--- a/source3/smbd/server.c
+++ b/source3/smbd/server.c
@@ -32,24 +32,7 @@
#include "memcache.h"
#include "ctdbd_conn.h"
#include "printing/printer_list.h"
-
-#include "../librpc/gen_ndr/srv_dfs.h"
-#include "../librpc/gen_ndr/srv_dssetup.h"
-#include "../librpc/gen_ndr/srv_echo.h"
-#include "../librpc/gen_ndr/srv_eventlog.h"
-#include "../librpc/gen_ndr/srv_initshutdown.h"
-#include "../librpc/gen_ndr/srv_lsa.h"
-#include "../librpc/gen_ndr/srv_netlogon.h"
-#include "../librpc/gen_ndr/srv_ntsvcs.h"
-#include "../librpc/gen_ndr/srv_samr.h"
-#include "../librpc/gen_ndr/srv_spoolss.h"
-#include "../librpc/gen_ndr/srv_srvsvc.h"
-#include "../librpc/gen_ndr/srv_svcctl.h"
-#include "../librpc/gen_ndr/srv_winreg.h"
-#include "../librpc/gen_ndr/srv_wkssvc.h"
-#include "../librpc/gen_ndr/srv_epmapper.h"
-
-#include "printing/nt_printing_migrate.h"
+#include "rpc_server/srv_rpc_register.h"
#ifdef WITH_DFS
extern int dcelogin_atmost_once;
@@ -845,20 +828,6 @@ static bool init_structs(void )
return True;
}
-static bool spoolss_init_cb(void *ptr)
-{
- struct messaging_context *msg_ctx = talloc_get_type_abort(
- ptr, struct messaging_context);
- return nt_printing_tdb_migrate(msg_ctx);
-}
-
-static bool spoolss_shutdown_cb(void *ptr)
-{
- srv_spoolss_cleanup();
-
- return true;
-}
-
/****************************************************************************
main program.
****************************************************************************/
@@ -907,7 +876,6 @@ extern void build_options(bool screen);
TALLOC_CTX *frame;
NTSTATUS status;
uint64_t unique_id;
- struct rpc_srv_callbacks spoolss_cb;
/*
* Do this before any other talloc operation
@@ -1225,63 +1193,7 @@ extern void build_options(bool screen);
return -1;
}
- /*
- * Initialize spoolss with an init function to convert printers first.
- * static_init_rpc will try to initialize the spoolss server too but you
- * can't register it twice.
- */
- spoolss_cb.init = spoolss_init_cb;
- spoolss_cb.shutdown = spoolss_shutdown_cb;
- spoolss_cb.private_data = smbd_server_conn->msg_ctx;
-
- /*
- * TODO: Create a dependency tree, so that all services are started
- * in the right order.
- */
- if (!NT_STATUS_IS_OK(rpc_lsarpc_init(NULL))) {
- exit(1);
- }
- if (!NT_STATUS_IS_OK(rpc_samr_init(NULL))) {
- exit(1);
- }
- if (!NT_STATUS_IS_OK(rpc_netlogon_init(NULL))) {
- exit(1);
- }
-
- if (!NT_STATUS_IS_OK(rpc_winreg_init(NULL))) {
- exit(1);
- }
- if (!NT_STATUS_IS_OK(rpc_srvsvc_init(NULL))) {
- exit(1);
- }
-
- if (!NT_STATUS_IS_OK(rpc_spoolss_init(&spoolss_cb))) {
- exit(1);
- }
- if (!NT_STATUS_IS_OK(rpc_svcctl_init(NULL))) {
- exit(1);
- }
- if (!NT_STATUS_IS_OK(rpc_ntsvcs_init(NULL))) {
- exit(1);
- }
- if (!NT_STATUS_IS_OK(rpc_eventlog_init(NULL))) {
- exit(1);
- }
- if (!NT_STATUS_IS_OK(rpc_initshutdown_init(NULL))) {
- exit(1);
- }
- if (!NT_STATUS_IS_OK(rpc_netdfs_init(NULL))) {
- exit(1);
- }
-#ifdef DEVELOPER
- if (!NT_STATUS_IS_OK(rpc_rpcecho_init(NULL))) {
- exit(1);
- }
-#endif
- if (!NT_STATUS_IS_OK(rpc_dssetup_init(NULL))) {
- exit(1);
- }
- if (!NT_STATUS_IS_OK(rpc_wkssvc_init(NULL))) {
+ if (!srv_rpc_register(smbd_server_conn->msg_ctx)) {
exit(1);
}