ldap/servers/plugins/referint/referint.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
New commits:
commit 0b5cdb4346a9c44cf03191a38b0dd9b5b0327e1d
Author: Rich Megginson <rmeggins(a)redhat.com>
Date: Wed Jul 18 15:19:35 2012 -0600
Ticket #410 - Referential integrity plug-in does not work when update interval is not
zero
https://fedorahosted.org/389/ticket/410
Resolves: Ticket #410
Bug Description: Referential integrity plug-in does not work when update interval is
not zero
Reviewed by: nhosoi (Thanks!)
Branch: 389-ds-base-1.2.11
Fix Description: Checking for newsuperior == NULL is not sufficient - also
have to check for slapi_sdn_get_dn(newsuperior) == NULL as well. Otherwise
we write the string "(null)" to the referint log and that blows up the code
that attempt to apply the change.
Platforms tested: RHEL6 x86_64
Flag Day: no
Doc impact: no
diff --git a/ldap/servers/plugins/referint/referint.c
b/ldap/servers/plugins/referint/referint.c
index 7e45e0e..3342634 100644
--- a/ldap/servers/plugins/referint/referint.c
+++ b/ldap/servers/plugins/referint/referint.c
@@ -1084,6 +1084,7 @@ writeintegritylog(Slapi_PBlock *pb, char *logfilename, Slapi_DN
*sdn,
int len_to_write = 0;
int rc;
const char *requestordn = NULL;
+ const char *newsuperiordn = NULL;
size_t reqdn_len = 0;
/*
@@ -1115,7 +1116,9 @@ writeintegritylog(Slapi_PBlock *pb, char *logfilename, Slapi_DN
*sdn,
/* add the length of the newrdn */
len_to_write += strlen(newrdn);
}
- if(NULL == newsuperior){
+ newsuperiordn = slapi_sdn_get_dn(newsuperior);
+ if(NULL == newsuperiordn)
+ {
/* add the length of "NULL" */
len_to_write += 4;
} else {
@@ -1137,8 +1140,8 @@ writeintegritylog(Slapi_PBlock *pb, char *logfilename, Slapi_DN
*sdn,
" to update references to this entry.\n");
} else {
PR_snprintf(buffer, MAX_LINE, "%s\t%s\t%s\t%s\t\n",
slapi_sdn_get_dn(sdn),
- (newrdn != NULL) ? newrdn : "NULL",
- (newsuperior != NULL) ? slapi_sdn_get_dn(newsuperior) :
"NULL",
+ (newrdn != NULL) ? newrdn : "NULL",
+ (newsuperiordn != NULL) ? newsuperiordn : "NULL",
requestordn ? requestordn : "NULL");
if (PR_Write(prfd,buffer,strlen(buffer)) < 0){
slapi_log_error(SLAPI_LOG_FATAL,REFERINT_PLUGIN_SUBSYSTEM,