Sfoglia il codice sorgente

* Possibly fixed a config sharing problem

svn: 259
Bryan Drewery 22 anni fa
parent
commit
627818c367
2 ha cambiato i file con 4 aggiunte e 4 eliminazioni
  1. 2 2
      src/config.c
  2. 2 2
      src/userent.c

+ 2 - 2
src/config.c

@@ -516,7 +516,7 @@ void got_config_share(int idx, char *ln)
   int i;
   int i;
   struct cfg_entry *cfgent = NULL;
   struct cfg_entry *cfgent = NULL;
 
 
-  cfg_noshare++;
+  cfg_noshare = 1;
   name = newsplit(&ln);
   name = newsplit(&ln);
   for (i = 0; !cfgent && (i < cfg_count); i++)
   for (i = 0; !cfgent && (i < cfg_count); i++)
     if (!strcmp(cfg[i]->name, name))
     if (!strcmp(cfg[i]->name, name))
@@ -526,7 +526,7 @@ void got_config_share(int idx, char *ln)
     botnet_send_cfg_broad(idx, cfgent);
     botnet_send_cfg_broad(idx, cfgent);
   } else
   } else
     putlog(LOG_ERRORS, "*", STR("Unrecognized config entry %s in userfile"), name);
     putlog(LOG_ERRORS, "*", STR("Unrecognized config entry %s in userfile"), name);
-  cfg_noshare--;
+  cfg_noshare = 0;
 }
 }
 
 
 void trigger_cfg_changed()
 void trigger_cfg_changed()

+ 2 - 2
src/userent.c

@@ -522,14 +522,14 @@ int config_gotshare(struct userrec *u, struct user_entry *e, char *buf, int idx)
     struct cfg_entry *cfgent = NULL;
     struct cfg_entry *cfgent = NULL;
     int i;
     int i;
 
 
-    cfg_noshare++;
+    cfg_noshare = 1;
     for (i = 0; !cfgent && (i < cfg_count); i++)
     for (i = 0; !cfgent && (i < cfg_count); i++)
       if (!strcmp(arg, cfg[i]->name) && (cfg[i]->flags & CFGF_LOCAL))
       if (!strcmp(arg, cfg[i]->name) && (cfg[i]->flags & CFGF_LOCAL))
 	cfgent = cfg[i];
 	cfgent = cfg[i];
     if (cfgent) {
     if (cfgent) {
       set_cfg_str(botnetnick, cfgent->name, buf[0] ? buf : NULL);
       set_cfg_str(botnetnick, cfgent->name, buf[0] ? buf : NULL);
     }
     }
-    cfg_noshare--;
+    cfg_noshare = 0;
     return 1;
     return 1;
   }
   }