Load a GeoIP database whose modification time is the epoch (#2604)

The newest .mmdb in configs/geoip was picked with mtime > modTime,
starting from 0, so a database with an mtime of 0 (as Docker's ADD
sets for downloads without Last-Modified) was never loaded and the
extension failed with "Could not find GeoIP2 database".

Assisted-by: Claude:claude-opus-5-5
This commit is contained in:
Adrian-Stefan Mares
2026-11-08 16:38:56 +00:00
committed by GitHub
parent 510f82d908
commit 5eb6a120af
+1 -1
View File
@@ -79,7 +79,7 @@ bool GeoIP_Extension::SDK_OnLoad(char *error, size_t maxlength, bool late)
{
libsys->PathFormat(database, sizeof(database), "%s/%s", m_GeoipDir, name);
if (libsys->FileTime(database, FileTime_LastChange, &mtime) && mtime > modTime)
if (libsys->FileTime(database, FileTime_LastChange, &mtime) && (m_GeoipDb[0] == '\0' || mtime > modTime))
{
modTime = mtime;
ke::SafeStrcpy(m_GeoipDb, sizeof(m_GeoipDb), database);