From: Pavel Filipenský Date: Fri, 24 Jun 2022 10:12:30 +0000 (+0200) Subject: s3:winbind: Improve logging in winbindd_xids_to_sids.c X-Git-Tag: tevent-0.13.0~128 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f52eeb89f4006672f90bbf26ede6c23eb09c3139;p=thirdparty%2Fsamba.git s3:winbind: Improve logging in winbindd_xids_to_sids.c Test scenario in ad_dc:local test environment: bin/wbinfo --unix-ids-to-sids=u100000 Signed-off-by: Pavel Filipenský Reviewed-by: Andreas Schneider --- diff --git a/source3/winbindd/winbindd_xids_to_sids.c b/source3/winbindd/winbindd_xids_to_sids.c index b0f4550f773..5d97d0231f5 100644 --- a/source3/winbindd/winbindd_xids_to_sids.c +++ b/source3/winbindd/winbindd_xids_to_sids.c @@ -49,27 +49,29 @@ struct tevent_req *winbindd_xids_to_sids_send(TALLOC_CTX *mem_ctx, } state->ev = ev; - DEBUG(3, ("xids_to_sids\n")); + D_NOTICE("[%s (%u)] Winbind external command XIDS_TO_SIDS start.\n", + cli->client_name, + (unsigned int)cli->pid); if (request->extra_len == 0) { tevent_req_done(req); return tevent_req_post(req, ev); } if (request->extra_data.data[request->extra_len-1] != '\0') { - DEBUG(10, ("Got invalid xids list\n")); + D_DEBUG("Got invalid XID list.\n"); tevent_req_nterror(req, NT_STATUS_INVALID_PARAMETER); return tevent_req_post(req, ev); } if (!parse_xidlist(state, request->extra_data.data, &state->xids, &state->num_xids)) { - DEBUG(10, ("parse_sidlist failed\n")); + D_DEBUG("parse_sidlist failed\n"); tevent_req_nterror(req, NT_STATUS_INVALID_PARAMETER); return tevent_req_post(req, ev); } - DBG_DEBUG("num_xids: %"PRIu32"\n%s\n", - state->num_xids, - (char *)request->extra_data.data); + D_DEBUG("Resolving %"PRIu32" XID(s):\n%s\n", + state->num_xids, + (char *)request->extra_data.data); subreq = wb_xids2sids_send(state, ev, state->xids, state->num_xids); if (tevent_req_nomem(subreq, req)) { @@ -104,8 +106,9 @@ NTSTATUS winbindd_xids_to_sids_recv(struct tevent_req *req, char *result = NULL; uint32_t i; + D_NOTICE("Winbind external command XIDS_TO_SIDS end.\n"); if (tevent_req_is_nterror(req, &status)) { - DBG_INFO("Could not convert xids: %s\n", nt_errstr(status)); + D_WARNING("Could not convert xids: %s\n", nt_errstr(status)); return status; } @@ -123,6 +126,8 @@ NTSTATUS winbindd_xids_to_sids_recv(struct tevent_req *req, str = sid_buf.buf; } + D_NOTICE("%u: XID %u mapped to SID %s.\n", + i, state->xids[i].id, str); result = talloc_asprintf_append_buffer( result, "%s\n", str); if (result == NULL) { @@ -130,8 +135,6 @@ NTSTATUS winbindd_xids_to_sids_recv(struct tevent_req *req, } } - DBG_DEBUG("sids:\n%s\n", result); - response->extra_data.data = result; response->length += talloc_get_size(result);