mirror of
https://github.com/unrealircd/unrealircd.git
synced 2026-06-29 10:56:37 +02:00
Various small UnrealDB fixes
This commit is contained in:
@@ -522,6 +522,7 @@ int reputation_load_db_new(UnrealDB *db)
|
||||
e->score = score;
|
||||
e->last_seen = last_seen;
|
||||
add_reputation_entry(e);
|
||||
safe_free(ip);
|
||||
}
|
||||
unrealdb_close(db);
|
||||
#ifdef BENCHMARK
|
||||
|
||||
+6
-1
@@ -234,7 +234,7 @@ UnrealDB *unrealdb_open(const char *filename, UnrealDBMode mode, char *secret_bl
|
||||
secr = find_secret(secret_block);
|
||||
if (!secr)
|
||||
{
|
||||
unrealdb_set_error(c, UNREALDB_ERROR_SECRET, "Secret block '%s' not found or invalid", secr->name);
|
||||
unrealdb_set_error(c, UNREALDB_ERROR_SECRET, "Secret block '%s' not found or invalid", secret_block);
|
||||
goto unrealdb_open_fail;
|
||||
}
|
||||
|
||||
@@ -379,6 +379,11 @@ UnrealDB *unrealdb_open(const char *filename, UnrealDBMode mode, char *secret_bl
|
||||
unrealdb_set_error(c, UNREALDB_ERROR_HEADER, "Header contains unknown cipher 0x%x", (int)c->config->cipher);
|
||||
goto unrealdb_open_fail;
|
||||
}
|
||||
if (c->config->keylen > 1024)
|
||||
{
|
||||
unrealdb_set_error(c, UNREALDB_ERROR_HEADER, "Header is corrupt (keylen=%d)", (int)c->config->keylen);
|
||||
goto unrealdb_open_fail; /* Something must be wrong, this makes no sense. */
|
||||
}
|
||||
c->config->key = safe_alloc_sensitive(c->config->keylen);
|
||||
|
||||
dbcache = find_secret_cache(secr, c->config);
|
||||
|
||||
Reference in New Issue
Block a user