diff options
author | Sumit Bose <sbose@redhat.com> | 2014-12-02 21:10:01 +0100 |
---|---|---|
committer | Sumit Bose <sbose@redhat.com> | 2014-12-17 17:35:57 +0100 |
commit | b52b26176c92f3b06dba5598428c70c0cde13fd1 (patch) | |
tree | 80573197ffd3952d3ebf33dcd029c25957f459a4 /src | |
parent | 8f9d7684a47cd4715dce22c8254ddde205db9afe (diff) | |
download | sssd-b52b26176c92f3b06dba5598428c70c0cde13fd1.tar.gz sssd-b52b26176c92f3b06dba5598428c70c0cde13fd1.tar.xz sssd-b52b26176c92f3b06dba5598428c70c0cde13fd1.zip |
IPA: do not try to add override gid twice
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 which
cause an error in ldb_add() or ldm_modify().
Related to https://fedorahosted.org/sssd/ticket/2514
Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/db/sysdb_views.c | 8 |
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; } |