Przeglądaj źródła

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
Rich Megginson 13 lat temu
rodzic
commit
0b5cdb4346
1 zmienionych plików z 6 dodań i 3 usunięć
  1. 6 3
      ldap/servers/plugins/referint/referint.c

+ 6 - 3
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,