]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3:winbind: Improve logging in winbindd_group.c
authorPavel Filipenský <pfilipen@redhat.com>
Thu, 23 Jun 2022 10:42:51 +0000 (12:42 +0200)
committerAndreas Schneider <asn@cryptomilk.org>
Fri, 15 Jul 2022 14:25:38 +0000 (14:25 +0000)
Signed-off-by: Pavel Filipenský <pfilipen@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
source3/winbindd/winbindd_group.c

index b607a2805a74f3e1b626fabe664bdbfd5c9d681b..a90889ec36f5e944964d1e161418011b581ef50d 100644 (file)
@@ -41,6 +41,7 @@ bool fill_grent(TALLOC_CTX *mem_ctx, struct winbindd_gr *gr,
        nt_status = normalize_name_map(mem_ctx, dom_name, gr_name,
                                       &mapped_name);
 
+       D_DEBUG("Filling domain '%s' and group '%s'.\n", dom_name, gr_name);
        /* Basic whitespace replacement */
        if (NT_STATUS_IS_OK(nt_status)) {
                full_group_name = fill_domain_username_talloc(mem_ctx, dom_name,
@@ -57,6 +58,7 @@ bool fill_grent(TALLOC_CTX *mem_ctx, struct winbindd_gr *gr,
        }
 
        if (full_group_name == NULL) {
+               D_DEBUG("Returning false, since there is no full group name.\n");
                return false;
        }
 
@@ -67,6 +69,7 @@ bool fill_grent(TALLOC_CTX *mem_ctx, struct winbindd_gr *gr,
        strlcpy(gr->gr_name, full_group_name, sizeof(gr->gr_name));
        strlcpy(gr->gr_passwd, "x", sizeof(gr->gr_passwd));
 
+       D_DEBUG("Returning true. Full group name is '%s'.\n", gr_name);
        return True;
 }
 
@@ -132,7 +135,7 @@ NTSTATUS winbindd_print_groupmembers(struct db_context *members,
        m.ofs = 0;
        m.buf = talloc_array(mem_ctx, char, c.len);
        if (m.buf == NULL) {
-               DEBUG(5, ("talloc failed\n"));
+               D_WARNING("talloc failed\n");
                return NT_STATUS_NO_MEMORY;
        }
 
@@ -146,5 +149,6 @@ NTSTATUS winbindd_print_groupmembers(struct db_context *members,
 
        *num_members = c.num;
        *result = m.buf;
+       D_DEBUG("Returning %d member(s).\n", *num_members);
        return NT_STATUS_OK;
 }