summaryrefslogtreecommitdiff
path: root/server/providers
diff options
context:
space:
mode:
authorSimo Sorce <ssorce@redhat.com>2009-11-30 15:00:50 -0500
committerStephen Gallagher <sgallagh@redhat.com>2009-12-07 10:18:53 -0500
commite4be4c446da6dc15f2778c93f22611c93b981e4d (patch)
treef6419ddd973028c0c076bf6e79e6406755b99bbb /server/providers
parentb1a074deb982b536b41fadfcb72f363630b0b8c5 (diff)
downloadsssd-e4be4c446da6dc15f2778c93f22611c93b981e4d.tar.gz
sssd-e4be4c446da6dc15f2778c93f22611c93b981e4d.tar.bz2
sssd-e4be4c446da6dc15f2778c93f22611c93b981e4d.zip
Resolve nested groups also when rfc2307bis is used
Diffstat (limited to 'server/providers')
-rw-r--r--server/providers/ldap/sdap_async_accounts.c70
1 files changed, 2 insertions, 68 deletions
diff --git a/server/providers/ldap/sdap_async_accounts.c b/server/providers/ldap/sdap_async_accounts.c
index 07e165f0..157ec3e9 100644
--- a/server/providers/ldap/sdap_async_accounts.c
+++ b/server/providers/ldap/sdap_async_accounts.c
@@ -686,53 +686,6 @@ static int sdap_parse_memberships(TALLOC_CTX *memctx,
break;
case SDAP_SCHEMA_RFC2307BIS:
- DEBUG(9, ("[RFC2307bis Schema]\n"));
-
- /* in this schema only users are members */
- mus = talloc_array(memctx, const char *, num_values +1);
- if (!mus) {
- ret = ENOMEM;
- goto done;
- }
-
- for (i = 0, u = 0; i < num_values; i++) {
- struct ldb_dn *tmp_dn = NULL;
- const struct ldb_val *v;
-
- /* parse out DN */
- tmp_dn = ldb_dn_new_fmt(mus,
- sysdb_handle_get_ldb(handle), "%.*s",
- (int)values[i].length,
- (char *)values[i].data);
- if (!tmp_dn) {
- DEBUG(1, ("Unable to parse DN: [%.*s]\n",
- (int)values[i].length,
- (char *)values[i].data));
- continue;
- }
- v = ldb_dn_get_rdn_val(tmp_dn);
- if (!v) {
- DEBUG(1, ("Unable to parse DN: [%.*s]\n",
- (int)values[i].length,
- (char *)values[i].data));
- continue;
- }
-
- mus[u] = talloc_asprintf(mus, "%.*s",
- (int)v->length,
- (char *)v->data);
- if (!mus[u]) {
- DEBUG(1, ("Out of memory?!\n"));
- continue;
- }
- u++;
-
- DEBUG(9, ("Member DN [%.*s], RDN [%.*s]\n",
- (int)values[i].length, (char *)values[i].data,
- (int)v->length, (char *)v->data));
- }
- break;
-
case SDAP_SCHEMA_IPA_V1:
case SDAP_SCHEMA_AD:
DEBUG(9, ("[IPA or AD Schema]\n"));
@@ -1216,10 +1169,10 @@ struct tevent_req *sdap_save_groups_send(TALLOC_CTX *memctx,
switch (opts->schema_type) {
case SDAP_SCHEMA_RFC2307:
- case SDAP_SCHEMA_RFC2307BIS:
state->twopass = false;
break;
+ case SDAP_SCHEMA_RFC2307BIS:
case SDAP_SCHEMA_IPA_V1:
case SDAP_SCHEMA_AD:
state->twopass = true;
@@ -2056,25 +2009,6 @@ static void sdap_get_initgr_process(struct tevent_req *subreq)
break;
case SDAP_SCHEMA_RFC2307BIS:
-
- ret = sysdb_attrs_get_string(state->orig_user,
- SYSDB_ORIG_DN, &user_dn);
- if (ret) {
- tevent_req_error(req, EINVAL);
- return;
- }
-
- subreq = sdap_initgr_rfc2307_send(state, state->ev, state->opts,
- state->sysdb, state->dom,
- state->sh, user_dn,
- state->name, state->grp_attrs);
- if (!subreq) {
- tevent_req_error(req, ENOMEM);
- return;
- }
- tevent_req_set_callback(subreq, sdap_get_initgr_done, req);
- return;
-
case SDAP_SCHEMA_IPA_V1:
case SDAP_SCHEMA_AD:
/* TODO: AD uses a different member/memberof schema
@@ -2109,11 +2043,11 @@ static void sdap_get_initgr_done(struct tevent_req *subreq)
switch (state->opts->schema_type) {
case SDAP_SCHEMA_RFC2307:
- case SDAP_SCHEMA_RFC2307BIS:
ret = sdap_initgr_rfc2307_recv(subreq);
break;
+ case SDAP_SCHEMA_RFC2307BIS:
case SDAP_SCHEMA_IPA_V1:
case SDAP_SCHEMA_AD: