summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPavel Březina <pbrezina@redhat.com>2015-02-19 12:04:09 +0100
committerJakub Hrozek <jhrozek@redhat.com>2015-03-08 22:27:16 +0100
commit17531a398cc9084036cb08d69fe876a8f12707bb (patch)
tree336099412efe7c5b47197a74f2fee51b6342d8d0 /src
parentab0eda3622b828df2bfb7850c96d1395f614eb13 (diff)
downloadsssd-17531a398cc9084036cb08d69fe876a8f12707bb.tar.gz
sssd-17531a398cc9084036cb08d69fe876a8f12707bb.tar.xz
sssd-17531a398cc9084036cb08d69fe876a8f12707bb.zip
be_refresh: add sdap_refresh_init
Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
Diffstat (limited to 'src')
-rw-r--r--src/providers/ad/ad_init.c7
-rw-r--r--src/providers/ipa/ipa_init.c7
-rw-r--r--src/providers/ldap/ldap_common.h10
-rw-r--r--src/providers/ldap/ldap_init.c7
-rw-r--r--src/providers/ldap/sdap_refresh.c32
5 files changed, 33 insertions, 30 deletions
diff --git a/src/providers/ad/ad_init.c b/src/providers/ad/ad_init.c
index 2de7e0a44..ca2d49f62 100644
--- a/src/providers/ad/ad_init.c
+++ b/src/providers/ad/ad_init.c
@@ -260,12 +260,9 @@ sssm_ad_id_init(struct be_ctx *bectx,
}
/* setup periodical refresh of expired records */
- ret = be_refresh_add_cb(bectx->refresh_ctx, BE_REFRESH_TYPE_NETGROUPS,
- sdap_refresh_netgroups_send,
- sdap_refresh_netgroups_recv,
- ad_ctx->sdap_id_ctx);
+ ret = sdap_refresh_init(bectx->refresh_ctx, ad_ctx->sdap_id_ctx);
if (ret != EOK && ret != EEXIST) {
- DEBUG(SSSDBG_MINOR_FAILURE, "Periodical refresh of netgroups "
+ DEBUG(SSSDBG_MINOR_FAILURE, "Periodical refresh "
"will not work [%d]: %s\n", ret, strerror(ret));
}
diff --git a/src/providers/ipa/ipa_init.c b/src/providers/ipa/ipa_init.c
index 160d15cac..4b26e8baa 100644
--- a/src/providers/ipa/ipa_init.c
+++ b/src/providers/ipa/ipa_init.c
@@ -354,12 +354,9 @@ int sssm_ipa_id_init(struct be_ctx *bectx,
}
/* setup periodical refresh of expired records */
- ret = be_refresh_add_cb(bectx->refresh_ctx, BE_REFRESH_TYPE_NETGROUPS,
- sdap_refresh_netgroups_send,
- sdap_refresh_netgroups_recv,
- sdap_ctx);
+ ret = sdap_refresh_init(bectx->refresh_ctx, sdap_ctx);
if (ret != EOK && ret != EEXIST) {
- DEBUG(SSSDBG_MINOR_FAILURE, "Periodical refresh of netgroups "
+ DEBUG(SSSDBG_MINOR_FAILURE, "Periodical refresh "
"will not work [%d]: %s\n", ret, strerror(ret));
}
diff --git a/src/providers/ldap/ldap_common.h b/src/providers/ldap/ldap_common.h
index f8b4e0142..bf69489a7 100644
--- a/src/providers/ldap/ldap_common.h
+++ b/src/providers/ldap/ldap_common.h
@@ -324,13 +324,7 @@ struct sdap_id_ctx *
sdap_id_ctx_new(TALLOC_CTX *mem_ctx, struct be_ctx *bectx,
struct sdap_service *sdap_service);
-struct tevent_req *sdap_refresh_netgroups_send(TALLOC_CTX *mem_ctx,
- struct tevent_context *ev,
- struct be_ctx *be_ctx,
- struct sss_domain_info *domain,
- char **names,
- void *pvt);
-
-errno_t sdap_refresh_netgroups_recv(struct tevent_req *req);
+errno_t sdap_refresh_init(struct be_refresh_ctx *refresh_ctx,
+ struct sdap_id_ctx *id_ctx);
#endif /* _LDAP_COMMON_H_ */
diff --git a/src/providers/ldap/ldap_init.c b/src/providers/ldap/ldap_init.c
index cebd548a4..247e20ef7 100644
--- a/src/providers/ldap/ldap_init.c
+++ b/src/providers/ldap/ldap_init.c
@@ -179,12 +179,9 @@ static int ldap_id_init_internal(struct be_ctx *bectx,
}
/* setup periodical refresh of expired records */
- ret = be_refresh_add_cb(bectx->refresh_ctx, BE_REFRESH_TYPE_NETGROUPS,
- sdap_refresh_netgroups_send,
- sdap_refresh_netgroups_recv,
- ctx);
+ ret = sdap_refresh_init(bectx->refresh_ctx, ctx);
if (ret != EOK && ret != EEXIST) {
- DEBUG(SSSDBG_MINOR_FAILURE, "Periodical refresh of netgroups "
+ DEBUG(SSSDBG_MINOR_FAILURE, "Periodical refresh "
"will not work [%d]: %s\n", ret, strerror(ret));
}
diff --git a/src/providers/ldap/sdap_refresh.c b/src/providers/ldap/sdap_refresh.c
index 29055359f..e300e28b6 100644
--- a/src/providers/ldap/sdap_refresh.c
+++ b/src/providers/ldap/sdap_refresh.c
@@ -199,18 +199,36 @@ static errno_t sdap_refresh_recv(struct tevent_req *req)
return EOK;
}
-struct tevent_req *sdap_refresh_netgroups_send(TALLOC_CTX *mem_ctx,
- struct tevent_context *ev,
- struct be_ctx *be_ctx,
- struct sss_domain_info *domain,
- char **names,
- void *pvt)
+static struct tevent_req *
+sdap_refresh_netgroups_send(TALLOC_CTX *mem_ctx,
+ struct tevent_context *ev,
+ struct be_ctx *be_ctx,
+ struct sss_domain_info *domain,
+ char **names,
+ void *pvt)
{
return sdap_refresh_send(mem_ctx, ev, be_ctx, domain,
BE_REQ_NETGROUP, names, pvt);
}
-errno_t sdap_refresh_netgroups_recv(struct tevent_req *req)
+static errno_t sdap_refresh_netgroups_recv(struct tevent_req *req)
{
return sdap_refresh_recv(req);
}
+
+errno_t sdap_refresh_init(struct be_refresh_ctx *refresh_ctx,
+ struct sdap_id_ctx *id_ctx)
+{
+ errno_t ret;
+
+ ret = be_refresh_add_cb(refresh_ctx, BE_REFRESH_TYPE_NETGROUPS,
+ sdap_refresh_netgroups_send,
+ sdap_refresh_netgroups_recv,
+ id_ctx);
+ if (ret != EOK && ret != EEXIST) {
+ DEBUG(SSSDBG_MINOR_FAILURE, "Periodical refresh of netgroups "
+ "will not work [%d]: %s\n", ret, strerror(ret));
+ }
+
+ return ret;
+}