Bug 1491706

Summary: Adding an invalid replication agreement crashes the server
Product: Red Hat Enterprise Linux 7 Reporter: mreynolds
Component: 389-ds-baseAssignee: mreynolds
Status: CLOSED ERRATA QA Contact: Viktor Ashirov <vashirov>
Severity: urgent Docs Contact:
Priority: urgent    
Version: 7.5CC: msauton, nkinder, rmeggins, spichugi
Target Milestone: rcKeywords: ZStream
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: 389-ds-base-1.3.7.5-4.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1491778 (view as bug list) Environment:
Last Closed: 2018-04-10 14:19:40 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1491778    

Description mreynolds 2017-09-14 12:43:46 UTC
Description of problem:

Add a replication agreement with an invalid value for "nsds5replicaEnabled" causes the server to crash

dn: cn=whatever,cn=replica,cn="dc=example,dc=com",cn=mapping tree,cn=config
objectClass: nsds5replicationagreement
objectClass: top
nsds5replicahost: ldap.example.com
nsds5replicaport: 389
nsds5ReplicaBindDN: cn=test,cn=config
nsds5replicabindmethod: SIMPLE
nsds5replicaroot: dc=example,dc=com
description: test
nsds5replicaupdateschedule: 0001-2359 0123456
nsds5replicatedattributelist: (objectclass=*) $ EXCLUDE authorityRevocationList
nsds5replicacredentials: test
nsds5BeginReplicaRefresh: start
nsds5ReplicaEnabled: True

--->  nsds5ReplicaEnabled only accepts "on" or "off", not "True or "False"


Stack trace:

0x00007fb68af115b7 in unschedule_window_state_change_event (sch=0x0) at ../389-ds-base/ldap/servers/plugins/replication/repl5_schedule.c:588
588	    if (sch->pending_event) {
(gdb) p *sch
Cannot access memory at address 0x0
(gdb) where
#0  0x00007fb68af115b7 in unschedule_window_state_change_event (sch=0x0) at ../389-ds-base/ldap/servers/plugins/replication/repl5_schedule.c:588
#1  0x00007fb68af10b7f in schedule_destroy (s=0x0) at ../389-ds-base/ldap/servers/plugins/replication/repl5_schedule.c:134
#2  0x00007fb68aee00d6 in agmt_delete (rap=0x7fb659023168) at ../389-ds-base/ldap/servers/plugins/replication/repl5_agmt.c:634
#3  0x00007fb68aedfddb in agmt_new_from_entry (e=0x4b4cd00) at ../389-ds-base/ldap/servers/plugins/replication/repl5_agmt.c:537
#4  0x00007fb68aee63b4 in add_new_agreement (e=0x4b4cd00) at ../389-ds-base/ldap/servers/plugins/replication/repl5_agmtlist.c:136
#5  0x00007fb68aee673c in agmtlist_add_callback (pb=0x223ff60, e=0x4b4cd00, entryAfter=0x0, returncode=0x7fb6590233d4, returntext=0x7fb659023450 "", arg=0x0)
    at ../389-ds-base/ldap/servers/plugins/replication/repl5_agmtlist.c:232
#6  0x00007fb697a4f4e8 in dse_call_callback (pdse=0x1e86ff0, pb=0x223ff60, operation=16, flags=1, entryBefore=0x4b4cd00, entryAfter=0x0, returncode=0x7fb6590233d4, returntext=0x7fb659023450 "") at ../389-ds-base/ldap/servers/slapd/dse.c:2523
#7  0x00007fb697a4e7f1 in dse_add (pb=0x223ff60) at ../389-ds-base/ldap/servers/slapd/dse.c:2220
#8  0x00007fb697a3140f in op_shared_add (pb=0x223ff60) at ../389-ds-base/ldap/servers/slapd/add.c:671
#9  0x00007fb697a303fd in do_add (pb=0x223ff60) at ../389-ds-base/ldap/servers/slapd/add.c:228
#10 0x0000000000416a9c in connection_dispatch_operation (conn=0x47c9d70, op=0x21e0000, pb=0x223ff60) at ../389-ds-base/ldap/servers/slapd/connection.c:609
#11 0x0000000000418a3a in connection_threadmain () at ../389-ds-base/ldap/servers/slapd/connection.c:1761
#12 0x00007fb6957c470c in _pt_root () at /lib64/libnspr4.so
#13 0x00007fb69516173a in start_thread () at /lib64/libpthread.so.0
#14 0x00007fb694c52e7f in clone () at /lib64/libc.so.6

Comment 2 mreynolds 2017-09-14 12:45:15 UTC
https://pagure.io/389-ds-base/issue/49380

Fixed upstream

Comment 5 Simon Pichugin 2017-11-03 14:33:07 UTC
================== test session starts ==================
platform linux -- Python 3.5.1, pytest-3.2.3, py-1.4.34, pluggy-0.4.0 -- /opt/rh/rh-python35/root/usr/bin/python3
cachedir: .cache
metadata: {'Python': '3.5.1', 'Platform': 'Linux-3.10.0-765.el7.x86_64-x86_64-with-redhat-7.5-Maipo', 'Plugins': {'metadata': '1.5.0', 'html': '1.16.0'}, 'Packages': {'pytest': '3.2.3', 'pluggy': '0.4.0', 'py': '1.4.34'}}
389-ds-base: 1.3.7.5-6.el7
nss: 3.34.0-0.1.beta1.el7
nspr: 4.17.0-1.el7
openldap: 2.4.44-5.el7
svrcore: 4.1.3-2.el7

rootdir: /export/tests, inifile:
plugins: metadata-1.5.0, html-1.16.0
collected 1 item

suites/replication/acceptance_test.py::test_invalid_agmt PASSED

================== 1 passed in 47.00 seconds ==================

Comment 8 errata-xmlrpc 2018-04-10 14:19:40 UTC
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://access.redhat.com/errata/RHBA-2018:0811