[Reconnoiter-devel] [reconnoiter commit] r1484 - trunk/src

svn-commit at lists.omniti.com svn-commit at lists.omniti.com
Sat Nov 6 12:34:46 EDT 2010


Author: jesus
Date: 2010-11-06 12:34:46 -0400 (Sat, 06 Nov 2010)
New Revision: 1484

Modified:
   trunk/src/noit_check.c
Log:
refs #324

This is kinda scary.  Perhaps I saw something deeper when I wrote the
original comments about not being allowed to change a check's module
once set.  After some review I don't see why we can't change the module
as long as the check isn't live.  Assuming no fire_event, we should have
no risk -- a new fire event will be chosen once the check is "enabled"
and it will be the correct one for the newly specified module.


Modified: trunk/src/noit_check.c
===================================================================
--- trunk/src/noit_check.c	2010-11-05 16:57:29 UTC (rev 1483)
+++ trunk/src/noit_check.c	2010-11-06 16:34:46 UTC (rev 1484)
@@ -213,11 +213,13 @@
     if(noit_hash_retrieve(&polls, (char *)uuid, UUID_SIZE,
                           &vcheck)) {
       noit_check_t *existing_check = (noit_check_t *)vcheck;
-      /* Once set, we can never change it. */
+      /* Once set, it cannot be checked if the check is live */
       assert(!existing_check->module || !existing_check->module[0] ||
-             !strcmp(existing_check->module, module));
-      /* Only set it if it is not yet set */
-      if(!existing_check->module || !existing_check->module[0]) {
+             !strcmp(existing_check->module, module) ||
+             !NOIT_CHECK_LIVE(existing_check));
+      /* Set it if it is unset or being changed */
+      if(!existing_check->module || !existing_check->module[0] ||
+         strcmp(existing_check->module, module)) {
         if(existing_check->module) free(existing_check->module);
         existing_check->module = strdup(module);
       }



More information about the Reconnoiter-devel mailing list