summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2011-05-25 18:51:56 +1000
committerAndrew Bartlett <abartlet@samba.org>2011-05-31 00:32:07 +0200
commite5dd03d1991f125fa3cfddac9a41d2f9e6391c42 (patch)
tree0b1c0bdf4759f2ad1331febe2612ca739eba8d30
parent81905585c093b6d641a10f6c338949bcbaa724c0 (diff)
downloadsamba-e5dd03d1991f125fa3cfddac9a41d2f9e6391c42.tar.gz
samba-e5dd03d1991f125fa3cfddac9a41d2f9e6391c42.tar.bz2
samba-e5dd03d1991f125fa3cfddac9a41d2f9e6391c42.zip
s3-globals Remove smbd_event_context() (use server_event_context())
This has been a wrapper around server_event_context() for some time now, and removing this from dummmysmbd.c assists with library dependencies. Andrew Bartlett
-rw-r--r--source3/include/proto.h1
-rw-r--r--source3/lib/dummysmbd.c5
-rw-r--r--source3/modules/onefs_cbrl.c2
-rw-r--r--source3/modules/vfs_aio_fork.c6
-rw-r--r--source3/modules/vfs_preopen.c2
-rw-r--r--source3/smbd/aio.c4
-rw-r--r--source3/smbd/blocking.c2
-rw-r--r--source3/smbd/close.c2
-rw-r--r--source3/smbd/fileio.c2
-rw-r--r--source3/smbd/globals.c2
-rw-r--r--source3/smbd/ipc.c4
-rw-r--r--source3/smbd/oplock.c2
-rw-r--r--source3/smbd/oplock_irix.c2
-rw-r--r--source3/smbd/oplock_linux.c2
-rw-r--r--source3/smbd/oplock_onefs.c2
-rw-r--r--source3/smbd/pipes.c6
-rw-r--r--source3/smbd/process.c26
-rw-r--r--source3/smbd/server.c47
-rw-r--r--source3/smbd/service.c2
-rw-r--r--source3/smbd/signing.c4
-rw-r--r--source3/smbd/smb2_lock.c2
-rw-r--r--source3/smbd/smb2_read.c2
-rw-r--r--source3/smbd/smb2_server.c2
-rw-r--r--source3/smbd/smb2_write.c2
-rw-r--r--source3/torture/vfstest.c10
25 files changed, 61 insertions, 82 deletions
diff --git a/source3/include/proto.h b/source3/include/proto.h
index ac5e755360..8cd3ec2ea8 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -1853,7 +1853,6 @@ NTSTATUS can_delete_directory(struct connection_struct *conn,
const char *dirname);
bool change_to_root_user(void);
void smbd_set_server_fd(int fd);
-struct event_context *smbd_event_context(void);
void contend_level2_oplocks_begin(files_struct *fsp,
enum level2_contention_type type);
void contend_level2_oplocks_end(files_struct *fsp,
diff --git a/source3/lib/dummysmbd.c b/source3/lib/dummysmbd.c
index 1d311a2dd9..541b59e0cc 100644
--- a/source3/lib/dummysmbd.c
+++ b/source3/lib/dummysmbd.c
@@ -45,11 +45,6 @@ bool change_to_root_user(void)
return false;
}
-struct event_context *smbd_event_context(void)
-{
- return NULL;
-}
-
/**
* The following two functions need to be called from inside the low-level BRL
* code for oplocks correctness in smbd. Since other utility binaries also
diff --git a/source3/modules/onefs_cbrl.c b/source3/modules/onefs_cbrl.c
index 5c69bec566..2f20d04ddb 100644
--- a/source3/modules/onefs_cbrl.c
+++ b/source3/modules/onefs_cbrl.c
@@ -251,7 +251,7 @@ static void onefs_init_cbrl(void)
DEBUG(10, ("cbrl_event_fd = %d\n", cbrl_event_fd));
/* Register the CBRL event_fd with samba's event system */
- cbrl_fde = event_add_fd(smbd_event_context(),
+ cbrl_fde = event_add_fd(server_event_context(),
NULL,
cbrl_event_fd,
EVENT_FD_READ,
diff --git a/source3/modules/vfs_aio_fork.c b/source3/modules/vfs_aio_fork.c
index 41b5a89dd2..fdf32f6c20 100644
--- a/source3/modules/vfs_aio_fork.c
+++ b/source3/modules/vfs_aio_fork.c
@@ -260,7 +260,7 @@ static void aio_child_cleanup(struct event_context *event_ctx,
/*
* Re-schedule the next cleanup round
*/
- list->cleanup_event = event_add_timed(smbd_event_context(), list,
+ list->cleanup_event = event_add_timed(server_event_context(), list,
timeval_add(&now, 30, 0),
aio_child_cleanup, list);
@@ -290,7 +290,7 @@ static struct aio_child_list *init_aio_children(struct vfs_handle_struct *handle
*/
if (data->cleanup_event == NULL) {
- data->cleanup_event = event_add_timed(smbd_event_context(), data,
+ data->cleanup_event = event_add_timed(server_event_context(), data,
timeval_current_ofs(30, 0),
aio_child_cleanup, data);
if (data->cleanup_event == NULL) {
@@ -519,7 +519,7 @@ static NTSTATUS create_aio_child(struct smbd_server_connection *sconn,
result->sockfd = fdpair[0];
close(fdpair[1]);
- result->sock_event = event_add_fd(smbd_event_context(), result,
+ result->sock_event = event_add_fd(server_event_context(), result,
result->sockfd, EVENT_FD_READ,
handle_aio_completion,
result);
diff --git a/source3/modules/vfs_preopen.c b/source3/modules/vfs_preopen.c
index e4b3a0c435..e0d1fd7ec0 100644
--- a/source3/modules/vfs_preopen.c
+++ b/source3/modules/vfs_preopen.c
@@ -237,7 +237,7 @@ static NTSTATUS preopen_init_helper(struct preopen_helper *h)
}
close(fdpair[1]);
h->fd = fdpair[0];
- h->fde = event_add_fd(smbd_event_context(), h->state, h->fd,
+ h->fde = event_add_fd(server_event_context(), h->state, h->fd,
EVENT_FD_READ, preopen_helper_readable, h);
if (h->fde == NULL) {
close(h->fd);
diff --git a/source3/smbd/aio.c b/source3/smbd/aio.c
index d3f42bf422..1f9130fecf 100644
--- a/source3/smbd/aio.c
+++ b/source3/smbd/aio.c
@@ -81,8 +81,8 @@ static bool initialize_async_io_handler(void)
}
tried_signal_setup = true;
- aio_signal_event = tevent_add_signal(smbd_event_context(),
- smbd_event_context(),
+ aio_signal_event = tevent_add_signal(server_event_context(),
+ server_event_context(),
RT_SIGNAL_AIO, SA_SIGINFO,
smbd_aio_signal_handler,
NULL);
diff --git a/source3/smbd/blocking.c b/source3/smbd/blocking.c
index d125a74439..ca4106b346 100644
--- a/source3/smbd/blocking.c
+++ b/source3/smbd/blocking.c
@@ -139,7 +139,7 @@ static bool recalc_brl_timeout(struct smbd_server_connection *sconn)
(int)from_now.tv_sec, (int)from_now.tv_usec));
}
- sconn->smb1.locks.brl_timeout = event_add_timed(smbd_event_context(),
+ sconn->smb1.locks.brl_timeout = event_add_timed(server_event_context(),
NULL, next_timeout,
brl_timeout_fn, sconn);
if (sconn->smb1.locks.brl_timeout == NULL) {
diff --git a/source3/smbd/close.c b/source3/smbd/close.c
index aeed4e3c9d..52cfc111fb 100644
--- a/source3/smbd/close.c
+++ b/source3/smbd/close.c
@@ -283,7 +283,7 @@ static NTSTATUS close_remove_share_mode(files_struct *fsp,
/* Ensure any pending write time updates are done. */
if (fsp->update_write_time_event) {
- update_write_time_handler(smbd_event_context(),
+ update_write_time_handler(server_event_context(),
fsp->update_write_time_event,
timeval_current(),
(void *)fsp);
diff --git a/source3/smbd/fileio.c b/source3/smbd/fileio.c
index ea607d3d5d..5e0ea9041d 100644
--- a/source3/smbd/fileio.c
+++ b/source3/smbd/fileio.c
@@ -240,7 +240,7 @@ void trigger_write_time_update(struct files_struct *fsp)
/* trigger the update 2 seconds later */
fsp->update_write_time_event =
- event_add_timed(smbd_event_context(), NULL,
+ event_add_timed(server_event_context(), NULL,
timeval_current_ofs(0, delay),
update_write_time_handler, fsp);
}
diff --git a/source3/smbd/globals.c b/source3/smbd/globals.c
index 6f7f200b01..93f2ad701b 100644
--- a/source3/smbd/globals.c
+++ b/source3/smbd/globals.c
@@ -152,7 +152,7 @@ void smbd_init_globals(void)
ZERO_STRUCT(sec_ctx_stack);
- smbd_server_conn = talloc_zero(smbd_event_context(), struct smbd_server_connection);
+ smbd_server_conn = talloc_zero(server_event_context(), struct smbd_server_connection);
if (!smbd_server_conn) {
exit_server("failed to create smbd_server_connection");
}
diff --git a/source3/smbd/ipc.c b/source3/smbd/ipc.c
index 7cc6904510..0b12179adc 100644
--- a/source3/smbd/ipc.c
+++ b/source3/smbd/ipc.c
@@ -268,7 +268,7 @@ static void api_dcerpc_cmd(connection_struct *conn, struct smb_request *req,
state->num_data = length;
state->max_read = max_read;
- subreq = np_write_send(state, smbd_event_context(), state->handle,
+ subreq = np_write_send(state, server_event_context(), state->handle,
state->data, length);
if (subreq == NULL) {
TALLOC_FREE(state);
@@ -305,7 +305,7 @@ static void api_dcerpc_cmd_write_done(struct tevent_req *subreq)
goto send;
}
- subreq = np_read_send(req->conn, smbd_event_context(),
+ subreq = np_read_send(req->conn, server_event_context(),
state->handle, state->data, state->max_read);
if (subreq == NULL) {
reply_nterror(req, NT_STATUS_NO_MEMORY);
diff --git a/source3/smbd/oplock.c b/source3/smbd/oplock.c
index 087d6ef045..02eb3361b8 100644
--- a/source3/smbd/oplock.c
+++ b/source3/smbd/oplock.c
@@ -353,7 +353,7 @@ static void add_oplock_timeout_handler(files_struct *fsp)
}
fsp->oplock_timeout =
- event_add_timed(smbd_event_context(), fsp,
+ event_add_timed(server_event_context(), fsp,
timeval_current_ofs(OPLOCK_BREAK_TIMEOUT, 0),
oplock_timeout_handler, fsp);
diff --git a/source3/smbd/oplock_irix.c b/source3/smbd/oplock_irix.c
index 207952d040..ef737efd22 100644
--- a/source3/smbd/oplock_irix.c
+++ b/source3/smbd/oplock_irix.c
@@ -332,7 +332,7 @@ struct kernel_oplocks *irix_init_kernel_oplocks(TALLOC_CTX *mem_ctx)
ctx->read_fd = pfd[0];
ctx->write_fd = pfd[1];
- ctx->read_fde = event_add_fd(smbd_event_context(),
+ ctx->read_fde = event_add_fd(server_event_context(),
ctx,
ctx->read_fd,
EVENT_FD_READ,
diff --git a/source3/smbd/oplock_linux.c b/source3/smbd/oplock_linux.c
index 4f243e2e9f..19f4d6e06d 100644
--- a/source3/smbd/oplock_linux.c
+++ b/source3/smbd/oplock_linux.c
@@ -210,7 +210,7 @@ struct kernel_oplocks *linux_init_kernel_oplocks(TALLOC_CTX *mem_ctx)
ctx->ops = &linux_koplocks;
- se = tevent_add_signal(smbd_event_context(),
+ se = tevent_add_signal(server_event_context(),
ctx,
RT_SIGNAL_LEASE, SA_SIGINFO,
linux_oplock_signal_handler,
diff --git a/source3/smbd/oplock_onefs.c b/source3/smbd/oplock_onefs.c
index dbf465ca63..4717b1faf7 100644
--- a/source3/smbd/oplock_onefs.c
+++ b/source3/smbd/oplock_onefs.c
@@ -709,7 +709,7 @@ struct kernel_oplocks *onefs_init_kernel_oplocks(TALLOC_CTX *mem_ctx)
DEBUG(10, ("oplock event_fd = %d\n", ctx->onefs_event_fd));
/* Register the oplock event_fd with samba's event system */
- ctx->read_fde = event_add_fd(smbd_event_context(),
+ ctx->read_fde = event_add_fd(server_event_context(),
ctx,
ctx->onefs_event_fd,
EVENT_FD_READ,
diff --git a/source3/smbd/pipes.c b/source3/smbd/pipes.c
index c8829cd58a..2de48adcbc 100644
--- a/source3/smbd/pipes.c
+++ b/source3/smbd/pipes.c
@@ -203,7 +203,7 @@ void reply_pipe_write(struct smb_request *req)
DEBUG(6, ("reply_pipe_write: %x name: %s len: %d\n", (int)fsp->fnum,
fsp_str_dbg(fsp), (int)state->numtowrite));
- subreq = np_write_send(state, smbd_event_context(),
+ subreq = np_write_send(state, server_event_context(),
fsp->fake_file_handle, data, state->numtowrite);
if (subreq == NULL) {
TALLOC_FREE(state);
@@ -319,7 +319,7 @@ void reply_pipe_write_and_X(struct smb_request *req)
state->numtowrite -= 2;
}
- subreq = np_write_send(state, smbd_event_context(),
+ subreq = np_write_send(state, server_event_context(),
fsp->fake_file_handle, data, state->numtowrite);
if (subreq == NULL) {
TALLOC_FREE(state);
@@ -426,7 +426,7 @@ void reply_pipe_read_and_X(struct smb_request *req)
state->outbuf = req->outbuf;
req->outbuf = NULL;
- subreq = np_read_send(state, smbd_event_context(),
+ subreq = np_read_send(state, server_event_context(),
fsp->fake_file_handle, data,
state->smb_maxcnt);
if (subreq == NULL) {
diff --git a/source3/smbd/process.c b/source3/smbd/process.c
index dc637de30a..dbc0a33a0a 100644
--- a/source3/smbd/process.c
+++ b/source3/smbd/process.c
@@ -624,7 +624,7 @@ static bool push_queued_message(struct smb_request *req,
}
}
- msg->te = event_add_timed(smbd_event_context(),
+ msg->te = event_add_timed(server_event_context(),
msg,
end_time,
smbd_deferred_open_timer,
@@ -708,7 +708,7 @@ void schedule_deferred_open_message_smb(uint64_t mid)
"scheduling mid %llu\n",
(unsigned long long)mid ));
- te = event_add_timed(smbd_event_context(),
+ te = event_add_timed(server_event_context(),
pml,
timeval_zero(),
smbd_deferred_open_timer,
@@ -934,8 +934,8 @@ void smbd_setup_sig_term_handler(void)
{
struct tevent_signal *se;
- se = tevent_add_signal(smbd_event_context(),
- smbd_event_context(),
+ se = tevent_add_signal(server_event_context(),
+ server_event_context(),
SIGTERM, 0,
smbd_sig_term_handler,
NULL);
@@ -987,11 +987,11 @@ static NTSTATUS smbd_server_connection_loop_once(struct smbd_server_connection *
* select for longer than it would take to wait for them.
*/
- event_add_to_poll_args(smbd_event_context(), conn,
+ event_add_to_poll_args(server_event_context(), conn,
&conn->pfds, &num_pfds, &timeout);
/* Process a signal and timed events now... */
- if (run_events_poll(smbd_event_context(), 0, NULL, 0)) {
+ if (run_events_poll(server_event_context(), 0, NULL, 0)) {
return NT_STATUS_RETRY;
}
@@ -1013,7 +1013,7 @@ static NTSTATUS smbd_server_connection_loop_once(struct smbd_server_connection *
return map_nt_error_from_unix(errno);
}
- retry = run_events_poll(smbd_event_context(), ret, conn->pfds,
+ retry = run_events_poll(server_event_context(), ret, conn->pfds,
num_pfds);
if (retry) {
return NT_STATUS_RETRY;
@@ -2814,7 +2814,7 @@ bool fork_echo_handler(struct smbd_server_connection *sconn)
set_blocking(listener_pipe[1], false);
status = reinit_after_fork(sconn->msg_ctx,
- smbd_event_context(),
+ server_event_context(),
procid_self(), false);
if (!NT_STATUS_IS_OK(status)) {
DEBUG(1, ("reinit_after_fork failed: %s\n",
@@ -2834,7 +2834,7 @@ bool fork_echo_handler(struct smbd_server_connection *sconn)
* Without smb signing this is the same as the normal smbd
* listener. This needs to change once signing comes in.
*/
- sconn->smb1.echo_handler.trusted_fde = event_add_fd(smbd_event_context(),
+ sconn->smb1.echo_handler.trusted_fde = event_add_fd(server_event_context(),
sconn,
sconn->smb1.echo_handler.trusted_fd,
EVENT_FD_READ,
@@ -3044,7 +3044,7 @@ void smbd_process(struct smbd_server_connection *sconn)
MSG_DEBUG, debug_message);
if ((lp_keepalive() != 0)
- && !(event_add_idle(smbd_event_context(), NULL,
+ && !(event_add_idle(server_event_context(), NULL,
timeval_set(lp_keepalive(), 0),
"keepalive", keepalive_fn,
NULL))) {
@@ -3052,14 +3052,14 @@ void smbd_process(struct smbd_server_connection *sconn)
exit(1);
}
- if (!(event_add_idle(smbd_event_context(), NULL,
+ if (!(event_add_idle(server_event_context(), NULL,
timeval_set(IDLE_CLOSED_TIMEOUT, 0),
"deadtime", deadtime_fn, sconn))) {
DEBUG(0, ("Could not add deadtime event\n"));
exit(1);
}
- if (!(event_add_idle(smbd_event_context(), NULL,
+ if (!(event_add_idle(server_event_context(), NULL,
timeval_set(SMBD_HOUSEKEEPING_INTERVAL, 0),
"housekeeping", housekeeping_fn, sconn))) {
DEBUG(0, ("Could not add housekeeping event\n"));
@@ -3116,7 +3116,7 @@ void smbd_process(struct smbd_server_connection *sconn)
exit_server("init_dptrs() failed");
}
- sconn->smb1.fde = event_add_fd(smbd_event_context(),
+ sconn->smb1.fde = event_add_fd(server_event_context(),
sconn,
sconn->sock,
EVENT_FD_READ,
diff --git a/source3/smbd/server.c b/source3/smbd/server.c
index 10edb5ef45..fc6ab3a277 100644
--- a/source3/smbd/server.c
+++ b/source3/smbd/server.c
@@ -51,11 +51,6 @@ extern void start_spoolssd(struct event_context *ev_ctx,
extern int dcelogin_atmost_once;
#endif /* WITH_DFS */
-struct event_context *smbd_event_context(void)
-{
- return server_event_context();
-}
-
/*******************************************************************
What to do when smb.conf is updated.
********************************************************************/
@@ -258,7 +253,7 @@ static void remove_child_pid(pid_t pid, bool unclean_shutdown)
if (!cleanup_te) {
/* call the cleanup timer, but not too often */
int cleanup_time = lp_parm_int(-1, "smbd", "cleanuptime", 20);
- cleanup_te = event_add_timed(smbd_event_context(), NULL,
+ cleanup_te = event_add_timed(server_event_context(), NULL,
timeval_current_ofs(cleanup_time, 0),
cleanup_timeout_fn,
&cleanup_te);
@@ -336,8 +331,8 @@ static void smbd_setup_sig_chld_handler(void)
{
struct tevent_signal *se;
- se = tevent_add_signal(smbd_event_context(),
- smbd_event_context(),
+ se = tevent_add_signal(server_event_context(),
+ server_event_context(),
SIGCHLD, 0,
smbd_sig_chld_handler,
NULL);
@@ -439,7 +434,7 @@ static void smbd_accept_connection(struct tevent_context *ev,
s = NULL;
status = reinit_after_fork(smbd_messaging_context(),
- smbd_event_context(), procid_self(),
+ server_event_context(), procid_self(),
true);
if (!NT_STATUS_IS_OK(status)) {
if (NT_STATUS_EQUAL(status,
@@ -552,7 +547,7 @@ static bool smbd_open_one_socket(struct smbd_parent_context *parent,
return false;
}
- s->fde = tevent_add_fd(smbd_event_context(),
+ s->fde = tevent_add_fd(server_event_context(),
s,
s->fd, TEVENT_FD_READ,
smbd_accept_connection,
@@ -733,7 +728,7 @@ static bool open_sockets_smbd(struct smbd_parent_context *parent,
return false;
}
- if (!(event_add_idle(smbd_event_context(), NULL,
+ if (!(event_add_idle(server_event_context(), NULL,
timeval_set(SMBD_HOUSEKEEPING_INTERVAL, 0),
"parent_housekeeping", smbd_parent_housekeeping,
NULL))) {
@@ -771,14 +766,14 @@ static bool open_sockets_smbd(struct smbd_parent_context *parent,
if (lp_multicast_dns_register() && (dns_port != 0)) {
#ifdef WITH_DNSSD_SUPPORT
- smbd_setup_mdns_registration(smbd_event_context(),
+ smbd_setup_mdns_registration(server_event_context(),
parent, dns_port);
#endif
#ifdef WITH_AVAHI_SUPPORT
void *avahi_conn;
avahi_conn = avahi_start_register(
- smbd_event_context(), smbd_event_context(), dns_port);
+ server_event_context(), server_event_context(), dns_port);
if (avahi_conn == NULL) {
DEBUG(10, ("avahi_start_register failed\n"));
}
@@ -797,7 +792,7 @@ static void smbd_parent_loop(struct smbd_parent_context *parent)
int ret;
TALLOC_CTX *frame = talloc_stackframe();
- ret = tevent_loop_once(smbd_event_context());
+ ret = tevent_loop_once(server_event_context());
if (ret != 0) {
exit_server_cleanly("tevent_loop_once() error");
}
@@ -887,7 +882,7 @@ extern void build_options(bool screen);
load_case_tables();
/* Initialize the event context, it will panic on error */
- smbd_event_context();
+ server_event_context();
smbd_init_globals();
@@ -1094,7 +1089,7 @@ extern void build_options(bool screen);
pidfile_create("smbd");
status = reinit_after_fork(smbd_messaging_context(),
- smbd_event_context(),
+ server_event_context(),
procid_self(), false);
if (!NT_STATUS_IS_OK(status)) {
DEBUG(0,("reinit_after_fork() failed\n"));
@@ -1104,7 +1099,7 @@ extern void build_options(bool screen);
smbd_server_conn->msg_ctx = smbd_messaging_context();
smbd_setup_sig_term_handler();
- smbd_setup_sig_hup_handler(smbd_event_context(),
+ smbd_setup_sig_hup_handler(server_event_context(),
smbd_server_conn->msg_ctx);
/* Setup all the TDB's - including CLEAR_IF_FIRST tdb's. */
@@ -1118,7 +1113,7 @@ extern void build_options(bool screen);
/* Initialise the password backed before the global_sam_sid
to ensure that we fetch from ldap before we make a domain sid up */
- if(!initialize_password_db(False, smbd_event_context()))
+ if(!initialize_password_db(False, server_event_context()))
exit(1);
if (!secrets_init()) {
@@ -1148,15 +1143,15 @@ extern void build_options(bool screen);
if (!locking_init())
exit(1);
- if (!messaging_tdb_parent_init(smbd_event_context())) {
+ if (!messaging_tdb_parent_init(server_event_context())) {
exit(1);
}
- if (!notify_internal_parent_init(smbd_event_context())) {
+ if (!notify_internal_parent_init(server_event_context())) {
exit(1);
}
- if (!serverid_parent_init(smbd_event_context())) {
+ if (!serverid_parent_init(server_event_context())) {
exit(1);
}
@@ -1203,12 +1198,12 @@ extern void build_options(bool screen);
"rpc_server", "epmapper",
"none");
if (strcasecmp_m(rpcsrv_type, "daemon") == 0) {
- start_epmd(smbd_event_context(),
+ start_epmd(server_event_context(),
smbd_server_conn->msg_ctx);
}
}
- if (!dcesrv_ep_setup(smbd_event_context(), smbd_server_conn->msg_ctx)) {
+ if (!dcesrv_ep_setup(server_event_context(), smbd_server_conn->msg_ctx)) {
exit(1);
}
@@ -1223,7 +1218,7 @@ extern void build_options(bool screen);
if (is_daemon && !interactive
&& lp_parm_bool(-1, "smbd", "backgroundqueue", true)) {
- start_background_queue(smbd_event_context(),
+ start_background_queue(server_event_context(),
smbd_messaging_context());
}
@@ -1236,7 +1231,7 @@ extern void build_options(bool screen);
"rpc_server", "spoolss",
"embedded");
if (strcasecmp_m(rpcsrv_type, "daemon") == 0) {
- start_spoolssd(smbd_event_context(),
+ start_spoolssd(server_event_context(),
smbd_messaging_context());
}
}
@@ -1266,7 +1261,7 @@ extern void build_options(bool screen);
return(0);
}
- parent = talloc_zero(smbd_event_context(), struct smbd_parent_context);
+ parent = talloc_zero(server_event_context(), struct smbd_parent_context);
if (!parent) {
exit_server("talloc(struct smbd_parent_context) failed");
}
diff --git a/source3/smbd/service.c b/source3/smbd/service.c
index 66c791bb55..0857645d1c 100644
--- a/source3/smbd/service.c
+++ b/source3/smbd/service.c
@@ -705,7 +705,7 @@ connection_struct *make_connection_snum(struct smbd_server_connection *sconn,
conn->notify_ctx = notify_init(conn,
sconn_server_id(sconn),
sconn->msg_ctx,
- smbd_event_context(),
+ server_event_context(),
conn);
}
diff --git a/source3/smbd/signing.c b/source3/smbd/signing.c
index bea2409883..25b3c40d7d 100644
--- a/source3/smbd/signing.c
+++ b/source3/smbd/signing.c
@@ -176,7 +176,7 @@ bool srv_init_signing(struct smbd_server_connection *conn)
struct smbd_shm_signing *s;
/* setup the signing state in shared memory */
- s = talloc_zero(smbd_event_context(), struct smbd_shm_signing);
+ s = talloc_zero(server_event_context(), struct smbd_shm_signing);
if (s == NULL) {
return false;
}
@@ -198,7 +198,7 @@ bool srv_init_signing(struct smbd_server_connection *conn)
return true;
}
- conn->smb1.signing_state = smb_signing_init(smbd_event_context(),
+ conn->smb1.signing_state = smb_signing_init(server_event_context(),
allowed, mandatory);
if (!conn->smb1.signing_state) {
return false;
diff --git a/source3/smbd/smb2_lock.c b/source3/smbd/smb2_lock.c
index fce3c7c897..712558481c 100644
--- a/source3/smbd/smb2_lock.c
+++ b/source3/smbd/smb2_lock.c
@@ -568,7 +568,7 @@ static bool recalc_smb2_brl_timeout(struct smbd_server_connection *sconn)
}
sconn->smb2.locks.brl_timeout = event_add_timed(
- smbd_event_context(),
+ server_event_context(),
NULL,
next_timeout,
brl_timeout_fn,
diff --git a/source3/smbd/smb2_read.c b/source3/smbd/smb2_read.c
index 6850d3df66..f90f569e8a 100644
--- a/source3/smbd/smb2_read.c
+++ b/source3/smbd/smb2_read.c
@@ -444,7 +444,7 @@ static struct tevent_req *smbd_smb2_read_send(TALLOC_CTX *mem_ctx,
return tevent_req_post(req, ev);
}
- subreq = np_read_send(state, smbd_event_context(),
+ subreq = np_read_send(state, server_event_context(),
fsp->fake_file_handle,
state->out_data.data,
state->out_data.length);
diff --git a/source3/smbd/smb2_server.c b/source3/smbd/smb2_server.c
index 7752fb07b5..65bb5b9eb0 100644
--- a/source3/smbd/smb2_server.c
+++ b/source3/smbd/smb2_server.c
@@ -95,7 +95,7 @@ static NTSTATUS smbd_initialize_smb2(struct smbd_server_connection *sconn)
TALLOC_FREE(sconn->smb1.fde);
- sconn->smb2.event_ctx = smbd_event_context();
+ sconn->smb2.event_ctx = server_event_context();
sconn->smb2.recv_queue = tevent_queue_create(sconn, "smb2 recv queue");
if (sconn->smb2.recv_queue == NULL) {
diff --git a/source3/smbd/smb2_write.c b/source3/smbd/smb2_write.c
index c0cba804ef..057abcc8f7 100644
--- a/source3/smbd/smb2_write.c
+++ b/source3/smbd/smb2_write.c
@@ -283,7 +283,7 @@ static struct tevent_req *smbd_smb2_write_send(TALLOC_CTX *mem_ctx,
return tevent_req_post(req, ev);
}
- subreq = np_write_send(state, smbd_event_context(),
+ subreq = np_write_send(state, server_event_context(),
fsp->fake_file_handle,
in_data.data,
in_data.length);
diff --git a/source3/torture/vfstest.c b/source3/torture/vfstest.c
index 584f6e30ef..74ef572577 100644
--- a/source3/torture/vfstest.c
+++ b/source3/torture/vfstest.c
@@ -414,16 +414,6 @@ void exit_server_cleanly(const char *const reason)
int last_message = -1;
-struct event_context *smbd_event_context(void)
-{
- static struct event_context *ctx;
-
- if (!ctx && !(ctx = event_context_init(NULL))) {
- smb_panic("Could not init smbd event context\n");
- }
- return ctx;
-}
-
/* Main function */
int main(int argc, char *argv[])