/* $OpenLDAP$ */
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
*
- * Copyright 1998-2006 The OpenLDAP Foundation.
+ * Copyright 1998-2007 The OpenLDAP Foundation.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
#include <stdio.h>
-#include <ac/krb.h>
#include <ac/socket.h>
#include <ac/string.h>
#include <ac/unistd.h>
#include <lutil.h>
#include <lutil_sha1.h>
+const struct berval slap_EXOP_MODIFY_PASSWD = BER_BVC(LDAP_EXOP_MODIFY_PASSWD);
+
static const char *defhash[] = {
#ifdef LUTIL_SHA1_BYTES
"{SSHA}",
req_extended_s qext = op->oq_extended;
Modifications *ml;
slap_callback cb = { NULL, slap_null_cb, NULL, NULL };
- slap_callback cb2 = { NULL, slap_replog_cb, NULL, NULL };
int i, nhash;
char **hashes;
int rc;
BackendDB *op_be;
int freenewpw = 0;
- cb2.sc_next = &cb;
-
assert( ber_bvcmp( &slap_EXOP_MODIFY_PASSWD, &op->ore_reqoid ) == 0 );
if( op->o_dn.bv_len == 0 ) {
slap_callback *sc = op->o_callback;
op->o_tag = LDAP_REQ_MODIFY;
- op->o_callback = &cb2;
+ op->o_callback = &cb;
op->orm_modlist = qpw->rs_mods;
- cb2.sc_private = qpw; /* let Modify know this was pwdMod,
+ cb.sc_private = qpw; /* let Modify know this was pwdMod,
* if it cares... */
rs->sr_err = op->o_bd->be_modify( op, rs );
+
+ /* be_modify() might have shuffled modifications */
+ qpw->rs_mods = op->orm_modlist;
+
if ( rs->sr_err == LDAP_SUCCESS ) {
rs->sr_rspdata = rsp;
+
} else if ( rsp ) {
ber_bvfree( rsp );
rsp = NULL;
slap_passwd_generate( struct berval *pass )
{
Debug( LDAP_DEBUG_TRACE, "slap_passwd_generate\n", 0, 0, 0 );
- pass->bv_val = NULL;
- pass->bv_len = 0;
+ BER_BVZERO( pass );
/*
* generate passwords of only 8 characters as some getpass(3)