r26237: Add loadparm context to the server service interface.
authorJelmer Vernooij <jelmer@samba.org>
Sun, 2 Dec 2007 23:28:07 +0000 (00:28 +0100)
committerStefan Metzmacher <metze@samba.org>
Fri, 21 Dec 2007 04:47:15 +0000 (05:47 +0100)
(This used to be commit 1386c5c92505a950c65411b8af74d703ce023f95)

12 files changed:
source4/cldap_server/cldap_server.c
source4/dsdb/repl/drepl_service.c
source4/kdc/kdc.c
source4/ldap_server/ldap_server.c
source4/nbt_server/nbt_server.c
source4/rpc_server/service_rpc.c
source4/smb_server/smb_server.c
source4/smbd/server.c
source4/smbd/service.c
source4/web_server/web_server.c
source4/winbind/wb_server.c
source4/wrepl_server/wrepl_server.c

index b43137c8dfff1a1c8a42cc0d59f700651da6234b..477526a1f2b96c4b1e96f8faf39b4cf64738e66d 100644 (file)
@@ -201,7 +201,7 @@ static void cldapd_task_init(struct task_server *task)
 /*
   initialise the cldapd server
  */
-static NTSTATUS cldapd_init(struct event_context *event_ctx, const struct model_ops *model_ops)
+static NTSTATUS cldapd_init(struct event_context *event_ctx, struct loadparm_context *lp_ctx, const struct model_ops *model_ops)
 {
        return task_server_startup(event_ctx, model_ops, cldapd_task_init);
 }
index 72033f41774c920d3f2947e18126877f7476d525..96db445f3dcf69bad1d38c7551cf5db6e23a959e 100644 (file)
@@ -182,7 +182,7 @@ static void dreplsrv_task_init(struct task_server *task)
 /*
   initialise the dsdb replicator service
  */
-static NTSTATUS dreplsrv_init(struct event_context *event_ctx, const struct model_ops *model_ops)
+static NTSTATUS dreplsrv_init(struct event_context *event_ctx, struct loadparm_context *lp_ctx, const struct model_ops *model_ops)
 {
        return task_server_startup(event_ctx, model_ops, dreplsrv_task_init);
 }
index 6c1f20bf134a3f32c66b5408be3f56af3eba52b3..da19d3be26c4d7e2f71336a79ac0bcd633cdb1a8 100644 (file)
@@ -650,6 +650,7 @@ static void kdc_task_init(struct task_server *task)
   called on startup of the KDC service 
 */
 static NTSTATUS kdc_init(struct event_context *event_ctx, 
+                        struct loadparm_context *lp_ctx,
                         const struct model_ops *model_ops)
 {      
        return task_server_startup(event_ctx, model_ops, kdc_task_init);
index 30afe7c590da162dc64e9ad74072f339cef22939..51dba26dcaa679f30253bec91aab262ecd4c5ad0 100644 (file)
@@ -581,6 +581,7 @@ failed:
   listening on all configured sockets
 */
 static NTSTATUS ldapsrv_init(struct event_context *event_context, 
+                            struct loadparm_context *lp_ctx,
                             const struct model_ops *model_ops)
 {      
        return task_server_startup(event_context, model_ops, ldapsrv_task_init);
index 173cea91d02b57993b51e2bd4ab37930f5570d3b..6e669f1930065bbfc0d54cacf167e3b436f9b425 100644 (file)
@@ -89,7 +89,7 @@ static void nbtd_task_init(struct task_server *task)
 /*
   initialise the nbt server
  */
-static NTSTATUS nbtd_init(struct event_context *event_ctx, const struct model_ops *model_ops)
+static NTSTATUS nbtd_init(struct event_context *event_ctx, struct loadparm_context *lp_ctx, const struct model_ops *model_ops)
 {
        return task_server_startup(event_ctx, model_ops, nbtd_task_init);
 }
index 04dd5a8ee9e4ae5d80ae6d59c6819d96bf4e044e..b9cf4887fb4479caadccc05f489cb6c9e1f4eeb8 100644 (file)
@@ -438,6 +438,7 @@ failed:
   listening on all configured sockets
 */
 static NTSTATUS dcesrv_init(struct event_context *event_context, 
+                           struct loadparm_context *lp_ctx,
                            const struct model_ops *model_ops)
 {      
        return task_server_startup(event_context, model_ops, dcesrv_task_init);
index 923c1bdfe5e511e920af2151bf9bde8decd9b3c1..ac5c5899325c237381ccfdfc20a38c91ae077b2d 100644 (file)
@@ -247,6 +247,7 @@ failed:
   listening on all configured sockets
 */
 static NTSTATUS smbsrv_init(struct event_context *event_context, 
+                           struct loadparm_context *lp_ctx,
                            const struct model_ops *model_ops)
 {      
        return task_server_startup(event_context, model_ops, smbsrv_task_init);
index 65196618db96cce84744c44fe0d7dfa3e2fd1e00..87bab39bd1dabb8ac550855f1b7b4a1813858a4d 100644 (file)
@@ -334,7 +334,7 @@ static int binary_smbd_main(const char *binary_name, int argc, const char *argv[
        }
 
        DEBUG(0,("%s: using '%s' process model\n", binary_name, model));
-       status = server_service_startup(event_ctx, model, lp_server_services(global_loadparm));
+       status = server_service_startup(event_ctx, global_loadparm, model, lp_server_services(global_loadparm));
        if (!NT_STATUS_IS_OK(status)) {
                DEBUG(0,("Starting Services failed - %s\n", nt_errstr(status)));
                return 1;
index c9ceef09fe51cef70d0ffeb12b9c0bd1d79a23cb..525b24561616b72bdbecead985e6aadc167cbb62 100644 (file)
 static struct registered_server {
        struct registered_server *next, *prev;
        const char *service_name;
-       NTSTATUS (*service_init)(struct event_context *, const struct model_ops *);
+       NTSTATUS (*service_init)(struct event_context *, struct loadparm_context *lp_ctx, const struct model_ops *);
 } *registered_servers;
 
 /*
   register a server service. 
 */
 NTSTATUS register_server_service(const char *name,
-                                NTSTATUS (*service_init)(struct event_context *, const struct model_ops *))
+                                NTSTATUS (*service_init)(struct event_context *, struct loadparm_context *lp_ctx, const struct model_ops *))
 {
        struct registered_server *srv;
        srv = talloc(talloc_autofree_context(), struct registered_server);
@@ -54,12 +54,13 @@ NTSTATUS register_server_service(const char *name,
 */
 static NTSTATUS server_service_init(const char *name,
                                    struct event_context *event_ctx,
+                                   struct loadparm_context *lp_ctx,
                                    const struct model_ops *model_ops)
 {
        struct registered_server *srv;
        for (srv=registered_servers; srv; srv=srv->next) {
                if (strcasecmp(name, srv->service_name) == 0) {
-                       return srv->service_init(event_ctx, model_ops);
+                       return srv->service_init(event_ctx, lp_ctx, model_ops);
                }
        }
        return NT_STATUS_INVALID_SYSTEM_SERVICE;
@@ -70,6 +71,7 @@ static NTSTATUS server_service_init(const char *name,
   startup all of our server services
 */
 NTSTATUS server_service_startup(struct event_context *event_ctx, 
+                               struct loadparm_context *lp_ctx,
                                const char *model, const char **server_services)
 {
        int i;
@@ -89,7 +91,7 @@ NTSTATUS server_service_startup(struct event_context *event_ctx,
        for (i=0;server_services[i];i++) {
                NTSTATUS status;
 
-               status = server_service_init(server_services[i], event_ctx, model_ops);
+               status = server_service_init(server_services[i], event_ctx, lp_ctx, model_ops);
                if (!NT_STATUS_IS_OK(status)) {
                        DEBUG(0,("Failed to start service '%s' - %s\n", 
                                 server_services[i], nt_errstr(status)));
index 3926993334b6036f74fecd06c0fa27faa08c566d..be7b6aabdf0770652ae390e55c76f69207fdc42d 100644 (file)
@@ -286,6 +286,7 @@ failed:
   listening on all configured sockets
 */
 static NTSTATUS websrv_init(struct event_context *event_context, 
+                           struct loadparm_context *lp_ctx,
                            const struct model_ops *model_ops)
 {      
        return task_server_startup(event_context, model_ops, websrv_task_init);
index 42252607740d9f8fc4e55834a44c9ddbfb7908a0..6eb3d1513b1b2aa098a20da08eaaa2c4d305e8be 100644 (file)
@@ -201,6 +201,7 @@ nomem:
   initialise the winbind server
  */
 static NTSTATUS winbind_init(struct event_context *event_ctx,
+                            struct loadparm_context *lp_ctx,
                             const struct model_ops *model_ops)
 {
        return task_server_startup(event_ctx, model_ops, winbind_task_init);
index a5c80072852650faa2ddf1dc22b22ce8aa6d5b4d..fbbd8e26d9b59158b8883dce215710fd4f57a6cc 100644 (file)
@@ -495,9 +495,9 @@ static void wreplsrv_task_init(struct task_server *task)
 /*
   initialise the WREPL server
  */
-static NTSTATUS wreplsrv_init(struct event_context *event_ctx, const struct model_ops *model_ops)
+static NTSTATUS wreplsrv_init(struct event_context *event_ctx, struct loadparm_context *lp_ctx, const struct model_ops *model_ops)
 {
-       if (!lp_wins_support(global_loadparm)) {
+       if (!lp_wins_support(lp_ctx)) {
                return NT_STATUS_OK;
        }