/* passwd.c - ldbm backend password routines */
/* $OpenLDAP$ */
/*
- * Copyright 1998-2000 The OpenLDAP Foundation, All Rights Reserved.
+ * Copyright 1998-2002 The OpenLDAP Foundation, All Rights Reserved.
* COPYING RESTRICTIONS APPLY, see COPYRIGHT file
*/
struct berval **rspdata,
LDAPControl *** rspctrls,
const char **text,
- BVarray *refs
+ BerVarray *refs
)
{
struct ldbminfo *li = (struct ldbminfo *) be->be_private;
struct berval ndn;
assert( reqoid != NULL );
- assert( strcmp( LDAP_EXOP_X_MODIFY_PASSWD, reqoid ) == 0 );
+ assert( strcmp( LDAP_EXOP_MODIFY_PASSWD, reqoid ) == 0 );
rc = slap_passwd_parse( reqdata,
&id, NULL, &new, text );
goto done;
}
+ /* grab giant lock for writing */
+ ldap_pvt_thread_rdwr_wlock(&li->li_giant_rwlock);
+
e = dn2entry_w( be, &ndn, NULL );
if( e == NULL ) {
+ ldap_pvt_thread_rdwr_wunlock(&li->li_giant_rwlock);
*text = "could not locate authorization entry";
rc = LDAP_NO_SUCH_OBJECT;
goto done;
done:
if( e != NULL ) {
cache_return_entry_w( &li->li_cache, e );
- }
-
- if( id.bv_val != NULL ) {
- free( id.bv_val );
- }
-
- if( new.bv_val != NULL ) {
- free( new.bv_val );
+ ldap_pvt_thread_rdwr_wunlock(&li->li_giant_rwlock);
}
if( hash.bv_val != NULL ) {