From d38bddc59d7ff728b16fe8cf20400fe0c2f57da9 Mon Sep 17 00:00:00 2001 From: Sumit Bose Date: Wed, 24 Sep 2014 13:01:20 +0200 Subject: [PATCH 01/12] confdb: add has_views and view_name to sss_domain_info To let the responders know which view is applied and to make view handling more efficiently especially when no view is applied/available two new member are added to the sss_domain_info struct. view_name is the name of the view if available. has_views is only true if the client has a specific view applied, i.e. it is false for the case when there are no views at all (e.g. plain LDAP provider) or the client has the FreeIPA default view. This allows the responders to easily bypass any view related code. --- src/confdb/confdb.c | 3 +++ src/confdb/confdb.h | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/confdb/confdb.c b/src/confdb/confdb.c index 0adff2b..8443fe5 100644 --- a/src/confdb/confdb.c +++ b/src/confdb/confdb.c @@ -1205,6 +1205,9 @@ static int confdb_get_domain_internal(struct confdb_ctx *cdb, goto done; } + domain->has_views = false; + domain->view_name = NULL; + *_domain = domain; ret = EOK; done: diff --git a/src/confdb/confdb.h b/src/confdb/confdb.h index 720b7dc..34d4610 100644 --- a/src/confdb/confdb.h +++ b/src/confdb/confdb.h @@ -255,6 +255,9 @@ struct sss_domain_info { char *forest; struct timeval subdomains_last_checked; + bool has_views; + char *view_name; + struct sss_domain_info *prev; struct sss_domain_info *next; -- 1.8.3.1