From 576774dc7cc0f7af7505f0f1a19b52e3c84c6625 Mon Sep 17 00:00:00 2001 From: Thierry Bordaz Date: Fri, 14 Dec 2018 17:42:22 +0100 Subject: [PATCH] Ticket 50091 - shadowWarning is not generated if passwordWarning is lower than 86400 seconds (1 day) Bug Description: For a shadowAccount, if a password policy defines passwordWarning below 1 days (86400 seconds) then the shadowWarning (in day) is not returned from the entry. In such case its value is '0'. Fix Description: The fix is to accept shadowWarning = 0 as valid value and return it https://pagure.io/389-ds-base/issue/50091 Reviewed by: Mark Reynolds Platforms tested: F27 Flag Day: no Doc impact: no --- ldap/servers/slapd/pw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ldap/servers/slapd/pw.c b/ldap/servers/slapd/pw.c index ec23ed1a5..11149f51a 100644 --- a/ldap/servers/slapd/pw.c +++ b/ldap/servers/slapd/pw.c @@ -2844,7 +2844,7 @@ add_shadow_ext_password_attrs(Slapi_PBlock *pb, Slapi_Entry **e) shadowval = _MAX_SHADOW; } } - if (shadowval > 0) { + if (shadowval >= 0) { shwarn = slapi_entry_attr_get_charptr(*e, "shadowWarning"); if (shwarn) { sval = strtoll(shwarn, NULL, 0); -- 2.17.2