From: Volker Lendecke Date: Tue, 13 Feb 2018 13:05:15 +0000 (+0100) Subject: winbind: Don't explicitly send "server_id" for ONLINESTATUS X-Git-Url: http://git.samba.org/?a=commitdiff_plain;h=0e3c2c8bc66d747e0eb8e7c1736268f7fd0b0d7a;p=metze%2Fsamba%2Fwip.git winbind: Don't explicitly send "server_id" for ONLINESTATUS Messaging already provides the sender id Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison --- diff --git a/source3/utils/smbcontrol.c b/source3/utils/smbcontrol.c index 0f6dacce20de..4b47d3bed57f 100644 --- a/source3/utils/smbcontrol.c +++ b/source3/utils/smbcontrol.c @@ -1160,10 +1160,6 @@ static bool do_winbind_onlinestatus(struct tevent_context *ev_ctx, const struct server_id pid, const int argc, const char **argv) { - struct server_id myid; - - myid = messaging_server_id(msg_ctx); - if (argc != 1) { fprintf(stderr, "Usage: smbcontrol winbindd onlinestatus\n"); return False; @@ -1172,9 +1168,9 @@ static bool do_winbind_onlinestatus(struct tevent_context *ev_ctx, messaging_register(msg_ctx, NULL, MSG_WINBIND_ONLINESTATUS, print_pid_string_cb); - if (!send_message(msg_ctx, pid, MSG_WINBIND_ONLINESTATUS, &myid, - sizeof(myid))) + if (!send_message(msg_ctx, pid, MSG_WINBIND_ONLINESTATUS, NULL, 0)) { return False; + } wait_replies(ev_ctx, msg_ctx, procid_to_pid(&pid) == 0); diff --git a/source3/winbindd/winbindd_dual.c b/source3/winbindd/winbindd_dual.c index 993166d82d91..7b1527c38f3a 100644 --- a/source3/winbindd/winbindd_dual.c +++ b/source3/winbindd/winbindd_dual.c @@ -796,16 +796,9 @@ void winbind_msg_onlinestatus(struct messaging_context *msg_ctx, { TALLOC_CTX *mem_ctx; const char *message; - struct server_id *sender; DEBUG(5,("winbind_msg_onlinestatus received.\n")); - if (!data->data) { - return; - } - - sender = (struct server_id *)data->data; - mem_ctx = talloc_init("winbind_msg_onlinestatus"); if (mem_ctx == NULL) { return; @@ -817,7 +810,7 @@ void winbind_msg_onlinestatus(struct messaging_context *msg_ctx, return; } - messaging_send_buf(msg_ctx, *sender, MSG_WINBIND_ONLINESTATUS, + messaging_send_buf(msg_ctx, server_id, MSG_WINBIND_ONLINESTATUS, (const uint8_t *)message, strlen(message) + 1); talloc_destroy(mem_ctx);