summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLukas Slebodnik <lslebodn@redhat.com>2015-03-11 18:11:13 +0100
committerJakub Hrozek <jhrozek@redhat.com>2015-04-14 12:48:02 +0200
commit5fc3aaad046c74dd9a01b7f1f009f27e7351b127 (patch)
tree7af0f7f17137a3a7508b39eedf167b62b781f667
parent4876ffc045dc73a868e28d250235edc462180a3c (diff)
downloadsssd-5fc3aaad046c74dd9a01b7f1f009f27e7351b127.tar.gz
sssd-5fc3aaad046c74dd9a01b7f1f009f27e7351b127.tar.xz
sssd-5fc3aaad046c74dd9a01b7f1f009f27e7351b127.zip
memberof: Do not create request with 0 attribute values
[sysdb_set_entry_attr] (0x0080): ldb_modify failed: [Constraint violation](19) [attribute 'ghost': attribute on 'name=Escalation,cn=groups,cn=LDAP,cn=sysdb' specified, but with 0 values (illegal)] [sysdb_error_to_errno] (0x0020): LDB returned unexpected error: [Constraint violation] [sysdb_set_entry_attr] (0x0040): Error: 14 (Bad address) [sdap_store_group_with_gid] (0x0040): Could not store group Escalation [sdap_save_group] (0x0080): Could not store group with GID: [Bad address] [sdap_save_group] (0x0080): Failed to save group [Escalation]: [Bad address] [sdap_save_groups] (0x0040): Failed to store group 1. Ignoring. Reviewed-by: Jakub Hrozek <jhrozek@redhat.com> (cherry picked from commit 999c87114479f230c840a5c020e107c45b29fd56) (cherry picked from commit cbab37e665d948278a491733e3993ac62beb0427)
-rw-r--r--src/ldb_modules/memberof.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/ldb_modules/memberof.c b/src/ldb_modules/memberof.c
index 995c382a8..4d7b23ea1 100644
--- a/src/ldb_modules/memberof.c
+++ b/src/ldb_modules/memberof.c
@@ -3302,6 +3302,12 @@ static int mbof_inherited_mod(struct mbof_mod_ctx *mod_ctx)
}
el->num_values = j;
+ if (el->num_values == 0) {
+ /* nothing to do */
+ /* We cannot modify element which has 0 values */
+ msg->num_elements = 0;
+ }
+
mod_ctx->igh->mod_msg = msg;
mod_ctx->igh->el = el;