From: Teemu Toivola Date: Wed, 8 May 2019 20:10:59 +0000 (+0300) Subject: ignore anything that starts with the database name during legacy db import instead... X-Git-Tag: v2.3~39 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a6e1dd882616cefe23ecf8bf720bb7fc59a3b1b7;p=vnstat ignore anything that starts with the database name during legacy db import instead of the exact name of the database, this avoids possible issues with possible automatically created secondary sqlite files --- diff --git a/src/daemon.c b/src/daemon.c index 87e3db0..6c08993 100644 --- a/src/daemon.c +++ b/src/daemon.c @@ -325,7 +325,7 @@ unsigned int importlegacydbs(DSTATE *s) s->dbifcount = 0; while ((di = readdir(dir))) { - if ((di->d_name[0] != '.') && (strcmp(di->d_name, DATABASEFILE) != 0)) { + if ((di->d_name[0] != '.') && (strncmp(di->d_name, DATABASEFILE, strlen(DATABASEFILE)) != 0)) { /* ignore already known interfaces */ if (db_getinterfacecountbyname(di->d_name)) { continue;