File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed
security-admin/src/main/java/org/apache/ranger/biz Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -530,17 +530,17 @@ public VXPortalUser changeEmailAddress(XXPortalUser gjUser,
530530 MessageEnums .OPER_NO_PERMISSION , null , null , ""
531531 + changeEmail );
532532 }
533- } else {
534- String encryptedOldPwd = encrypt (gjUser .getLoginId (), changeEmail .getOldPassword ());
533+ } else {
534+ String encryptedOldPwd = encrypt (gjUser .getLoginId (), changeEmail .getOldPassword ());
535+ if (!stringUtil .equals (encryptedOldPwd , gjUser .getPassword ())) {
536+ encryptedOldPwd = encryptWithOlderAlgo (gjUser .getLoginId (), changeEmail .getOldPassword ());
535537 if (!stringUtil .equals (encryptedOldPwd , gjUser .getPassword ())) {
536- logger .info ("changeEmailAddress(). Invalid password. changeEmail="
537- + changeEmail );
538- throw restErrorUtil .createRESTException (
539- "serverMsg.userMgrWrongPassword" ,
540- MessageEnums .OPER_NO_PERMISSION , null , null , ""
541- + changeEmail );
538+ logger .info ("changeEmailAddress(). Invalid password. changeEmail=" + changeEmail );
539+ throw restErrorUtil .createRESTException ("serverMsg.userMgrWrongPassword" ,
540+ MessageEnums .OPER_NO_PERMISSION , null , null , "" + changeEmail );
542541 }
543542 }
543+ }
544544
545545 // Normalize email. Make it lower case
546546 gjUser .setEmailAddress (stringUtil .normalizeEmail (changeEmail
You can’t perform that action at this time.
0 commit comments