summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2011-06-21 14:45:45 +0200
committerAndreas Schneider <asn@samba.org>2011-07-14 16:10:47 +0200
commit7da54eab641a0b9fa2aca63cbf3364cb34efb812 (patch)
treec025763a107a6c0963020f41c15de2dc9b2a28a6 /source3
parentfa1bba26aae83b5412601e102f65a58ec7a146e4 (diff)
downloadsamba-7da54eab641a0b9fa2aca63cbf3364cb34efb812.tar.gz
samba-7da54eab641a0b9fa2aca63cbf3364cb34efb812.tar.bz2
samba-7da54eab641a0b9fa2aca63cbf3364cb34efb812.zip
s3-smbd: Pass msg_ctx to smbd_accept_connection.
Diffstat (limited to 'source3')
-rw-r--r--source3/smbd/server.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/source3/smbd/server.c b/source3/smbd/server.c
index 82459c277e..aadac6ad0b 100644
--- a/source3/smbd/server.c
+++ b/source3/smbd/server.c
@@ -355,6 +355,7 @@ struct smbd_open_socket {
struct smbd_parent_context *parent;
int fd;
struct tevent_fd *fde;
+ struct messaging_context *msg_ctx;
};
static void smbd_open_socket_close_fn(struct tevent_context *ev,
@@ -374,6 +375,7 @@ static void smbd_accept_connection(struct tevent_context *ev,
struct smbd_server_connection *sconn = smbd_server_conn;
struct smbd_open_socket *s = talloc_get_type_abort(private_data,
struct smbd_open_socket);
+ struct messaging_context *msg_ctx = s->msg_ctx;
struct sockaddr_storage addr;
socklen_t in_addrlen = sizeof(addr);
int fd;
@@ -433,8 +435,9 @@ static void smbd_accept_connection(struct tevent_context *ev,
talloc_free(s->parent);
s = NULL;
- status = reinit_after_fork(smbd_messaging_context(),
- server_event_context(), procid_self(),
+ status = reinit_after_fork(msg_ctx,
+ ev,
+ procid_self(),
true);
if (!NT_STATUS_IS_OK(status)) {
if (NT_STATUS_EQUAL(status,
@@ -457,8 +460,8 @@ static void smbd_accept_connection(struct tevent_context *ev,
}
smbd_setup_sig_term_handler();
- smbd_setup_sig_hup_handler(server_event_context(),
- server_messaging_context());
+ smbd_setup_sig_hup_handler(ev,
+ msg_ctx);
if (!serverid_register(procid_self(),
FLAG_MSG_GENERAL|FLAG_MSG_SMBD
@@ -557,6 +560,7 @@ static bool smbd_open_one_socket(struct smbd_parent_context *parent,
return false;
}
+ s->msg_ctx = msg_ctx;
s->fde = tevent_add_fd(ev_ctx,
s,
s->fd, TEVENT_FD_READ,