Fixed minor reporting bug

This commit is contained in:
john 2019-12-03 04:06:45 -05:00
parent b6d4d8df3f
commit 36b3295df7
3 changed files with 18 additions and 6 deletions

View File

@ -89,7 +89,7 @@ struct Global G= {
.version= {
.major= 0,
.minor= 13,
.patch= 1
.patch= 2
},
.bitTuples.flags= GlobalFlagBitTuples
@ -186,7 +186,7 @@ main(int argc, char **argv)
int c, option_ndx= 0;
c= getopt_long(argc, argv, ":a::cst:v", long_options, &option_ndx);
c= getopt_long(argc, argv, ":a::cFst:v", long_options, &option_ndx);
if(-1 == c) break;
@ -197,10 +197,6 @@ main(int argc, char **argv)
++errflg;
break;
case 'c':
G.flags |= GLB_LIST_CNTRY_FLG;
break;
case 'a':
G.flags |= GLB_LIST_ADDR_FLG;
if(optarg) {
@ -213,6 +209,14 @@ main(int argc, char **argv)
}
break;
case 'c':
G.flags |= GLB_LIST_CNTRY_FLG;
break;
case 'F':
G.flags |= GLB_FLUSH_CACHE_FLG;
break;
case 's':
G.flags |= GLB_LIST_SUMMARY_FLG;
break;
@ -251,6 +255,7 @@ main(int argc, char **argv)
" --help\tprint this usage message.\n"
" -a[+]\t\tList results by Address. '+' to perform DNS reverse lookups.\n"
" -c\t\tlist results by Country\n"
" -F\t\tFlush the cache\n"
" -s\t\tlist Summary results only\n"
" -t confFile\tTest confFile, do not apply iptables rules\n"
" -v\t\tVerbose information about unrecognized configuration info\n"
@ -335,6 +340,9 @@ main(int argc, char **argv)
/* Open our cache, instance file-specific LOGTYPE objects */
{ /*=============================================================*/
if(G.flags & GLB_FLUSH_CACHE_FLG && !access(G.cacheDir, F_OK)) {
ez_rmdir_recursive(G.cacheDir);
}
/* Make the directory if needed */
if(access(G.cacheDir, F_OK)) {

View File

@ -69,6 +69,7 @@ enum GlobalFlg_enum {
GLB_PRINT_LOGFILE_NAMES_FLG=1<<5,
GLB_DNS_LOOKUP_FLG =1<<6,
GLB_DNS_FILTER_BAD_FLG =1<<7,
GLB_FLUSH_CACHE_FLG =1<<8,
GLB_LONG_LISTING_MASK = GLB_LIST_CNTRY_FLG|GLB_LIST_ADDR_FLG
};

View File

@ -190,6 +190,9 @@ obsv_load_AddrRPT(struct obsv *self, struct infoTuple *it)
assert(self->len < sizeof(lbuf));
unsigned len= MIN(self->len, sizeof(lbuf)-1);
/* Put null terminator in place */
lbuf[len]= '\0';
ez_gzseek(it->fh, self->pos, SEEK_SET);
ez_gzread(it->fh, lbuf, len);
AddrRPT_addLine(it->ar, it->lf, lbuf);