mirror of
https://github.com/samba-team/samba.git
synced 2025-01-12 09:18:10 +03:00
s3:winbind: Improve logging in winbindd_wins_byip.c
Test scenario: $ bin/wbinfo --WINS-by-ip=10.53.57.30 Signed-off-by: Pavel Filipenský <pfilipen@redhat.com> Reviewed-by: Andreas Schneider <asn@samba.org>
This commit is contained in:
parent
0f031024b1
commit
7a9bec6a67
@ -45,14 +45,16 @@ struct tevent_req *winbindd_wins_byip_send(TALLOC_CTX *mem_ctx,
|
|||||||
if (req == NULL) {
|
if (req == NULL) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Ensure null termination */
|
/* Ensure null termination */
|
||||||
request->data.winsreq[sizeof(request->data.winsreq)-1]='\0';
|
request->data.winsreq[sizeof(request->data.winsreq)-1]='\0';
|
||||||
|
|
||||||
fstr_sprintf(state->response, "%s\t", request->data.winsreq);
|
fstr_sprintf(state->response, "%s\t", request->data.winsreq);
|
||||||
|
|
||||||
DEBUG(3, ("[%5lu]: wins_byip %s\n", (unsigned long)cli->pid,
|
D_NOTICE("[%s (%u)] Winbind external command WINS_BYIP start.\n"
|
||||||
request->data.winsreq));
|
"Resolving wins byip for %s.\n",
|
||||||
|
cli->client_name,
|
||||||
|
(unsigned int)cli->pid,
|
||||||
|
request->data.winsreq);
|
||||||
|
|
||||||
make_nmb_name(&state->star, "*", 0);
|
make_nmb_name(&state->star, "*", 0);
|
||||||
|
|
||||||
@ -104,11 +106,11 @@ static void winbindd_wins_byip_done(struct tevent_req *subreq)
|
|||||||
continue;
|
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));
|
size = strlen(names[i].name + strlen(state->response));
|
||||||
if (size > sizeof(state->response) - 1) {
|
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);
|
tevent_req_nterror(req, STATUS_BUFFER_OVERFLOW);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -117,7 +119,6 @@ static void winbindd_wins_byip_done(struct tevent_req *subreq)
|
|||||||
}
|
}
|
||||||
state->response[strlen(state->response)-1] = '\n';
|
state->response[strlen(state->response)-1] = '\n';
|
||||||
|
|
||||||
DEBUG(10, ("response: %s", state->response));
|
|
||||||
|
|
||||||
TALLOC_FREE(names);
|
TALLOC_FREE(names);
|
||||||
tevent_req_done(req);
|
tevent_req_done(req);
|
||||||
@ -133,6 +134,9 @@ NTSTATUS winbindd_wins_byip_recv(struct tevent_req *req,
|
|||||||
if (tevent_req_is_nterror(req, &status)) {
|
if (tevent_req_is_nterror(req, &status)) {
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
D_NOTICE("Winbind external command WINS_BYIP end.\n"
|
||||||
|
"Response: %s",
|
||||||
|
state->response);
|
||||||
fstrcpy(presp->data.winsresp, state->response);
|
fstrcpy(presp->data.winsresp, state->response);
|
||||||
return NT_STATUS_OK;
|
return NT_STATUS_OK;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user