int32_t update_pw_encoding(Slapi_PBlock *orig_pb, Slapi_Entry *e, Slapi_DN *sdn, char *cleartextpassword) {
char *dn = (char *)slapi_sdn_get_ndn(sdn);
Slapi_Attr *pw = NULL;
Slapi_Value **password_values = NULL;
passwdPolicy *pwpolicy = NULL;
struct pw_scheme *curpwsp = NULL;
Slapi_Mods smods;
char *hashed_val = NULL;
Slapi_PBlock *pb = NULL;
int32_t res = 0;
slapi_mods_init(&smods, 0);
/*
* Does the entry have a pw?
*/
if (e == NULL || slapi_entry_attr_find(e, SLAPI_USERPWD_ATTR, &pw) != 0 || pw == NULL) {
slapi_log_err(SLAPI_LOG_WARNING,
"update_pw_encoding", "Could not read password attribute on '%s'\n",
dn);
res = -1;
goto free_and_return;
}