summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSumit Bose <sbose@redhat.com>2016-07-05 15:16:42 +0200
committerJakub Hrozek <jhrozek@redhat.com>2016-07-07 10:29:02 +0200
commite3d447a682164d1f6490227af2df6864ee7d6e1d (patch)
treea9e93eb4aa7fcac639327a07bc6b6f38f1dbc0eb
parentc125e741d3111e2f9b56866ba00835ca05c6f349 (diff)
downloadsssd-e3d447a682164d1f6490227af2df6864ee7d6e1d.tar.gz
sssd-e3d447a682164d1f6490227af2df6864ee7d6e1d.tar.xz
sssd-e3d447a682164d1f6490227af2df6864ee7d6e1d.zip
IPA: expand name in ipa_add_ad_memberships_get_next()
Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
-rw-r--r--src/providers/ipa/ipa_subdomains_ext_groups.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/providers/ipa/ipa_subdomains_ext_groups.c b/src/providers/ipa/ipa_subdomains_ext_groups.c
index 93ef1f4a1..ec05a828c 100644
--- a/src/providers/ipa/ipa_subdomains_ext_groups.c
+++ b/src/providers/ipa/ipa_subdomains_ext_groups.c
@@ -829,6 +829,8 @@ static void ipa_add_ad_memberships_get_next(struct tevent_req *req)
int ret;
const struct ldb_val *val;
bool missing_groups;
+ const char *fq_name;
+ char *tmp_str;
while (state->groups[state->iter] != NULL
&& state->groups[state->iter][0] == '\0') {
@@ -870,12 +872,22 @@ static void ipa_add_ad_memberships_get_next(struct tevent_req *req)
goto fail;
}
+ fq_name = (const char *) val->data;
+ if (strchr(fq_name, '@') == NULL) {
+ tmp_str = sss_create_internal_fqname(state, fq_name,
+ state->group_dom->name);
+ /* keep using val->data if sss_create_internal_fqname() fails */
+ if (tmp_str != NULL) {
+ fq_name = tmp_str;
+ }
+ }
+
/* TODO: here is would be useful for have a filter type like BE_FILTER_DN to
* directly fetch the group with the corresponding DN. */
subreq = groups_get_send(state, state->ev,
state->sdap_id_ctx, state->group_sdom,
state->sdap_id_ctx->conn,
- (const char *) val->data,
+ fq_name,
BE_FILTER_NAME, BE_ATTR_CORE,
false, false);
if (subreq == NULL) {