Red Hat Bugzilla – Bug 875862
crash in DNA if no dnamagicregen is specified
Last modified: 2013-02-21 03:21:26 EST
This bug is created as a clone of upstream ticket: https://fedorahosted.org/389/ticket/517 If you have a DNA configuration to provide values for a given attribute, but do not specify the dnamagicregen attribute and value, and you attempt to add/modify that given attribute, the server will crash in _dna_pre_op_modify(): {{{ /* If we have a value, see if it's the magic value. */ if (bv) { len = strlen(config_entry->generate); if (len == bv->bv_len) { if (!slapi_UTF8NCASECMP(bv->bv_val, config_entry->generate, len)) { slapi_ch_array_add(&types_to_generate, slapi_ch_strdup(type)); } } }}} because the server does not first check if config_entry->generate is NULL before doing the strlen.
Request you to please add steps to Verify.
(In reply to comment #2) > Request you to please add steps to Verify. Mark, could you provide the steps? Thanks!
This is an easy one. To reproduce: [1] Setup the DNA plugin, but do NOT set "dnamagicregen" [2] Make an update that would trigger the DNA plugin to update an entry. [3] Server crashes.
[jrusnack@dstet ~]$ ldapsearch -h localhost -p 22222 -D "cn=directory manager " -w Secret123 -b "cn=uidNumber,cn=Distributed Numeric Assignment Plugin,cn=plugins,cn=config" -LL version: 1 dn: cn=uidNumber,cn=Distributed Numeric Assignment Plugin,cn=plugins,cn=config objectClass: top objectClass: extensibleObject cn: uidNumber dnaType: uidNumber dnaNextValue: 2 dnaMaxValue: 1300 dnaThreshold: 200 dnaFilter: (objectClass=posixAccount) dnaScope: ou=people,o=my.com [jrusnack@dstet ~]$ ldapmodify -h localhost -p 22222 -D "cn=directory manager " -w Secret123 -a <<EOF dn: uid=tuser2,ou=people,o=my.com objectclass: top objectclass: posixAccount objectclass: person objectclass: inetorgperson cn: tuser2 uid: tuser2 sn: tuser2 homeDirectory: /home/tuser2 gidNumber: 2 EOF adding new entry "uid=tuser2,ou=people,o=my.com" [jrusnack@dstet ~]$ ldapsearch -h localhost -p 22222 -D "cn=directory manager " -w Secret123 -LLL -b "uid=tuser2,ou=people,o=my.com" dn: uid=tuser2,ou=People,o=my.com objectClass: top objectClass: posixAccount objectClass: person objectClass: inetorgperson objectClass: organizationalPerson cn: tuser2 uid: tuser2 sn: tuser2 homeDirectory: /home/tuser2 gidNumber: 2 uidNumber: 2 [jrusnack@dstet ~]$ rpm -qa 389* 389-ds-base-1.2.11.15-11.el6.x86_64 389-ds-base-libs-1.2.11.15-11.el6.x86_64 Verified.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. http://rhn.redhat.com/errata/RHSA-2013-0503.html