From: Kurt Zeilenga Date: Tue, 12 Mar 2002 22:46:13 +0000 (+0000) Subject: Align with back-ldbm version X-Git-Tag: OPENLDAP_REL_ENG_2_MP~351 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=dbfc18985a04e58aebf43a98a8f7c798b4ff6d7b;p=openldap Align with back-ldbm version --- diff --git a/servers/slapd/back-bdb/passwd.c b/servers/slapd/back-bdb/passwd.c index bec8619789..8be81e0080 100644 --- a/servers/slapd/back-bdb/passwd.c +++ b/servers/slapd/back-bdb/passwd.c @@ -38,7 +38,8 @@ bdb_exop_passwd( struct berval id = { 0, NULL }; struct berval new = { 0, NULL }; - struct berval *dn; + struct berval dn; + struct berval ndn; assert( reqoid != NULL ); assert( strcmp( LDAP_EXOP_MODIFY_PASSWD, reqoid ) == 0 ); @@ -73,17 +74,27 @@ bdb_exop_passwd( goto done; } - dn = id.bv_val ? &id : &op->o_dn; + if( id.bv_len ) { + dn = id; + } else { + dn = op->o_dn; + } Debug( LDAP_DEBUG_TRACE, "bdb_exop_passwd: \"%s\"%s\n", - dn->bv_val, id.bv_val ? " (proxy)" : "", 0 ); + dn.bv_val, id.bv_len ? " (proxy)" : "", 0 ); - if( dn->bv_len == 0 ) { + if( dn.bv_len == 0 ) { *text = "No password is associated with the Root DSE"; rc = LDAP_OPERATIONS_ERROR; goto done; } + rc = dnNormalize2( NULL, &dn, &ndn ); + if( rc != LDAP_SUCCESS ) { + *text = "Invalid DN"; + goto done; + } + if( 0 ) { retry: /* transaction retry */ if ( e != NULL ) { @@ -121,7 +132,7 @@ retry: /* transaction retry */ op->o_private = &opinfo; /* get entry */ - rc = bdb_dn2entry_w( be, ltid, dn, &e, NULL, 0 ); + rc = bdb_dn2entry_w( be, ltid, &ndn, &e, NULL, 0 ); switch(rc) { case DB_LOCK_DEADLOCK: