|
|
62a0d7 |
From 8233ca6a64e673aad41f2aeb1f6152930fd16f72 Mon Sep 17 00:00:00 2001
|
|
|
62a0d7 |
From: Sumit Bose <sbose@redhat.com>
|
|
|
62a0d7 |
Date: Tue, 5 Jan 2016 13:46:55 +0100
|
|
|
62a0d7 |
Subject: [PATCH] ipa_s2n_save_objects(): use configured user and group timeout
|
|
|
62a0d7 |
MIME-Version: 1.0
|
|
|
62a0d7 |
Content-Type: text/plain; charset=UTF-8
|
|
|
62a0d7 |
Content-Transfer-Encoding: 8bit
|
|
|
62a0d7 |
|
|
|
62a0d7 |
Resolves https://fedorahosted.org/sssd/ticket/2899
|
|
|
62a0d7 |
|
|
|
62a0d7 |
Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com>
|
|
|
62a0d7 |
(cherry picked from commit acce97e8d97e81a9e660d46c4e3c00bcb423c035)
|
|
|
62a0d7 |
(cherry picked from commit e8b5470df44c9f4eb0a4ccc0c79efe778c9658ba)
|
|
|
62a0d7 |
---
|
|
|
62a0d7 |
src/providers/ipa/ipa_s2n_exop.c | 10 +++++-----
|
|
|
62a0d7 |
1 file changed, 5 insertions(+), 5 deletions(-)
|
|
|
62a0d7 |
|
|
|
62a0d7 |
diff --git a/src/providers/ipa/ipa_s2n_exop.c b/src/providers/ipa/ipa_s2n_exop.c
|
|
|
62a0d7 |
index bcd11749fbde4cae2a47b9b2182138ae04f2d6bc..d101a437dfaf2829013f9e3e3705a7161c654d78 100644
|
|
|
62a0d7 |
--- a/src/providers/ipa/ipa_s2n_exop.c
|
|
|
62a0d7 |
+++ b/src/providers/ipa/ipa_s2n_exop.c
|
|
|
62a0d7 |
@@ -1743,7 +1743,6 @@ static errno_t ipa_s2n_save_objects(struct sss_domain_info *dom,
|
|
|
62a0d7 |
{
|
|
|
62a0d7 |
int ret;
|
|
|
62a0d7 |
time_t now;
|
|
|
62a0d7 |
- uint64_t timeout = 10*60*60; /* FIXME: find a better timeout ! */
|
|
|
62a0d7 |
struct sss_nss_homedir_ctx homedir_ctx;
|
|
|
62a0d7 |
char *name = NULL;
|
|
|
62a0d7 |
char *realm;
|
|
|
62a0d7 |
@@ -1947,7 +1946,7 @@ static errno_t ipa_s2n_save_objects(struct sss_domain_info *dom,
|
|
|
62a0d7 |
* SYSDB_INITGR_EXPIRE will be set.*/
|
|
|
62a0d7 |
ret = sysdb_attrs_add_time_t(attrs->sysdb_attrs,
|
|
|
62a0d7 |
SYSDB_INITGR_EXPIRE,
|
|
|
62a0d7 |
- time(NULL) + timeout);
|
|
|
62a0d7 |
+ time(NULL) + dom->user_timeout);
|
|
|
62a0d7 |
if (ret != EOK) {
|
|
|
62a0d7 |
DEBUG(SSSDBG_OP_FAILURE,
|
|
|
62a0d7 |
"sysdb_attrs_add_time_t failed.\n");
|
|
|
62a0d7 |
@@ -2006,7 +2005,7 @@ static errno_t ipa_s2n_save_objects(struct sss_domain_info *dom,
|
|
|
62a0d7 |
gid, attrs->a.user.pw_gecos,
|
|
|
62a0d7 |
attrs->a.user.pw_dir, attrs->a.user.pw_shell,
|
|
|
62a0d7 |
NULL, attrs->sysdb_attrs, NULL,
|
|
|
62a0d7 |
- timeout, now);
|
|
|
62a0d7 |
+ dom->user_timeout, now);
|
|
|
62a0d7 |
if (ret == EEXIST && dom->mpg == true) {
|
|
|
62a0d7 |
/* This handles the case where getgrgid() was called for
|
|
|
62a0d7 |
* this user, so a group was created in the cache
|
|
|
62a0d7 |
@@ -2034,7 +2033,7 @@ static errno_t ipa_s2n_save_objects(struct sss_domain_info *dom,
|
|
|
62a0d7 |
attrs->a.user.pw_dir,
|
|
|
62a0d7 |
attrs->a.user.pw_shell,
|
|
|
62a0d7 |
NULL, attrs->sysdb_attrs, NULL,
|
|
|
62a0d7 |
- timeout, now);
|
|
|
62a0d7 |
+ dom->user_timeout, now);
|
|
|
62a0d7 |
if (ret != EOK) {
|
|
|
62a0d7 |
DEBUG(SSSDBG_OP_FAILURE,
|
|
|
62a0d7 |
"sysdb_store_user failed for MPG user [%d]: %s\n",
|
|
|
62a0d7 |
@@ -2174,7 +2173,8 @@ static errno_t ipa_s2n_save_objects(struct sss_domain_info *dom,
|
|
|
62a0d7 |
}
|
|
|
62a0d7 |
|
|
|
62a0d7 |
ret = sysdb_store_group(dom, name, attrs->a.group.gr_gid,
|
|
|
62a0d7 |
- attrs->sysdb_attrs, timeout, now);
|
|
|
62a0d7 |
+ attrs->sysdb_attrs, dom->group_timeout,
|
|
|
62a0d7 |
+ now);
|
|
|
62a0d7 |
if (ret != EOK) {
|
|
|
62a0d7 |
DEBUG(SSSDBG_OP_FAILURE, "sysdb_store_group failed.\n");
|
|
|
62a0d7 |
goto done;
|
|
|
62a0d7 |
--
|
|
|
62a0d7 |
2.4.11
|
|
|
62a0d7 |
|