1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-21 09:34:19 +03:00

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 <aleroux@tranquil.it>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jo Sutton <josutton@catalyst.net.nz>

Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Tue Jul  9 08:37:22 UTC 2024 on atb-devel-224
This commit is contained in:
Andréas Leroux 2024-07-05 14:21:33 +02:00 committed by Andreas Schneider
parent 26c56ae51e
commit 2c1a4a516f
8 changed files with 16 additions and 1 deletions

View File

@ -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>

View File

@ -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",
};

View File

@ -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

View File

@ -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)}

View File

@ -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)
{

View File

@ -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,

View File

@ -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;
};

View File

@ -54,6 +54,9 @@
#undef strcasecmp
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_LDAPSRV
static void ldapsrv_terminate_connection_done(struct tevent_req *subreq);
/*