]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/back-ldbm/passwd.c
Set peeraddr also for IPv6, fixes ITS#1918
[openldap] / servers / slapd / back-ldbm / passwd.c
index 58d545283290db421167b2a0bd91cd1e7cac3eb9..ae0f245858baf04814381e36a3d84261622085b1 100644 (file)
@@ -42,7 +42,7 @@ ldbm_back_exop_passwd(
        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 );
@@ -108,8 +108,12 @@ ldbm_back_exop_passwd(
                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;
@@ -173,6 +177,7 @@ ldbm_back_exop_passwd(
 done:
        if( e != NULL ) {
                cache_return_entry_w( &li->li_cache, e );
+               ldap_pvt_thread_rdwr_wunlock(&li->li_giant_rwlock);
        }
 
        if( hash.bv_val != NULL ) {