#51141 Issue 51100 - Correct numSubordinates value for cn=monitor
Closed 3 years ago by spichugi. Opened 3 years ago by spichugi.
spichugi/389-ds-base i51100  into  master

file modified
+5 -2
@@ -1109,8 +1109,11 @@ 

      if (-1 != rc) {

          /* update num sub of parent with no lock; we already hold the write lock */

          if (0 == rc) { /* entry was added, not merged; update numsub */

-             dse_updateNumSubOfParent(pdse, slapi_entry_get_sdn_const(e),

-                                      SLAPI_OPERATION_ADD);

+             /* easter egg entry - don't update num sub */

+             if (strcmp(slapi_entry_get_ndn(e), "ou=red hat directory server team,cn=monitor") != 0) {

I can not find this DN in the source code, where is the easter egg entry coming from?

+                 dse_updateNumSubOfParent(pdse, slapi_entry_get_sdn_const(e),

+                                          SLAPI_OPERATION_ADD);

+             }

          } else { /* entry was merged, free temp unused data */

              dse_node_delete(&n);

          }

Bug Description: numSubordinates for cn=monitor shows 4
while there are 3 child entries are present.

Fix Description: Ignore easter egg entry while increasing
numSubordinates count.

https://pagure.io/389-ds-base/issue/51100

Reviewed by: ?

I can not find this DN in the source code, where is the easter egg entry coming from?

It's stored obfuscated in easter_egg_entry in fedse.c:

2624        egg_decode(src); /* twiddle bits */
(gdb) 
2625        e = slapi_str2entry(src, 0);
(gdb) p src
$1 = 0x55ba3a5584a0 "dn: ou=Red Hat Directory Server Team,cn=monitor\nobjectClass: top\nobjectClass: organizationalUnit\nobjectClass: directory-team-extensible-object\nou: Netscape Security Solutions\nou: Netscape Directory Te"...

It's stored obfuscated in easter_egg_entry in fedse.c:
2624 egg_decode(src); / twiddle bits /
(gdb)
2625 e = slapi_str2entry(src, 0);
(gdb) p src
$1 = 0x55ba3a5584a0 "dn: ou=Red Hat Directory Server Team,cn=monitor\nobjectClass: top\nobjectClass: organizationalUnit\nobjectClass: directory-team-extensible-object\nou: Netscape Security Solutions\nou: Netscape Directory Te"...

Thanks! Ok, LGTM

rebased onto ac58ddf

3 years ago

Pull-Request has been merged by spichugi

3 years ago

I've never enjoyed a bug report quite so much as this in hindsight :)

389-ds-base is moving from Pagure to Github. This means that new issues and pull requests
will be accepted only in 389-ds-base's github repository.

This pull request has been cloned to Github as issue and is available here:
- https://github.com/389ds/389-ds-base/issues/4194

If you want to continue to work on the PR, please navigate to the github issue,
download the patch from the attachments and file a new pull request.

Thank you for understanding. We apologize for all inconvenience.

Pull-Request has been closed by spichugi

3 years ago
Metadata