summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2011-12-13 13:55:02 +0100
committerStefan Metzmacher <metze@samba.org>2011-12-13 20:31:09 +0100
commit290ce331b6e5995095a1237277a2a6a7272986ce (patch)
treeb8025db2506a35664c8b3bd132a0427afd1e2dfb
parent8a83464216156204c75c44e90fae55dc34cb389f (diff)
downloadsamba-290ce331b6e5995095a1237277a2a6a7272986ce.tar.gz
samba-290ce331b6e5995095a1237277a2a6a7272986ce.tar.bz2
samba-290ce331b6e5995095a1237277a2a6a7272986ce.zip
s3:smbd: pass smbd_server_connection to smbd_setup_sig_hup_handler()
metze
-rw-r--r--source3/smbd/process.c21
-rw-r--r--source3/smbd/proto.h3
-rw-r--r--source3/smbd/server.c3
3 files changed, 13 insertions, 14 deletions
diff --git a/source3/smbd/process.c b/source3/smbd/process.c
index a2cccaad43..b3e4d0d9fb 100644
--- a/source3/smbd/process.c
+++ b/source3/smbd/process.c
@@ -899,23 +899,24 @@ static void smbd_sig_hup_handler(struct tevent_context *ev,
void *siginfo,
void *private_data)
{
- struct messaging_context *msg_ctx = talloc_get_type_abort(
- private_data, struct messaging_context);
+ struct smbd_server_connection *sconn =
+ talloc_get_type_abort(private_data,
+ struct smbd_server_connection);
+
change_to_root_user();
DEBUG(1,("Reloading services after SIGHUP\n"));
- reload_services(msg_ctx, smbd_server_conn->sock, False);
- if (am_parent) {
- printing_subsystem_update(ev, msg_ctx, true);
- }
+ reload_services(sconn->msg_ctx, sconn->sock, false);
}
-void smbd_setup_sig_hup_handler(struct tevent_context *ev,
- struct messaging_context *msg_ctx)
+void smbd_setup_sig_hup_handler(struct smbd_server_connection *sconn)
{
struct tevent_signal *se;
- se = tevent_add_signal(ev, ev, SIGHUP, 0, smbd_sig_hup_handler,
- msg_ctx);
+ se = tevent_add_signal(sconn->ev_ctx,
+ sconn,
+ SIGHUP, 0,
+ smbd_sig_hup_handler,
+ sconn);
if (!se) {
exit_server("failed to setup SIGHUP handler");
}
diff --git a/source3/smbd/proto.h b/source3/smbd/proto.h
index bf759f5304..0cc6b66d63 100644
--- a/source3/smbd/proto.h
+++ b/source3/smbd/proto.h
@@ -756,8 +756,7 @@ NTSTATUS make_default_filesystem_acl(TALLOC_CTX *ctx,
/* The following definitions come from smbd/process.c */
void smbd_setup_sig_term_handler(struct smbd_server_connection *sconn);
-void smbd_setup_sig_hup_handler(struct tevent_context *ev,
- struct messaging_context *msg_ctx);
+void smbd_setup_sig_hup_handler(struct smbd_server_connection *sconn);
bool srv_send_smb(struct smbd_server_connection *sconn, char *buffer,
bool no_signing, uint32_t seqnum,
bool do_encrypt,
diff --git a/source3/smbd/server.c b/source3/smbd/server.c
index f7edc9996e..9966cf46a0 100644
--- a/source3/smbd/server.c
+++ b/source3/smbd/server.c
@@ -461,8 +461,7 @@ static void smbd_accept_connection(struct tevent_context *ev,
}
smbd_setup_sig_term_handler(sconn);
- smbd_setup_sig_hup_handler(ev,
- msg_ctx);
+ smbd_setup_sig_hup_handler(sconn);
if (!serverid_register(messaging_server_id(msg_ctx),
FLAG_MSG_GENERAL|FLAG_MSG_SMBD