]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3:winbind: Improve logging in winbindd_xids_to_sids.c
authorPavel Filipenský <pfilipen@redhat.com>
Fri, 24 Jun 2022 10:12:30 +0000 (12:12 +0200)
committerAndreas Schneider <asn@cryptomilk.org>
Fri, 15 Jul 2022 14:25:38 +0000 (14:25 +0000)
Test scenario in ad_dc:local test environment:
bin/wbinfo --unix-ids-to-sids=u100000

Signed-off-by: Pavel Filipenský <pfilipen@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
source3/winbindd/winbindd_xids_to_sids.c

index b0f4550f77347e6f604f84fc66744af981882ecd..5d97d0231f5ccf9409c080ad4d7a2bd32899be20 100644 (file)
@@ -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);