X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=servers%2Fslapd%2Fconnection.c;h=bc2b8a4d09d2cd7fd3de7e7ec658ddc85b93457e;hb=4d02a43ec9a4be422d83094e8d39b7ef3bc290c5;hp=7f9cd8adbf3713228220bd48f65062ce66f985cf;hpb=3bf87500a3a417d912ced6260464e709293098e5;p=openldap diff --git a/servers/slapd/connection.c b/servers/slapd/connection.c index 7f9cd8adbf..bc2b8a4d09 100644 --- a/servers/slapd/connection.c +++ b/servers/slapd/connection.c @@ -1,7 +1,7 @@ /* $OpenLDAP$ */ /* This work is part of OpenLDAP Software . * - * Copyright 1998-2012 The OpenLDAP Foundation. + * Copyright 1998-2013 The OpenLDAP Foundation. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -406,6 +406,7 @@ Connection * connection_init( c->c_sasl_sockctx = NULL; c->c_sasl_extra = NULL; c->c_sasl_bindop = NULL; + c->c_sasl_cbind = NULL; c->c_sb = ber_sockbuf_alloc( ); @@ -451,6 +452,7 @@ Connection * connection_init( assert( c->c_sasl_sockctx == NULL ); assert( c->c_sasl_extra == NULL ); assert( c->c_sasl_bindop == NULL ); + assert( c->c_sasl_cbind == NULL ); assert( c->c_currentber == NULL ); assert( c->c_writewaiter == 0); assert( c->c_writers == 0); @@ -574,6 +576,11 @@ Connection * connection_init( backend_connection_init(c); ldap_pvt_thread_mutex_unlock( &c->c_mutex ); + if ( !(flags & CONN_IS_UDP )) + Statslog( LDAP_DEBUG_STATS, + "conn=%ld fd=%ld ACCEPT from %s (%s)\n", + id, (long) s, peername, listener->sl_name.bv_val, 0 ); + return c; } @@ -1403,6 +1410,12 @@ connection_read( ber_socket_t s, conn_readinfo *cri ) c->c_connid, (int) s, c->c_tls_ssf, c->c_ssf, 0 ); slap_sasl_external( c, c->c_tls_ssf, &authid ); if ( authid.bv_val ) free( authid.bv_val ); + { + char cbinding[64]; + struct berval cbv = { sizeof(cbinding), cbinding }; + if ( ldap_pvt_tls_get_unique( ssl, &cbv, 1 )) + slap_sasl_cbinding( c, &cbv ); + } } else if ( rc == 1 && ber_sockbuf_ctrl( c->c_sb, LBER_SB_OPT_NEEDS_WRITE, NULL )) { /* need to retry */ slapd_set_write( s, 1 );