Red Hat Bugzilla – Bug 1166260
cookie_change_info returns random negative number if there was no change in a tree
Last modified: 2015-03-05 04:37:25 EST
This bug is created as a clone of upstream ticket: https://fedorahosted.org/389/ticket/47960 Setup: single master replication (M1 and C1) Enabled plugins: Content Synchronization and Retro Changelog Plugin. To retrieve a cookie I use this command: {{{ ldapsearch -h localhost:1189 -D "cn=Directory Manager" -w Secret123 -b dc=example,dc=com -o ldif-wrap=no -E sync=ro | grep "1.3.6.1.4.1.4203.1.9.1.3" | awk '{print $4}' | base64 -d | colrm 1 3 }}} I enabled plugins and restarted the servers. Then I ran several times the command to view the cookie on M1: rhel7ds.brq.redhat.com:1189#cn=directory manager:dc=example,dc=com:(objectClass=*)#-1259389152 rhel7ds.brq.redhat.com:1189#cn=directory manager:dc=example,dc=com:(objectClass=*)#-1476428000 rhel7ds.brq.redhat.com:1189#cn=directory manager:dc=example,dc=com:(objectClass=*)#-1677787360 rhel7ds.brq.redhat.com:1189#cn=directory manager:dc=example,dc=com:(objectClass=*)#-1728143584 rhel7ds.brq.redhat.com:1189#cn=directory manager:dc=example,dc=com:(objectClass=*)#-1669394656 ... Then I did some changes in the DIT, after each change I checked the cookie: rhel7ds.brq.redhat.com:1189#cn=directory manager:dc=example,dc=com:(objectClass=*)#1 rhel7ds.brq.redhat.com:1189#cn=directory manager:dc=example,dc=com:(objectClass=*)#2 rhel7ds.brq.redhat.com:1189#cn=directory manager:dc=example,dc=com:(objectClass=*)#3 rhel7ds.brq.redhat.com:1189#cn=directory manager:dc=example,dc=com:(objectClass=*)#4 rhel7ds.brq.redhat.com:1189#cn=directory manager:dc=example,dc=com:(objectClass=*)#5 ... It looks like cookie_change_info is not initialized before the first change.
There is also an integer overflow in cookie_change_info: sync.h:70: int cookie_change_info; Retro Changelog Plugin uses unsigned long for storing changeNumber: retrocl.h:60:typedef unsigned long changeNumber; rhel7ds.brq.redhat.com:389#cn=directory manager:dc=example,dc=com:(objectClass=*)#2147483646 rhel7ds.brq.redhat.com:389#cn=directory manager:dc=example,dc=com:(objectClass=*)#2147483647 rhel7ds.brq.redhat.com:389#cn=directory manager:dc=example,dc=com:(objectClass=*)#-2147483648 rhel7ds.brq.redhat.com:389#cn=directory manager:dc=example,dc=com:(objectClass=*)#-2147483647 rhel7ds.brq.redhat.com:389#cn=directory manager:dc=example,dc=com:(objectClass=*)#-2147483646
$ rpm -qa | grep 389 389-ds-base-debuginfo-1.3.3.1-10.el7.x86_64 389-ds-base-1.3.3.1-10.el7.x86_64 389-ds-base-libs-1.3.3.1-10.el7.x86_64 [1] Right after enabling plugins and before making any change to the tree: rhel7ds.brq.redhat.com:389#cn=directory manager:dc=example,dc=com:(objectClass=*)#0 [2] There is no integer overflow: rhel7ds.brq.redhat.com:389#cn=directory manager:dc=example,dc=com:(objectClass=*)#2147483646 rhel7ds.brq.redhat.com:389#cn=directory manager:dc=example,dc=com:(objectClass=*)#2147483647 rhel7ds.brq.redhat.com:389#cn=directory manager:dc=example,dc=com:(objectClass=*)#2147483648 rhel7ds.brq.redhat.com:389#cn=directory manager:dc=example,dc=com:(objectClass=*)#2147483649 rhel7ds.brq.redhat.com:389#cn=directory manager:dc=example,dc=com: [3] And it successfully wraps around rhel7ds.brq.redhat.com:389#cn=directory manager:dc=example,dc=com:(objectClass=*)#4294967294 rhel7ds.brq.redhat.com:389#cn=directory manager:dc=example,dc=com:(objectClass=*)#4294967295 rhel7ds.brq.redhat.com:389#cn=directory manager:dc=example,dc=com:(objectClass=*)#0 rhel7ds.brq.redhat.com:389#cn=directory manager:dc=example,dc=com:(objectClass=*)#1 Marking as 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. https://rhn.redhat.com/errata/RHSA-2015-0416.html