]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3:winbind: Improve logging in winbindd_sids_to_xids.c
authorPavel Filipenský <pfilipen@redhat.com>
Fri, 24 Jun 2022 11:14:27 +0000 (13:14 +0200)
committerAndreas Schneider <asn@cryptomilk.org>
Fri, 15 Jul 2022 14:25:38 +0000 (14:25 +0000)
Test scenario:
bin/wbinfo --sid-to-uid=S-1-5-21-1961314572-195468382-2567644205-1107

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

index 37884f401aab3f862f2eba4fc648f9f9f865a944..1fbf02786a40f54f530d9bcf0d54553c190b6c34 100644 (file)
@@ -47,25 +47,27 @@ struct tevent_req *winbindd_sids_to_xids_send(TALLOC_CTX *mem_ctx,
        }
        state->ev = ev;
 
-       DEBUG(3, ("sids_to_xids\n"));
+       D_NOTICE("[%s (%u)] Winbind external command SIDS_TO_XIDS 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 sids list\n"));
+               D_DEBUG("Got invalid sids list\n");
                tevent_req_nterror(req, NT_STATUS_INVALID_PARAMETER);
                return tevent_req_post(req, ev);
        }
        if (!parse_sidlist(state, request->extra_data.data,
                           &state->sids, &state->num_sids)) {
-               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);
        }
 
-       DEBUG(10, ("num_sids: %d\n", (int)state->num_sids));
+       D_DEBUG("Resolving %u SID(s).\n", (int)state->num_sids);
 
        subreq = wb_sids2xids_send(state, ev, state->sids, state->num_sids);
        if (tevent_req_nomem(subreq, req)) {
@@ -106,8 +108,9 @@ NTSTATUS winbindd_sids_to_xids_recv(struct tevent_req *req,
        char *result = NULL;
        uint32_t i;
 
+       D_NOTICE("Winbind external command SIDS_TO_XIDS end.\n");
        if (tevent_req_is_nterror(req, &status)) {
-               DEBUG(5, ("Could not convert sids: %s\n", nt_errstr(status)));
+               D_WARNING("Could not convert sids: %s\n", nt_errstr(status));
                return status;
        }