Directory Server no longer terminates unexpectedly when deleting a non-existent attribute
Previously, deleting a non-existent attribute from the back end configuration caused Directory Server to terminate unexpectedly. This update applies a patch to pass a "NULL" value to the "ldbm_config_set()" function if no attribute was deleted. As a result, Directory Server now rejects the operation in the described scenario.
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.
https://rhn.redhat.com/errata/RHBA-2017-0667.html
Description of problem: During tickets/ticket48665_test.py execution slapd crashes. Version-Release number of selected component (if applicable): 389-ds-base-1.2.11.15-85.el6.x86_64 How reproducible: Allways Steps to Reproduce: 1. py.test -s -v dirsrvtests/tests/tickets/ticket48665_test.py Actual results: ====================== test session starts ====================== platform linux2 -- Python 2.7.8, pytest-3.0.5, py-1.4.31, pluggy-0.4.0 -- /opt/rh/python27/root/usr/bin/python cachedir: .cache DS build: 1.2.11.15 B2016.312.1950 389-ds-base: 1.2.11.15-85.el6 nss: 3.27.1-9.el6 nspr: 4.13.1-1.el6 openldap: 2.4.40-15.el6 svrcore: 4.0.4-5.1.el6 rootdir: /mnt/tests/rhds/tests/upstream/ds, inifile: plugins: html-1.12.0, cov-2.4.0, beakerlib-0.6 collected 1 items dirsrvtests/tests/tickets/ticket48665_test.py::test_ticket48665 Instance slapd-standalone removed. OK group dirsrv exists OK user dirsrv exists FAILEDInstance slapd-standalone removed. ============================ FAILURES ============================ ______________________________________ test_ticket48665 _______________________________________ topology = <tickets.ticket48665_test.TopologyStandalone object at 0x7f37c07bac90> def test_ticket48665(topology): """ This tests deletion of certain cn=config values. First, it should be able to delete, and not crash the server. Second, we might be able to delete then add to replace values. We should also still be able to mod replace the values and keep the server alive. """ #topology.standalone.config.enable_log('audit') #topology.standalone.config.enable_log('auditfail') #standalone.delete() This will trigger a mod delete then add. try: modlist = [(ldap.MOD_DELETE, 'nsslapd-cachememsize', None), (ldap.MOD_ADD, 'nsslapd-cachememsize', '1')] topology.standalone.modify_s("cn=%s,cn=ldbm database,cn=plugins,cn=config" % DEFAULT_BENAME, modlist) except: pass # Check the server has not commited seppuku. > result = topology.standalone.whoami_s() dirsrvtests/tests/tickets/ticket48665_test.py:76: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ../src/lib389/lib389/__init__.py:159: in inner return f(*args, **kwargs) /opt/rh/python27/root/usr/lib64/python2.7/site-packages/ldap/ldapobject.py:653: in whoami_s return self._ldap_call(self._l.whoami_s,serverctrls,clientctrls) ../src/lib389/lib389/__init__.py:159: in inner return f(*args, **kwargs) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <lib389.DirSrv object at 0x7f37c088f850> func = <built-in method whoami_s of LDAP object at 0x7f37c07be4b8>, args = (None, None) kwargs = {}, diagnostic_message_success = None e = SERVER_DOWN({'desc': "Can't contact LDAP server"},) def _ldap_call(self,func,*args,**kwargs): """ Wrapper method mainly for serializing calls into OpenLDAP libs and trace logs """ self._ldap_object_lock.acquire() if __debug__: if self._trace_level>=1: self._trace_file.write('*** %s %s - %s\n%s\n' % ( repr(self), self._uri, '.'.join((self.__class__.__name__,func.__name__)), pprint.pformat((args,kwargs)) )) if self._trace_level>=9: traceback.print_stack(limit=self._trace_stack_limit,file=self._trace_file) diagnostic_message_success = None try: try: > result = func(*args,**kwargs) E SERVER_DOWN: {'desc': "Can't contact LDAP server"} /opt/rh/python27/root/usr/lib64/python2.7/site-packages/ldap/ldapobject.py:106: SERVER_DOWN ====================== 1 failed in 31.58 seconds ====================== Expected results: The test should pass. Additional info: Most possibly it is related to the bug - "Segfault in ldbm_instance_modify_config_entry" - https://fedorahosted.org/389/ticket/48665 . It was applied only to RHEL 7.