The branch, master has been updated
       via  2c1a4a516ff ldap_server: Add a ldapsrv debug class to log LDAP 
queries
      from  26c56ae51ec s3:rpc_server: Initialize array

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 2c1a4a516ff425f3b27b52e6b8b63772b589da23
Author: Andréas Leroux <aler...@tranquil.it>
Date:   Fri Jul 5 14:21:33 2024 +0200

    ldap_server: Add a ldapsrv debug class to log LDAP queries
    
    Patch updated for recent samba versions in merge request #3295 by kvvloten
    Initial patch created by Jeremy Allison 
(https://www.spinics.net/lists/samba/msg161128.html) to log LDAP server 
queries/functions in a separate file
    
    Signed-off-by: Andréas Leroux <aler...@tranquil.it>
    Reviewed-by: Andreas Schneider <a...@samba.org>
    Reviewed-by: Jo Sutton <josut...@catalyst.net.nz>
    
    Autobuild-User(master): Andreas Schneider <a...@cryptomilk.org>
    Autobuild-Date(master): Tue Jul  9 08:37:22 UTC 2024 on atb-devel-224

-----------------------------------------------------------------------

Summary of changes:
 docs-xml/smbdotconf/logging/loglevel.xml       | 1 +
 lib/util/debug-classes/debug-classname-table.c | 1 +
 lib/util/debug.h                               | 1 +
 python/samba/tests/logfiles.py                 | 2 +-
 source4/ldap_server/ldap_backend.c             | 3 +++
 source4/ldap_server/ldap_bind.c                | 3 +++
 source4/ldap_server/ldap_extended.c            | 3 +++
 source4/ldap_server/ldap_server.c              | 3 +++
 8 files changed, 16 insertions(+), 1 deletion(-)


Changeset truncated at 500 lines:

diff --git a/docs-xml/smbdotconf/logging/loglevel.xml 
b/docs-xml/smbdotconf/logging/loglevel.xml
index 434c5d06832..19ab2b77571 100644
--- a/docs-xml/smbdotconf/logging/loglevel.xml
+++ b/docs-xml/smbdotconf/logging/loglevel.xml
@@ -57,6 +57,7 @@
        <listitem><para><parameter 
moreinfo="none">dsdb_transaction_json_audit</parameter></para></listitem>
        <listitem><para><parameter 
moreinfo="none">dsdb_group_audit</parameter></para></listitem>
        <listitem><para><parameter 
moreinfo="none">dsdb_group_json_audit</parameter></para></listitem>
+       <listitem><para><parameter 
moreinfo="none">ldapsrv</parameter></para></listitem>
     </itemizedlist>
 
     <para>Various modules register dynamic debug classes at first usage:</para>
diff --git a/lib/util/debug-classes/debug-classname-table.c 
b/lib/util/debug-classes/debug-classname-table.c
index 9062078165a..b57bfc216b8 100644
--- a/lib/util/debug-classes/debug-classname-table.c
+++ b/lib/util/debug-classes/debug-classname-table.c
@@ -59,4 +59,5 @@ static const char *default_classname_table[] = {
        [DBGC_DSDB_TXN_AUDIT_JSON] =    "dsdb_transaction_json_audit",
        [DBGC_DSDB_GROUP_AUDIT] =       "dsdb_group_audit",
        [DBGC_DSDB_GROUP_AUDIT_JSON] =  "dsdb_group_json_audit",
+       [DBGC_LDAPSRV] =                "ldapsrv",
 };
diff --git a/lib/util/debug.h b/lib/util/debug.h
index 4687ac074b1..a4ad56048ff 100644
--- a/lib/util/debug.h
+++ b/lib/util/debug.h
@@ -98,6 +98,7 @@ bool dbgsetclass(int level, int cls);
 #define DBGC_DSDB_TXN_AUDIT_JSON       35
 #define DBGC_DSDB_GROUP_AUDIT  36
 #define DBGC_DSDB_GROUP_AUDIT_JSON     37
+#define DBGC_LDAPSRV           38
 
 /* So you can define DBGC_CLASS before including debug.h */
 #ifndef DBGC_CLASS
diff --git a/python/samba/tests/logfiles.py b/python/samba/tests/logfiles.py
index 38c38045b8d..e8fd4b0c5c4 100644
--- a/python/samba/tests/logfiles.py
+++ b/python/samba/tests/logfiles.py
@@ -33,7 +33,7 @@ CLASS_LIST = ["all", "tdb", "printdrivers", "lanman", "smb",
               "smb2", "smb2_credits", "dsdb_audit", "dsdb_json_audit",
               "dsdb_password_audit", "dsdb_password_json_audit",
               "dsdb_transaction_audit", "dsdb_transaction_json_audit",
-              "dsdb_group_audit", "dsdb_group_json_audit"]
+              "dsdb_group_audit", "dsdb_group_json_audit", "ldapsrv"]
 
 
 CLASS_CODES = {k: i for i, k in enumerate(CLASS_LIST)}
diff --git a/source4/ldap_server/ldap_backend.c 
b/source4/ldap_server/ldap_backend.c
index 3aa7ac38212..986bc1db941 100644
--- a/source4/ldap_server/ldap_backend.c
+++ b/source4/ldap_server/ldap_backend.c
@@ -36,6 +36,9 @@
 #include "libcli/ldap/ldap_proto.h"
 #include "source4/auth/auth.h"
 
+#undef DBGC_CLASS
+#define DBGC_CLASS DBGC_LDAPSRV
+
 static int map_ldb_error(TALLOC_CTX *mem_ctx, int ldb_err,
        const char *add_err_string, const char **errstring)
 {
diff --git a/source4/ldap_server/ldap_bind.c b/source4/ldap_server/ldap_bind.c
index 65e252edb70..f9c7dce312f 100644
--- a/source4/ldap_server/ldap_bind.c
+++ b/source4/ldap_server/ldap_bind.c
@@ -32,6 +32,9 @@
 #include "../lib/util/tevent_ntstatus.h"
 #include "lib/util/time_basic.h"
 
+#undef DBGC_CLASS
+#define DBGC_CLASS DBGC_LDAPSRV
+
 static char *ldapsrv_bind_error_msg(TALLOC_CTX *mem_ctx,
                                    HRESULT hresult,
                                    uint32_t DSID,
diff --git a/source4/ldap_server/ldap_extended.c 
b/source4/ldap_server/ldap_extended.c
index a451050ea75..b4ea4916988 100644
--- a/source4/ldap_server/ldap_extended.c
+++ b/source4/ldap_server/ldap_extended.c
@@ -26,6 +26,9 @@
 #include "librpc/gen_ndr/auth.h"
 #include "libcli/security/security_token.h"
 
+#undef DBGC_CLASS
+#define DBGC_CLASS DBGC_LDAPSRV
+
 struct ldapsrv_starttls_postprocess_context {
        struct ldapsrv_connection *conn;
 };
diff --git a/source4/ldap_server/ldap_server.c 
b/source4/ldap_server/ldap_server.c
index 90316fd6b68..3a91f6d4fc2 100644
--- a/source4/ldap_server/ldap_server.c
+++ b/source4/ldap_server/ldap_server.c
@@ -54,6 +54,9 @@
 
 #undef strcasecmp
 
+#undef DBGC_CLASS
+#define DBGC_CLASS DBGC_LDAPSRV
+
 static void ldapsrv_terminate_connection_done(struct tevent_req *subreq);
 
 /*


-- 
Samba Shared Repository

Reply via email to