From a9fb92467ed584ecc0d7c0c44ce0969eeacb4963 Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Mon, 29 Nov 1999 17:44:14 +0000 Subject: [PATCH] Add send_ldap_sasl() to facility implementation of SASL bind. --- servers/slapd/proto-slap.h | 10 ++++++++-- servers/slapd/result.c | 39 +++++++++++++++++++++++++++++++++++-- servers/slapd/tools/mimic.c | 27 +++++++++++++++++++++++++ 3 files changed, 72 insertions(+), 4 deletions(-) diff --git a/servers/slapd/proto-slap.h b/servers/slapd/proto-slap.h index 8cd5406c1b..7064a4da49 100644 --- a/servers/slapd/proto-slap.h +++ b/servers/slapd/proto-slap.h @@ -330,6 +330,12 @@ LIBSLAPD_F (void) send_ldap_result LDAP_P(( struct berval **refs, LDAPControl **ctrls )); +LIBSLAPD_F (void) send_ldap_sasl LDAP_P(( + Connection *conn, Operation *op, + ber_int_t err, const char *matched, + const char *text, + struct berval *cred )); + LIBSLAPD_F (void) send_ldap_disconnect LDAP_P(( Connection *conn, Operation *op, ber_int_t err, const char *text )); @@ -337,8 +343,8 @@ LIBSLAPD_F (void) send_ldap_disconnect LDAP_P(( LIBSLAPD_F (void) send_ldap_extended LDAP_P(( Connection *conn, Operation *op, ber_int_t err, const char *matched, - const char *text, char *rspoid, - struct berval *rspdata )); + const char *text, + char *rspoid, struct berval *rspdata )); LIBSLAPD_F (void) send_search_result LDAP_P(( Connection *conn, Operation *op, diff --git a/servers/slapd/result.c b/servers/slapd/result.c index c7f6892dfd..510102a7c0 100644 --- a/servers/slapd/result.c +++ b/servers/slapd/result.c @@ -440,6 +440,41 @@ send_ldap_result( } } +void +send_ldap_sasl( + Connection *conn, + Operation *op, + ber_int_t err, + const char *matched, + const char *text, + struct berval *cred +) +{ + ber_tag_t tag; + ber_int_t msgid; + + Debug( LDAP_DEBUG_TRACE, "send_ldap_sasl %ld\n", + (long) err, NULL, NULL ); + + tag = req2res( op->o_tag ); + msgid = (tag != LBER_SEQUENCE) ? op->o_msgid : 0; + +#ifdef LDAP_CONNECTIONLESS + if ( op->o_cldap ) { + ber_pvt_sb_udp_set_dst( conn->c_sb, &op->o_clientaddr ); + Debug( LDAP_DEBUG_TRACE, "UDP response to %s port %d\n", + inet_ntoa(((struct sockaddr_in *) + &op->o_clientaddr)->sin_addr ), + ((struct sockaddr_in *) &op->o_clientaddr)->sin_port, + 0 ); + } +#endif + + send_ldap_response( conn, op, tag, msgid, + err, matched, text, NULL, + NULL, cred, NULL ); +} + void send_ldap_extended( Connection *conn, @@ -455,8 +490,8 @@ send_ldap_extended( ber_int_t msgid; Debug( LDAP_DEBUG_TRACE, - "send_ldap_extended %d:%s\n", - err, rspoid ? rspoid : "", NULL ); + "send_ldap_extended %ld:%s\n", + (long) err, rspoid ? rspoid : "", NULL ); tag = req2res( op->o_tag ); msgid = (tag != LBER_SEQUENCE) ? op->o_msgid : 0; diff --git a/servers/slapd/tools/mimic.c b/servers/slapd/tools/mimic.c index 55d35c6090..caea1a5135 100644 --- a/servers/slapd/tools/mimic.c +++ b/servers/slapd/tools/mimic.c @@ -39,6 +39,33 @@ send_ldap_disconnect( assert(0); } +void +send_ldap_extended( + Connection *conn, + Operation *op, + ber_int_t err, + const char *matched, + const char *text, + char *rspoid, + struct berval *rspdata +) +{ + assert(0); +} + +void +send_ldap_sasl( + Connection *conn, + Operation *op, + ber_int_t err, + const char *matched, + const char *text, + struct berval *cred +) +{ + assert(0); +} + void send_ldap_result( Connection *conn, -- 2.39.5