Browse Source

Ticket #48394 - lower password history minimum to 1

Description: Per request, lower the minimum value of the kept password
history from 2 to 1 for both Global password policy as well as for
Fine-grained password policy.

https://fedorahosted.org/389/ticket/48394

Reviewed by [email protected] (Thank you, William!!)
Noriko Hosoi 10 years ago
parent
commit
5e689f8d61
2 changed files with 3 additions and 3 deletions
  1. 2 2
      ldap/servers/slapd/libglobs.c
  2. 1 1
      ldap/servers/slapd/modify.c

+ 2 - 2
ldap/servers/slapd/libglobs.c

@@ -3078,10 +3078,10 @@ config_set_pw_inhistory( const char *attrname, char *value, char *errorbuf, int
   errno = 0;
   history = strtol(value, &endp, 10);
 
-  if ( *endp != '\0' || errno == ERANGE || history < 2 || history > 24 ) {
+  if ( *endp != '\0' || errno == ERANGE || history < 1 || history > 24 ) {
 	PR_snprintf ( errorbuf, SLAPI_DSE_RETURNTEXT_SIZE, 
 			  "password history length \"%s\" is invalid. "
-			  "The password history must range from 2 to 24",
+			  "The password history must range from 1 to 24",
 			  value );
 	retVal = LDAP_OPERATIONS_ERROR;
 	return retVal;

+ 1 - 1
ldap/servers/slapd/modify.c

@@ -85,7 +85,7 @@ static struct attr_value_check {
 	{CONFIG_PW_WARNING_ATTRIBUTE, check_pw_duration_value, 0, -1},
 	{CONFIG_PW_MINLENGTH_ATTRIBUTE, attr_check_minmax, 2, 512},
 	{CONFIG_PW_MAXFAILURE_ATTRIBUTE, attr_check_minmax, 1, 32767},
-	{CONFIG_PW_INHISTORY_ATTRIBUTE, attr_check_minmax, 2, 24},
+	{CONFIG_PW_INHISTORY_ATTRIBUTE, attr_check_minmax, 1, 24},
 	{CONFIG_PW_LOCKDURATION_ATTRIBUTE, check_pw_duration_value, -1, -1},
 	{CONFIG_PW_RESETFAILURECOUNT_ATTRIBUTE, check_pw_resetfailurecount_value, -1, -1},
 	{CONFIG_PW_GRACELIMIT_ATTRIBUTE, attr_check_minmax, 0, -1},