Merged revisions 34911 via svnmerge from
[asterisk/asterisk.git] / apps / app_voicemail.c
index f5c362d..629a92a 100644 (file)
@@ -788,8 +788,10 @@ static void vm_change_password_shell(struct ast_vm_user *vmu, char *newpassword)
 {
        char buf[255];
        snprintf(buf,255,"%s %s %s %s",ext_pass_cmd,vmu->context,vmu->mailbox,newpassword);
-       if (!ast_safe_system(buf))
+       if (!ast_safe_system(buf)) {
+               reset_user_pw(vmu->context, vmu->mailbox, newpassword);
                ast_copy_string(vmu->password, newpassword, sizeof(vmu->password));
+       }
 }
 
 static int make_dir(char *dest, int len, const char *context, const char *ext, const char *folder)