Vendor import of pam_passwdqc v0.5.

This commit is contained in:
des 2002-04-16 22:25:21 +00:00
parent 6b6956a9f0
commit 8c0e4ba23b
2 changed files with 15 additions and 11 deletions

View File

@ -410,12 +410,12 @@ PAM_EXTERN int pam_sm_chauthtok(pam_handle_t *pamh, int flags,
if (status != PAM_SUCCESS) if (status != PAM_SUCCESS)
return status; return status;
if (!newpass || (check_max(&params, pamh, newpass) && enforce)) if (!newpass || (check_max(&params, pamh, newpass) && enforce))
return PAM_AUTHTOK_RECOVERY_ERR; return PAM_AUTHTOK_ERR;
reason = _passwdqc_check(&params.qc, newpass, oldpass, pw); reason = _passwdqc_check(&params.qc, newpass, oldpass, pw);
if (reason) { if (reason) {
say(pamh, PAM_ERROR_MSG, MESSAGE_WEAKPASS, reason); say(pamh, PAM_ERROR_MSG, MESSAGE_WEAKPASS, reason);
if (enforce) if (enforce)
status = PAM_AUTHTOK_RECOVERY_ERR; status = PAM_AUTHTOK_ERR;
} }
return status; return status;
} }
@ -469,12 +469,12 @@ retry:
if (randomonly) { if (randomonly) {
say(pamh, PAM_ERROR_MSG, getuid() != 0 ? say(pamh, PAM_ERROR_MSG, getuid() != 0 ?
MESSAGE_MISCONFIGURED : MESSAGE_RANDOMFAILED); MESSAGE_MISCONFIGURED : MESSAGE_RANDOMFAILED);
return PAM_AUTHTOK_RECOVERY_ERR; return PAM_AUTHTOK_ERR;
} }
status = converse(pamh, PAM_PROMPT_ECHO_OFF, PROMPT_NEWPASS1, &resp); status = converse(pamh, PAM_PROMPT_ECHO_OFF, PROMPT_NEWPASS1, &resp);
if (status == PAM_SUCCESS && (!resp || !resp->resp)) if (status == PAM_SUCCESS && (!resp || !resp->resp))
status = PAM_AUTHTOK_RECOVERY_ERR; status = PAM_AUTHTOK_ERR;
if (status != PAM_SUCCESS) { if (status != PAM_SUCCESS) {
if (randompass) _pam_overwrite(randompass); if (randompass) _pam_overwrite(randompass);
@ -487,11 +487,11 @@ retry:
if (!newpass) { if (!newpass) {
if (randompass) _pam_overwrite(randompass); if (randompass) _pam_overwrite(randompass);
return PAM_AUTHTOK_RECOVERY_ERR; return PAM_AUTHTOK_ERR;
} }
if (check_max(&params, pamh, newpass) && enforce) { if (check_max(&params, pamh, newpass) && enforce) {
status = PAM_AUTHTOK_RECOVERY_ERR; status = PAM_AUTHTOK_ERR;
retry_wanted = 1; retry_wanted = 1;
} }
@ -505,7 +505,7 @@ retry:
else else
say(pamh, PAM_ERROR_MSG, MESSAGE_WEAKPASS, reason); say(pamh, PAM_ERROR_MSG, MESSAGE_WEAKPASS, reason);
if (enforce) { if (enforce) {
status = PAM_AUTHTOK_RECOVERY_ERR; status = PAM_AUTHTOK_ERR;
retry_wanted = 1; retry_wanted = 1;
} }
} }
@ -519,13 +519,13 @@ retry:
status = say(pamh, status = say(pamh,
PAM_ERROR_MSG, MESSAGE_MISTYPED); PAM_ERROR_MSG, MESSAGE_MISTYPED);
if (status == PAM_SUCCESS) { if (status == PAM_SUCCESS) {
status = PAM_AUTHTOK_RECOVERY_ERR; status = PAM_AUTHTOK_ERR;
retry_wanted = 1; retry_wanted = 1;
} }
} }
_pam_drop_reply(resp, 1); _pam_drop_reply(resp, 1);
} else } else
status = PAM_AUTHTOK_RECOVERY_ERR; status = PAM_AUTHTOK_ERR;
} }
if (status == PAM_SUCCESS) if (status == PAM_SUCCESS)

View File

@ -1,8 +1,8 @@
# $Id: pam_passwdqc.spec,v 1.9 2002/02/06 22:36:40 mci Exp $ # $Id: pam_passwdqc.spec,v 1.11 2002/04/16 16:56:52 solar Exp $
Summary: Pluggable password "quality check". Summary: Pluggable password "quality check".
Name: pam_passwdqc Name: pam_passwdqc
Version: 0.4 Version: 0.5
Release: owl1 Release: owl1
License: relaxed BSD and (L)GPL-compatible License: relaxed BSD and (L)GPL-compatible
Group: System Environment/Base Group: System Environment/Base
@ -35,6 +35,10 @@ rm -rf $RPM_BUILD_ROOT
/lib/security/pam_passwdqc.so /lib/security/pam_passwdqc.so
%changelog %changelog
* Tue Apr 16 2002 Solar Designer <solar@owl.openwall.com>
- 0.5: preliminary OpenPAM (FreeBSD-current) support in the code and related
code cleanups (thanks to Dag-Erling Smorgrav).
* Thu Feb 07 2002 Michail Litvak <mci@owl.openwall.com> * Thu Feb 07 2002 Michail Litvak <mci@owl.openwall.com>
- Enforce our new spec file conventions. - Enforce our new spec file conventions.