|
@@ -32,7 +32,7 @@ settings_t settings = {
|
|
|
/* -- STATIC -- */
|
|
/* -- STATIC -- */
|
|
|
"", "", "", "", "", "", "", "", "", "",
|
|
"", "", "", "", "", "", "", "", "", "",
|
|
|
/* -- DYNAMIC -- */
|
|
/* -- DYNAMIC -- */
|
|
|
- "", "", "", "", "", "", "", "",
|
|
|
|
|
|
|
+ "", "", "", "", "", "", "", "", "",
|
|
|
/* -- PADDING */
|
|
/* -- PADDING */
|
|
|
""
|
|
""
|
|
|
};
|
|
};
|
|
@@ -135,7 +135,7 @@ bin_checksum(const char *fname, int todo)
|
|
|
OPENSSL_cleanse(hash, sizeof(hash));
|
|
OPENSSL_cleanse(hash, sizeof(hash));
|
|
|
|
|
|
|
|
/* Copy over only the dynamic data, leaving the pack config static */
|
|
/* Copy over only the dynamic data, leaving the pack config static */
|
|
|
- memcpy(&settings.bots, &newsettings.bots, SIZE_CONF);
|
|
|
|
|
|
|
+ memcpy(&settings.DYNAMIC_HEADER, &newsettings.DYNAMIC_HEADER, SIZE_CONF);
|
|
|
OPENSSL_cleanse(&newsettings, sizeof(settings_t));
|
|
OPENSSL_cleanse(&newsettings, sizeof(settings_t));
|
|
|
|
|
|
|
|
munmap(map, size);
|
|
munmap(map, size);
|
|
@@ -206,7 +206,7 @@ bin_checksum(const char *fname, int todo)
|
|
|
|
|
|
|
|
if (todo & WRITE_CONF) {
|
|
if (todo & WRITE_CONF) {
|
|
|
/* Copy in the encrypted conf data */
|
|
/* Copy in the encrypted conf data */
|
|
|
- memcpy(&outmap[newpos], &settings.bots, SIZE_CONF);
|
|
|
|
|
|
|
+ memcpy(&outmap[newpos], &settings.DYNAMIC_HEADER, SIZE_CONF);
|
|
|
#ifdef DEBUG
|
|
#ifdef DEBUG
|
|
|
sdprintf(STR("writing conf: %d\n"), SIZE_CONF);
|
|
sdprintf(STR("writing conf: %d\n"), SIZE_CONF);
|
|
|
#endif
|
|
#endif
|
|
@@ -474,6 +474,7 @@ static void edpack(settings_t *incfg, const char *in_hash, int what)
|
|
|
update_hash();
|
|
update_hash();
|
|
|
|
|
|
|
|
/* -- DYNAMIC -- */
|
|
/* -- DYNAMIC -- */
|
|
|
|
|
+ dofield(incfg->dynamic_initialized);
|
|
|
dofield(incfg->bots);
|
|
dofield(incfg->bots);
|
|
|
dofield(incfg->uid);
|
|
dofield(incfg->uid);
|
|
|
dofield(incfg->autocron);
|
|
dofield(incfg->autocron);
|
|
@@ -507,6 +508,7 @@ tellconfig(settings_t *incfg)
|
|
|
// dofield(incfg->salt1);
|
|
// dofield(incfg->salt1);
|
|
|
// dofield(incfg->salt2);
|
|
// dofield(incfg->salt2);
|
|
|
// -- DYNAMIC --
|
|
// -- DYNAMIC --
|
|
|
|
|
+ dofield(incfg->dynamic_initialized);
|
|
|
dofield(incfg->bots);
|
|
dofield(incfg->bots);
|
|
|
dofield(incfg->uid);
|
|
dofield(incfg->uid);
|
|
|
dofield(incfg->autocron);
|
|
dofield(incfg->autocron);
|
|
@@ -650,7 +652,7 @@ static void
|
|
|
clear_settings(void)
|
|
clear_settings(void)
|
|
|
{
|
|
{
|
|
|
// memset(&settings.bots, 0, sizeof(settings_t) - SIZE_PACK - PREFIXLEN);
|
|
// memset(&settings.bots, 0, sizeof(settings_t) - SIZE_PACK - PREFIXLEN);
|
|
|
- memset(&settings.bots, 0, SIZE_CONF);
|
|
|
|
|
|
|
+ memset(&settings.DYNAMIC_HEADER, 0, SIZE_CONF);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
void conf_to_bin(conf_t *in, bool move, int die)
|
|
void conf_to_bin(conf_t *in, bool move, int die)
|
|
@@ -661,6 +663,7 @@ void conf_to_bin(conf_t *in, bool move, int die)
|
|
|
clear_settings();
|
|
clear_settings();
|
|
|
sdprintf("converting conf to bin\n");
|
|
sdprintf("converting conf to bin\n");
|
|
|
simple_snprintf(settings.uid, sizeof(settings.uid), "%d", in->uid);
|
|
simple_snprintf(settings.uid, sizeof(settings.uid), "%d", in->uid);
|
|
|
|
|
+ strlcpy(settings.dynamic_initialized, "1", sizeof(settings.dynamic_initialized));
|
|
|
simple_snprintf(settings.autocron, sizeof(settings.autocron), "%d", in->autocron);
|
|
simple_snprintf(settings.autocron, sizeof(settings.autocron), "%d", in->autocron);
|
|
|
simple_snprintf(settings.portmin, sizeof(settings.portmin), "%d", in->portmin);
|
|
simple_snprintf(settings.portmin, sizeof(settings.portmin), "%d", in->portmin);
|
|
|
simple_snprintf(settings.portmax, sizeof(settings.portmax), "%d", in->portmax);
|
|
simple_snprintf(settings.portmax, sizeof(settings.portmax), "%d", in->portmax);
|