summaryrefslogtreecommitdiffstats
path: root/src/providers/ldap/ldap_id_cleanup.c
diff options
context:
space:
mode:
authorJan Zeleny <jzeleny@redhat.com>2011-05-27 07:33:09 -0400
committerStephen Gallagher <sgallagh@redhat.com>2011-06-02 14:07:45 -0400
commit00142aba00a2adcf32f0741b8ea8a31c5a461675 (patch)
tree5d99db7d533d49b3f1255af421479171d5702907 /src/providers/ldap/ldap_id_cleanup.c
parentace07a7d75c5a7c3f5613e5349fa8c1ffd05863a (diff)
downloadsssd-00142aba00a2adcf32f0741b8ea8a31c5a461675.tar.gz
sssd-00142aba00a2adcf32f0741b8ea8a31c5a461675.tar.xz
sssd-00142aba00a2adcf32f0741b8ea8a31c5a461675.zip
Non-posix group processing - ldap provider and nss responder
Diffstat (limited to 'src/providers/ldap/ldap_id_cleanup.c')
-rw-r--r--src/providers/ldap/ldap_id_cleanup.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/providers/ldap/ldap_id_cleanup.c b/src/providers/ldap/ldap_id_cleanup.c
index 7f7a02c64..d31dace55 100644
--- a/src/providers/ldap/ldap_id_cleanup.c
+++ b/src/providers/ldap/ldap_id_cleanup.c
@@ -395,6 +395,7 @@ static int cleanup_groups(TALLOC_CTX *memctx,
size_t u_count;
int ret;
int i;
+ const char *posix;
tmpctx = talloc_new(memctx);
if (!tmpctx) {
@@ -433,19 +434,18 @@ static int cleanup_groups(TALLOC_CTX *memctx,
goto done;
}
- gid = (gid_t) ldb_msg_find_attr_as_uint(msgs[i], SYSDB_GIDNUM, 0);
- if (!gid) {
- DEBUG(2, ("Entry has no GID\n"));
- ret = EIO;
- goto done;
+ posix = ldb_msg_find_attr_as_string(msgs[i], SYSDB_POSIX, NULL);
+ if (!posix || strcmp(posix, "TRUE") == 0) {
+ /* Search for users that are members of this group, or
+ * that have this group as their primary GID
+ */
+ gid = (gid_t) ldb_msg_find_attr_as_uint(msgs[i], SYSDB_GIDNUM, 0);
+ subfilter = talloc_asprintf(tmpctx, "(|(%s=%s)(%s=%lu))",
+ SYSDB_MEMBEROF, dn,
+ SYSDB_GIDNUM, (long unsigned) gid);
+ } else {
+ subfilter = talloc_asprintf(tmpctx, "(%s=%s)", SYSDB_MEMBEROF, dn);
}
-
- /* Search for users that are members of this group, or
- * that have this group as their primary GID
- */
- subfilter = talloc_asprintf(tmpctx, "(|(%s=%s)(%s=%lu))",
- SYSDB_MEMBEROF, dn,
- SYSDB_GIDNUM, (long unsigned) gid);
if (!subfilter) {
DEBUG(2, ("Failed to build filter\n"));
ret = ENOMEM;