summaryrefslogtreecommitdiffstats
path: root/daemons
diff options
context:
space:
mode:
authorMartin Kosek <mkosek@redhat.com>2012-02-02 11:55:14 +0100
committerMartin Kosek <mkosek@redhat.com>2012-02-03 17:21:33 +0100
commitf2cc9c8d33e50b52554a2df8148d4bf7c92fc89a (patch)
tree5a31136a2688526ca5d394b6efe3753da5c10e08 /daemons
parentcf12f3106a7f55fbdb03d64588e8201f14470fe8 (diff)
downloadfreeipa-f2cc9c8d33e50b52554a2df8148d4bf7c92fc89a.tar.gz
freeipa-f2cc9c8d33e50b52554a2df8148d4bf7c92fc89a.tar.xz
freeipa-f2cc9c8d33e50b52554a2df8148d4bf7c92fc89a.zip
Improve password change error message
User always receives the same error message if he changes his password via "ipa passwd" command and the new password fails configured password policy. He then has to investigate on his own the actual reason why was the policy violated. This patch improves our SLAPI PWD plugins to provide a better error message explaining the violation reason. https://fedorahosted.org/freeipa/ticket/2067
Diffstat (limited to 'daemons')
-rw-r--r--daemons/ipa-slapi-plugins/ipa-pwd-extop/ipa_pwd_extop.c2
-rw-r--r--daemons/ipa-slapi-plugins/ipa-pwd-extop/ipapwd_prepost.c4
2 files changed, 3 insertions, 3 deletions
diff --git a/daemons/ipa-slapi-plugins/ipa-pwd-extop/ipa_pwd_extop.c b/daemons/ipa-slapi-plugins/ipa-pwd-extop/ipa_pwd_extop.c
index 82acc49dd..f9cff70cb 100644
--- a/daemons/ipa-slapi-plugins/ipa-pwd-extop/ipa_pwd_extop.c
+++ b/daemons/ipa-slapi-plugins/ipa-pwd-extop/ipa_pwd_extop.c
@@ -461,7 +461,7 @@ parse_req_done:
/* check the policy */
ret = ipapwd_CheckPolicy(&pwdata);
if (ret) {
- errMesg = "Password Fails to meet minimum strength criteria";
+ errMesg = ipapwd_error2string(ret);
if (ret == IPAPWD_POLICY_ERROR) {
errMesg = "Internal error";
rc = ret;
diff --git a/daemons/ipa-slapi-plugins/ipa-pwd-extop/ipapwd_prepost.c b/daemons/ipa-slapi-plugins/ipa-pwd-extop/ipapwd_prepost.c
index a4663c0cc..410c536a5 100644
--- a/daemons/ipa-slapi-plugins/ipa-pwd-extop/ipapwd_prepost.c
+++ b/daemons/ipa-slapi-plugins/ipa-pwd-extop/ipapwd_prepost.c
@@ -302,7 +302,7 @@ static int ipapwd_pre_add(Slapi_PBlock *pb)
ret = ipapwd_CheckPolicy(&pwdop->pwdata);
if (ret) {
- errMesg = "Password Fails to meet minimum strength criteria";
+ errMesg = ipapwd_error2string(ret);
rc = LDAP_CONSTRAINT_VIOLATION;
goto done;
}
@@ -750,7 +750,7 @@ static int ipapwd_pre_mod(Slapi_PBlock *pb)
if (has_krb_keys == 0) {
ret = ipapwd_CheckPolicy(&pwdop->pwdata);
if (ret) {
- errMesg = "Password Fails to meet minimum strength criteria";
+ errMesg = ipapwd_error2string(ret);
rc = LDAP_CONSTRAINT_VIOLATION;
goto done;
}