From: Stefan Metzmacher Date: Tue, 13 Dec 2011 12:55:02 +0000 (+0100) Subject: s3:smbd: pass smbd_server_connection to smbd_setup_sig_hup_handler() X-Git-Tag: tevent-0.9.15~803 X-Git-Url: http://git.samba.org/?a=commitdiff_plain;h=290ce331b6e5995095a1237277a2a6a7272986ce;p=ddiss%2Fsamba.git s3:smbd: pass smbd_server_connection to smbd_setup_sig_hup_handler() metze --- diff --git a/source3/smbd/process.c b/source3/smbd/process.c index a2cccaad436..b3e4d0d9fbb 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 bf759f53048..0cc6b66d631 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 f7edc9996e4..9966cf46a0f 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