From: Pavel Filipenský Date: Wed, 4 Aug 2021 16:29:11 +0000 (+0200) Subject: s3:winbind: Improve logging in winbindd_getgrent.c X-Git-Tag: tevent-0.13.0~148 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ac8f35d6b49b2b2bfba476827818929fe7307c0d;p=thirdparty%2Fsamba.git s3:winbind: Improve logging in winbindd_getgrent.c Test scenario: id ADDOMAIN/alice Signed-off-by: Pavel Filipenský Reviewed-by: Andreas Schneider --- diff --git a/source3/winbindd/winbindd_getgrent.c b/source3/winbindd/winbindd_getgrent.c index b78d1f5b465..bcec1c6aeb8 100644 --- a/source3/winbindd/winbindd_getgrent.c +++ b/source3/winbindd/winbindd_getgrent.c @@ -48,11 +48,15 @@ struct tevent_req *winbindd_getgrent_send(TALLOC_CTX *mem_ctx, state->num_groups = 0; state->cli = cli; - DBG_NOTICE("[%s (%u)] getgrent\n", - cli->client_name, - (unsigned int)cli->pid); + D_NOTICE("[%s (%u)] Winbind external command GETGRENT start.\n" + "The caller (%s) provided room for %d entries.\n", + cli->client_name, + (unsigned int)cli->pid, + cli->client_name, + request->data.num_entries); if (cli->grent_state == NULL) { + D_NOTICE("The grent state from winbindd client state is NULL.\n"); tevent_req_nterror(req, NT_STATUS_NO_MORE_ENTRIES); return tevent_req_post(req, ev); } @@ -98,8 +102,8 @@ static void winbindd_getgrent_done(struct tevent_req *subreq) &state->members[state->num_groups]); TALLOC_FREE(subreq); if (NT_STATUS_EQUAL(status, NT_STATUS_NO_MORE_ENTRIES)) { - DEBUG(10, ("winbindd_getgrent_done: done with %d groups\n", - (int)state->num_groups)); + D_WARNING("winbindd_getgrent_done: done with %d groups\n", + (int)state->num_groups); TALLOC_FREE(state->cli->grent_state); tevent_req_done(req); return; @@ -110,14 +114,13 @@ static void winbindd_getgrent_done(struct tevent_req *subreq) } state->num_groups += 1; if (state->num_groups >= state->max_groups) { - DEBUG(10, ("winbindd_getgrent_done: Got enough groups: %d\n", - (int)state->num_groups)); + D_DEBUG("winbindd_getgrent_done: Got enough groups: %d\n", + (int)state->num_groups); tevent_req_done(req); return; } if (state->cli->grent_state == NULL) { - DEBUG(10, ("winbindd_getgrent_done: endgrent called in " - "between\n")); + D_DEBUG("winbindd_getgrent_done: endgrent called in between\n"); tevent_req_nterror(req, NT_STATUS_INVALID_PARAMETER); return; } @@ -144,7 +147,7 @@ NTSTATUS winbindd_getgrent_recv(struct tevent_req *req, if (tevent_req_is_nterror(req, &status)) { TALLOC_FREE(state->cli->grent_state); - DEBUG(5, ("getgrent failed: %s\n", nt_errstr(status))); + D_WARNING("getgrent failed: %s\n", nt_errstr(status)); return status; } @@ -201,5 +204,10 @@ NTSTATUS winbindd_getgrent_recv(struct tevent_req *req, response->data.num_entries = state->num_groups; response->length += talloc_get_size(result); response->extra_data.data = talloc_move(response, &result); + + D_NOTICE("Winbind external command GETGRENT end.\n" + "Received %d entries.\n", + response->data.num_entries); + return NT_STATUS_OK; }