Blame SOURCES/0063-CACHE_REQ-Domain-type-selection-in-cache_req.patch

bb7cd1
From 5519295726bb2a0e88475e1d8deff0b8c0f65119 Mon Sep 17 00:00:00 2001
bb7cd1
From: Jakub Hrozek <jhrozek@redhat.com>
bb7cd1
Date: Fri, 24 Mar 2017 10:39:12 +0100
bb7cd1
Subject: [PATCH 63/72] CACHE_REQ: Domain type selection in cache_req
bb7cd1
MIME-Version: 1.0
bb7cd1
Content-Type: text/plain; charset=UTF-8
bb7cd1
Content-Transfer-Encoding: 8bit
bb7cd1
bb7cd1
Related to:
bb7cd1
    https://pagure.io/SSSD/sssd/issue/3310
bb7cd1
bb7cd1
Adds a new enumeration cache_req_dom_type. It is a tri-state that
bb7cd1
allows the caller to select which domains can be contacted - either only
bb7cd1
POSIX, only application domains or any type.
bb7cd1
bb7cd1
Not all plugins of cache_req have the new parameter added -- only those
bb7cd1
that are usable/useful in a non-POSIX environment. For example, it makes
bb7cd1
no sense to allow the selection for calls by ID because those are
bb7cd1
inherently POSIX-specific. Also, services or netgroups are supported
bb7cd1
only coming from POSIX domains.
bb7cd1
bb7cd1
At the moment, the patch should not change any behaviour as all calls
bb7cd1
default to contacting POSIX domains only.
bb7cd1
bb7cd1
Reviewed-by: Pavel Březina <pbrezina@redhat.com>
bb7cd1
---
bb7cd1
 src/responder/common/cache_req/cache_req.c         | 80 ++++++++++++++++++++--
bb7cd1
 src/responder/common/cache_req/cache_req.h         | 19 +++++
bb7cd1
 src/responder/common/cache_req/cache_req_private.h |  3 +
bb7cd1
 .../cache_req/plugins/cache_req_enum_groups.c      |  4 +-
bb7cd1
 .../common/cache_req/plugins/cache_req_enum_svc.c  |  3 +-
bb7cd1
 .../cache_req/plugins/cache_req_enum_users.c       |  4 +-
bb7cd1
 .../cache_req/plugins/cache_req_group_by_filter.c  |  5 +-
bb7cd1
 .../cache_req/plugins/cache_req_group_by_id.c      |  4 +-
bb7cd1
 .../cache_req/plugins/cache_req_group_by_name.c    |  5 +-
bb7cd1
 .../cache_req/plugins/cache_req_host_by_name.c     |  4 +-
bb7cd1
 .../plugins/cache_req_initgroups_by_name.c         |  5 +-
bb7cd1
 .../cache_req/plugins/cache_req_netgroup_by_name.c |  4 +-
bb7cd1
 .../cache_req/plugins/cache_req_object_by_id.c     |  4 +-
bb7cd1
 .../cache_req/plugins/cache_req_object_by_name.c   |  4 +-
bb7cd1
 .../cache_req/plugins/cache_req_object_by_sid.c    |  4 +-
bb7cd1
 .../cache_req/plugins/cache_req_svc_by_name.c      |  4 +-
bb7cd1
 .../cache_req/plugins/cache_req_svc_by_port.c      |  4 +-
bb7cd1
 .../cache_req/plugins/cache_req_user_by_cert.c     |  4 +-
bb7cd1
 .../cache_req/plugins/cache_req_user_by_filter.c   |  5 +-
bb7cd1
 .../cache_req/plugins/cache_req_user_by_id.c       |  4 +-
bb7cd1
 .../cache_req/plugins/cache_req_user_by_name.c     |  9 ++-
bb7cd1
 src/responder/ifp/ifp_groups.c                     | 14 +++-
bb7cd1
 src/responder/ifp/ifp_users.c                      | 19 +++--
bb7cd1
 src/responder/ifp/ifpsrv_cmd.c                     |  3 +-
bb7cd1
 src/responder/nss/nss_enum.c                       |  2 +-
bb7cd1
 src/responder/nss/nss_get_object.c                 |  3 +-
bb7cd1
 src/responder/pam/pamsrv_cmd.c                     |  5 +-
bb7cd1
 src/responder/sudo/sudosrv_get_sudorules.c         |  3 +-
bb7cd1
 src/tests/cmocka/test_responder_cache_req.c        | 62 ++++++++++++++---
bb7cd1
 29 files changed, 246 insertions(+), 47 deletions(-)
bb7cd1
bb7cd1
diff --git a/src/responder/common/cache_req/cache_req.c b/src/responder/common/cache_req/cache_req.c
bb7cd1
index 483126396f8addbad744ae03bfc739801cd0c18b..3a5fecf34427437bbf95317e05c5bd8b07b4537d 100644
bb7cd1
--- a/src/responder/common/cache_req/cache_req.c
bb7cd1
+++ b/src/responder/common/cache_req/cache_req.c
bb7cd1
@@ -89,12 +89,31 @@ static errno_t cache_req_set_plugin(struct cache_req *cr,
bb7cd1
     return EOK;
bb7cd1
 }
bb7cd1
 
bb7cd1
+static const char *
bb7cd1
+cache_req_dom_type_as_str(struct cache_req *cr)
bb7cd1
+{
bb7cd1
+    if (cr == NULL) {
bb7cd1
+        return "BUG: Invalid cache_req pointer\n";
bb7cd1
+    }
bb7cd1
+    switch (cr->req_dom_type) {
bb7cd1
+    case CACHE_REQ_POSIX_DOM:
bb7cd1
+        return "POSIX-only";
bb7cd1
+    case CACHE_REQ_APPLICATION_DOM:
bb7cd1
+        return "Application-only";
bb7cd1
+    case CACHE_REQ_ANY_DOM:
bb7cd1
+        return "Any";
bb7cd1
+    }
bb7cd1
+
bb7cd1
+    return "Unknown";
bb7cd1
+}
bb7cd1
+
bb7cd1
 static struct cache_req *
bb7cd1
 cache_req_create(TALLOC_CTX *mem_ctx,
bb7cd1
                  struct resp_ctx *rctx,
bb7cd1
                  struct cache_req_data *data,
bb7cd1
                  struct sss_nc_ctx *ncache,
bb7cd1
-                 int midpoint)
bb7cd1
+                 int midpoint,
bb7cd1
+                 enum cache_req_dom_type req_dom_type)
bb7cd1
 {
bb7cd1
     struct cache_req *cr;
bb7cd1
     errno_t ret;
bb7cd1
@@ -108,6 +127,7 @@ cache_req_create(TALLOC_CTX *mem_ctx,
bb7cd1
     cr->data = data;
bb7cd1
     cr->ncache = ncache;
bb7cd1
     cr->midpoint = midpoint;
bb7cd1
+    cr->req_dom_type = req_dom_type;
bb7cd1
     cr->req_start = time(NULL);
bb7cd1
 
bb7cd1
     /* It is perfectly fine to just overflow here. */
bb7cd1
@@ -145,8 +165,8 @@ cache_req_set_name(struct cache_req *cr, const char *name)
bb7cd1
 }
bb7cd1
 
bb7cd1
 static bool
bb7cd1
-cache_req_validate_domain(struct cache_req *cr,
bb7cd1
-                          struct sss_domain_info *domain)
bb7cd1
+cache_req_validate_domain_enumeration(struct cache_req *cr,
bb7cd1
+                                      struct sss_domain_info *domain)
bb7cd1
 {
bb7cd1
     if (!cr->plugin->require_enumeration) {
bb7cd1
         return true;
bb7cd1
@@ -164,6 +184,52 @@ cache_req_validate_domain(struct cache_req *cr,
bb7cd1
     return true;
bb7cd1
 }
bb7cd1
 
bb7cd1
+static bool
bb7cd1
+cache_req_validate_domain_type(struct cache_req *cr,
bb7cd1
+                               struct sss_domain_info *domain)
bb7cd1
+{
bb7cd1
+    bool valid = false;
bb7cd1
+
bb7cd1
+    switch (cr->req_dom_type) {
bb7cd1
+    case CACHE_REQ_POSIX_DOM:
bb7cd1
+        valid = domain->type == DOM_TYPE_POSIX ? true : false;
bb7cd1
+        break;
bb7cd1
+    case CACHE_REQ_APPLICATION_DOM:
bb7cd1
+        valid = domain->type == DOM_TYPE_APPLICATION ? true : false;
bb7cd1
+        break;
bb7cd1
+    case CACHE_REQ_ANY_DOM:
bb7cd1
+        valid = true;
bb7cd1
+        break;
bb7cd1
+    }
bb7cd1
+
bb7cd1
+    DEBUG(SSSDBG_TRACE_INTERNAL,
bb7cd1
+          "Request type %s for domain %s type %s is %svalid\n",
bb7cd1
+          cache_req_dom_type_as_str(cr),
bb7cd1
+          domain->name,
bb7cd1
+          sss_domain_type_str(domain),
bb7cd1
+          valid ? "" : "not ");
bb7cd1
+    return valid;
bb7cd1
+}
bb7cd1
+
bb7cd1
+static bool
bb7cd1
+cache_req_validate_domain(struct cache_req *cr,
bb7cd1
+                          struct sss_domain_info *domain)
bb7cd1
+{
bb7cd1
+    bool ok;
bb7cd1
+
bb7cd1
+    ok = cache_req_validate_domain_enumeration(cr, domain);
bb7cd1
+    if (ok == false) {
bb7cd1
+        return false;
bb7cd1
+    }
bb7cd1
+
bb7cd1
+    ok = cache_req_validate_domain_type(cr, domain);
bb7cd1
+    if (ok == false) {
bb7cd1
+        return false;
bb7cd1
+    }
bb7cd1
+
bb7cd1
+    return true;
bb7cd1
+}
bb7cd1
+
bb7cd1
 static errno_t
bb7cd1
 cache_req_is_well_known_object(TALLOC_CTX *mem_ctx,
bb7cd1
                                struct cache_req *cr,
bb7cd1
@@ -651,6 +717,7 @@ struct tevent_req *cache_req_send(TALLOC_CTX *mem_ctx,
bb7cd1
                                   struct resp_ctx *rctx,
bb7cd1
                                   struct sss_nc_ctx *ncache,
bb7cd1
                                   int midpoint,
bb7cd1
+                                  enum cache_req_dom_type req_dom_type,
bb7cd1
                                   const char *domain,
bb7cd1
                                   struct cache_req_data *data)
bb7cd1
 {
bb7cd1
@@ -667,7 +734,8 @@ struct tevent_req *cache_req_send(TALLOC_CTX *mem_ctx,
bb7cd1
     }
bb7cd1
 
bb7cd1
     state->ev = ev;
bb7cd1
-    state->cr = cr = cache_req_create(state, rctx, data, ncache, midpoint);
bb7cd1
+    state->cr = cr = cache_req_create(state, rctx, data,
bb7cd1
+                                      ncache, midpoint, req_dom_type);
bb7cd1
     if (state->cr == NULL) {
bb7cd1
         ret = ENOMEM;
bb7cd1
         goto done;
bb7cd1
@@ -952,13 +1020,15 @@ cache_req_steal_data_and_send(TALLOC_CTX *mem_ctx,
bb7cd1
                               struct resp_ctx *rctx,
bb7cd1
                               struct sss_nc_ctx *ncache,
bb7cd1
                               int cache_refresh_percent,
bb7cd1
+                              enum cache_req_dom_type req_dom_type,
bb7cd1
                               const char *domain,
bb7cd1
                               struct cache_req_data *data)
bb7cd1
 {
bb7cd1
     struct tevent_req *req;
bb7cd1
 
bb7cd1
     req = cache_req_send(mem_ctx, ev, rctx, ncache,
bb7cd1
-                         cache_refresh_percent, domain, data);
bb7cd1
+                         cache_refresh_percent,
bb7cd1
+                         req_dom_type, domain, data);
bb7cd1
     if (req == NULL) {
bb7cd1
         talloc_zfree(data);
bb7cd1
         return NULL;
bb7cd1
diff --git a/src/responder/common/cache_req/cache_req.h b/src/responder/common/cache_req/cache_req.h
bb7cd1
index d0e5ff43921467fc191fd5cc7d5b49cc039b7f67..c04b2fba6f0445dcfcc9cfe1b5963ac975c39118 100644
bb7cd1
--- a/src/responder/common/cache_req/cache_req.h
bb7cd1
+++ b/src/responder/common/cache_req/cache_req.h
bb7cd1
@@ -57,6 +57,18 @@ enum cache_req_type {
bb7cd1
     CACHE_REQ_SENTINEL
bb7cd1
 };
bb7cd1
 
bb7cd1
+/* Whether to limit the request type to a certain domain type
bb7cd1
+ * (POSIX/non-POSIX)
bb7cd1
+ */
bb7cd1
+enum cache_req_dom_type {
bb7cd1
+    /* Only look up data in POSIX domains */
bb7cd1
+    CACHE_REQ_POSIX_DOM,
bb7cd1
+    /* Only look up data in application domains */
bb7cd1
+    CACHE_REQ_APPLICATION_DOM,
bb7cd1
+    /* Look up data in any domain type */
bb7cd1
+    CACHE_REQ_ANY_DOM
bb7cd1
+};
bb7cd1
+
bb7cd1
 /* Input data. */
bb7cd1
 
bb7cd1
 struct cache_req_data;
bb7cd1
@@ -172,6 +184,7 @@ struct tevent_req *cache_req_send(TALLOC_CTX *mem_ctx,
bb7cd1
                                   struct resp_ctx *rctx,
bb7cd1
                                   struct sss_nc_ctx *ncache,
bb7cd1
                                   int midpoint,
bb7cd1
+                                  enum cache_req_dom_type req_dom_type,
bb7cd1
                                   const char *domain,
bb7cd1
                                   struct cache_req_data *data);
bb7cd1
 
bb7cd1
@@ -191,6 +204,7 @@ cache_req_user_by_name_send(TALLOC_CTX *mem_ctx,
bb7cd1
                             struct resp_ctx *rctx,
bb7cd1
                             struct sss_nc_ctx *ncache,
bb7cd1
                             int cache_refresh_percent,
bb7cd1
+                            enum cache_req_dom_type req_dom_type,
bb7cd1
                             const char *domain,
bb7cd1
                             const char *name);
bb7cd1
 
bb7cd1
@@ -228,6 +242,7 @@ cache_req_user_by_cert_send(TALLOC_CTX *mem_ctx,
bb7cd1
                             struct resp_ctx *rctx,
bb7cd1
                             struct sss_nc_ctx *ncache,
bb7cd1
                             int cache_refresh_percent,
bb7cd1
+                            enum cache_req_dom_type req_dom_type,
bb7cd1
                             const char *domain,
bb7cd1
                             const char *pem_cert);
bb7cd1
 
bb7cd1
@@ -240,6 +255,7 @@ cache_req_group_by_name_send(TALLOC_CTX *mem_ctx,
bb7cd1
                              struct resp_ctx *rctx,
bb7cd1
                              struct sss_nc_ctx *ncache,
bb7cd1
                              int cache_refresh_percent,
bb7cd1
+                             enum cache_req_dom_type req_dom_type,
bb7cd1
                              const char *domain,
bb7cd1
                              const char *name);
bb7cd1
 
bb7cd1
@@ -264,6 +280,7 @@ cache_req_initgr_by_name_send(TALLOC_CTX *mem_ctx,
bb7cd1
                               struct resp_ctx *rctx,
bb7cd1
                               struct sss_nc_ctx *ncache,
bb7cd1
                               int cache_refresh_percent,
bb7cd1
+                              enum cache_req_dom_type req_dom_type,
bb7cd1
                               const char *domain,
bb7cd1
                               const char *name);
bb7cd1
 
bb7cd1
@@ -274,6 +291,7 @@ struct tevent_req *
bb7cd1
 cache_req_user_by_filter_send(TALLOC_CTX *mem_ctx,
bb7cd1
                               struct tevent_context *ev,
bb7cd1
                               struct resp_ctx *rctx,
bb7cd1
+                              enum cache_req_dom_type req_dom_type,
bb7cd1
                               const char *domain,
bb7cd1
                               const char *filter);
bb7cd1
 
bb7cd1
@@ -284,6 +302,7 @@ struct tevent_req *
bb7cd1
 cache_req_group_by_filter_send(TALLOC_CTX *mem_ctx,
bb7cd1
                               struct tevent_context *ev,
bb7cd1
                               struct resp_ctx *rctx,
bb7cd1
+                              enum cache_req_dom_type req_dom_type,
bb7cd1
                               const char *domain,
bb7cd1
                               const char *filter);
bb7cd1
 
bb7cd1
diff --git a/src/responder/common/cache_req/cache_req_private.h b/src/responder/common/cache_req/cache_req_private.h
bb7cd1
index 2d3c1870795e4fd5667f603280edcee24f926220..851005c389f994b1bd2d04cda9b68df8b18492cc 100644
bb7cd1
--- a/src/responder/common/cache_req/cache_req_private.h
bb7cd1
+++ b/src/responder/common/cache_req/cache_req_private.h
bb7cd1
@@ -42,6 +42,8 @@ struct cache_req {
bb7cd1
     struct sss_domain_info *domain;
bb7cd1
     bool cache_first;
bb7cd1
     bool bypass_cache;
bb7cd1
+    /* Only contact domains with this type */
bb7cd1
+    enum cache_req_dom_type req_dom_type;
bb7cd1
 
bb7cd1
     /* Debug information */
bb7cd1
     uint32_t reqid;
bb7cd1
@@ -108,6 +110,7 @@ cache_req_steal_data_and_send(TALLOC_CTX *mem_ctx,
bb7cd1
                               struct resp_ctx *rctx,
bb7cd1
                               struct sss_nc_ctx *ncache,
bb7cd1
                               int cache_refresh_percent,
bb7cd1
+                              enum cache_req_dom_type req_dom_type,
bb7cd1
                               const char *domain,
bb7cd1
                               struct cache_req_data *data);
bb7cd1
 
bb7cd1
diff --git a/src/responder/common/cache_req/plugins/cache_req_enum_groups.c b/src/responder/common/cache_req/plugins/cache_req_enum_groups.c
bb7cd1
index dbb40c98339cc9295e3678e05340396aff51ac78..49ce3508e678862e4389657187b9659ce90fbd1c 100644
bb7cd1
--- a/src/responder/common/cache_req/plugins/cache_req_enum_groups.c
bb7cd1
+++ b/src/responder/common/cache_req/plugins/cache_req_enum_groups.c
bb7cd1
@@ -96,5 +96,7 @@ cache_req_enum_groups_send(TALLOC_CTX *mem_ctx,
bb7cd1
     }
bb7cd1
 
bb7cd1
     return cache_req_steal_data_and_send(mem_ctx, ev, rctx, ncache,
bb7cd1
-                                         cache_refresh_percent, domain, data);
bb7cd1
+                                         cache_refresh_percent,
bb7cd1
+                                         CACHE_REQ_POSIX_DOM, domain,
bb7cd1
+                                         data);
bb7cd1
 }
bb7cd1
diff --git a/src/responder/common/cache_req/plugins/cache_req_enum_svc.c b/src/responder/common/cache_req/plugins/cache_req_enum_svc.c
bb7cd1
index 28dea33c601f500b9c7af0de3eb9e1c342f03522..499b994738d62707b4e86d5a8383e3e2b82e8c57 100644
bb7cd1
--- a/src/responder/common/cache_req/plugins/cache_req_enum_svc.c
bb7cd1
+++ b/src/responder/common/cache_req/plugins/cache_req_enum_svc.c
bb7cd1
@@ -97,5 +97,6 @@ cache_req_enum_svc_send(TALLOC_CTX *mem_ctx,
bb7cd1
     }
bb7cd1
 
bb7cd1
     return cache_req_steal_data_and_send(mem_ctx, ev, rctx, ncache,
bb7cd1
-                                         cache_refresh_percent, domain, data);
bb7cd1
+                                         cache_refresh_percent,
bb7cd1
+                                         CACHE_REQ_POSIX_DOM, domain, data);
bb7cd1
 }
bb7cd1
diff --git a/src/responder/common/cache_req/plugins/cache_req_enum_users.c b/src/responder/common/cache_req/plugins/cache_req_enum_users.c
bb7cd1
index 3b1a85841e3ed853cd329dfa9d762cb7a05cbd43..b635354be6e9d2e2e2af1a6f867ac68e6cf7f085 100644
bb7cd1
--- a/src/responder/common/cache_req/plugins/cache_req_enum_users.c
bb7cd1
+++ b/src/responder/common/cache_req/plugins/cache_req_enum_users.c
bb7cd1
@@ -96,5 +96,7 @@ cache_req_enum_users_send(TALLOC_CTX *mem_ctx,
bb7cd1
     }
bb7cd1
 
bb7cd1
     return cache_req_steal_data_and_send(mem_ctx, ev, rctx, ncache,
bb7cd1
-                                         cache_refresh_percent, domain, data);
bb7cd1
+                                         cache_refresh_percent,
bb7cd1
+                                         CACHE_REQ_POSIX_DOM, domain,
bb7cd1
+                                         data);
bb7cd1
 }
bb7cd1
diff --git a/src/responder/common/cache_req/plugins/cache_req_group_by_filter.c b/src/responder/common/cache_req/plugins/cache_req_group_by_filter.c
bb7cd1
index 6ce6ae0d63967ac50b813a47ac938251619948da..4377a476c36e5e03c8533bc62335b84fa1cee3ff 100644
bb7cd1
--- a/src/responder/common/cache_req/plugins/cache_req_group_by_filter.c
bb7cd1
+++ b/src/responder/common/cache_req/plugins/cache_req_group_by_filter.c
bb7cd1
@@ -140,6 +140,7 @@ struct tevent_req *
bb7cd1
 cache_req_group_by_filter_send(TALLOC_CTX *mem_ctx,
bb7cd1
                                struct tevent_context *ev,
bb7cd1
                                struct resp_ctx *rctx,
bb7cd1
+                               enum cache_req_dom_type req_dom_type,
bb7cd1
                                const char *domain,
bb7cd1
                                const char *filter)
bb7cd1
 {
bb7cd1
@@ -151,5 +152,7 @@ cache_req_group_by_filter_send(TALLOC_CTX *mem_ctx,
bb7cd1
     }
bb7cd1
 
bb7cd1
     return cache_req_steal_data_and_send(mem_ctx, ev, rctx, NULL,
bb7cd1
-                                         0, domain, data);
bb7cd1
+                                         0,
bb7cd1
+                                         req_dom_type, domain,
bb7cd1
+                                         data);
bb7cd1
 }
bb7cd1
diff --git a/src/responder/common/cache_req/plugins/cache_req_group_by_id.c b/src/responder/common/cache_req/plugins/cache_req_group_by_id.c
bb7cd1
index e98f76f8cd20742b81ae247df61db159d2584a17..ad5b7d890a42f29b586ab8e0943fef3dfab1162d 100644
bb7cd1
--- a/src/responder/common/cache_req/plugins/cache_req_group_by_id.c
bb7cd1
+++ b/src/responder/common/cache_req/plugins/cache_req_group_by_id.c
bb7cd1
@@ -166,5 +166,7 @@ cache_req_group_by_id_send(TALLOC_CTX *mem_ctx,
bb7cd1
     }
bb7cd1
 
bb7cd1
     return cache_req_steal_data_and_send(mem_ctx, ev, rctx, ncache,
bb7cd1
-                                         cache_refresh_percent, domain, data);
bb7cd1
+                                         cache_refresh_percent,
bb7cd1
+                                         CACHE_REQ_POSIX_DOM, domain,
bb7cd1
+                                         data);
bb7cd1
 }
bb7cd1
diff --git a/src/responder/common/cache_req/plugins/cache_req_group_by_name.c b/src/responder/common/cache_req/plugins/cache_req_group_by_name.c
bb7cd1
index af6f23ccfd68f952027462ba3e74ed7219d04651..de1e8f9442273acf386a2278b06f28ee63a7e3c6 100644
bb7cd1
--- a/src/responder/common/cache_req/plugins/cache_req_group_by_name.c
bb7cd1
+++ b/src/responder/common/cache_req/plugins/cache_req_group_by_name.c
bb7cd1
@@ -205,6 +205,7 @@ cache_req_group_by_name_send(TALLOC_CTX *mem_ctx,
bb7cd1
                              struct resp_ctx *rctx,
bb7cd1
                              struct sss_nc_ctx *ncache,
bb7cd1
                              int cache_refresh_percent,
bb7cd1
+                             enum cache_req_dom_type req_dom_type,
bb7cd1
                              const char *domain,
bb7cd1
                              const char *name)
bb7cd1
 {
bb7cd1
@@ -216,5 +217,7 @@ cache_req_group_by_name_send(TALLOC_CTX *mem_ctx,
bb7cd1
     }
bb7cd1
 
bb7cd1
     return cache_req_steal_data_and_send(mem_ctx, ev, rctx, ncache,
bb7cd1
-                                         cache_refresh_percent, domain, data);
bb7cd1
+                                         cache_refresh_percent,
bb7cd1
+                                         req_dom_type, domain,
bb7cd1
+                                         data);
bb7cd1
 }
bb7cd1
diff --git a/src/responder/common/cache_req/plugins/cache_req_host_by_name.c b/src/responder/common/cache_req/plugins/cache_req_host_by_name.c
bb7cd1
index 77b46831fec3abc4126ef9d9be67221469801094..1171cd63fac5cc1d36b31bf8a069f059705cae90 100644
bb7cd1
--- a/src/responder/common/cache_req/plugins/cache_req_host_by_name.c
bb7cd1
+++ b/src/responder/common/cache_req/plugins/cache_req_host_by_name.c
bb7cd1
@@ -117,5 +117,7 @@ cache_req_host_by_name_send(TALLOC_CTX *mem_ctx,
bb7cd1
     }
bb7cd1
 
bb7cd1
     return cache_req_steal_data_and_send(mem_ctx, ev, rctx, ncache,
bb7cd1
-                                         cache_refresh_percent, domain, data);
bb7cd1
+                                         cache_refresh_percent,
bb7cd1
+                                         CACHE_REQ_POSIX_DOM, domain,
bb7cd1
+                                         data);
bb7cd1
 }
bb7cd1
diff --git a/src/responder/common/cache_req/plugins/cache_req_initgroups_by_name.c b/src/responder/common/cache_req/plugins/cache_req_initgroups_by_name.c
bb7cd1
index 307b65a24282838b99c472b50a71f06865aed3f0..f100aefe5c92279cde7e3209c7f48f5e2b35f135 100644
bb7cd1
--- a/src/responder/common/cache_req/plugins/cache_req_initgroups_by_name.c
bb7cd1
+++ b/src/responder/common/cache_req/plugins/cache_req_initgroups_by_name.c
bb7cd1
@@ -220,6 +220,7 @@ cache_req_initgr_by_name_send(TALLOC_CTX *mem_ctx,
bb7cd1
                               struct resp_ctx *rctx,
bb7cd1
                               struct sss_nc_ctx *ncache,
bb7cd1
                               int cache_refresh_percent,
bb7cd1
+                              enum cache_req_dom_type req_dom_type,
bb7cd1
                               const char *domain,
bb7cd1
                               const char *name)
bb7cd1
 {
bb7cd1
@@ -231,5 +232,7 @@ cache_req_initgr_by_name_send(TALLOC_CTX *mem_ctx,
bb7cd1
     }
bb7cd1
 
bb7cd1
     return cache_req_steal_data_and_send(mem_ctx, ev, rctx, ncache,
bb7cd1
-                                         cache_refresh_percent, domain, data);
bb7cd1
+                                         cache_refresh_percent,
bb7cd1
+                                         req_dom_type, domain,
bb7cd1
+                                         data);
bb7cd1
 }
bb7cd1
diff --git a/src/responder/common/cache_req/plugins/cache_req_netgroup_by_name.c b/src/responder/common/cache_req/plugins/cache_req_netgroup_by_name.c
bb7cd1
index e49d6d84a41ce8dabf18c87373826f8e7b684bda..ab3e553d3ecb8ae09094dcfc938ed0ac01925327 100644
bb7cd1
--- a/src/responder/common/cache_req/plugins/cache_req_netgroup_by_name.c
bb7cd1
+++ b/src/responder/common/cache_req/plugins/cache_req_netgroup_by_name.c
bb7cd1
@@ -150,5 +150,7 @@ cache_req_netgroup_by_name_send(TALLOC_CTX *mem_ctx,
bb7cd1
     }
bb7cd1
 
bb7cd1
     return cache_req_steal_data_and_send(mem_ctx, ev, rctx, ncache,
bb7cd1
-                                         cache_refresh_percent, domain, data);
bb7cd1
+                                         cache_refresh_percent,
bb7cd1
+                                         CACHE_REQ_POSIX_DOM, domain,
bb7cd1
+                                         data);
bb7cd1
 }
bb7cd1
diff --git a/src/responder/common/cache_req/plugins/cache_req_object_by_id.c b/src/responder/common/cache_req/plugins/cache_req_object_by_id.c
bb7cd1
index 046e313c83d1d4c75237b047be779201b8a5d3c0..9557bd15270b2eb1a0671f9ef91033efac29c3ac 100644
bb7cd1
--- a/src/responder/common/cache_req/plugins/cache_req_object_by_id.c
bb7cd1
+++ b/src/responder/common/cache_req/plugins/cache_req_object_by_id.c
bb7cd1
@@ -134,5 +134,7 @@ cache_req_object_by_id_send(TALLOC_CTX *mem_ctx,
bb7cd1
     }
bb7cd1
 
bb7cd1
     return cache_req_steal_data_and_send(mem_ctx, ev, rctx, ncache,
bb7cd1
-                                         cache_refresh_percent, domain, data);
bb7cd1
+                                         cache_refresh_percent,
bb7cd1
+                                         CACHE_REQ_POSIX_DOM, domain,
bb7cd1
+                                         data);
bb7cd1
 }
bb7cd1
diff --git a/src/responder/common/cache_req/plugins/cache_req_object_by_name.c b/src/responder/common/cache_req/plugins/cache_req_object_by_name.c
bb7cd1
index 74d2b3dea287e890b38e4d5bb176ad2dc6337b7e..e236d1fa4aadcd87b192d34ebaf5f9ad8908b6c2 100644
bb7cd1
--- a/src/responder/common/cache_req/plugins/cache_req_object_by_name.c
bb7cd1
+++ b/src/responder/common/cache_req/plugins/cache_req_object_by_name.c
bb7cd1
@@ -228,5 +228,7 @@ cache_req_object_by_name_send(TALLOC_CTX *mem_ctx,
bb7cd1
     }
bb7cd1
 
bb7cd1
     return cache_req_steal_data_and_send(mem_ctx, ev, rctx, ncache,
bb7cd1
-                                         cache_refresh_percent, domain, data);
bb7cd1
+                                         cache_refresh_percent,
bb7cd1
+                                         CACHE_REQ_POSIX_DOM, domain,
bb7cd1
+                                         data);
bb7cd1
 }
bb7cd1
diff --git a/src/responder/common/cache_req/plugins/cache_req_object_by_sid.c b/src/responder/common/cache_req/plugins/cache_req_object_by_sid.c
bb7cd1
index ab577663111cfd424e7f46308b2621af7f1ca264..dfec79da07d669165205a767cab22c2254686134 100644
bb7cd1
--- a/src/responder/common/cache_req/plugins/cache_req_object_by_sid.c
bb7cd1
+++ b/src/responder/common/cache_req/plugins/cache_req_object_by_sid.c
bb7cd1
@@ -143,5 +143,7 @@ cache_req_object_by_sid_send(TALLOC_CTX *mem_ctx,
bb7cd1
     }
bb7cd1
 
bb7cd1
     return cache_req_steal_data_and_send(mem_ctx, ev, rctx, ncache,
bb7cd1
-                                         cache_refresh_percent, domain, data);
bb7cd1
+                                         cache_refresh_percent,
bb7cd1
+                                         CACHE_REQ_POSIX_DOM, domain,
bb7cd1
+                                         data);
bb7cd1
 }
bb7cd1
diff --git a/src/responder/common/cache_req/plugins/cache_req_svc_by_name.c b/src/responder/common/cache_req/plugins/cache_req_svc_by_name.c
bb7cd1
index ef13f097a8ae78ec9db5b7f6e14924b511578b34..b2bfb26ffed1a60ed8389fa89b0e728c8c6cf76c 100644
bb7cd1
--- a/src/responder/common/cache_req/plugins/cache_req_svc_by_name.c
bb7cd1
+++ b/src/responder/common/cache_req/plugins/cache_req_svc_by_name.c
bb7cd1
@@ -175,5 +175,7 @@ cache_req_svc_by_name_send(TALLOC_CTX *mem_ctx,
bb7cd1
     }
bb7cd1
 
bb7cd1
     return cache_req_steal_data_and_send(mem_ctx, ev, rctx, ncache,
bb7cd1
-                                         cache_refresh_percent, domain, data);
bb7cd1
+                                         cache_refresh_percent,
bb7cd1
+                                         CACHE_REQ_POSIX_DOM, domain,
bb7cd1
+                                         data);
bb7cd1
 }
bb7cd1
diff --git a/src/responder/common/cache_req/plugins/cache_req_svc_by_port.c b/src/responder/common/cache_req/plugins/cache_req_svc_by_port.c
bb7cd1
index afa2eeeda12794de26e798aee4b88900bc87ed93..0e48437f4b64d26112be88af1eebc20f012b70fd 100644
bb7cd1
--- a/src/responder/common/cache_req/plugins/cache_req_svc_by_port.c
bb7cd1
+++ b/src/responder/common/cache_req/plugins/cache_req_svc_by_port.c
bb7cd1
@@ -149,5 +149,7 @@ cache_req_svc_by_port_send(TALLOC_CTX *mem_ctx,
bb7cd1
     }
bb7cd1
 
bb7cd1
     return cache_req_steal_data_and_send(mem_ctx, ev, rctx, ncache,
bb7cd1
-                                         cache_refresh_percent, domain, data);
bb7cd1
+                                         cache_refresh_percent,
bb7cd1
+                                         CACHE_REQ_POSIX_DOM, domain,
bb7cd1
+                                         data);
bb7cd1
 }
bb7cd1
diff --git a/src/responder/common/cache_req/plugins/cache_req_user_by_cert.c b/src/responder/common/cache_req/plugins/cache_req_user_by_cert.c
bb7cd1
index f237c8d0fe3faf5aea553480f3f92eb279209a20..286a34db276e0098060982c572e2a68ceceebf60 100644
bb7cd1
--- a/src/responder/common/cache_req/plugins/cache_req_user_by_cert.c
bb7cd1
+++ b/src/responder/common/cache_req/plugins/cache_req_user_by_cert.c
bb7cd1
@@ -105,6 +105,7 @@ cache_req_user_by_cert_send(TALLOC_CTX *mem_ctx,
bb7cd1
                             struct resp_ctx *rctx,
bb7cd1
                             struct sss_nc_ctx *ncache,
bb7cd1
                             int cache_refresh_percent,
bb7cd1
+                            enum cache_req_dom_type req_dom_type,
bb7cd1
                             const char *domain,
bb7cd1
                             const char *pem_cert)
bb7cd1
 {
bb7cd1
@@ -117,5 +118,6 @@ cache_req_user_by_cert_send(TALLOC_CTX *mem_ctx,
bb7cd1
 
bb7cd1
     return cache_req_steal_data_and_send(mem_ctx, ev, rctx, ncache,
bb7cd1
                                          cache_refresh_percent,
bb7cd1
-                                         domain, data);
bb7cd1
+                                         req_dom_type, domain,
bb7cd1
+                                         data);
bb7cd1
 }
bb7cd1
diff --git a/src/responder/common/cache_req/plugins/cache_req_user_by_filter.c b/src/responder/common/cache_req/plugins/cache_req_user_by_filter.c
bb7cd1
index eb71b42dad3a805298df0c8425409d571befb31b..c476814373cd784bf8dbbea1da7b010afe5bb4e4 100644
bb7cd1
--- a/src/responder/common/cache_req/plugins/cache_req_user_by_filter.c
bb7cd1
+++ b/src/responder/common/cache_req/plugins/cache_req_user_by_filter.c
bb7cd1
@@ -140,6 +140,7 @@ struct tevent_req *
bb7cd1
 cache_req_user_by_filter_send(TALLOC_CTX *mem_ctx,
bb7cd1
                               struct tevent_context *ev,
bb7cd1
                               struct resp_ctx *rctx,
bb7cd1
+                              enum cache_req_dom_type req_dom_type,
bb7cd1
                               const char *domain,
bb7cd1
                               const char *filter)
bb7cd1
 {
bb7cd1
@@ -151,5 +152,7 @@ cache_req_user_by_filter_send(TALLOC_CTX *mem_ctx,
bb7cd1
     }
bb7cd1
 
bb7cd1
     return cache_req_steal_data_and_send(mem_ctx, ev, rctx, NULL,
bb7cd1
-                                         0, domain, data);
bb7cd1
+                                         0,
bb7cd1
+                                         req_dom_type, domain,
bb7cd1
+                                         data);
bb7cd1
 }
bb7cd1
diff --git a/src/responder/common/cache_req/plugins/cache_req_user_by_id.c b/src/responder/common/cache_req/plugins/cache_req_user_by_id.c
bb7cd1
index fa783714b7c67ca029d18a223b64a3a69e3e6929..9ba73292e5dc518e86c6e00e7e493d6871f28e70 100644
bb7cd1
--- a/src/responder/common/cache_req/plugins/cache_req_user_by_id.c
bb7cd1
+++ b/src/responder/common/cache_req/plugins/cache_req_user_by_id.c
bb7cd1
@@ -166,5 +166,7 @@ cache_req_user_by_id_send(TALLOC_CTX *mem_ctx,
bb7cd1
     }
bb7cd1
 
bb7cd1
     return cache_req_steal_data_and_send(mem_ctx, ev, rctx, ncache,
bb7cd1
-                                         cache_refresh_percent, domain, data);
bb7cd1
+                                         cache_refresh_percent,
bb7cd1
+                                         CACHE_REQ_POSIX_DOM, domain,
bb7cd1
+                                         data);
bb7cd1
 }
bb7cd1
diff --git a/src/responder/common/cache_req/plugins/cache_req_user_by_name.c b/src/responder/common/cache_req/plugins/cache_req_user_by_name.c
bb7cd1
index 0670febdce2d51e0373045570dd07f56255db7bc..15da7d0d20b1ac97511a226daecc8ef7e7d2e7e4 100644
bb7cd1
--- a/src/responder/common/cache_req/plugins/cache_req_user_by_name.c
bb7cd1
+++ b/src/responder/common/cache_req/plugins/cache_req_user_by_name.c
bb7cd1
@@ -210,6 +210,7 @@ cache_req_user_by_name_send(TALLOC_CTX *mem_ctx,
bb7cd1
                             struct resp_ctx *rctx,
bb7cd1
                             struct sss_nc_ctx *ncache,
bb7cd1
                             int cache_refresh_percent,
bb7cd1
+                            enum cache_req_dom_type req_dom_type,
bb7cd1
                             const char *domain,
bb7cd1
                             const char *name)
bb7cd1
 {
bb7cd1
@@ -221,7 +222,9 @@ cache_req_user_by_name_send(TALLOC_CTX *mem_ctx,
bb7cd1
     }
bb7cd1
 
bb7cd1
     return cache_req_steal_data_and_send(mem_ctx, ev, rctx, ncache,
bb7cd1
-                                         cache_refresh_percent, domain, data);
bb7cd1
+                                         cache_refresh_percent,
bb7cd1
+                                         req_dom_type, domain,
bb7cd1
+                                         data);
bb7cd1
 }
bb7cd1
 
bb7cd1
 struct tevent_req *
bb7cd1
@@ -243,5 +246,7 @@ cache_req_user_by_name_attrs_send(TALLOC_CTX *mem_ctx,
bb7cd1
     }
bb7cd1
 
bb7cd1
     return cache_req_steal_data_and_send(mem_ctx, ev, rctx, ncache,
bb7cd1
-                                         cache_refresh_percent, domain, data);
bb7cd1
+                                         cache_refresh_percent,
bb7cd1
+                                         CACHE_REQ_POSIX_DOM, domain,
bb7cd1
+                                         data);
bb7cd1
 }
bb7cd1
diff --git a/src/responder/ifp/ifp_groups.c b/src/responder/ifp/ifp_groups.c
bb7cd1
index 94d1e84cc9de75727d3c47c0a5a24790d21ce132..99908e96bd971bce4b4e9064a77d8413f837d743 100644
bb7cd1
--- a/src/responder/ifp/ifp_groups.c
bb7cd1
+++ b/src/responder/ifp/ifp_groups.c
bb7cd1
@@ -118,7 +118,9 @@ int ifp_groups_find_by_name(struct sbus_request *sbus_req,
bb7cd1
     }
bb7cd1
 
bb7cd1
     req = cache_req_group_by_name_send(sbus_req, ctx->rctx->ev, ctx->rctx,
bb7cd1
-                                       ctx->rctx->ncache, 0, NULL, name);
bb7cd1
+                                       ctx->rctx->ncache, 0,
bb7cd1
+                                       CACHE_REQ_POSIX_DOM, NULL,
bb7cd1
+                                       name);
bb7cd1
     if (req == NULL) {
bb7cd1
         return ENOMEM;
bb7cd1
     }
bb7cd1
@@ -271,6 +273,7 @@ static int ifp_groups_list_by_name_step(struct ifp_list_ctx *list_ctx)
bb7cd1
     req = cache_req_group_by_filter_send(list_ctx,
bb7cd1
                                         list_ctx->ctx->rctx->ev,
bb7cd1
                                         list_ctx->ctx->rctx,
bb7cd1
+                                        CACHE_REQ_POSIX_DOM,
bb7cd1
                                         list_ctx->dom->name,
bb7cd1
                                         list_ctx->filter);
bb7cd1
     if (req == NULL) {
bb7cd1
@@ -355,7 +358,8 @@ int ifp_groups_list_by_domain_and_name(struct sbus_request *sbus_req,
bb7cd1
     }
bb7cd1
 
bb7cd1
     req = cache_req_group_by_filter_send(list_ctx, ctx->rctx->ev, ctx->rctx,
bb7cd1
-                                        domain, filter);
bb7cd1
+                                         CACHE_REQ_POSIX_DOM,
bb7cd1
+                                         domain, filter);
bb7cd1
     if (req == NULL) {
bb7cd1
         return ENOMEM;
bb7cd1
     }
bb7cd1
@@ -522,7 +526,10 @@ static struct tevent_req *resolv_ghosts_send(TALLOC_CTX *mem_ctx,
bb7cd1
     }
bb7cd1
 
bb7cd1
     subreq = cache_req_group_by_name_send(state, ev, ctx->rctx,
bb7cd1
-                                          ctx->rctx->ncache, 0, domain->name, name);
bb7cd1
+                                          ctx->rctx->ncache, 0,
bb7cd1
+                                          CACHE_REQ_POSIX_DOM,
bb7cd1
+                                          domain->name,
bb7cd1
+                                          name);
bb7cd1
     if (subreq == NULL) {
bb7cd1
         ret = ENOMEM;
bb7cd1
         goto immediately;
bb7cd1
@@ -601,6 +608,7 @@ errno_t resolv_ghosts_step(struct tevent_req *req)
bb7cd1
 
bb7cd1
     subreq = cache_req_user_by_name_send(state, state->ev, state->ctx->rctx,
bb7cd1
                                          state->ctx->rctx->ncache, 0,
bb7cd1
+                                         CACHE_REQ_POSIX_DOM,
bb7cd1
                                          state->domain->name,
bb7cd1
                                          state->ghosts[state->index]);
bb7cd1
     if (subreq == NULL) {
bb7cd1
diff --git a/src/responder/ifp/ifp_users.c b/src/responder/ifp/ifp_users.c
bb7cd1
index cc78300f31e863fcb5366e18a14abc597c6f7ddb..436bb268fa9c78d72fb744e0d338aa561a7d8764 100644
bb7cd1
--- a/src/responder/ifp/ifp_users.c
bb7cd1
+++ b/src/responder/ifp/ifp_users.c
bb7cd1
@@ -99,7 +99,9 @@ int ifp_users_find_by_name(struct sbus_request *sbus_req,
bb7cd1
     }
bb7cd1
 
bb7cd1
     req = cache_req_user_by_name_send(sbus_req, ctx->rctx->ev, ctx->rctx,
bb7cd1
-                                      ctx->rctx->ncache, 0, NULL, name);
bb7cd1
+                                      ctx->rctx->ncache, 0,
bb7cd1
+                                      CACHE_REQ_POSIX_DOM,
bb7cd1
+                                      NULL, name);
bb7cd1
     if (req == NULL) {
bb7cd1
         return ENOMEM;
bb7cd1
     }
bb7cd1
@@ -253,7 +255,9 @@ int ifp_users_find_by_cert(struct sbus_request *sbus_req, void *data,
bb7cd1
     }
bb7cd1
 
bb7cd1
     req = cache_req_user_by_cert_send(sbus_req, ctx->rctx->ev, ctx->rctx,
bb7cd1
-                                      ctx->rctx->ncache, 0, NULL, derb64);
bb7cd1
+                                      ctx->rctx->ncache, 0,
bb7cd1
+                                      CACHE_REQ_POSIX_DOM, NULL,
bb7cd1
+                                      derb64);
bb7cd1
     if (req == NULL) {
bb7cd1
         return ENOMEM;
bb7cd1
     }
bb7cd1
@@ -367,6 +371,7 @@ static int ifp_users_list_by_cert_step(struct ifp_list_ctx *list_ctx)
bb7cd1
                                       list_ctx->ctx->rctx,
bb7cd1
                                       list_ctx->ctx->rctx->ncache,
bb7cd1
                                       0,
bb7cd1
+                                      CACHE_REQ_POSIX_DOM,
bb7cd1
                                       list_ctx->dom->name,
bb7cd1
                                       list_ctx->filter);
bb7cd1
     if (req == NULL) {
bb7cd1
@@ -532,7 +537,9 @@ int ifp_users_find_by_name_and_cert(struct sbus_request *sbus_req, void *data,
bb7cd1
 
bb7cd1
     if (name_and_cert_ctx->name != NULL) {
bb7cd1
         req = cache_req_user_by_name_send(sbus_req, ctx->rctx->ev, ctx->rctx,
bb7cd1
-                                          ctx->rctx->ncache, 0, NULL,
bb7cd1
+                                          ctx->rctx->ncache, 0,
bb7cd1
+                                          CACHE_REQ_POSIX_DOM,
bb7cd1
+                                          NULL,
bb7cd1
                                           name_and_cert_ctx->name);
bb7cd1
         if (req == NULL) {
bb7cd1
             return ENOMEM;
bb7cd1
@@ -614,6 +621,7 @@ static int ifp_users_find_by_name_and_cert_step(
bb7cd1
                                       list_ctx->ctx->rctx,
bb7cd1
                                       list_ctx->ctx->rctx->ncache,
bb7cd1
                                       0,
bb7cd1
+                                      CACHE_REQ_POSIX_DOM,
bb7cd1
                                       list_ctx->dom->name,
bb7cd1
                                       list_ctx->filter);
bb7cd1
     if (req == NULL) {
bb7cd1
@@ -774,6 +782,7 @@ static int ifp_users_list_by_name_step(struct ifp_list_ctx *list_ctx)
bb7cd1
     req = cache_req_user_by_filter_send(list_ctx,
bb7cd1
                                         list_ctx->ctx->rctx->ev,
bb7cd1
                                         list_ctx->ctx->rctx,
bb7cd1
+                                        CACHE_REQ_POSIX_DOM,
bb7cd1
                                         list_ctx->dom->name,
bb7cd1
                                         list_ctx->filter);
bb7cd1
     if (req == NULL) {
bb7cd1
@@ -858,6 +867,7 @@ int ifp_users_list_by_domain_and_name(struct sbus_request *sbus_req,
bb7cd1
     }
bb7cd1
 
bb7cd1
     req = cache_req_user_by_filter_send(list_ctx, ctx->rctx->ev, ctx->rctx,
bb7cd1
+                                        CACHE_REQ_POSIX_DOM,
bb7cd1
                                         domain, filter);
bb7cd1
     if (req == NULL) {
bb7cd1
         return ENOMEM;
bb7cd1
@@ -1102,7 +1112,8 @@ int ifp_users_user_update_groups_list(struct sbus_request *sbus_req,
bb7cd1
     }
bb7cd1
 
bb7cd1
     req = cache_req_initgr_by_name_send(sbus_req, ctx->rctx->ev, ctx->rctx,
bb7cd1
-                                        ctx->rctx->ncache, 0, domain->name,
bb7cd1
+                                        ctx->rctx->ncache, 0,
bb7cd1
+                                        CACHE_REQ_POSIX_DOM, domain->name,
bb7cd1
                                         username);
bb7cd1
     if (req == NULL) {
bb7cd1
         return ENOMEM;
bb7cd1
diff --git a/src/responder/ifp/ifpsrv_cmd.c b/src/responder/ifp/ifpsrv_cmd.c
bb7cd1
index 07edcddffa1091f8bbcf79a25962aadc791bb890..118b5083b14bf5692c6fdd7ba90668fe514aa89d 100644
bb7cd1
--- a/src/responder/ifp/ifpsrv_cmd.c
bb7cd1
+++ b/src/responder/ifp/ifpsrv_cmd.c
bb7cd1
@@ -509,7 +509,8 @@ ifp_user_get_attr_lookup(struct tevent_req *subreq)
bb7cd1
     }
bb7cd1
 
bb7cd1
     subreq = cache_req_send(state, state->rctx->ev, state->rctx,
bb7cd1
-                            state->ncache, 0, state->domname, data);
bb7cd1
+                            state->ncache, 0, CACHE_REQ_POSIX_DOM,
bb7cd1
+                            state->domname, data);
bb7cd1
     if (subreq == NULL) {
bb7cd1
         tevent_req_error(req, ENOMEM);
bb7cd1
         return;
bb7cd1
diff --git a/src/responder/nss/nss_enum.c b/src/responder/nss/nss_enum.c
bb7cd1
index b1cce2cde43ece735285c132d0127c142ee83cb0..aa7d8428f37e943a6b5904495c40ad4b8011b767 100644
bb7cd1
--- a/src/responder/nss/nss_enum.c
bb7cd1
+++ b/src/responder/nss/nss_enum.c
bb7cd1
@@ -93,7 +93,7 @@ nss_setent_internal_send(TALLOC_CTX *mem_ctx,
bb7cd1
     /* Create new object. */
bb7cd1
     state->enum_ctx->is_ready = false;
bb7cd1
     subreq = cache_req_send(req, ev, cli_ctx->rctx, cli_ctx->rctx->ncache,
bb7cd1
-                            0, NULL, data);
bb7cd1
+                            0, CACHE_REQ_POSIX_DOM, NULL, data);
bb7cd1
     if (subreq == NULL) {
bb7cd1
         DEBUG(SSSDBG_CRIT_FAILURE, "Unable to send cache request!\n");
bb7cd1
         ret = ENOMEM;
bb7cd1
diff --git a/src/responder/nss/nss_get_object.c b/src/responder/nss/nss_get_object.c
bb7cd1
index f83dd393c0e333d8914802e005672a15a51d5939..9058793ea2d72b57003a7219414af6a0f0c5b89e 100644
bb7cd1
--- a/src/responder/nss/nss_get_object.c
bb7cd1
+++ b/src/responder/nss/nss_get_object.c
bb7cd1
@@ -190,7 +190,8 @@ nss_get_object_send(TALLOC_CTX *mem_ctx,
bb7cd1
     }
bb7cd1
 
bb7cd1
     subreq = cache_req_send(req, ev, cli_ctx->rctx, cli_ctx->rctx->ncache,
bb7cd1
-                            state->nss_ctx->cache_refresh_percent, NULL, data);
bb7cd1
+                            state->nss_ctx->cache_refresh_percent,
bb7cd1
+                            CACHE_REQ_POSIX_DOM, NULL, data);
bb7cd1
     if (subreq == NULL) {
bb7cd1
         DEBUG(SSSDBG_CRIT_FAILURE, "Unable to send cache request!\n");
bb7cd1
         ret = ENOMEM;
bb7cd1
diff --git a/src/responder/pam/pamsrv_cmd.c b/src/responder/pam/pamsrv_cmd.c
bb7cd1
index ba2563c11885ff39681c2ef432acaedf26702b64..fa6d2cc10fe1404196f9d9221a469d7a9a768211 100644
bb7cd1
--- a/src/responder/pam/pamsrv_cmd.c
bb7cd1
+++ b/src/responder/pam/pamsrv_cmd.c
bb7cd1
@@ -1315,7 +1315,9 @@ static void pam_forwarder_cert_cb(struct tevent_req *req)
bb7cd1
 
bb7cd1
 
bb7cd1
     req = cache_req_user_by_cert_send(preq, cctx->ev, cctx->rctx,
bb7cd1
-                                      pctx->rctx->ncache, 0, NULL, cert);
bb7cd1
+                                      pctx->rctx->ncache, 0,
bb7cd1
+                                      CACHE_REQ_POSIX_DOM, NULL,
bb7cd1
+                                      cert);
bb7cd1
     if (req == NULL) {
bb7cd1
         DEBUG(SSSDBG_OP_FAILURE, "cache_req_user_by_cert_send failed.\n");
bb7cd1
         ret = ENOMEM;
bb7cd1
@@ -1507,6 +1509,7 @@ static int pam_check_user_search(struct pam_auth_req *preq)
bb7cd1
                            preq->cctx->rctx,
bb7cd1
                            preq->cctx->rctx->ncache,
bb7cd1
                            0,
bb7cd1
+                           CACHE_REQ_POSIX_DOM,
bb7cd1
                            preq->pd->domain,
bb7cd1
                            data);
bb7cd1
     if (!dpreq) {
bb7cd1
diff --git a/src/responder/sudo/sudosrv_get_sudorules.c b/src/responder/sudo/sudosrv_get_sudorules.c
bb7cd1
index 52dfd5c709e48f0d4610a4b384962fbc2869312b..cfdbfc9c9c66d96f774822d6a4d4aaaf1327abe3 100644
bb7cd1
--- a/src/responder/sudo/sudosrv_get_sudorules.c
bb7cd1
+++ b/src/responder/sudo/sudosrv_get_sudorules.c
bb7cd1
@@ -644,7 +644,8 @@ struct tevent_req *sudosrv_get_rules_send(TALLOC_CTX *mem_ctx,
bb7cd1
     DEBUG(SSSDBG_TRACE_FUNC, "Running initgroups for [%s]\n", username);
bb7cd1
 
bb7cd1
     subreq = cache_req_initgr_by_name_send(state, ev, sudo_ctx->rctx,
bb7cd1
-                                           sudo_ctx->rctx->ncache, 0, NULL,
bb7cd1
+                                           sudo_ctx->rctx->ncache, 0,
bb7cd1
+                                           CACHE_REQ_POSIX_DOM, NULL,
bb7cd1
                                            username);
bb7cd1
     if (subreq == NULL) {
bb7cd1
         ret = ENOMEM;
bb7cd1
diff --git a/src/tests/cmocka/test_responder_cache_req.c b/src/tests/cmocka/test_responder_cache_req.c
bb7cd1
index 5f1e5350eaf1d85de376c94731f0bd678f884a1d..80086232fd437876c2b190fb972c2ee3194d9efd 100644
bb7cd1
--- a/src/tests/cmocka/test_responder_cache_req.c
bb7cd1
+++ b/src/tests/cmocka/test_responder_cache_req.c
bb7cd1
@@ -84,6 +84,28 @@ struct test_group {
bb7cd1
     talloc_free(req_mem_ctx);                                               \
bb7cd1
 } while (0)
bb7cd1
 
bb7cd1
+#define run_cache_req_domtype(ctx, send_fn, done_fn, dom, crp, domtype, lookup, expret) do { \
bb7cd1
+    TALLOC_CTX *req_mem_ctx;                                                                 \
bb7cd1
+    struct tevent_req *req;                                                                  \
bb7cd1
+    errno_t ret;                                                                             \
bb7cd1
+                                                                                             \
bb7cd1
+    req_mem_ctx = talloc_new(global_talloc_context);                                         \
bb7cd1
+    check_leaks_push(req_mem_ctx);                                                           \
bb7cd1
+                                                                                             \
bb7cd1
+    req = send_fn(req_mem_ctx, ctx->tctx->ev, ctx->rctx,                                     \
bb7cd1
+                  ctx->ncache, crp,                                                          \
bb7cd1
+                  domtype,                                                                   \
bb7cd1
+                  (dom == NULL ? NULL : dom->name), lookup);                                 \
bb7cd1
+    assert_non_null(req);                                                                    \
bb7cd1
+    tevent_req_set_callback(req, done_fn, ctx);                                              \
bb7cd1
+                                                                                             \
bb7cd1
+    ret = test_ev_loop(ctx->tctx);                                                           \
bb7cd1
+    assert_int_equal(ret, expret);                                                           \
bb7cd1
+    assert_true(check_leaks_pop(req_mem_ctx));                                               \
bb7cd1
+                                                                                             \
bb7cd1
+    talloc_free(req_mem_ctx);                                                                \
bb7cd1
+} while (0)
bb7cd1
+
bb7cd1
 struct cache_req_test_ctx {
bb7cd1
     struct sss_test_ctx *tctx;
bb7cd1
     struct resp_ctx *rctx;
bb7cd1
@@ -211,9 +233,11 @@ static void run_user_by_name(struct cache_req_test_ctx *test_ctx,
bb7cd1
                              int cache_refresh_percent,
bb7cd1
                              errno_t exp_ret)
bb7cd1
 {
bb7cd1
-    run_cache_req(test_ctx, cache_req_user_by_name_send,
bb7cd1
-                  cache_req_user_by_name_test_done, domain,
bb7cd1
-                  cache_refresh_percent, users[0].short_name, exp_ret);
bb7cd1
+    run_cache_req_domtype(test_ctx, cache_req_user_by_name_send,
bb7cd1
+                          cache_req_user_by_name_test_done, domain,
bb7cd1
+                          cache_refresh_percent,
bb7cd1
+                          CACHE_REQ_POSIX_DOM,
bb7cd1
+                          users[0].short_name, exp_ret);
bb7cd1
 }
bb7cd1
 
bb7cd1
 static void run_user_by_upn(struct cache_req_test_ctx *test_ctx,
bb7cd1
@@ -221,9 +245,11 @@ static void run_user_by_upn(struct cache_req_test_ctx *test_ctx,
bb7cd1
                             int cache_refresh_percent,
bb7cd1
                             errno_t exp_ret)
bb7cd1
 {
bb7cd1
-    run_cache_req(test_ctx, cache_req_user_by_name_send,
bb7cd1
-                  cache_req_user_by_name_test_done, domain,
bb7cd1
-                  cache_refresh_percent, users[0].upn, exp_ret);
bb7cd1
+    run_cache_req_domtype(test_ctx, cache_req_user_by_name_send,
bb7cd1
+                          cache_req_user_by_name_test_done, domain,
bb7cd1
+                          cache_refresh_percent,
bb7cd1
+                          CACHE_REQ_POSIX_DOM,
bb7cd1
+                          users[0].upn, exp_ret);
bb7cd1
 }
bb7cd1
 
bb7cd1
 static void run_user_by_id(struct cache_req_test_ctx *test_ctx,
bb7cd1
@@ -318,9 +344,11 @@ static void run_group_by_name(struct cache_req_test_ctx *test_ctx,
bb7cd1
                               int cache_refresh_percent,
bb7cd1
                               errno_t exp_ret)
bb7cd1
 {
bb7cd1
-    run_cache_req(test_ctx, cache_req_group_by_name_send,
bb7cd1
-                  cache_req_group_by_name_test_done, domain,
bb7cd1
-                  cache_refresh_percent, groups[0].short_name, exp_ret);
bb7cd1
+    run_cache_req_domtype(test_ctx, cache_req_group_by_name_send,
bb7cd1
+                          cache_req_group_by_name_test_done, domain,
bb7cd1
+                          cache_refresh_percent,
bb7cd1
+                          CACHE_REQ_POSIX_DOM,
bb7cd1
+                          groups[0].short_name, exp_ret);
bb7cd1
 }
bb7cd1
 
bb7cd1
 static void run_group_by_id(struct cache_req_test_ctx *test_ctx,
bb7cd1
@@ -605,7 +633,9 @@ void test_user_by_name_multiple_domains_parse(void **state)
bb7cd1
     check_leaks_push(req_mem_ctx);
bb7cd1
 
bb7cd1
     req = cache_req_user_by_name_send(req_mem_ctx, test_ctx->tctx->ev,
bb7cd1
-                                      test_ctx->rctx, test_ctx->ncache, 0,
bb7cd1
+                                      test_ctx->rctx, test_ctx->ncache,
bb7cd1
+                                      CACHE_REQ_POSIX_DOM,
bb7cd1
+                                      0,
bb7cd1
                                       NULL, input_fqn);
bb7cd1
     assert_non_null(req);
bb7cd1
     tevent_req_set_callback(req, cache_req_user_by_name_test_done, test_ctx);
bb7cd1
@@ -1119,7 +1149,8 @@ void test_group_by_name_multiple_domains_parse(void **state)
bb7cd1
 
bb7cd1
     req = cache_req_group_by_name_send(req_mem_ctx, test_ctx->tctx->ev,
bb7cd1
                                        test_ctx->rctx, test_ctx->ncache, 0,
bb7cd1
-                                       NULL, input_fqn);
bb7cd1
+                                       CACHE_REQ_POSIX_DOM, NULL,
bb7cd1
+                                       input_fqn);
bb7cd1
     assert_non_null(req);
bb7cd1
     tevent_req_set_callback(req, cache_req_group_by_name_test_done, test_ctx);
bb7cd1
 
bb7cd1
@@ -1421,6 +1452,7 @@ void test_user_by_recent_filter_valid(void **state)
bb7cd1
     /* User TEST_USER is created with a DP callback. */
bb7cd1
     req = cache_req_user_by_filter_send(req_mem_ctx, test_ctx->tctx->ev,
bb7cd1
                                         test_ctx->rctx,
bb7cd1
+                                        CACHE_REQ_POSIX_DOM,
bb7cd1
                                         test_ctx->tctx->dom->name,
bb7cd1
                                         TEST_USER_PREFIX);
bb7cd1
     assert_non_null(req);
bb7cd1
@@ -1463,6 +1495,7 @@ void test_users_by_recent_filter_valid(void **state)
bb7cd1
     /* User TEST_USER1 and TEST_USER2 are created with a DP callback. */
bb7cd1
     req = cache_req_user_by_filter_send(req_mem_ctx, test_ctx->tctx->ev,
bb7cd1
                                         test_ctx->rctx,
bb7cd1
+                                        CACHE_REQ_POSIX_DOM,
bb7cd1
                                         test_ctx->tctx->dom->name,
bb7cd1
                                         TEST_USER_PREFIX);
bb7cd1
     assert_non_null(req);
bb7cd1
@@ -1524,6 +1557,7 @@ void test_users_by_filter_filter_old(void **state)
bb7cd1
 
bb7cd1
     req = cache_req_user_by_filter_send(req_mem_ctx, test_ctx->tctx->ev,
bb7cd1
                                         test_ctx->rctx,
bb7cd1
+                                        CACHE_REQ_POSIX_DOM,
bb7cd1
                                         test_ctx->tctx->dom->name,
bb7cd1
                                         TEST_USER_PREFIX);
bb7cd1
     assert_non_null(req);
bb7cd1
@@ -1559,6 +1593,7 @@ void test_users_by_filter_notfound(void **state)
bb7cd1
 
bb7cd1
     req = cache_req_user_by_filter_send(req_mem_ctx, test_ctx->tctx->ev,
bb7cd1
                                         test_ctx->rctx,
bb7cd1
+                                        CACHE_REQ_POSIX_DOM,
bb7cd1
                                         test_ctx->tctx->dom->name,
bb7cd1
                                         "nosuchuser*");
bb7cd1
     assert_non_null(req);
bb7cd1
@@ -1592,6 +1627,7 @@ static void test_users_by_filter_multiple_domains_notfound(void **state)
bb7cd1
 
bb7cd1
     req = cache_req_user_by_filter_send(req_mem_ctx, test_ctx->tctx->ev,
bb7cd1
                                         test_ctx->rctx,
bb7cd1
+                                        CACHE_REQ_POSIX_DOM,
bb7cd1
                                         domain->name,
bb7cd1
                                         "nosuchuser*");
bb7cd1
     assert_non_null(req);
bb7cd1
@@ -1636,6 +1672,7 @@ void test_group_by_recent_filter_valid(void **state)
bb7cd1
     /* Group TEST_GROUP is created with a DP callback. */
bb7cd1
     req = cache_req_group_by_filter_send(req_mem_ctx, test_ctx->tctx->ev,
bb7cd1
                                          test_ctx->rctx,
bb7cd1
+                                         CACHE_REQ_POSIX_DOM,
bb7cd1
                                          test_ctx->tctx->dom->name,
bb7cd1
                                          TEST_USER_PREFIX);
bb7cd1
     assert_non_null(req);
bb7cd1
@@ -1680,6 +1717,7 @@ void test_groups_by_recent_filter_valid(void **state)
bb7cd1
     /* Group TEST_GROUP1 and TEST_GROUP2 are created with a DP callback. */
bb7cd1
     req = cache_req_group_by_filter_send(req_mem_ctx, test_ctx->tctx->ev,
bb7cd1
                                          test_ctx->rctx,
bb7cd1
+                                         CACHE_REQ_POSIX_DOM,
bb7cd1
                                          test_ctx->tctx->dom->name,
bb7cd1
                                          TEST_USER_PREFIX);
bb7cd1
     assert_non_null(req);
bb7cd1
@@ -1738,6 +1776,7 @@ void test_groups_by_filter_notfound(void **state)
bb7cd1
 
bb7cd1
     req = cache_req_group_by_filter_send(req_mem_ctx, test_ctx->tctx->ev,
bb7cd1
                                         test_ctx->rctx,
bb7cd1
+                                        CACHE_REQ_POSIX_DOM,
bb7cd1
                                         test_ctx->tctx->dom->name,
bb7cd1
                                         "nosuchgroup*");
bb7cd1
     assert_non_null(req);
bb7cd1
@@ -1770,6 +1809,7 @@ void test_groups_by_filter_multiple_domains_notfound(void **state)
bb7cd1
 
bb7cd1
     req = cache_req_group_by_filter_send(req_mem_ctx, test_ctx->tctx->ev,
bb7cd1
                                         test_ctx->rctx,
bb7cd1
+                                        CACHE_REQ_POSIX_DOM,
bb7cd1
                                         domain->name,
bb7cd1
                                         "nosuchgroup*");
bb7cd1
     assert_non_null(req);
bb7cd1
-- 
bb7cd1
2.9.3
bb7cd1