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

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