summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLukas Slebodnik <lslebodn@redhat.com>2015-04-13 09:50:29 +0200
committerJakub Hrozek <jhrozek@redhat.com>2015-04-22 12:52:10 +0200
commitbea6b6c6bcf711e0d96a4263f60e0e1b0a64c45f (patch)
treef8d3327e08531fce16d6caaa87183fa713d27936
parent64eb7055b640e9c92701886effc36f74fe9e709f (diff)
downloadsssd-bea6b6c6bcf711e0d96a4263f60e0e1b0a64c45f.tar.gz
sssd-bea6b6c6bcf711e0d96a4263f60e0e1b0a64c45f.tar.xz
sssd-bea6b6c6bcf711e0d96a4263f60e0e1b0a64c45f.zip
SDAP: Filter ad groups in initgroups
Function sdap_add_incomplete_groups stored domain local groups from subdomain as POSIX group, which should not be done. Resolves: https://fedorahosted.org/sssd/ticket/2614 Reviewed-by: Jakub Hrozek <jhrozek@redhat.com> (cherry picked from commit b9fbeb75e7a4f50f98d979a70a710f9221892483)
-rw-r--r--src/providers/ldap/sdap_async_initgroups.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/providers/ldap/sdap_async_initgroups.c b/src/providers/ldap/sdap_async_initgroups.c
index bc6b5e45e..43b72fe20 100644
--- a/src/providers/ldap/sdap_async_initgroups.c
+++ b/src/providers/ldap/sdap_async_initgroups.c
@@ -51,6 +51,7 @@ errno_t sdap_add_incomplete_groups(struct sysdb_ctx *sysdb,
time_t now;
char *sid_str = NULL;
bool use_id_mapping;
+ bool need_filter;
char *tmp_name;
/* There are no groups in LDAP but we should add user to groups ?? */
@@ -205,6 +206,17 @@ errno_t sdap_add_incomplete_groups(struct sysdb_ctx *sysdb,
uuid = NULL;
}
+ ret = sdap_check_ad_group_type(domain, opts, ldap_groups[ai],
+ groupname, &need_filter);
+ if (ret != EOK) {
+ goto done;
+ }
+
+ if (need_filter) {
+ posix = false;
+ gid = 0;
+ }
+
DEBUG(SSSDBG_TRACE_INTERNAL,
"Adding fake group %s to sysdb\n", groupname);
ret = sysdb_add_incomplete_group(domain, groupname, gid,