winbind: Don't explicitly send "server_id" for ONLINESTATUS
authorVolker Lendecke <vl@samba.org>
Tue, 13 Feb 2018 13:05:15 +0000 (14:05 +0100)
committerJeremy Allison <jra@samba.org>
Thu, 15 Feb 2018 19:32:24 +0000 (20:32 +0100)
Messaging already provides the sender id

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/utils/smbcontrol.c
source3/winbindd/winbindd_dual.c

index 0f6dacce20deece5e49e0a30d24a9c69fb9f561a..4b47d3bed57fb52a07fd1aa3a21b38b83fc6e9b7 100644 (file)
@@ -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);
 
index 993166d82d91991646effe62e11a625b027eaefb..7b1527c38f3a60a468764d6bb1fae6a131ba5a8d 100644 (file)
@@ -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);