summaryrefslogtreecommitdiffstats
path: root/src/providers/ldap
diff options
context:
space:
mode:
Diffstat (limited to 'src/providers/ldap')
-rw-r--r--src/providers/ldap/sdap.c14
-rw-r--r--src/providers/ldap/sdap.h2
-rw-r--r--src/providers/ldap/sdap_async.c6
3 files changed, 6 insertions, 16 deletions
diff --git a/src/providers/ldap/sdap.c b/src/providers/ldap/sdap.c
index 4c364df73..4bb701187 100644
--- a/src/providers/ldap/sdap.c
+++ b/src/providers/ldap/sdap.c
@@ -293,7 +293,7 @@ int sdap_get_map(TALLOC_CTX *memctx,
int sdap_parse_entry(TALLOC_CTX *memctx,
struct sdap_handle *sh, struct sdap_msg *sm,
struct sdap_attr_map *map, int attrs_num,
- struct sysdb_attrs **_attrs, char **_dn,
+ struct sysdb_attrs **_attrs,
bool disable_range_retrieval)
{
struct sysdb_attrs *attrs;
@@ -307,7 +307,6 @@ int sdap_parse_entry(TALLOC_CTX *memctx,
bool store;
bool base64;
char *base_attr;
- char *dn = NULL;
uint32_t range_offset;
TALLOC_CTX *tmp_ctx = talloc_new(NULL);
if (!tmp_ctx) return ENOMEM;
@@ -336,16 +335,8 @@ int sdap_parse_entry(TALLOC_CTX *memctx,
DEBUG(SSSDBG_TRACE_LIBS, "OriginalDN: [%s].\n", str);
ret = sysdb_attrs_add_string(attrs, SYSDB_ORIG_DN, str);
- if (ret) goto done;
- if (_dn) {
- dn = talloc_strdup(tmp_ctx, str);
- if (!dn) {
- ret = ENOMEM;
- ldap_memfree(str);
- goto done;
- }
- }
ldap_memfree(str);
+ if (ret) goto done;
if (map) {
vals = ldap_get_values_len(sh->ldap, sm->msg, "objectClass");
@@ -523,7 +514,6 @@ int sdap_parse_entry(TALLOC_CTX *memctx,
}
*_attrs = talloc_steal(memctx, attrs);
- if (_dn) *_dn = talloc_steal(memctx, dn);
ret = EOK;
done:
diff --git a/src/providers/ldap/sdap.h b/src/providers/ldap/sdap.h
index 960054f36..d5366ad89 100644
--- a/src/providers/ldap/sdap.h
+++ b/src/providers/ldap/sdap.h
@@ -495,7 +495,7 @@ int sdap_get_map(TALLOC_CTX *memctx,
int sdap_parse_entry(TALLOC_CTX *memctx,
struct sdap_handle *sh, struct sdap_msg *sm,
struct sdap_attr_map *map, int attrs_num,
- struct sysdb_attrs **_attrs, char **_dn,
+ struct sysdb_attrs **_attrs,
bool disable_range_retrieval);
errno_t sdap_parse_deref(TALLOC_CTX *mem_ctx,
diff --git a/src/providers/ldap/sdap_async.c b/src/providers/ldap/sdap_async.c
index b4645738b..590cbe100 100644
--- a/src/providers/ldap/sdap_async.c
+++ b/src/providers/ldap/sdap_async.c
@@ -1543,7 +1543,7 @@ static errno_t sdap_get_generic_parse_entry(struct sdap_handle *sh,
ret = sdap_parse_entry(state, sh, msg,
state->map, state->map_num_attrs,
- &attrs, NULL, disable_range_rtrvl);
+ &attrs, disable_range_rtrvl);
if (ret != EOK) {
DEBUG(SSSDBG_MINOR_FAILURE,
"sdap_parse_entry failed [%d]: %s\n", ret, strerror(ret));
@@ -1948,7 +1948,7 @@ static errno_t sdap_sd_search_parse_entry(struct sdap_handle *sh,
ret = sdap_parse_entry(state, sh, msg,
NULL, 0,
- &attrs, NULL, disable_range_rtrvl);
+ &attrs, disable_range_rtrvl);
if (ret != EOK) {
DEBUG(SSSDBG_MINOR_FAILURE,
"sdap_parse_entry failed [%d]: %s\n", ret, strerror(ret));
@@ -2201,7 +2201,7 @@ static errno_t sdap_asq_search_parse_entry(struct sdap_handle *sh,
ret = sdap_parse_entry(res[mi], sh, msg,
map, num_attrs,
- &res[mi]->attrs, NULL, disable_range_rtrvl);
+ &res[mi]->attrs, disable_range_rtrvl);
if (ret != EOK) {
DEBUG(SSSDBG_MINOR_FAILURE,
"sdap_parse_entry failed [%d]: %s\n", ret, strerror(ret));