From ef2e26c91b80556af033d3335e55f5dfa6fff31d Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 13 Aug 2003 01:53:07 +0000 Subject: first public release of samba4 code (This used to be commit b0510b5428b3461aeb9bbe3cc95f62fc73e2b97f) --- source4/smbd/process_model.c | 85 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 source4/smbd/process_model.c (limited to 'source4/smbd/process_model.c') diff --git a/source4/smbd/process_model.c b/source4/smbd/process_model.c new file mode 100644 index 0000000000..06127d1364 --- /dev/null +++ b/source4/smbd/process_model.c @@ -0,0 +1,85 @@ +/* + Unix SMB/CIFS implementation. + process model manager - main loop + Copyright (C) Andrew Tridgell 1992-2003 + Copyright (C) James J Myers 2003 + + 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" + + +/* the list of currently registered process models */ +static struct { + const char *name; + struct model_ops *ops; +} *models = NULL; +static int num_models; + +/* + register a process model. + + The 'name' can be later used by other backends to find the operations + structure for this backend. +*/ +BOOL register_process_model(const char *name, struct model_ops *ops) +{ + if (process_model_byname(name) != NULL) { + /* its already registered! */ + DEBUG(2,("process_model '%s' already registered\n", + name)); + return False; + } + + models = Realloc(models, sizeof(models[0]) * (num_models+1)); + if (!models) { + smb_panic("out of memory in register_process_model"); + } + + models[num_models].name = smb_xstrdup(name); + models[num_models].ops = smb_xmemdup(ops, sizeof(*ops)); + + num_models++; + + return True; +} + +/* + return the operations structure for a named backend of the specified type +*/ +struct model_ops *process_model_byname(const char *name) +{ + int i; + + for (i=0;i Date: Mon, 2 Feb 2004 13:43:03 +0000 Subject: - we now specify the object files in the subsystems config.m4 file I plan to convert all objectfile group to use SMB_SUBSYSTEM later I'll add a SMB_BINARY() and SMB_LIBRARY(), then there will be no more need to touch Makefile.in, because all make rules will be autogenerated by configure - convert the PROCESS_MODEL subsystem to this new scheme and move the pthread test to smbd/process_model.m4 - convert the CHARSET subsystem to this new scheme and move the iconv test to lib/iconv.m4 (This used to be commit 2e57ee884ebea194ee79ac20e84e385481b56aa2) --- source4/smbd/process_model.c | 64 ++++++++++++++++++++++++++++++++------------ 1 file changed, 47 insertions(+), 17 deletions(-) (limited to 'source4/smbd/process_model.c') diff --git a/source4/smbd/process_model.c b/source4/smbd/process_model.c index 06127d1364..121b35aba4 100644 --- a/source4/smbd/process_model.c +++ b/source4/smbd/process_model.c @@ -24,7 +24,6 @@ /* the list of currently registered process models */ static struct { - const char *name; struct model_ops *ops; } *models = NULL; static int num_models; @@ -35,13 +34,15 @@ static int num_models; The 'name' can be later used by other backends to find the operations structure for this backend. */ -BOOL register_process_model(const char *name, struct model_ops *ops) +static NTSTATUS register_process_model(void *_ops) { - if (process_model_byname(name) != NULL) { + const struct model_ops *ops = _ops; + + if (process_model_byname(ops->name) != NULL) { /* its already registered! */ - DEBUG(2,("process_model '%s' already registered\n", - name)); - return False; + DEBUG(0,("PROCESS_MODEL '%s' already registered\n", + ops->name)); + return NT_STATUS_OBJECT_NAME_COLLISION; } models = Realloc(models, sizeof(models[0]) * (num_models+1)); @@ -49,23 +50,26 @@ BOOL register_process_model(const char *name, struct model_ops *ops) smb_panic("out of memory in register_process_model"); } - models[num_models].name = smb_xstrdup(name); models[num_models].ops = smb_xmemdup(ops, sizeof(*ops)); + models[num_models].ops->name = smb_xstrdup(ops->name); num_models++; - return True; + DEBUG(3,("PROCESS_MODEL '%s' registered\n", + ops->name)); + + return NT_STATUS_OK; } /* return the operations structure for a named backend of the specified type */ -struct model_ops *process_model_byname(const char *name) +const struct model_ops *process_model_byname(const char *name) { int i; for (i=0;iname, name) == 0) { return models[i].ops; } } @@ -73,13 +77,39 @@ struct model_ops *process_model_byname(const char *name) return NULL; } +/* + return the PROCESS_MODEL module version, and the size of some critical types + This can be used by process model modules to either detect compilation errors, or provide + multiple implementations for different smbd compilation options in one module +*/ +const struct process_model_critical_sizes *process_model_version(void) +{ + static const struct process_model_critical_sizes critical_sizes = { + PROCESS_MODEL_VERSION, + sizeof(struct model_ops), + sizeof(struct server_context), + sizeof(struct event_context), + sizeof(struct fd_event) + }; + + return &critical_sizes; +} -/* initialise the builtin process models */ -void process_model_init(void) +/* + initialise the PROCESS_MODEL subsystem +*/ +BOOL process_model_init(void) { - process_model_standard_init(); - process_model_single_init(); -#ifdef WITH_PTHREADS - process_model_thread_init(); -#endif + NTSTATUS status; + + status = register_subsystem("process_model", register_process_model); + if (!NT_STATUS_IS_OK(status)) { + return False; + } + + /* FIXME: Perhaps panic if a basic process model, such as simple, fails to initialise? */ + static_init_process_model; + + DEBUG(3,("PROCESS subsystem version %d initialised\n", PROCESS_MODEL_VERSION)); + return True; } -- cgit From f89a67e3452b0613f659c4ba26c6ed79843c33de Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 23 Jun 2004 23:44:50 +0000 Subject: r1233: -move smb related code to smb_server/* -move process_model code to smbd/process_model.c -remove some used code metze (This used to be commit 10dd8487290a2876253ce69033e374d23b42e704) --- source4/smbd/process_model.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'source4/smbd/process_model.c') diff --git a/source4/smbd/process_model.c b/source4/smbd/process_model.c index 121b35aba4..1947b37dc3 100644 --- a/source4/smbd/process_model.c +++ b/source4/smbd/process_model.c @@ -21,6 +21,29 @@ #include "includes.h" +/* + setup the events for the chosen process model +*/ +void process_model_startup(struct event_context *events, + const char *model) +{ + const struct model_ops *ops; + + ops = process_model_byname(model); + if (!ops) { + DEBUG(0,("Unknown process model '%s'\n", model)); + exit(-1); + } + + ops->model_startup(); + + /* now setup the listening sockets, adding + event handlers to the events structure */ + open_sockets_smbd(events, ops); + + /* setup any sockets we need to listen on for RPC over TCP */ + open_sockets_rpc(events, ops); +} /* the list of currently registered process models */ static struct { -- cgit From d4ae6ae74d712b74800e360590052d318d2fd101 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Mon, 28 Jun 2004 07:41:15 +0000 Subject: r1277: rename struct server_context to smbsrv_ontext because I need server_context fot the generic server infastructure metze (This used to be commit 0712f9f30797e65362c99423c0cf158a2f539000) --- source4/smbd/process_model.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/smbd/process_model.c') diff --git a/source4/smbd/process_model.c b/source4/smbd/process_model.c index 1947b37dc3..b098e740ca 100644 --- a/source4/smbd/process_model.c +++ b/source4/smbd/process_model.c @@ -110,7 +110,7 @@ const struct process_model_critical_sizes *process_model_version(void) static const struct process_model_critical_sizes critical_sizes = { PROCESS_MODEL_VERSION, sizeof(struct model_ops), - sizeof(struct server_context), + sizeof(struct smbsrv_context), sizeof(struct event_context), sizeof(struct fd_event) }; -- cgit From 118f3edd27f5adacc1da636ed05b33f04999584f Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Tue, 29 Jun 2004 07:40:14 +0000 Subject: r1291: rename struct smbsrv_context to smbsrv_connection because this is the connection state per transport layer (tcp) connection I also moved the substructs directly into smbsrv_connection, because they don't need a struct name and we should allway pass the complete smbsrv_connection struct into functions metze (This used to be commit 60f823f201fcedf5473008e8453a6351e73a92c7) --- source4/smbd/process_model.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/smbd/process_model.c') diff --git a/source4/smbd/process_model.c b/source4/smbd/process_model.c index b098e740ca..16bce3913d 100644 --- a/source4/smbd/process_model.c +++ b/source4/smbd/process_model.c @@ -110,7 +110,7 @@ const struct process_model_critical_sizes *process_model_version(void) static const struct process_model_critical_sizes critical_sizes = { PROCESS_MODEL_VERSION, sizeof(struct model_ops), - sizeof(struct smbsrv_context), + sizeof(struct smbsrv_connection), sizeof(struct event_context), sizeof(struct fd_event) }; -- cgit From fe0706d5d5813edc29c909c4f74c593fb5717190 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Tue, 29 Jun 2004 09:20:18 +0000 Subject: r1292: Add const to the subsystem/module registration code. Add some 'multi init' code, until we get a better set of infrustructure. Andrew Bartlett (This used to be commit 982422b2d286335378531ae9523e74192340af3c) --- source4/smbd/process_model.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/smbd/process_model.c') diff --git a/source4/smbd/process_model.c b/source4/smbd/process_model.c index 16bce3913d..f981b36798 100644 --- a/source4/smbd/process_model.c +++ b/source4/smbd/process_model.c @@ -57,7 +57,7 @@ static int num_models; The 'name' can be later used by other backends to find the operations structure for this backend. */ -static NTSTATUS register_process_model(void *_ops) +static NTSTATUS register_process_model(const void *_ops) { const struct model_ops *ops = _ops; -- cgit From 45a85bdd353418828df8017a9d7eb7c14f6f0cd3 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Tue, 13 Jul 2004 21:04:56 +0000 Subject: r1486: commit the start of the generic server infastructure the idea is to have services as modules (smb, dcerpc, swat, ...) the process_model don't know about the service it self anymore. TODO: - the smbsrv should use the smbsrv_send function - the service subsystem init should be done like for other modules - we need to have a generic socket subsystem, which handle stream, datagram, and virtuell other sockets( e.g. for the ntvfs_ipc module to connect to the dcerpc server , or for smb or dcerpc or whatever to connect to a server wide auth service) - and other fixes... NOTE: process model pthread seems to be broken( but also before this patch!) metze (This used to be commit bbe5e00715ca4013ff0dbc345aa97adc6b5c2458) --- source4/smbd/process_model.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'source4/smbd/process_model.c') diff --git a/source4/smbd/process_model.c b/source4/smbd/process_model.c index f981b36798..0bdb316317 100644 --- a/source4/smbd/process_model.c +++ b/source4/smbd/process_model.c @@ -24,8 +24,7 @@ /* setup the events for the chosen process model */ -void process_model_startup(struct event_context *events, - const char *model) +const struct model_ops *process_model_startup(const char *model) { const struct model_ops *ops; @@ -37,12 +36,7 @@ void process_model_startup(struct event_context *events, ops->model_startup(); - /* now setup the listening sockets, adding - event handlers to the events structure */ - open_sockets_smbd(events, ops); - - /* setup any sockets we need to listen on for RPC over TCP */ - open_sockets_rpc(events, ops); + return ops; } /* the list of currently registered process models */ -- cgit From aa34fcebf8aa0660574a7c6976b33b3f37985e27 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 2 Nov 2004 07:18:24 +0000 Subject: r3466: split out request.h, signing.h, and smb_server.h (This used to be commit 7c4e6ebf05790dd6e29896dd316db0fff613aa4e) --- source4/smbd/process_model.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source4/smbd/process_model.c') diff --git a/source4/smbd/process_model.c b/source4/smbd/process_model.c index 0bdb316317..101a24b694 100644 --- a/source4/smbd/process_model.c +++ b/source4/smbd/process_model.c @@ -20,6 +20,8 @@ */ #include "includes.h" +#include "smb_server/smb_server.h" +#include "smbd/process_model.h" /* setup the events for the chosen process model -- cgit From a99b6219a810a1cd10bd62a6716780602808f0cd Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 2 Nov 2004 12:15:17 +0000 Subject: r3481: split out client.h and events.h (This used to be commit c6f486574470a311e0d336c026103f131451e21e) --- source4/smbd/process_model.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source4/smbd/process_model.c') diff --git a/source4/smbd/process_model.c b/source4/smbd/process_model.c index 101a24b694..3493425774 100644 --- a/source4/smbd/process_model.c +++ b/source4/smbd/process_model.c @@ -20,6 +20,7 @@ */ #include "includes.h" +#include "events.h" #include "smb_server/smb_server.h" #include "smbd/process_model.h" -- cgit From 71db46ea665606384f2be1be708c74c97c9adfb2 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 6 Nov 2004 23:23:15 +0000 Subject: r3586: Fix some of the issues with the module init functions. Both subsystems and modules can now have init functions, which can be specified in .mk files (INIT_FUNCTION = ...) The build system will define : - SUBSYSTEM_init_static_modules that calls the init functions of all statically compiled modules. Failing to load will generate an error which is not fatal - BINARY_init_subsystems that calls the init functions (if defined) for the subsystems the binary depends on This removes the hack with the "static bool Initialised = " and the "lazy_init" functions (This used to be commit 7a8244761bfdfdfb48f8264d76951ebdfbf7bd8a) --- source4/smbd/process_model.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'source4/smbd/process_model.c') diff --git a/source4/smbd/process_model.c b/source4/smbd/process_model.c index 3493425774..69e321e0c2 100644 --- a/source4/smbd/process_model.c +++ b/source4/smbd/process_model.c @@ -118,18 +118,17 @@ const struct process_model_critical_sizes *process_model_version(void) /* initialise the PROCESS_MODEL subsystem */ -BOOL process_model_init(void) +NTSTATUS process_model_init(void) { NTSTATUS status; status = register_subsystem("process_model", register_process_model); if (!NT_STATUS_IS_OK(status)) { - return False; + return status; } - /* FIXME: Perhaps panic if a basic process model, such as simple, fails to initialise? */ - static_init_process_model; + process_model_init_static_modules; DEBUG(3,("PROCESS subsystem version %d initialised\n", PROCESS_MODEL_VERSION)); - return True; + return NT_STATUS_OK; } -- cgit From 31ded4901b4529ad2e49871502cab5ecba71483a Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sun, 14 Nov 2004 22:23:23 +0000 Subject: r3737: - Get rid of the register_subsystem() and register_backend() functions. - Re-disable tdbtool (it was building fine on my Debian box but other machines were having problems) (This used to be commit 0d7bb2c40b7a9ed59df3f8944133ea562697e814) --- source4/smbd/process_model.c | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) (limited to 'source4/smbd/process_model.c') diff --git a/source4/smbd/process_model.c b/source4/smbd/process_model.c index 69e321e0c2..2a3efe2088 100644 --- a/source4/smbd/process_model.c +++ b/source4/smbd/process_model.c @@ -54,7 +54,7 @@ static int num_models; The 'name' can be later used by other backends to find the operations structure for this backend. */ -static NTSTATUS register_process_model(const void *_ops) +NTSTATUS register_process_model(const void *_ops) { const struct model_ops *ops = _ops; @@ -114,21 +114,3 @@ const struct process_model_critical_sizes *process_model_version(void) return &critical_sizes; } - -/* - initialise the PROCESS_MODEL subsystem -*/ -NTSTATUS process_model_init(void) -{ - NTSTATUS status; - - status = register_subsystem("process_model", register_process_model); - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - process_model_init_static_modules; - - DEBUG(3,("PROCESS subsystem version %d initialised\n", PROCESS_MODEL_VERSION)); - return NT_STATUS_OK; -} -- cgit From e5ce904ddbd6175ba86ed827bf096b76b11b5511 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 3 Dec 2004 06:42:06 +0000 Subject: r4054: got rid of Realloc(), replacing it with the type safe macro realloc_p() (This used to be commit b0f6e21481745d1b2ced28d9ed6f09f6ffd99562) --- source4/smbd/process_model.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source4/smbd/process_model.c') diff --git a/source4/smbd/process_model.c b/source4/smbd/process_model.c index 2a3efe2088..ad9a26d377 100644 --- a/source4/smbd/process_model.c +++ b/source4/smbd/process_model.c @@ -43,7 +43,7 @@ const struct model_ops *process_model_startup(const char *model) } /* the list of currently registered process models */ -static struct { +static struct process_model { struct model_ops *ops; } *models = NULL; static int num_models; @@ -65,7 +65,7 @@ NTSTATUS register_process_model(const void *_ops) return NT_STATUS_OBJECT_NAME_COLLISION; } - models = Realloc(models, sizeof(models[0]) * (num_models+1)); + models = realloc_p(models, struct process_model, num_models+1); if (!models) { smb_panic("out of memory in register_process_model"); } -- cgit From 9327ec51d11855ec0ceac3ce1f4e0a75c8b57081 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Fri, 14 Jan 2005 01:32:56 +0000 Subject: r4728: split up server_services into: - stream_socket services the smb, ldap and rpc service which sets up a srtam socket end then waits for connections and - task services which this you can create a seperate task that do something (this is also going through the process_model subsystem so with -M standard a new process for this created with -M thread a new thread ... I'll add datagram services later when we whave support for datagram sockets in lib/socket/ see the next commit as an example for service_task's metze (This used to be commit d5fa02746c6569b09b6e05785642da2fad3ba3e0) --- source4/smbd/process_model.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source4/smbd/process_model.c') diff --git a/source4/smbd/process_model.c b/source4/smbd/process_model.c index ad9a26d377..f2abfd0a49 100644 --- a/source4/smbd/process_model.c +++ b/source4/smbd/process_model.c @@ -27,7 +27,7 @@ /* setup the events for the chosen process model */ -const struct model_ops *process_model_startup(const char *model) +const struct model_ops *process_model_startup(struct server_context *srv_ctx, const char *model) { const struct model_ops *ops; @@ -37,7 +37,7 @@ const struct model_ops *process_model_startup(const char *model) exit(-1); } - ops->model_startup(); + ops->model_init(srv_ctx); return ops; } -- cgit From 55d4d36993293fee914a009f1d8f05810e347f2b Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 30 Jan 2005 00:54:57 +0000 Subject: r5102: This is a major simplification of the logic for controlling top level servers in smbd. The old code still contained a fairly bit of legacy from the time when smbd was only handling SMB connection. The new code gets rid of all of the smb_server specific code in smbd/, and creates a much simpler infrastructures for new server code. Major changes include: - simplified the process model code a lot. - got rid of the top level server and service structures completely. The top level context is now the event_context. This got rid of service.h and server.h completely (they were the most confusing parts of the old code) - added service_stream.[ch] for the helper functions that are specific to stream type services (services that handle streams, and use a logically separate process per connection) - got rid of the builtin idle_handler code in the service logic, as none of the servers were using it, and it can easily be handled by a server in future by adding its own timed_event to the event context. - fixed some major memory leaks in the rpc server code. - added registration of servers, rather than hard coding our list of possible servers. This allows for servers as modules in the future. - temporarily disabled the winbind code until I add the helper functions for that type of server - added error checking on service startup. If a configured server fails to startup then smbd doesn't startup. - cleaned up the command line handling in smbd, removing unused options (This used to be commit cf6a46c3cbde7b1eb1b86bd3882b953a2de3a42e) --- source4/smbd/process_model.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'source4/smbd/process_model.c') diff --git a/source4/smbd/process_model.c b/source4/smbd/process_model.c index f2abfd0a49..16a0075d2d 100644 --- a/source4/smbd/process_model.c +++ b/source4/smbd/process_model.c @@ -22,12 +22,11 @@ #include "includes.h" #include "events.h" #include "smb_server/smb_server.h" -#include "smbd/process_model.h" /* setup the events for the chosen process model */ -const struct model_ops *process_model_startup(struct server_context *srv_ctx, const char *model) +const struct model_ops *process_model_startup(struct event_context *ev, const char *model) { const struct model_ops *ops; @@ -37,7 +36,7 @@ const struct model_ops *process_model_startup(struct server_context *srv_ctx, co exit(-1); } - ops->model_init(srv_ctx); + ops->model_init(ev); return ops; } @@ -107,7 +106,6 @@ const struct process_model_critical_sizes *process_model_version(void) static const struct process_model_critical_sizes critical_sizes = { PROCESS_MODEL_VERSION, sizeof(struct model_ops), - sizeof(struct smbsrv_connection), sizeof(struct event_context), sizeof(struct fd_event) }; -- cgit From 66170ef8b36b499aa5b44ef10c1bd362a50f2636 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 3 Feb 2005 02:35:52 +0000 Subject: r5185: make all the events data structures private to events.c. This will make it possible to add optimisations to the events code such as keeping the next timed event in a sorted list, and using epoll for file descriptor events. I also removed the loop events code, as it wasn't being used anywhere, and changed timed events to always be one-shot (as adding a new timed event in the event handler is so easy to do if needed) (This used to be commit d7b4b6de51342a65bf46fce772d313f92f8d73d3) --- source4/smbd/process_model.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'source4/smbd/process_model.c') diff --git a/source4/smbd/process_model.c b/source4/smbd/process_model.c index 16a0075d2d..f4e21e7e14 100644 --- a/source4/smbd/process_model.c +++ b/source4/smbd/process_model.c @@ -105,9 +105,7 @@ const struct process_model_critical_sizes *process_model_version(void) { static const struct process_model_critical_sizes critical_sizes = { PROCESS_MODEL_VERSION, - sizeof(struct model_ops), - sizeof(struct event_context), - sizeof(struct fd_event) + sizeof(struct model_ops) }; return &critical_sizes; -- cgit From 131dc76d56df40b3511c47e54f15412a25b491f8 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 3 Feb 2005 11:56:03 +0000 Subject: r5197: moved events code to lib/events/ (suggestion from metze) (This used to be commit 7f54c8a339f36aa43c9340be70ab7f0067593ef2) --- source4/smbd/process_model.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/smbd/process_model.c') diff --git a/source4/smbd/process_model.c b/source4/smbd/process_model.c index f4e21e7e14..d3e5eeaa48 100644 --- a/source4/smbd/process_model.c +++ b/source4/smbd/process_model.c @@ -20,7 +20,7 @@ */ #include "includes.h" -#include "events.h" +#include "lib/events/events.h" #include "smb_server/smb_server.h" /* -- cgit From 448483199fb436309735f5203b3282fca2c517ec Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 26 Dec 2005 16:46:55 +0000 Subject: r12494: Support loading modules from .so files for most subsystems. We now use a different system for initializing the modules for a subsystem. Most subsystems now have an init function that looks something like this: init_module_fn static_init[] = STATIC_AUTH_MODULES; init_module_fn *shared_init = load_samba_modules(NULL, "auth"); run_init_functions(static_init); run_init_functions(shared_init); talloc_free(shared_init); I hope to eliminate the other init functions later on (the init_programname_subsystems; defines). (This used to be commit b6d2ad4ce0a91c4be790dd258820c492ff1787ea) --- source4/smbd/process_model.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'source4/smbd/process_model.c') diff --git a/source4/smbd/process_model.c b/source4/smbd/process_model.c index d3e5eeaa48..312cc5e264 100644 --- a/source4/smbd/process_model.c +++ b/source4/smbd/process_model.c @@ -80,6 +80,19 @@ NTSTATUS register_process_model(const void *_ops) return NT_STATUS_OK; } +NTSTATUS process_model_init(void) +{ + init_module_fn static_init[] = STATIC_PROCESS_MODEL_MODULES; + init_module_fn *shared_init = load_samba_modules(NULL, "process_model"); + + run_init_functions(static_init); + run_init_functions(shared_init); + + talloc_free(shared_init); + + return NT_STATUS_OK; +} + /* return the operations structure for a named backend of the specified type */ -- cgit From 6aafed9600a3fa05932668c70fc0e20f3724dab6 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 26 Dec 2005 18:48:23 +0000 Subject: r12499: Move smb_build.h out of includes.h (This used to be commit c92ace494f92084ddf178626cdf392d151043bc7) --- source4/smbd/process_model.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source4/smbd/process_model.c') diff --git a/source4/smbd/process_model.c b/source4/smbd/process_model.c index 312cc5e264..f984682657 100644 --- a/source4/smbd/process_model.c +++ b/source4/smbd/process_model.c @@ -22,6 +22,7 @@ #include "includes.h" #include "lib/events/events.h" #include "smb_server/smb_server.h" +#include "smb_build.h" /* setup the events for the chosen process model -- cgit From d4de4c2d210d2e8c9b5aedf70695594809ad6a0b Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Fri, 30 Dec 2005 13:16:54 +0000 Subject: r12608: Remove some unused #include lines. (This used to be commit 70e7449318aa0e9d2639c76730a7d1683b2f4981) --- source4/smbd/process_model.c | 1 - 1 file changed, 1 deletion(-) (limited to 'source4/smbd/process_model.c') diff --git a/source4/smbd/process_model.c b/source4/smbd/process_model.c index f984682657..8fdf5cc2f5 100644 --- a/source4/smbd/process_model.c +++ b/source4/smbd/process_model.c @@ -20,7 +20,6 @@ */ #include "includes.h" -#include "lib/events/events.h" #include "smb_server/smb_server.h" #include "smb_build.h" -- cgit From 80c8a522861068e7b0974986936f65052dd6f70f Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Thu, 23 Feb 2006 12:48:13 +0000 Subject: r13655: Use new name of build header (This used to be commit bca0e8054f6d9c7adc9d92e0c30d4323f994c9e9) --- source4/smbd/process_model.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/smbd/process_model.c') diff --git a/source4/smbd/process_model.c b/source4/smbd/process_model.c index 8fdf5cc2f5..5010d745db 100644 --- a/source4/smbd/process_model.c +++ b/source4/smbd/process_model.c @@ -21,7 +21,7 @@ #include "includes.h" #include "smb_server/smb_server.h" -#include "smb_build.h" +#include "build.h" /* setup the events for the chosen process model -- cgit From 306b12ad4943737f6810df9237ab93b64c931fbd Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Thu, 9 Mar 2006 19:55:04 +0000 Subject: r14094: Use saner module directory names, fix loading of server service modules. (This used to be commit b6ffad3860ba2cf9d8f3423d65be91dcfc962ca2) --- source4/smbd/process_model.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/smbd/process_model.c') diff --git a/source4/smbd/process_model.c b/source4/smbd/process_model.c index 5010d745db..5a01ad4fab 100644 --- a/source4/smbd/process_model.c +++ b/source4/smbd/process_model.c @@ -82,7 +82,7 @@ NTSTATUS register_process_model(const void *_ops) NTSTATUS process_model_init(void) { - init_module_fn static_init[] = STATIC_PROCESS_MODEL_MODULES; + init_module_fn static_init[] = STATIC_process_model_MODULES; init_module_fn *shared_init = load_samba_modules(NULL, "process_model"); run_init_functions(static_init); -- cgit From 9565c708987fbe69b9ac981c99f6a5f239784c4a Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sun, 19 Mar 2006 17:51:15 +0000 Subject: r14567: Make some more functions public. (This used to be commit 8e84e6cb6b172c89072723e07f344da8f4476c1f) --- source4/smbd/process_model.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source4/smbd/process_model.c') diff --git a/source4/smbd/process_model.c b/source4/smbd/process_model.c index 5a01ad4fab..bfe3a67e1a 100644 --- a/source4/smbd/process_model.c +++ b/source4/smbd/process_model.c @@ -26,7 +26,7 @@ /* setup the events for the chosen process model */ -const struct model_ops *process_model_startup(struct event_context *ev, const char *model) +_PUBLIC_ const struct model_ops *process_model_startup(struct event_context *ev, const char *model) { const struct model_ops *ops; @@ -53,7 +53,7 @@ static int num_models; The 'name' can be later used by other backends to find the operations structure for this backend. */ -NTSTATUS register_process_model(const void *_ops) +_PUBLIC_ NTSTATUS register_process_model(const void *_ops) { const struct model_ops *ops = _ops; -- cgit From ad06a8bd651e3a8b598c92a356ac1ce4117ae72e Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Sun, 26 Mar 2006 01:23:40 +0000 Subject: r14736: - the ntvfs subsystem should not know about smb_server.h - the process module subsystem should not know about smb_server.h - the smb_server module should not know about process models metze (This used to be commit bac95bb8f4ad35a31ee666f5916ff9b2f292d964) --- source4/smbd/process_model.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/smbd/process_model.c') diff --git a/source4/smbd/process_model.c b/source4/smbd/process_model.c index bfe3a67e1a..c6d8074fae 100644 --- a/source4/smbd/process_model.c +++ b/source4/smbd/process_model.c @@ -20,7 +20,7 @@ */ #include "includes.h" -#include "smb_server/smb_server.h" +#include "smbd/process_model.h" #include "build.h" /* -- cgit From 0479a2f1cbae51fcd8dbdc3c148c808421fb4d25 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 10 Jul 2007 02:07:03 +0000 Subject: r23792: convert Samba4 to GPLv3 There are still a few tidyups of old FSF addresses to come (in both s3 and s4). More commits soon. (This used to be commit fcf38a38ac691abd0fa51b89dc951a08e89fdafa) --- source4/smbd/process_model.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'source4/smbd/process_model.c') diff --git a/source4/smbd/process_model.c b/source4/smbd/process_model.c index c6d8074fae..f83c7b784b 100644 --- a/source4/smbd/process_model.c +++ b/source4/smbd/process_model.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, @@ -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 ffeee68e4b72dd94fee57366bd8d38b8c284c3d4 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 8 Sep 2007 12:42:09 +0000 Subject: r25026: Move param/param.h out of includes.h (This used to be commit abe8349f9b4387961ff3665d8c589d61cd2edf31) --- source4/smbd/process_model.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source4/smbd/process_model.c') diff --git a/source4/smbd/process_model.c b/source4/smbd/process_model.c index f83c7b784b..e11e6193fe 100644 --- a/source4/smbd/process_model.c +++ b/source4/smbd/process_model.c @@ -21,6 +21,7 @@ #include "includes.h" #include "smbd/process_model.h" #include "build.h" +#include "param/param.h" /* setup the events for the chosen process model -- cgit From 2f3551ca7cee59d4d053cceb87abdf1da1b3a1ad Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 1 Oct 2007 18:52:55 +0000 Subject: r25446: Merge some changes I made on the way home from SFO: 2007-09-29 More higher-level passing around of lp_ctx. 2007-09-29 Fix warning. 2007-09-29 Pass loadparm contexts on a higher level. 2007-09-29 Avoid using global loadparm context. (This used to be commit 3468952e771ab31f90b6c374ade01c5550810f42) --- source4/smbd/process_model.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/smbd/process_model.c') diff --git a/source4/smbd/process_model.c b/source4/smbd/process_model.c index e11e6193fe..bb4d3a53bb 100644 --- a/source4/smbd/process_model.c +++ b/source4/smbd/process_model.c @@ -83,7 +83,7 @@ _PUBLIC_ NTSTATUS register_process_model(const void *_ops) NTSTATUS process_model_init(void) { init_module_fn static_init[] = STATIC_process_model_MODULES; - init_module_fn *shared_init = load_samba_modules(NULL, "process_model"); + init_module_fn *shared_init = load_samba_modules(NULL, global_loadparm, "process_model"); run_init_functions(static_init); run_init_functions(shared_init); -- cgit From 6c999cd12344f2bb8b1d2941210b4c205b3e0aad Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sun, 2 Dec 2007 22:32:11 +0100 Subject: r26236: Remove more uses of global_loadparm or specify loadparm_context explicitly. (This used to be commit 5b29ef7c03d9ae76b0ca909e9f03a58e1bad3521) --- source4/smbd/process_model.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source4/smbd/process_model.c') diff --git a/source4/smbd/process_model.c b/source4/smbd/process_model.c index bb4d3a53bb..e240ae2c60 100644 --- a/source4/smbd/process_model.c +++ b/source4/smbd/process_model.c @@ -80,10 +80,10 @@ _PUBLIC_ NTSTATUS register_process_model(const void *_ops) return NT_STATUS_OK; } -NTSTATUS process_model_init(void) +NTSTATUS process_model_init(struct loadparm_context *lp_ctx) { init_module_fn static_init[] = STATIC_process_model_MODULES; - init_module_fn *shared_init = load_samba_modules(NULL, global_loadparm, "process_model"); + init_module_fn *shared_init = load_samba_modules(NULL, lp_ctx, "process_model"); run_init_functions(static_init); run_init_functions(shared_init); -- cgit From be33f4c611d37ebba59ff618033dc73601339ad1 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sun, 23 Dec 2007 23:54:30 -0600 Subject: r26576: Allow the static module loading code to be used for the Python modules. Simplify the way module initialization functions are handled. (This used to be commit ba8be2dfc0de4434c798663336b81f7f95cde520) --- source4/smbd/process_model.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/smbd/process_model.c') diff --git a/source4/smbd/process_model.c b/source4/smbd/process_model.c index e240ae2c60..dc3ede613c 100644 --- a/source4/smbd/process_model.c +++ b/source4/smbd/process_model.c @@ -82,7 +82,7 @@ _PUBLIC_ NTSTATUS register_process_model(const void *_ops) NTSTATUS process_model_init(struct loadparm_context *lp_ctx) { - init_module_fn static_init[] = STATIC_process_model_MODULES; + init_module_fn static_init[] = { STATIC_process_model_MODULES, NULL }; init_module_fn *shared_init = load_samba_modules(NULL, lp_ctx, "process_model"); run_init_functions(static_init); -- cgit From c13ae707313c5bf9819a75c1699d099565d2494d Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 24 Dec 2007 01:28:22 -0600 Subject: r26580: Include sentinel in build.h, in case the list is empty. (This used to be commit f1997dabed584bdc864c4b7235c29603c312ef46) --- source4/smbd/process_model.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/smbd/process_model.c') diff --git a/source4/smbd/process_model.c b/source4/smbd/process_model.c index dc3ede613c..8939637c3f 100644 --- a/source4/smbd/process_model.c +++ b/source4/smbd/process_model.c @@ -82,7 +82,7 @@ _PUBLIC_ NTSTATUS register_process_model(const void *_ops) NTSTATUS process_model_init(struct loadparm_context *lp_ctx) { - init_module_fn static_init[] = { STATIC_process_model_MODULES, NULL }; + init_module_fn static_init[] = { STATIC_process_model_MODULES }; init_module_fn *shared_init = load_samba_modules(NULL, lp_ctx, "process_model"); run_init_functions(static_init); -- cgit From 2bf39edc9d0abf3306bd25b9c40d88aceb029be7 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 8 Mar 2008 15:28:12 +0100 Subject: Push SOVERSION and VERSION out of perl code. (This used to be commit 0ba8ac6a14c62ff9edfe9f0bf43b8a7406b85291) --- source4/smbd/process_model.c | 1 - 1 file changed, 1 deletion(-) (limited to 'source4/smbd/process_model.c') diff --git a/source4/smbd/process_model.c b/source4/smbd/process_model.c index 8939637c3f..22918368bf 100644 --- a/source4/smbd/process_model.c +++ b/source4/smbd/process_model.c @@ -20,7 +20,6 @@ #include "includes.h" #include "smbd/process_model.h" -#include "build.h" #include "param/param.h" /* -- cgit From fb6fdfce37a91021c346a52bd7d55a5ee576580a Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 8 Mar 2008 17:02:40 +0100 Subject: Fix the build. (This used to be commit f2e49744717eb46bbfafeea9e2eb412a38a142e7) --- source4/smbd/process_model.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source4/smbd/process_model.c') diff --git a/source4/smbd/process_model.c b/source4/smbd/process_model.c index 22918368bf..e267995596 100644 --- a/source4/smbd/process_model.c +++ b/source4/smbd/process_model.c @@ -81,6 +81,9 @@ _PUBLIC_ NTSTATUS register_process_model(const void *_ops) NTSTATUS process_model_init(struct loadparm_context *lp_ctx) { + extern NTSTATUS process_model_standard_init(void); + extern NTSTATUS process_model_prefork_init(void); + extern NTSTATUS process_model_single_init(void); init_module_fn static_init[] = { STATIC_process_model_MODULES }; init_module_fn *shared_init = load_samba_modules(NULL, lp_ctx, "process_model"); -- cgit From afe3e8172ddaa5e4aa811faceecda4f943d6e2ef Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Wed, 2 Apr 2008 04:53:27 +0200 Subject: Install public header files again and include required prototypes. (This used to be commit 47ffbbf67435904754469544390b67d34c958343) --- source4/smbd/process_model.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source4/smbd/process_model.c') diff --git a/source4/smbd/process_model.c b/source4/smbd/process_model.c index 8939637c3f..fcbe2d9872 100644 --- a/source4/smbd/process_model.c +++ b/source4/smbd/process_model.c @@ -80,7 +80,7 @@ _PUBLIC_ NTSTATUS register_process_model(const void *_ops) return NT_STATUS_OK; } -NTSTATUS process_model_init(struct loadparm_context *lp_ctx) +_PUBLIC_ NTSTATUS process_model_init(struct loadparm_context *lp_ctx) { init_module_fn static_init[] = { STATIC_process_model_MODULES }; init_module_fn *shared_init = load_samba_modules(NULL, lp_ctx, "process_model"); @@ -96,7 +96,7 @@ NTSTATUS process_model_init(struct loadparm_context *lp_ctx) /* return the operations structure for a named backend of the specified type */ -const struct model_ops *process_model_byname(const char *name) +_PUBLIC_ const struct model_ops *process_model_byname(const char *name) { int i; -- cgit From 21a11373e05c3278d05f56c4ee5940f31045a7ab Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 14 Jun 2008 12:14:27 +0200 Subject: Fix prototype for pthread process model. (This used to be commit 280c411613b21acc1e65e5657b209d266dbad8d3) --- source4/smbd/process_model.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source4/smbd/process_model.c') diff --git a/source4/smbd/process_model.c b/source4/smbd/process_model.c index e631975b37..704e6cc7a2 100644 --- a/source4/smbd/process_model.c +++ b/source4/smbd/process_model.c @@ -81,6 +81,7 @@ _PUBLIC_ NTSTATUS register_process_model(const void *_ops) _PUBLIC_ NTSTATUS process_model_init(struct loadparm_context *lp_ctx) { + extern NTSTATUS process_model_thread_init(void); extern NTSTATUS process_model_standard_init(void); extern NTSTATUS process_model_prefork_init(void); extern NTSTATUS process_model_single_init(void); -- cgit