From 7a9bec6a67ba242baaa2870e150ccd4ddb0f313e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Pavel=20Filipensk=C3=BD?= Date: Fri, 24 Jun 2022 13:07:42 +0200 Subject: [PATCH] s3:winbind: Improve logging in winbindd_wins_byip.c MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Test scenario: $ bin/wbinfo --WINS-by-ip=10.53.57.30 Signed-off-by: Pavel Filipenský Reviewed-by: Andreas Schneider --- source3/winbindd/winbindd_wins_byip.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/source3/winbindd/winbindd_wins_byip.c b/source3/winbindd/winbindd_wins_byip.c index 58223d91348..1b9cdbcd7be 100644 --- a/source3/winbindd/winbindd_wins_byip.c +++ b/source3/winbindd/winbindd_wins_byip.c @@ -45,14 +45,16 @@ struct tevent_req *winbindd_wins_byip_send(TALLOC_CTX *mem_ctx, if (req == NULL) { return NULL; } - /* Ensure null termination */ request->data.winsreq[sizeof(request->data.winsreq)-1]='\0'; fstr_sprintf(state->response, "%s\t", request->data.winsreq); - DEBUG(3, ("[%5lu]: wins_byip %s\n", (unsigned long)cli->pid, - request->data.winsreq)); + D_NOTICE("[%s (%u)] Winbind external command WINS_BYIP start.\n" + "Resolving wins byip for %s.\n", + cli->client_name, + (unsigned int)cli->pid, + request->data.winsreq); make_nmb_name(&state->star, "*", 0); @@ -104,11 +106,11 @@ static void winbindd_wins_byip_done(struct tevent_req *subreq) continue; } - DEBUG(10, ("got name %s\n", names[i].name)); + D_DEBUG("Got name '%s'.\n", names[i].name); size = strlen(names[i].name + strlen(state->response)); if (size > sizeof(state->response) - 1) { - DEBUG(10, ("To much data\n")); + D_WARNING("Too much data!\n"); tevent_req_nterror(req, STATUS_BUFFER_OVERFLOW); return; } @@ -117,7 +119,6 @@ static void winbindd_wins_byip_done(struct tevent_req *subreq) } state->response[strlen(state->response)-1] = '\n'; - DEBUG(10, ("response: %s", state->response)); TALLOC_FREE(names); tevent_req_done(req); @@ -133,6 +134,9 @@ NTSTATUS winbindd_wins_byip_recv(struct tevent_req *req, if (tevent_req_is_nterror(req, &status)) { return status; } + D_NOTICE("Winbind external command WINS_BYIP end.\n" + "Response: %s", + state->response); fstrcpy(presp->data.winsresp, state->response); return NT_STATUS_OK; } -- 2.47.3