From e0a3fbf8ba571c90a765135a04cf51a98ceaf407 Mon Sep 17 00:00:00 2001 From: Jakub Hrozek Date: Tue, 22 Jan 2013 09:07:37 +0100 Subject: Convert the value of pwd_exp_warning to seconds When read from the domain section, the pwd_expiration_warning was properly converted to seconds from days, but not the pam_pwd_expiration_warning set in the [pam] section. https://fedorahosted.org/sssd/ticket/1773 --- src/confdb/confdb.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/confdb/confdb.c b/src/confdb/confdb.c index 37a5758c7..6dd03fa3d 100644 --- a/src/confdb/confdb.c +++ b/src/confdb/confdb.c @@ -1012,10 +1012,7 @@ static int confdb_get_domain_internal(struct confdb_ctx *cdb, val = ldb_msg_find_attr_as_int(res->msgs[0], CONFDB_DOMAIN_PWD_EXPIRATION_WARNING, -1); - if (val > 0) { - /* The value is in days, transform it to seconds */ - val *= 24 * 3600; - } else { + if (val == -1) { ret = confdb_get_int(cdb, CONFDB_PAM_CONF_ENTRY, CONFDB_PAM_PWD_EXPIRATION_WARNING, -1, &val); @@ -1024,7 +1021,11 @@ static int confdb_get_domain_internal(struct confdb_ctx *cdb, val = -1; } } - domain->pwd_expiration_warning = val; + + if (val > 0) { + /* The value is in days, transform it to seconds */ + domain->pwd_expiration_warning = val * 24 * 3600; + } ret = get_entry_as_uint32(res->msgs[0], &domain->override_gid, CONFDB_DOMAIN_OVERRIDE_GID, 0); -- cgit