summaryrefslogtreecommitdiff
path: root/src/providers/ipa
diff options
context:
space:
mode:
authorStephen Gallagher <sgallagh@redhat.com>2012-05-08 13:37:14 -0400
committerStephen Gallagher <sgallagh@redhat.com>2012-05-10 11:34:46 -0400
commitca4b7b92738f3dd463914e3de5757cd98d37a983 (patch)
treeb7b781eabeed9a096fca59df8d836418ac3a41b7 /src/providers/ipa
parente2a59ba258ab98a6f50a1af627bc4cdceaa59101 (diff)
downloadsssd-ca4b7b92738f3dd463914e3de5757cd98d37a983.tar.gz
sssd-ca4b7b92738f3dd463914e3de5757cd98d37a983.tar.bz2
sssd-ca4b7b92738f3dd463914e3de5757cd98d37a983.zip
LDAP: Add attr_count return value to build_attrs_from_map()
This is necessary because in several places in the code, we are appending to the attrs returned from this value, and if we relied on the map size macro, we would be appending after the NULL terminator if one or more attributes were defined as NULL.
Diffstat (limited to 'src/providers/ipa')
-rw-r--r--src/providers/ipa/ipa_hosts.c5
-rw-r--r--src/providers/ipa/ipa_id.c2
-rw-r--r--src/providers/ipa/ipa_netgroups.c2
-rw-r--r--src/providers/ipa/ipa_selinux_maps.c2
-rw-r--r--src/providers/ipa/ipa_subdomains_id.c4
5 files changed, 8 insertions, 7 deletions
diff --git a/src/providers/ipa/ipa_hosts.c b/src/providers/ipa/ipa_hosts.c
index 30013864..09a5acaf 100644
--- a/src/providers/ipa/ipa_hosts.c
+++ b/src/providers/ipa/ipa_hosts.c
@@ -102,7 +102,8 @@ ipa_host_info_send(TALLOC_CTX *mem_ctx,
state->host_map = host_map;
state->hostgroup_map = hostgroup_map;
- ret = build_attrs_from_map(state, host_map, IPA_OPTS_HOST, &state->attrs);
+ ret = build_attrs_from_map(state, host_map, IPA_OPTS_HOST,
+ &state->attrs, NULL);
if (ret != EOK) {
goto immediate;
}
@@ -213,7 +214,7 @@ ipa_host_info_done(struct tevent_req *subreq)
if (state->hostgroup_map) {
talloc_free(state->attrs);
ret = build_attrs_from_map(state, state->hostgroup_map,
- IPA_OPTS_HOSTGROUP, &state->attrs);
+ IPA_OPTS_HOSTGROUP, &state->attrs, NULL);
if (ret != EOK) {
tevent_req_error(req, ret);
return;
diff --git a/src/providers/ipa/ipa_id.c b/src/providers/ipa/ipa_id.c
index f2a27c74..1f434799 100644
--- a/src/providers/ipa/ipa_id.c
+++ b/src/providers/ipa/ipa_id.c
@@ -212,7 +212,7 @@ struct tevent_req *ipa_netgroup_get_send(TALLOC_CTX *memctx,
talloc_zfree(clean_name);
ret = build_attrs_from_map(state, ctx->opts->netgroup_map,
- IPA_OPTS_NETGROUP, &state->attrs);
+ IPA_OPTS_NETGROUP, &state->attrs, NULL);
if (ret != EOK) goto fail;
ret = ipa_netgroup_get_retry(req);
diff --git a/src/providers/ipa/ipa_netgroups.c b/src/providers/ipa/ipa_netgroups.c
index 3aedf531..881eeb86 100644
--- a/src/providers/ipa/ipa_netgroups.c
+++ b/src/providers/ipa/ipa_netgroups.c
@@ -528,7 +528,7 @@ static int ipa_netgr_fetch_hosts(struct ipa_get_netgroups_state *state,
return ENOMEM;
ret = build_attrs_from_map(state, state->ipa_opts->host_map,
- IPA_OPTS_HOST, &attrs);
+ IPA_OPTS_HOST, &attrs, NULL);
if (ret != EOK) {
talloc_free(filter);
return ret;
diff --git a/src/providers/ipa/ipa_selinux_maps.c b/src/providers/ipa/ipa_selinux_maps.c
index 711274b1..28923cee 100644
--- a/src/providers/ipa/ipa_selinux_maps.c
+++ b/src/providers/ipa/ipa_selinux_maps.c
@@ -77,7 +77,7 @@ struct tevent_req *ipa_selinux_get_maps_send(TALLOC_CTX *mem_ctx,
state->maps = NULL;
ret = build_attrs_from_map(state, ipa_opts->selinuxuser_map,
- IPA_OPTS_SELINUX_USERMAP, &state->attrs);
+ IPA_OPTS_SELINUX_USERMAP, &state->attrs, NULL);
if (ret != EOK) goto fail;
state->cur_filter = NULL;
diff --git a/src/providers/ipa/ipa_subdomains_id.c b/src/providers/ipa/ipa_subdomains_id.c
index a4558e68..39f076cd 100644
--- a/src/providers/ipa/ipa_subdomains_id.c
+++ b/src/providers/ipa/ipa_subdomains_id.c
@@ -89,11 +89,11 @@ struct tevent_req *ipa_get_subdomain_account_info_send(TALLOC_CTX *memctx,
switch (state->entry_type) {
case BE_REQ_USER:
ret = build_attrs_from_map(state, ctx->opts->user_map,
- SDAP_OPTS_USER, &state->attrs);
+ SDAP_OPTS_USER, &state->attrs, NULL);
break;
case BE_REQ_GROUP:
ret = build_attrs_from_map(state, ctx->opts->group_map,
- SDAP_OPTS_GROUP, &state->attrs);
+ SDAP_OPTS_GROUP, &state->attrs, NULL);
break;
default:
ret = EINVAL;