]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3:winbind: Improve logging in winbindd_getgrgid.c
authorPavel Filipenský <pfilipen@redhat.com>
Wed, 4 Aug 2021 16:36:51 +0000 (18:36 +0200)
committerAndreas Schneider <asn@cryptomilk.org>
Fri, 15 Jul 2022 14:25:38 +0000 (14:25 +0000)
Test scenario:
id ADDOMAIN/alice

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

index 24d70161770ab47b6d788fd7bda6b75e377a125f..a4a6a0d6eb7a4535943ef18fe5e6706b349edaca 100644 (file)
@@ -49,10 +49,11 @@ struct tevent_req *winbindd_getgrgid_send(TALLOC_CTX *mem_ctx,
        }
        state->ev = ev;
 
-       DBG_NOTICE("[%s (%u)] getgrgid %d\n",
-                  cli->client_name,
-                  (unsigned int)cli->pid,
-                  (int)request->data.gid);
+       D_NOTICE("[%s (%u)] Winbind external command GETGRGID start.\n"
+                "gid=%u\n",
+                cli->client_name,
+                (unsigned int)cli->pid,
+                (int)request->data.gid);
 
        state->xid = (struct unixid) {
                .id = request->data.uid, .type = ID_TYPE_GID };
@@ -120,21 +121,22 @@ NTSTATUS winbindd_getgrgid_recv(struct tevent_req *req,
 
        if (tevent_req_is_nterror(req, &status)) {
                struct dom_sid_buf sidbuf;
-               DEBUG(5, ("Could not convert sid %s: %s\n",
+               D_WARNING("Could not convert sid %s: %s\n",
                          dom_sid_str_buf(state->sid, &sidbuf),
-                         nt_errstr(status)));
+                         nt_errstr(status));
                return status;
        }
 
        if (!fill_grent(talloc_tos(), &response->data.gr, state->domname,
                        state->name, state->gid)) {
-               DEBUG(5, ("fill_grent failed\n"));
+               D_WARNING("fill_grent failed\n");
                return NT_STATUS_NO_MEMORY;
        }
 
        status = winbindd_print_groupmembers(state->members, response,
                                             &num_members, &buf);
        if (!NT_STATUS_IS_OK(status)) {
+               D_WARNING("Failed with %s.\n", nt_errstr(status));
                return status;
        }
 
@@ -146,5 +148,9 @@ NTSTATUS winbindd_getgrgid_recv(struct tevent_req *req,
        response->extra_data.data = buf;
        response->length += talloc_get_size(response->extra_data.data);
 
+       D_NOTICE("Winbind external command GETGRGID end.\n"
+                "Returning %u group member(s).\n",
+                response->data.gr.num_gr_mem);
+
        return NT_STATUS_OK;
 }