summaryrefslogtreecommitdiffstats
path: root/server/providers/ldap/sdap.c
diff options
context:
space:
mode:
authorSimo Sorce <ssorce@redhat.com>2009-08-26 16:52:18 -0400
committerSimo Sorce <ssorce@redhat.com>2009-08-27 13:55:23 -0400
commitdd6bf2b53c0f01cf5d0e748ae090cefa0557990c (patch)
tree7832a9bb972482d7027acfbf0e74bf7ef27f6748 /server/providers/ldap/sdap.c
parent61684e3e684855a72555c11a6de980b132676067 (diff)
downloadsssd-dd6bf2b53c0f01cf5d0e748ae090cefa0557990c.tar.gz
sssd-dd6bf2b53c0f01cf5d0e748ae090cefa0557990c.tar.xz
sssd-dd6bf2b53c0f01cf5d0e748ae090cefa0557990c.zip
Make enumeration an independent task
Always immediately return to DP, and update users/groups in the background. Also implements an optimization to retrieve only changed/new users/groups by filtering using the modifyTimestamp after the first query.
Diffstat (limited to 'server/providers/ldap/sdap.c')
-rw-r--r--server/providers/ldap/sdap.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/server/providers/ldap/sdap.c b/server/providers/ldap/sdap.c
index 3260043bb..dacce9c20 100644
--- a/server/providers/ldap/sdap.c
+++ b/server/providers/ldap/sdap.c
@@ -40,8 +40,9 @@ struct sdap_gen_opts default_basic_opts[] = {
{ "groupSearchScope", "sub", NULL },
{ "groupSearchFilter", NULL, NULL },
{ "ldapSchema", "rfc2307", NULL },
- { "offline_timeout", "5", NULL },
- { "force_upper_case_realm", "0", NULL }
+ { "offline_timeout", "60", NULL },
+ { "force_upper_case_realm", "0", NULL },
+ { "enumeration_refresh_timeout", "300", NULL }
};
struct sdap_id_map rfc2307_user_map[] = {
@@ -56,7 +57,8 @@ struct sdap_id_map rfc2307_user_map[] = {
{ "userPrincipal", "krbPrincipalName", SYSDB_UPN, NULL },
{ "userFullname", "cn", SYSDB_FULLNAME, NULL },
{ "userMemberOf", NULL, SYSDB_MEMBEROF, NULL },
- { "userUUID", NULL, SYSDB_UUID, NULL }
+ { "userUUID", NULL, SYSDB_UUID, NULL },
+ { "userModifyTimestamp", "modifyTimestamp", SYSDB_ORIG_MODSTAMP, NULL }
};
struct sdap_id_map rfc2307_group_map[] = {
@@ -65,7 +67,8 @@ struct sdap_id_map rfc2307_group_map[] = {
{ "groupPwd", "userPassword", SYSDB_PWD, NULL },
{ "groupGidNumber", "gidNumber", SYSDB_GIDNUM, NULL },
{ "groupMember", "memberuid", SYSDB_MEMBER, NULL },
- { "groupUUID", NULL, SYSDB_UUID, NULL }
+ { "groupUUID", NULL, SYSDB_UUID, NULL },
+ { "groupModifyTimestamp", "modifyTimestamp", SYSDB_ORIG_MODSTAMP, NULL }
};
struct sdap_id_map rfc2307bis_user_map[] = {
@@ -81,7 +84,8 @@ struct sdap_id_map rfc2307bis_user_map[] = {
{ "userFullname", "cn", SYSDB_FULLNAME, NULL },
{ "userMemberOf", "memberOf", SYSDB_MEMBEROF, NULL },
/* FIXME: this is 389ds specific */
- { "userUUID", "nsUniqueId", SYSDB_UUID, NULL }
+ { "userUUID", "nsUniqueId", SYSDB_UUID, NULL },
+ { "userModifyTimestamp", "modifyTimestamp", SYSDB_ORIG_MODSTAMP, NULL }
};
struct sdap_id_map rfc2307bis_group_map[] = {
@@ -91,7 +95,8 @@ struct sdap_id_map rfc2307bis_group_map[] = {
{ "groupGidNumber", "gidNumber", SYSDB_GIDNUM, NULL },
{ "groupMember", "member", SYSDB_MEMBER, NULL },
/* FIXME: this is 389ds specific */
- { "groupUUID", "nsUniqueId", SYSDB_UUID, NULL }
+ { "groupUUID", "nsUniqueId", SYSDB_UUID, NULL },
+ { "groupModifyTimestamp", "modifyTimestamp", SYSDB_ORIG_MODSTAMP, NULL }
};
/* =Retrieve-Options====================================================== */
@@ -171,6 +176,11 @@ int sdap_get_options(TALLOC_CTX *memctx,
&opts->force_upper_case_realm);
if (ret != EOK) goto done;
+ ret = confdb_get_int(cdb, opts, conf_path,
+ "enumeration_refresh_timeout", 300,
+ &opts->enum_refresh_timeout);
+ if (ret != EOK) goto done;
+
/* schema type */
if (strcasecmp(opts->basic[SDAP_SCHEMA].value, "rfc2307") == 0) {
opts->schema_type = SDAP_SCHEMA_RFC2307;