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

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