summaryrefslogtreecommitdiffstats
path: root/src/providers/ldap/sdap_async_initgroups_ad.c
diff options
context:
space:
mode:
authorSumit Bose <sbose@redhat.com>2013-12-10 10:14:28 +0100
committerJakub Hrozek <jhrozek@redhat.com>2013-12-19 17:34:01 +0100
commit8280c5213094a72fcaa499dda2f8647246185d45 (patch)
tree632fd902d268e1d537fd10f8ffbe835c6c894013 /src/providers/ldap/sdap_async_initgroups_ad.c
parentfb4435785f92712840efb107700452598371ce77 (diff)
downloadsssd-8280c5213094a72fcaa499dda2f8647246185d45.tar.gz
sssd-8280c5213094a72fcaa499dda2f8647246185d45.tar.xz
sssd-8280c5213094a72fcaa499dda2f8647246185d45.zip
AD: filter domain local groups for trusted/sub domains
In Active Directory groups with a domain local scope should only be used inside of the specific domain. Since SSSD read the group memberships from LDAP server of the user's domain the domain local groups are included in the LDAP result. Those groups should be filtered out if the domain is a sub/trusted domain, i.e. is not the domain the client running SSSD is joined to. The groups will still be in the cache but marked as non-POSIX groups and no GID will be assigned. Fixes https://fedorahosted.org/sssd/ticket/2178
Diffstat (limited to 'src/providers/ldap/sdap_async_initgroups_ad.c')
-rw-r--r--src/providers/ldap/sdap_async_initgroups_ad.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/providers/ldap/sdap_async_initgroups_ad.c b/src/providers/ldap/sdap_async_initgroups_ad.c
index ccaded945..1a381d81f 100644
--- a/src/providers/ldap/sdap_async_initgroups_ad.c
+++ b/src/providers/ldap/sdap_async_initgroups_ad.c
@@ -1142,6 +1142,7 @@ static errno_t sdap_ad_tokengroups_initgr_posix_recv(struct tevent_req *req)
struct sdap_ad_tokengroups_initgroups_state {
bool use_id_mapping;
+ struct sss_domain_info *domain;
};
static void sdap_ad_tokengroups_initgroups_done(struct tevent_req *subreq);
@@ -1172,8 +1173,9 @@ sdap_ad_tokengroups_initgroups_send(TALLOC_CTX *mem_ctx,
}
state->use_id_mapping = use_id_mapping;
+ state->domain = domain;
- if (state->use_id_mapping) {
+ if (state->use_id_mapping && !IS_SUBDOMAIN(state->domain)) {
subreq = sdap_ad_tokengroups_initgr_mapping_send(state, ev, opts,
sysdb, domain, sh,
name, orig_dn,
@@ -1213,7 +1215,7 @@ static void sdap_ad_tokengroups_initgroups_done(struct tevent_req *subreq)
req = tevent_req_callback_data(subreq, struct tevent_req);
state = tevent_req_data(req, struct sdap_ad_tokengroups_initgroups_state);
- if (state->use_id_mapping) {
+ if (state->use_id_mapping && !IS_SUBDOMAIN(state->domain)) {
ret = sdap_ad_tokengroups_initgr_mapping_recv(subreq);
} else {
ret = sdap_ad_tokengroups_initgr_posix_recv(subreq);