summaryrefslogtreecommitdiff
path: root/geoip.c
diff options
context:
space:
mode:
authorTobias Klauser <tklauser@distanz.ch>2018-03-06 14:11:53 +0100
committerTobias Klauser <tklauser@distanz.ch>2018-03-06 14:15:57 +0100
commit44ceece354c50795ba04e450b9269e6e3f92dd34 (patch)
treeb42200519bd20266990ac0db97b780e7de974129 /geoip.c
parentb90d055be5dd30212ebd0c0a810a7f020df70321 (diff)
geoip: store GeoIP files in $(PREFIX)/share by default
The /etc directory shouldn't contain non-human-readable files. netsniff-ng (when called with the '-U' option) currently installs the GeoIP database files to /etc/netsniff-ng by default. Change this to install them to $(PREFIX)/share/netsniff-ng instead, which is conformant to the FHS [1]. [1] https://wiki.debian.org/FilesystemHierarchyStandard Also create the respective directory in the 'make install' target. Fixes #187 Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Diffstat (limited to 'geoip.c')
-rw-r--r--geoip.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/geoip.c b/geoip.c
index d95305c..edf1497 100644
--- a/geoip.c
+++ b/geoip.c
@@ -33,37 +33,37 @@ struct file {
static const struct file files[] = {
[GEOIP_CITY_EDITION_REV1] = {
.desc = "City IPv4",
- .local = ETCDIRE_STRING "/city4.dat",
+ .local = DATDIR_STRING "/city4.dat",
.remote = "/GeoLiteCity.dat.gz",
.possible_prefix = PRE,
},
[GEOIP_CITY_EDITION_REV1_V6] = {
.desc = "City IPv6",
- .local = ETCDIRE_STRING "/city6.dat",
+ .local = DATDIR_STRING "/city6.dat",
.remote = "/GeoLiteCityv6.dat.gz",
.possible_prefix = PRE "/GeoLiteCityv6-beta",
},
[GEOIP_COUNTRY_EDITION] = {
.desc = "Country IPv4",
- .local = ETCDIRE_STRING "/country4.dat",
+ .local = DATDIR_STRING "/country4.dat",
.remote = "/GeoIP.dat.gz",
.possible_prefix = PRE "/GeoLiteCountry",
},
[GEOIP_COUNTRY_EDITION_V6] = {
.desc = "Country IPv6",
- .local = ETCDIRE_STRING "/country6.dat",
+ .local = DATDIR_STRING "/country6.dat",
.remote = "/GeoIPv6.dat.gz",
.possible_prefix = PRE,
},
[GEOIP_ASNUM_EDITION] = {
.desc = "AS Numbers IPv4",
- .local = ETCDIRE_STRING "/asname4.dat",
+ .local = DATDIR_STRING "/asname4.dat",
.remote = "/GeoIPASNum.dat.gz",
.possible_prefix = PRE "/asnum",
},
[GEOIP_ASNUM_EDITION_V6] = {
.desc = "AS Numbers IPv6",
- .local = ETCDIRE_STRING "/asname6.dat",
+ .local = DATDIR_STRING "/asname6.dat",
.remote = "/GeoIPASNumv6.dat.gz",
.possible_prefix = PRE "/asnum",
},
@@ -627,19 +627,19 @@ static void init_mirrors(void)
if (!fp)
panic("Cannot open geoip.conf!\n");
- fmemset(buff, 0, sizeof(buff));
+ memset(buff, 0, sizeof(buff));
while (fgets(buff, sizeof(buff), fp) != NULL &&
i < array_size(servers)) {
buff[sizeof(buff) - 1] = 0;
buff[strlen(buff) - 1] = 0;
if (buff[0] == '#') {
- fmemset(buff, 0, sizeof(buff));
+ memset(buff, 0, sizeof(buff));
continue;
}
servers[i++] = xstrdup(buff);
- fmemset(buff, 0, sizeof(buff));
+ memset(buff, 0, sizeof(buff));
}
fclose(fp);