summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/db/sysdb_views.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/db/sysdb_views.c b/src/db/sysdb_views.c
index 8cc279af6..c735a7bd8 100644
--- a/src/db/sysdb_views.c
+++ b/src/db/sysdb_views.c
@@ -525,8 +525,14 @@ errno_t sysdb_store_override(struct sss_domain_info *domain,
goto done;
}
- /* TODO: add nameAlias for case-insentitive searches */
for (c = 0; c < attrs->num; c++) {
+ /* Set num_values to 1 because by default user and group overrides
+ * use the same attribute name for the GID and this cause SSSD
+ * machinery to add the same value twice */
+ if (attrs->a[c].num_values > 1
+ && strcmp(attrs->a[c].name, SYSDB_GIDNUM) == 0) {
+ attrs->a[c].num_values = 1;
+ }
msg->elements[c] = attrs->a[c];
msg->elements[c].flags = LDB_FLAG_MOD_ADD;
}