]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/back-ldbm/passwd.c
Notices and acknowledgements
[openldap] / servers / slapd / back-ldbm / passwd.c
index 34c5bb523bb429bf433081c377981dcd53886fac..b5d0c5ebdcce00a6a05111968bf8832a1ee82fb4 100644 (file)
@@ -40,13 +40,12 @@ ldbm_back_exop_passwd(
 
 #ifdef NEW_LOGGING
        LDAP_LOG( BACK_LDBM, ENTRY,
-                  "ldbm_back_exop_passwd: \"%s\"\n", id.bv_val ? id.bv_val : "", 0,0 );
+               "ldbm_back_exop_passwd: \"%s\"\n", id.bv_val ? id.bv_val : "", 0,0 );
 #else
        Debug( LDAP_DEBUG_ARGS, "==> ldbm_back_exop_passwd: \"%s\"\n",
                id.bv_val ? id.bv_val : "", 0, 0 );
 #endif
 
-
        if( rc != LDAP_SUCCESS ) {
                goto done;
        }
@@ -63,10 +62,10 @@ ldbm_back_exop_passwd(
                rs->sr_rspdata = slap_passwd_return( &new );
        }
 
-       slap_passwd_hash( &new, &hash );
+       slap_passwd_hash( &new, &hash, &rs->sr_text );
 
        if( hash.bv_len == 0 ) {
-               rs->sr_text = "password hash failed";
+               if( !rs->sr_text ) rs->sr_text = "password hash failed";
                rc = LDAP_OTHER;
                goto done;
        }
@@ -102,13 +101,24 @@ ldbm_back_exop_passwd(
        ldap_pvt_thread_rdwr_wlock(&li->li_giant_rwlock);
 
        e = dn2entry_w( op->o_bd, &ndn, NULL );
-       if( e == NULL ) {
+
+       if ( e == NULL || is_entry_glue( e )) {
+               /* FIXME : dn2entry() should return non-glue entry */
                ldap_pvt_thread_rdwr_wunlock(&li->li_giant_rwlock);
                rs->sr_text = "could not locate authorization entry";
                rc = LDAP_NO_SUCH_OBJECT;
                goto done;
        }
 
+#ifdef LDBM_SUBENTRIES
+       if( is_entry_subentry( e ) ) {
+               /* entry is a subentry, don't allow operation */
+               rs->sr_text = "authorization entry is subentry";
+               rc = LDAP_OTHER;
+               goto done;
+       }
+#endif
+
        if( is_entry_alias( e ) ) {
                /* entry is an alias, don't allow operation */
                rs->sr_text = "authorization entry is alias";