summaryrefslogtreecommitdiffstats
path: root/src/confdb/confdb.c
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2013-01-22 09:07:37 +0100
committerJakub Hrozek <jhrozek@redhat.com>2013-01-22 13:04:15 +0100
commit1d262e93850e2be65a774da070600947f1b75153 (patch)
tree92595aeae2397b306b3f697d5675733512cca889 /src/confdb/confdb.c
parent16c245e50e7aa763cff5fa93cc45febf8241319d (diff)
downloadsssd-1d262e93850e2be65a774da070600947f1b75153.tar.gz
sssd-1d262e93850e2be65a774da070600947f1b75153.tar.xz
sssd-1d262e93850e2be65a774da070600947f1b75153.zip
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
Diffstat (limited to 'src/confdb/confdb.c')
-rw-r--r--src/confdb/confdb.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/confdb/confdb.c b/src/confdb/confdb.c
index 00643cd39..8ae8d016b 100644
--- a/src/confdb/confdb.c
+++ b/src/confdb/confdb.c
@@ -1024,10 +1024,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);
@@ -1036,7 +1033,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);