summaryrefslogtreecommitdiff
path: root/src/providers
diff options
context:
space:
mode:
Diffstat (limited to 'src/providers')
-rw-r--r--src/providers/ldap/sdap.c11
-rw-r--r--src/providers/ldap/sdap.h6
-rw-r--r--src/providers/ldap/sdap_async_netgroups.c12
3 files changed, 22 insertions, 7 deletions
diff --git a/src/providers/ldap/sdap.c b/src/providers/ldap/sdap.c
index 7741030c..078326ad 100644
--- a/src/providers/ldap/sdap.c
+++ b/src/providers/ldap/sdap.c
@@ -1260,3 +1260,14 @@ errno_t sdap_get_group_primary_name(TALLOC_CTX *memctx,
opts->group_map[SDAP_AT_GROUP_NAME].name,
attrs, dom, _group_name);
}
+
+errno_t sdap_get_netgroup_primary_name(TALLOC_CTX *memctx,
+ struct sdap_options *opts,
+ struct sysdb_attrs *attrs,
+ struct sss_domain_info *dom,
+ const char **_netgroup_name)
+{
+ return sdap_get_primary_name(memctx,
+ opts->netgroup_map[SDAP_AT_NETGROUP_NAME].name,
+ attrs, dom, _netgroup_name);
+}
diff --git a/src/providers/ldap/sdap.h b/src/providers/ldap/sdap.h
index 441ac904..0e886e98 100644
--- a/src/providers/ldap/sdap.h
+++ b/src/providers/ldap/sdap.h
@@ -511,6 +511,12 @@ errno_t sdap_get_user_primary_name(TALLOC_CTX *memctx,
struct sss_domain_info *dom,
const char **_user_name);
+errno_t sdap_get_netgroup_primary_name(TALLOC_CTX *memctx,
+ struct sdap_options *opts,
+ struct sysdb_attrs *attrs,
+ struct sss_domain_info *dom,
+ const char **_netgroup_name);
+
errno_t sdap_set_config_options_with_rootdse(struct sysdb_attrs *rootdse,
struct sdap_options *opts,
struct sdap_domain *sdom);
diff --git a/src/providers/ldap/sdap_async_netgroups.c b/src/providers/ldap/sdap_async_netgroups.c
index 099955a6..b47b3e59 100644
--- a/src/providers/ldap/sdap_async_netgroups.c
+++ b/src/providers/ldap/sdap_async_netgroups.c
@@ -53,15 +53,13 @@ static errno_t sdap_save_netgroup(TALLOC_CTX *memctx,
char *timestamp = NULL;
char **missing = NULL;
- ret = sysdb_attrs_get_el(attrs,
- opts->netgroup_map[SDAP_AT_NETGROUP_NAME].sys_name,
- &el);
- if (ret) goto fail;
- if (el->num_values == 0) {
- ret = EINVAL;
+ ret = sdap_get_netgroup_primary_name(memctx, opts, attrs, dom, &name);
+ if (ret != EOK) {
+ DEBUG(SSSDBG_OP_FAILURE, ("Failed to get netgroup name\n"));
goto fail;
}
- name = (const char *)el->values[0].data;
+
+ DEBUG(SSSDBG_TRACE_FUNC, ("Processing netgroup %s\n", name));
netgroup_attrs = sysdb_new_attrs(memctx);
if (!netgroup_attrs) {