summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFabiano Fidêncio <fidencio@redhat.com>2016-08-24 13:25:44 +0200
committerLukas Slebodnik <lslebodn@redhat.com>2016-08-27 10:00:03 +0200
commit2537fe318a3866780abca100cf6eb7c258f9d02b (patch)
treeac4575eac0ead512262d16ef216dd3f6af369468
parent413aef1529fb3d5ed4d0f38e219f5456d7fe3ae0 (diff)
downloadsssd-2537fe318a3866780abca100cf6eb7c258f9d02b.tar.gz
sssd-2537fe318a3866780abca100cf6eb7c258f9d02b.tar.xz
sssd-2537fe318a3866780abca100cf6eb7c258f9d02b.zip
PROXY: Remove cache_timeout attribute from save_user()
As this function already receives a struct sss_domain_info * parameter as argument, we can simply get the cache_timeout attribute by accessing domain->user_timeout. Related: https://fedorahosted.org/sssd/ticket/3134 Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com> Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com>
-rw-r--r--src/providers/proxy/proxy_id.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/providers/proxy/proxy_id.c b/src/providers/proxy/proxy_id.c
index ff2631c9b..bdcac6631 100644
--- a/src/providers/proxy/proxy_id.c
+++ b/src/providers/proxy/proxy_id.c
@@ -32,7 +32,7 @@
static int save_user(struct sss_domain_info *domain,
struct passwd *pwd, const char *real_name,
- const char *alias, uint64_t cache_timeout);
+ const char *alias);
static int
handle_getpw_result(enum nss_status status, struct passwd *pwd,
@@ -143,7 +143,7 @@ static int get_pw_name(struct proxy_id_ctx *ctx,
}
/* Both lookups went fine, we can save the user now */
- ret = save_user(dom, pwd, real_name, i_name, dom->user_timeout);
+ ret = save_user(dom, pwd, real_name, i_name);
done:
talloc_zfree(tmpctx);
@@ -224,7 +224,7 @@ delete_user(struct sss_domain_info *domain,
static int save_user(struct sss_domain_info *domain,
struct passwd *pwd, const char *real_name,
- const char *alias, uint64_t cache_timeout)
+ const char *alias)
{
const char *shell;
const char *gecos;
@@ -299,7 +299,7 @@ static int save_user(struct sss_domain_info *domain,
NULL,
attrs,
NULL,
- cache_timeout,
+ domain->user_timeout,
0);
if (ret) {
DEBUG(SSSDBG_OP_FAILURE, "Could not add user to cache\n");
@@ -365,7 +365,7 @@ static int get_pw_uid(struct proxy_id_ctx *ctx,
pwd->pw_name);
goto done;
}
- ret = save_user(dom, pwd, name, NULL, dom->user_timeout);
+ ret = save_user(dom, pwd, name, NULL);
done:
talloc_zfree(tmpctx);
@@ -495,7 +495,7 @@ static int enum_users(TALLOC_CTX *mem_ctx,
pwd->pw_name);
goto done;
}
- ret = save_user(dom, pwd, name, NULL, dom->user_timeout);
+ ret = save_user(dom, pwd, name, NULL);
if (ret) {
/* Do not fail completely on errors.
* Just report the failure to save and go on */
@@ -1328,7 +1328,7 @@ static int get_initgr(TALLOC_CTX *mem_ctx,
goto done;
}
- ret = save_user(dom, pwd, real_name, i_name, dom->user_timeout);
+ ret = save_user(dom, pwd, real_name, i_name);
if (ret) {
DEBUG(SSSDBG_OP_FAILURE, "Could not save user\n");
goto fail;