mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-02-23 14:09:39 +08:00
Statslog additions:
Added StatslogTest macro. Added attributes to modify and search Statslog. Added Statslog of SASL authcid.
This commit is contained in:
parent
f77c8b567e
commit
7c7daf8556
@ -269,8 +269,32 @@ do_modify(
|
||||
}
|
||||
#endif
|
||||
|
||||
Statslog( LDAP_DEBUG_STATS, "conn=%lu op=%lu MOD dn=\"%s\"\n",
|
||||
op->o_connid, op->o_opid, dn.bv_val, 0, 0 );
|
||||
if ( StatslogTest( LDAP_DEBUG_STATS ) ) {
|
||||
char abuf[BUFSIZ/2], *ptr = abuf;
|
||||
int len = 0;
|
||||
|
||||
Statslog( LDAP_DEBUG_STATS, "conn=%lu op=%lu MOD dn=\"%s\"\n",
|
||||
op->o_connid, op->o_opid, dn.bv_val, 0, 0 );
|
||||
|
||||
for ( tmp = modlist; tmp != NULL; tmp = tmp->sml_next ) {
|
||||
if (len + 1 + tmp->sml_type.bv_len > sizeof(abuf)) {
|
||||
Statslog( LDAP_DEBUG_STATS, "conn=%lu op=%lu MOD attr=%s\n",
|
||||
op->o_connid, op->o_opid, abuf, 0, 0 );
|
||||
len = 0;
|
||||
ptr = abuf;
|
||||
}
|
||||
if (len) {
|
||||
*ptr++ = ' ';
|
||||
len++;
|
||||
}
|
||||
ptr = lutil_strcopy(ptr, tmp->sml_type.bv_val);
|
||||
len += tmp->sml_type.bv_len;
|
||||
}
|
||||
if (len) {
|
||||
Statslog( LDAP_DEBUG_STATS, "conn=%lu op=%lu MOD attr=%s\n",
|
||||
op->o_connid, op->o_opid, abuf, 0, 0 );
|
||||
}
|
||||
}
|
||||
|
||||
manageDSAit = get_manageDSAit( op );
|
||||
|
||||
|
@ -764,6 +764,12 @@ slap_sasl_authorize(
|
||||
}
|
||||
|
||||
conn->c_sasl_dn = authzDN;
|
||||
if (conn->c_sasl_bindop) {
|
||||
Statslog( LDAP_DEBUG_STATS,
|
||||
"conn=%lu op=%lu BIND authcid=\"%s\"\n",
|
||||
conn->c_connid, conn->c_sasl_bindop->o_opid,
|
||||
auth_identity, 0, 0);
|
||||
}
|
||||
|
||||
#ifdef NEW_LOGGING
|
||||
LDAP_LOG( TRANSPORT, ENTRY,
|
||||
@ -882,6 +888,13 @@ slap_sasl_authorize(
|
||||
(long) (conn ? conn->c_connid : -1), 0, 0 );
|
||||
#endif
|
||||
|
||||
if (conn->c_sasl_bindop) {
|
||||
Statslog( LDAP_DEBUG_STATS,
|
||||
"conn=%lu op=%lu BIND authcid=\"%s\"\n",
|
||||
conn->c_connid, conn->c_sasl_bindop->o_opid,
|
||||
auth_identity, 0, 0);
|
||||
}
|
||||
|
||||
conn->c_sasl_dn = authzDN;
|
||||
*errstr = NULL;
|
||||
return SASL_OK;
|
||||
|
@ -24,6 +24,7 @@
|
||||
#include <ac/socket.h>
|
||||
|
||||
#include "ldap_pvt.h"
|
||||
#include "lutil.h"
|
||||
#include "slap.h"
|
||||
#include "slapi.h"
|
||||
|
||||
@ -213,9 +214,33 @@ do_search(
|
||||
Debug( LDAP_DEBUG_ARGS, "\n", 0, 0, 0 );
|
||||
#endif
|
||||
|
||||
Statslog( LDAP_DEBUG_STATS,
|
||||
"conn=%lu op=%lu SRCH base=\"%s\" scope=%d filter=\"%s\"\n",
|
||||
op->o_connid, op->o_opid, pbase.bv_val, scope, fstr.bv_val );
|
||||
if ( StatslogTest( LDAP_DEBUG_STATS ) ) {
|
||||
char abuf[BUFSIZ/2], *ptr = abuf;
|
||||
int len = 0;
|
||||
|
||||
Statslog( LDAP_DEBUG_STATS,
|
||||
"conn=%lu op=%lu SRCH base=\"%s\" scope=%d filter=\"%s\"\n",
|
||||
op->o_connid, op->o_opid, pbase.bv_val, scope, fstr.bv_val );
|
||||
|
||||
for ( i = 0; i<siz; i++ ) {
|
||||
if (len + 1 + an[i].an_name.bv_len > sizeof(abuf)) {
|
||||
Statslog( LDAP_DEBUG_STATS, "conn=%lu op=%lu SRCH attr=%s\n",
|
||||
op->o_connid, op->o_opid, abuf, 0, 0 );
|
||||
len = 0;
|
||||
ptr = abuf;
|
||||
}
|
||||
if (len) {
|
||||
*ptr++ = ' ';
|
||||
len++;
|
||||
}
|
||||
ptr = lutil_strcopy(ptr, an[i].an_name.bv_val);
|
||||
len += an[i].an_name.bv_len;
|
||||
}
|
||||
if (len) {
|
||||
Statslog( LDAP_DEBUG_STATS, "conn=%lu op=%lu MOD attr=%s\n",
|
||||
op->o_connid, op->o_opid, abuf, 0, 0 );
|
||||
}
|
||||
}
|
||||
|
||||
manageDSAit = get_manageDSAit( op );
|
||||
|
||||
|
@ -1879,12 +1879,14 @@ typedef struct slap_conn {
|
||||
syslog( ldap_syslog_level, (fmt), (connid), (opid), (arg1), \
|
||||
(arg2), (arg3) ); \
|
||||
} while (0)
|
||||
#define StatslogTest( level ) ((ldap_debug | ldap_syslog) & (level))
|
||||
#elif defined(LDAP_DEBUG)
|
||||
#define Statslog( level, fmt, connid, opid, arg1, arg2, arg3 ) \
|
||||
do { \
|
||||
if ( ldap_debug & (level) ) \
|
||||
fprintf( stderr, (fmt), (connid), (opid), (arg1), (arg2), (arg3) );\
|
||||
} while (0)
|
||||
#define StatslogTest( level ) (ldap_debug & (level))
|
||||
#elif defined(LDAP_SYSLOG)
|
||||
#define Statslog( level, fmt, connid, opid, arg1, arg2, arg3 ) \
|
||||
do { \
|
||||
@ -1892,8 +1894,10 @@ typedef struct slap_conn {
|
||||
syslog( ldap_syslog_level, (fmt), (connid), (opid), (arg1), \
|
||||
(arg2), (arg3) ); \
|
||||
} while (0)
|
||||
#define StatslogTest( level ) (ldap_syslog & (level))
|
||||
#else
|
||||
#define Statslog( level, fmt, connid, opid, arg1, arg2, arg3 )
|
||||
#define StatslogTest( level ) (0)
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user