mirror of
https://git.openldap.org/openldap/openldap.git
synced 2024-12-21 03:10:25 +08:00
Use struct berval * instead of ** for newpasswd
This commit is contained in:
parent
7fffc027b3
commit
7e1a566391
@ -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 )
|
||||
{
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user