diff options
author | Stefan Metzmacher <metze@samba.org> | 2020-08-11 18:24:39 +0200 |
---|---|---|
committer | Karolin Seeger <kseeger@samba.org> | 2020-08-31 09:26:36 +0000 |
commit | 02a5b62be8d34d55c1202644fd123eb76ee498de (patch) | |
tree | c182d06f831f722643fa3541623c9cbc703c443a | |
parent | 96a67ce2b2f8a248ad26d99d194080628d035555 (diff) | |
download | samba-02a5b62be8d34d55c1202644fd123eb76ee498de.tar.gz |
idmap_ad: Pass tldap debug messages on to DEBUG()
Bug: https://bugzilla.samba.org/show_bug.cgi?id=14465
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
(cherry picked from commit 7af2df01dff62d6d9ca572f320ef60dea41d6064)
-rw-r--r-- | source3/winbindd/idmap_ad.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/source3/winbindd/idmap_ad.c b/source3/winbindd/idmap_ad.c index 6d879cdf4d7..3bfeeee2d74 100644 --- a/source3/winbindd/idmap_ad.c +++ b/source3/winbindd/idmap_ad.c @@ -254,6 +254,41 @@ static TLDAPRC get_posix_schema_names(struct tldap_context *ld, return TLDAP_SUCCESS; } +static void idmap_ad_tldap_debug(void *log_private, + enum tldap_debug_level level, + const char *fmt, + va_list ap) +{ + int samba_level = -1; + + switch (level) { + case TLDAP_DEBUG_FATAL: + samba_level = DBGLVL_ERR; + break; + case TLDAP_DEBUG_ERROR: + samba_level = DBGLVL_ERR; + break; + case TLDAP_DEBUG_WARNING: + samba_level = DBGLVL_WARNING; + break; + case TLDAP_DEBUG_TRACE: + samba_level = DBGLVL_DEBUG; + break; + } + + if (CHECK_DEBUGLVL(samba_level)) { + char *s = NULL; + int ret; + + ret = vasprintf(&s, fmt, ap); + if (ret == -1) { + return; + } + DEBUG(samba_level, ("idmap_ad_tldap: %s", s)); + free(s); + } +} + static NTSTATUS idmap_ad_get_tldap_ctx(TALLOC_CTX *mem_ctx, const char *domname, struct tldap_context **pld) @@ -307,6 +342,7 @@ static NTSTATUS idmap_ad_get_tldap_ctx(TALLOC_CTX *mem_ctx, TALLOC_FREE(dcinfo); return NT_STATUS_NO_MEMORY; } + tldap_set_debug(ld, idmap_ad_tldap_debug, NULL); /* * Here we use or own machine account as |