X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=servers%2Fslapd%2Fpasswd.c;h=d22686a9649ea61f1165a203c1213cbf6ff6d5cb;hb=450f352ec14a6c053b50cd2016c197d461990d8e;hp=8b1c299e3c69c7704b60d1d4d66db5c5d3208b39;hpb=c890c96d13c53cf0fa1d9580fea2ab47a2c8caa9;p=openldap diff --git a/servers/slapd/passwd.c b/servers/slapd/passwd.c index 8b1c299e3c..d22686a964 100644 --- a/servers/slapd/passwd.c +++ b/servers/slapd/passwd.c @@ -2,7 +2,7 @@ /* $OpenLDAP$ */ /* This work is part of OpenLDAP Software . * - * Copyright 1998-2008 The OpenLDAP Foundation. + * Copyright 1998-2009 The OpenLDAP Foundation. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -503,14 +503,17 @@ slap_passwd_check( int result = 1; struct berval *bv; AccessControlState acl_state = ACL_STATE_INIT; + char credNul = cred->bv_val[cred->bv_len]; #ifdef SLAPD_SPASSWD void *old_authctx = NULL; - ldap_pvt_thread_pool_setkey( op->o_threadctx, slap_sasl_bind, - op->o_conn->c_sasl_authctx, NULL, &old_authctx, NULL ); + ldap_pvt_thread_pool_setkey( op->o_threadctx, (void *)slap_sasl_bind, + op->o_conn->c_sasl_authctx, 0, &old_authctx, NULL ); #endif + if ( credNul ) cred->bv_val[cred->bv_len] = 0; + for ( bv = a->a_vals; bv->bv_val != NULL; bv++ ) { /* if e is provided, check access */ if ( e && access_allowed( op, e, a->a_desc, bv, @@ -525,9 +528,11 @@ slap_passwd_check( } } + if ( credNul ) cred->bv_val[cred->bv_len] = credNul; + #ifdef SLAPD_SPASSWD - ldap_pvt_thread_pool_setkey( op->o_threadctx, slap_sasl_bind, - old_authctx, NULL, NULL, NULL ); + ldap_pvt_thread_pool_setkey( op->o_threadctx, (void *)slap_sasl_bind, + old_authctx, 0, NULL, NULL ); #endif return result;