From bcd7306877b6f6324af9f0148de2672897f597aa Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Mon, 20 Jan 2003 18:09:46 +0000 Subject: [PATCH] ITS#2268: SASL/ANONYMOUS fixes from kuenne@rentec.com --- servers/slapd/bind.c | 11 ++++++++--- servers/slapd/sasl.c | 26 ++++++++++++++------------ 2 files changed, 22 insertions(+), 15 deletions(-) diff --git a/servers/slapd/bind.c b/servers/slapd/bind.c index 24de0218e8..971bd2b0bf 100644 --- a/servers/slapd/bind.c +++ b/servers/slapd/bind.c @@ -331,16 +331,21 @@ do_bind( Statslog( LDAP_DEBUG_STATS, "conn=%lu op=%lu AUTHZ dn=\"%s\" mech=%s ssf=%d\n", op->o_connid, op->o_opid, - conn->c_dn.bv_val, conn->c_authmech.bv_val, ssf ); + conn->c_dn.bv_val ? conn->c_dn.bv_val : "", + conn->c_authmech.bv_val, ssf ); #ifdef NEW_LOGGING LDAP_LOG( OPERATION, DETAIL1, "do_bind: SASL/%s bind: dn=\"%s\" ssf=%d\n", - conn->c_authmech.bv_val, conn->c_dn.bv_val, ssf ); + conn->c_authmech.bv_val, + conn->c_dn.bv_val ? conn->c_dn.bv_val : "", + ssf ); #else Debug( LDAP_DEBUG_TRACE, "do_bind: SASL/%s bind: dn=\"%s\" ssf=%d\n", - conn->c_authmech.bv_val, conn->c_dn.bv_val, ssf ); + conn->c_authmech.bv_val, + conn->c_dn.bv_val ? conn->c_dn.bv_val : "", + ssf ); #endif } else if ( rc == LDAP_SASL_BIND_IN_PROGRESS ) { diff --git a/servers/slapd/sasl.c b/servers/slapd/sasl.c index 61511fa534..4514f3ceff 100644 --- a/servers/slapd/sasl.c +++ b/servers/slapd/sasl.c @@ -610,13 +610,13 @@ slap_sasl_canonicalize( LDAP_LOG( TRANSPORT, ENTRY, "slap_sasl_canonicalize: conn %d %s=\"%s\"\n", conn ? conn->c_connid : -1, - (flags & SASL_CU_AUTHID) ? "authcid" : "authzid", in ? in : ""); + (flags & SASL_CU_AUTHID) ? "authcid" : "authzid", + in ? in : ""); #else - Debug( LDAP_DEBUG_ARGS, "SASL Canonicalize [conn=%ld]: " - "%s=\"%s\"\n", - conn ? conn->c_connid : -1, - (flags & SASL_CU_AUTHID) ? "authcid" : "authzid", - in ? in : "" ); + Debug( LDAP_DEBUG_ARGS, "SASL Canonicalize [conn=%ld]: %s=\"%s\"\n", + conn ? conn->c_connid : -1, + (flags & SASL_CU_AUTHID) ? "authcid" : "authzid", + in ? in : ""); #endif /* If name is too big, just truncate. We don't care, we're @@ -685,14 +685,16 @@ slap_sasl_canonicalize( #ifdef NEW_LOGGING LDAP_LOG( TRANSPORT, ENTRY, "slap_sasl_canonicalize: conn %d %s=\"%s\"\n", - conn ? conn->c_connid : -1, names[0]+1, dn.bv_val ); + conn ? conn->c_connid : -1, names[0]+1, + dn.bv_val ? dn.bv_val : "" ); #else - Debug( LDAP_DEBUG_ARGS, "SASL Canonicalize [conn=%ld]: " - "%s=\"%s\"\n", - conn ? conn->c_connid : -1, - names[0]+1, dn.bv_val ); + Debug( LDAP_DEBUG_ARGS, "SASL Canonicalize [conn=%ld]: %s=\"%s\"\n", + conn ? conn->c_connid : -1, names[0]+1, + dn.bv_val ? dn.bv_val : "" ); #endif -done: AC_MEMCPY( out, in, inlen ); + +done: + AC_MEMCPY( out, in, inlen ); out[inlen] = '\0'; *out_len = inlen; -- 2.39.5