andykimpe / rpms / 389-ds-base

Forked from rpms/389-ds-base 5 months ago
Clone

Blame SOURCES/0066-Ticket-49370-local-password-policies-should-use-the-.patch

b69e47
From 1ec56936d29985a55f9529c1ea3e71056557b3ff Mon Sep 17 00:00:00 2001
b69e47
From: Mark Reynolds <mreynolds@redhat.com>
b69e47
Date: Fri, 1 Sep 2017 09:24:55 -0400
b69e47
Subject: [PATCH] Ticket 49370 - local password policies should use the same
b69e47
 defaults as the global policy
b69e47
b69e47
Description:  When a local password policy (subtree/user) is created it does not use
b69e47
              the same defaults as the global policy.  This causes inconsistent behavior.
b69e47
b69e47
https://pagure.io/389-ds-base/issue/49370
b69e47
b69e47
Reviewed by: firstyear(Thanks!)
b69e47
---
b69e47
 ldap/servers/slapd/pw.c | 21 +++++++++++++++++++++
b69e47
 1 file changed, 21 insertions(+)
b69e47
b69e47
diff --git a/ldap/servers/slapd/pw.c b/ldap/servers/slapd/pw.c
b69e47
index 378d148..19a863a 100644
b69e47
--- a/ldap/servers/slapd/pw.c
b69e47
+++ b/ldap/servers/slapd/pw.c
b69e47
@@ -1768,6 +1768,27 @@ new_passwdPolicy(Slapi_PBlock *pb, const char *dn)
b69e47
 				goto done;
b69e47
 			}
b69e47
 
b69e47
+			/* Set the default values */
b69e47
+			pwdpolicy->pw_mintokenlength = SLAPD_DEFAULT_PW_MINTOKENLENGTH;
b69e47
+			pwdpolicy->pw_minlength = SLAPD_DEFAULT_PW_MINLENGTH;
b69e47
+			pwdpolicy->pw_mindigits = SLAPD_DEFAULT_PW_MINDIGITS;
b69e47
+			pwdpolicy->pw_minalphas = SLAPD_DEFAULT_PW_MINALPHAS;
b69e47
+			pwdpolicy->pw_minuppers = SLAPD_DEFAULT_PW_MINUPPERS;
b69e47
+			pwdpolicy->pw_minlowers = SLAPD_DEFAULT_PW_MINLOWERS;
b69e47
+			pwdpolicy->pw_minspecials = SLAPD_DEFAULT_PW_MINSPECIALS;
b69e47
+			pwdpolicy->pw_min8bit = SLAPD_DEFAULT_PW_MIN8BIT;
b69e47
+			pwdpolicy->pw_maxrepeats = SLAPD_DEFAULT_PW_MAXREPEATS;
b69e47
+			pwdpolicy->pw_mincategories = SLAPD_DEFAULT_PW_MINCATEGORIES;
b69e47
+			pwdpolicy->pw_mintokenlength = SLAPD_DEFAULT_PW_MINTOKENLENGTH;
b69e47
+			pwdpolicy->pw_maxage = SLAPD_DEFAULT_PW_MAXAGE;
b69e47
+			pwdpolicy->pw_minage = SLAPD_DEFAULT_PW_MINAGE;
b69e47
+			pwdpolicy->pw_warning = SLAPD_DEFAULT_PW_WARNING;
b69e47
+			pwdpolicy->pw_inhistory = SLAPD_DEFAULT_PW_INHISTORY;
b69e47
+			pwdpolicy->pw_maxfailure = SLAPD_DEFAULT_PW_MAXFAILURE;
b69e47
+			pwdpolicy->pw_lockduration = SLAPD_DEFAULT_PW_LOCKDURATION;
b69e47
+			pwdpolicy->pw_resetfailurecount = SLAPD_DEFAULT_PW_RESETFAILURECOUNT;
b69e47
+			pwdpolicy->pw_gracelimit = SLAPD_DEFAULT_PW_GRACELIMIT;
b69e47
+
b69e47
 			/* set the default passwordLegacyPolicy setting */
b69e47
 			pwdpolicy->pw_is_legacy = 1;
b69e47
 
b69e47
-- 
b69e47
2.9.5
b69e47