]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3:winbind: Improve logging in winbindd_dsgetdcname.c
authorPavel Filipenský <pfilipen@redhat.com>
Fri, 24 Jun 2022 10:35:59 +0000 (12:35 +0200)
committerAndreas Schneider <asn@cryptomilk.org>
Fri, 15 Jul 2022 14:25:38 +0000 (14:25 +0000)
Test scenario:
$ bin/wbinfo --dsgetdcname=ADDOMAIN

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

index d001213c8752848ab64605ebd5eb81cf35109f63..9dadeab863beb67a5a05fbc93b06090b0fd5785d 100644 (file)
@@ -18,6 +18,7 @@
 */
 
 #include "includes.h"
+#include "util/debug.h"
 #include "winbindd.h"
 #include "librpc/gen_ndr/ndr_winbind_c.h"
 #include "lib/util/string_wrappers.h"
@@ -48,6 +49,10 @@ struct tevent_req *winbindd_dsgetdcname_send(TALLOC_CTX *mem_ctx,
                return NULL;
        }
 
+       D_NOTICE("[%s (%u)] Winbind external command DSGETDCNAME start.\n",
+                cli->client_name,
+                (unsigned int)cli->pid);
+
        request->data.dsgetdcname.domain_name
                [sizeof(request->data.dsgetdcname.domain_name)-1] = '\0';
        request->data.dsgetdcname.site_name
@@ -55,8 +60,8 @@ struct tevent_req *winbindd_dsgetdcname_send(TALLOC_CTX *mem_ctx,
        request->data.dsgetdcname.domain_guid
                [sizeof(request->data.dsgetdcname.domain_guid)-1] = '\0';
 
-       DEBUG(3, ("[%5lu]: dsgetdcname for %s\n", (unsigned long)cli->pid,
-                 request->data.dsgetdcname.domain_name));
+       D_NOTICE("Calling DsGetDcName for domain '%s'.\n",
+                request->data.dsgetdcname.domain_name);
 
        ds_flags = get_dsgetdc_flags(request->data.dsgetdcname.flags);
 
@@ -106,12 +111,12 @@ NTSTATUS winbindd_dsgetdcname_recv(struct tevent_req *req,
        char *guid_str;
        NTSTATUS status;
 
+       D_NOTICE("Winbind external command DSGETDCNAME end.\n");
        if (tevent_req_is_nterror(req, &status)) {
-               DEBUG(5, ("dsgetdcname failed: %s\n", nt_errstr(status)));
+               D_WARNING("Failed with: %s\n", nt_errstr(status));
                return status;
        }
 
-
        fstrcpy(response->data.dsgetdcname.dc_unc,
                state->dc_info->dc_unc);
        fstrcpy(response->data.dsgetdcname.dc_address,