From ac58ddf3e4c3a4f0388c56b262da8f7eeb11e230 Mon Sep 17 00:00:00 2001 From: Simon Pichugin Date: Jun 09 2020 16:36:25 +0000 Subject: Issue 51100 - Correct numSubordinates value for cn=monitor 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: mreynolds (Thanks!) --- diff --git a/ldap/servers/slapd/dse.c b/ldap/servers/slapd/dse.c index 0e22d3c..b62c6d3 100644 --- a/ldap/servers/slapd/dse.c +++ b/ldap/servers/slapd/dse.c @@ -1109,8 +1109,11 @@ dse_add_entry_pb(struct dse *pdse, Slapi_Entry *e, Slapi_PBlock *pb) 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) { + dse_updateNumSubOfParent(pdse, slapi_entry_get_sdn_const(e), + SLAPI_OPERATION_ADD); + } } else { /* entry was merged, free temp unused data */ dse_node_delete(&n); }