Use struct berval * instead of ** for newpasswd

This commit is contained in:
Howard Chu 2003-02-16 09:42:04 +00:00
parent 7fffc027b3
commit 7e1a566391
2 changed files with 9 additions and 8 deletions

View File

@ -20,7 +20,7 @@
int ldap_parse_passwd(
LDAP *ld,
LDAPMessage *res,
struct berval **newpasswd )
struct berval *newpasswd )
{
int rc;
char *retoid = NULL;
@ -31,7 +31,8 @@ int ldap_parse_passwd(
assert( res != NULL );
assert( newpasswd != NULL );
*newpasswd = NULL;
newpasswd->bv_val = NULL;
newpasswd->bv_len = 0;
rc = ldap_parse_extended_result( ld, res, &retoid, &retdata, 0 );
@ -49,7 +50,7 @@ int ldap_parse_passwd(
}
/* we should check the tag */
tag = ber_scanf( ber, "{O}", newpasswd );
tag = ber_scanf( ber, "{o}", newpasswd );
ber_free( ber, 1 );
if( tag == LBER_ERROR ) {
@ -129,7 +130,7 @@ ldap_passwd_s(
struct berval *user,
struct berval *oldpw,
struct berval *newpw,
struct berval **newpasswd,
struct berval *newpasswd,
LDAPControl **sctrls,
LDAPControl **cctrls )
{

View File

@ -72,7 +72,7 @@ ldap_back_exop_passwd(
struct berval id = { 0, NULL };
struct berval old = { 0, NULL };
struct berval new = { 0, NULL };
struct berval dn, mdn = { 0, NULL }, *newpw = NULL;
struct berval dn, mdn = { 0, NULL }, newpw;
LDAPMessage *res;
ber_int_t msgid;
char *msg = NULL, *match = NULL;
@ -156,9 +156,9 @@ ldap_back_exop_passwd(
if (rc == LDAP_SUCCESS) {
if (err == LDAP_SUCCESS) {
rc = ldap_parse_passwd(lc->ld, res, &newpw);
if (rc == LDAP_SUCCESS && newpw) {
*rspdata = slap_passwd_return(newpw);
ber_bvfree(newpw);
if (rc == LDAP_SUCCESS && newpw.bv_val) {
*rspdata = slap_passwd_return(&newpw);
free(newpw.bv_val);
}
} else {
rc = err;