diff options
author | ryoon <ryoon@pkgsrc.org> | 2014-05-04 09:30:26 +0000 |
---|---|---|
committer | ryoon <ryoon@pkgsrc.org> | 2014-05-04 09:30:26 +0000 |
commit | 4690d167456860659568c8b6c81e82f77d267c63 (patch) | |
tree | cd58d637f6c245c197dfc71ef6d0f7049f6667d8 /security | |
parent | dc94b29b2bf061877c6abb785591f3a22c3f6aa6 (diff) | |
download | pkgsrc-4690d167456860659568c8b6c81e82f77d267c63.tar.gz |
Fix build under OpenBSD 5.5
* OpenBSD 5.5 has no _PASSWORD_WARNDAYS definition in its header files
Declare _PASSWORD_WARNDAYS as 14 if _PASSWORD_WARNDAYS is not defined.
Move the definition above its use.
Diffstat (limited to 'security')
-rw-r--r-- | security/PAM/distinfo | 4 | ||||
-rw-r--r-- | security/PAM/patches/patch-ap | 32 |
2 files changed, 22 insertions, 14 deletions
diff --git a/security/PAM/distinfo b/security/PAM/distinfo index 552efbe89df..532633a8a00 100644 --- a/security/PAM/distinfo +++ b/security/PAM/distinfo @@ -1,4 +1,4 @@ -$NetBSD: distinfo,v 1.17 2010/02/02 17:09:28 tnn Exp $ +$NetBSD: distinfo,v 1.18 2014/05/04 09:30:26 ryoon Exp $ SHA1 (Linux-PAM-0.77.tar.gz) = 58dff29aec3c0b6a9e9b53af6fb643056ce0f304 RMD160 (Linux-PAM-0.77.tar.gz) = 15391ed7bed7b506bb391608b735332d0391580c @@ -18,7 +18,7 @@ SHA1 (patch-al) = 29c9ca136655d49d739d3c4dc664af9f0b1a5fa8 SHA1 (patch-am) = 9cf69342d0c6665ff6d9eebec35d6c3898854c8a SHA1 (patch-an) = 46e85fc6db95eda99ed664e7d4282a49d95437c4 SHA1 (patch-ao) = da8c42c2afa2c66fee4e8f453970d1a4b3a0f285 -SHA1 (patch-ap) = 0a923b67a909dde6f72129b0c853088f9d48bd91 +SHA1 (patch-ap) = 92fbf06fb0cbf89971ebd59e8172c3db2f406963 SHA1 (patch-aq) = 91587c5b9c6587221708247decb0e82f665ae2bf SHA1 (patch-ar) = b8072ebbc1a38c26d44c0e087a2b8b93f1eb7768 SHA1 (patch-as) = e4fdfef53c097985c2aa8ff8225fed1caa812c10 diff --git a/security/PAM/patches/patch-ap b/security/PAM/patches/patch-ap index 2984b120b4f..cd43de059be 100644 --- a/security/PAM/patches/patch-ap +++ b/security/PAM/patches/patch-ap @@ -1,6 +1,6 @@ -$NetBSD: patch-ap,v 1.3 2002/12/23 21:23:59 jlam Exp $ +$NetBSD: patch-ap,v 1.4 2014/05/04 09:30:26 ryoon Exp $ ---- modules/pam_unix/pam_unix_acct.c.orig Wed Dec 20 00:15:05 2000 +--- modules/pam_unix/pam_unix_acct.c.orig 2000-12-20 05:15:05.000000000 +0000 +++ modules/pam_unix/pam_unix_acct.c @@ -43,7 +43,9 @@ #include <sys/types.h> @@ -12,7 +12,18 @@ $NetBSD: patch-ap,v 1.3 2002/12/23 21:23:59 jlam Exp $ #include <time.h> /* for time() */ #include <security/_pam_macros.h> -@@ -71,8 +73,10 @@ PAM_EXTERN int pam_sm_acct_mgmt(pam_hand +@@ -60,6 +62,10 @@ + + #include "support.h" + ++#ifndef _PASSWORD_WARNDAYS ++#define _PASSWORD_WARNDAYS 14 ++#endif ++ + /* + * PAM framework looks for this entry-point to pass control to the + * account management module. +@@ -71,8 +77,10 @@ PAM_EXTERN int pam_sm_acct_mgmt(pam_hand unsigned int ctrl; const char *uname; int retval, daysleft; @@ -24,7 +35,7 @@ $NetBSD: patch-ap,v 1.3 2002/12/23 21:23:59 jlam Exp $ struct passwd *pwent; char buf[80]; -@@ -113,7 +117,9 @@ PAM_EXTERN int pam_sm_acct_mgmt(pam_hand +@@ -113,7 +121,9 @@ PAM_EXTERN int pam_sm_acct_mgmt(pam_hand return PAM_CRED_INSUFFICIENT; } } @@ -34,7 +45,7 @@ $NetBSD: patch-ap,v 1.3 2002/12/23 21:23:59 jlam Exp $ if (save_uid == pwent->pw_uid) setreuid( save_uid, save_euid ); else { -@@ -123,15 +129,21 @@ PAM_EXTERN int pam_sm_acct_mgmt(pam_hand +@@ -123,15 +133,21 @@ PAM_EXTERN int pam_sm_acct_mgmt(pam_hand } } else if (!strcmp( pwent->pw_passwd, "x" )) { @@ -57,7 +68,7 @@ $NetBSD: patch-ap,v 1.3 2002/12/23 21:23:59 jlam Exp $ D(("today is %d, last change %d", curdays, spent->sp_lstchg)); if ((curdays > spent->sp_expire) && (spent->sp_expire != -1) && (spent->sp_lstchg != 0)) { -@@ -143,6 +155,29 @@ PAM_EXTERN int pam_sm_acct_mgmt(pam_hand +@@ -143,6 +159,29 @@ PAM_EXTERN int pam_sm_acct_mgmt(pam_hand D(("account expired")); return PAM_ACCT_EXPIRED; } @@ -87,7 +98,7 @@ $NetBSD: patch-ap,v 1.3 2002/12/23 21:23:59 jlam Exp $ if ((curdays > (spent->sp_lstchg + spent->sp_max + spent->sp_inact)) && (spent->sp_max != -1) && (spent->sp_inact != -1) && (spent->sp_lstchg != 0)) { -@@ -154,7 +189,9 @@ PAM_EXTERN int pam_sm_acct_mgmt(pam_hand +@@ -154,7 +193,9 @@ PAM_EXTERN int pam_sm_acct_mgmt(pam_hand D(("account expired 2")); return PAM_ACCT_EXPIRED; } @@ -97,7 +108,7 @@ $NetBSD: patch-ap,v 1.3 2002/12/23 21:23:59 jlam Exp $ if (spent->sp_lstchg == 0) { _log_err(LOG_NOTICE, pamh ,"expired password for user %s (root enforced)" -@@ -173,6 +210,19 @@ PAM_EXTERN int pam_sm_acct_mgmt(pam_hand +@@ -173,6 +214,19 @@ PAM_EXTERN int pam_sm_acct_mgmt(pam_hand D(("need a new password 2")); return PAM_NEW_AUTHTOK_REQD; } @@ -117,14 +128,11 @@ $NetBSD: patch-ap,v 1.3 2002/12/23 21:23:59 jlam Exp $ if ((curdays > (spent->sp_lstchg + spent->sp_max - spent->sp_warn)) && (spent->sp_max != -1) && (spent->sp_warn != -1)) { daysleft = (spent->sp_lstchg + spent->sp_max) - curdays; -@@ -183,6 +233,21 @@ PAM_EXTERN int pam_sm_acct_mgmt(pam_hand +@@ -183,6 +237,18 @@ PAM_EXTERN int pam_sm_acct_mgmt(pam_hand daysleft, daysleft == 1 ? "" : "s"); _make_remark(pamh, ctrl, PAM_TEXT_INFO, buf); } +#else -+#ifndef _PASSWORD_WARNDAYS -+#define _PASSWORD_WARNDAYS 14 -+#endif + if ((now + _PASSWORD_WARNDAYS * 60 * 60 * 24 > pwent->pw_change) + && (pwent->pw_change != 0) && (pwent->pw_change != -1)) { + daysleft = (pwent->pw_change - now) / (60 * 60 * 24); |