diff options
author | Gary Lockyer <gary@catalyst.net.nz> | 2017-09-15 07:09:23 +1200 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2017-10-19 05:33:09 +0200 |
commit | b852ad044b98c0c574c3420956e153055d46136d (patch) | |
tree | 4246355fbade866ba399d3e6266b7572df953b09 /source4/ldap_server | |
parent | 6d7a8d80cdc9ee996ff503d8834037001cf233d9 (diff) | |
download | samba-b852ad044b98c0c574c3420956e153055d46136d.tar.gz |
source4/smbd: refactor the process model for prefork
Refactor the process model code to allow the addition of a prefork
process model.
- Add a process context to contain process model specific state
- Add a service details structure to allow service to indicate which
process model options they can support.
In the new code the services advertise the features they support to the
process model. The process model context is plumbed through to allow the
process model to keep track of the supported options, and any state
the process model may require.
Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Diffstat (limited to 'source4/ldap_server')
-rw-r--r-- | source4/ldap_server/ldap_server.c | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/source4/ldap_server/ldap_server.c b/source4/ldap_server/ldap_server.c index 7730ff981ca..d12c4e70e02 100644 --- a/source4/ldap_server/ldap_server.c +++ b/source4/ldap_server/ldap_server.c @@ -1030,7 +1030,7 @@ static NTSTATUS add_socket(struct task_server *task, model_ops, &ldap_stream_nonpriv_ops, "ip", address, &port, lpcfg_socket_options(lp_ctx), - ldap_service); + ldap_service, task->process_context); if (!NT_STATUS_IS_OK(status)) { DEBUG(0,("ldapsrv failed to bind to %s:%u - %s\n", address, port, nt_errstr(status))); @@ -1045,7 +1045,8 @@ static NTSTATUS add_socket(struct task_server *task, &ldap_stream_nonpriv_ops, "ip", address, &port, lpcfg_socket_options(lp_ctx), - ldap_service); + ldap_service, + task->process_context); if (!NT_STATUS_IS_OK(status)) { DEBUG(0,("ldapsrv failed to bind to %s:%u - %s\n", address, port, nt_errstr(status))); @@ -1067,7 +1068,8 @@ static NTSTATUS add_socket(struct task_server *task, &ldap_stream_nonpriv_ops, "ip", address, &port, lpcfg_socket_options(lp_ctx), - ldap_service); + ldap_service, + task->process_context); if (!NT_STATUS_IS_OK(status)) { DEBUG(0,("ldapsrv failed to bind to %s:%u - %s\n", address, port, nt_errstr(status))); @@ -1081,7 +1083,8 @@ static NTSTATUS add_socket(struct task_server *task, &ldap_stream_nonpriv_ops, "ip", address, &port, lpcfg_socket_options(lp_ctx), - ldap_service); + ldap_service, + task->process_context); if (!NT_STATUS_IS_OK(status)) { DEBUG(0,("ldapsrv failed to bind to %s:%u - %s\n", address, port, nt_errstr(status))); @@ -1210,7 +1213,7 @@ static void ldapsrv_task_init(struct task_server *task) model_ops, &ldap_stream_nonpriv_ops, "unix", ldapi_path, NULL, lpcfg_socket_options(task->lp_ctx), - ldap_service); + ldap_service, task->process_context); talloc_free(ldapi_path); if (!NT_STATUS_IS_OK(status)) { DEBUG(0,("ldapsrv failed to bind to %s - %s\n", @@ -1241,7 +1244,8 @@ static void ldapsrv_task_init(struct task_server *task) model_ops, &ldap_stream_priv_ops, "unix", ldapi_path, NULL, lpcfg_socket_options(task->lp_ctx), - ldap_service); + ldap_service, + task->process_context); talloc_free(ldapi_path); if (!NT_STATUS_IS_OK(status)) { DEBUG(0,("ldapsrv failed to bind to %s - %s\n", @@ -1261,5 +1265,10 @@ failed: NTSTATUS server_service_ldap_init(TALLOC_CTX *ctx) { - return register_server_service(ctx, "ldap", ldapsrv_task_init); + struct service_details details = { + .inhibit_fork_on_accept = false, + .inhibit_pre_fork = false + }; + return register_server_service(ctx, "ldap", ldapsrv_task_init, + &details); } |