Fixed a bug where mbtask would not stop calling undialable nodes
This commit is contained in:
parent
af926964ba
commit
e52324bf3a
@ -117,7 +117,6 @@ static int getkwd(char **dest)
|
|||||||
(*tmpm)->name = xstrcpy(v);
|
(*tmpm)->name = xstrcpy(v);
|
||||||
tmp = strtoul(p, NULL, 0);
|
tmp = strtoul(p, NULL, 0);
|
||||||
(*tmpm)->value = tmp;
|
(*tmpm)->value = tmp;
|
||||||
// Syslog('n', "getkwd: %s(%d): \"%s\" \"%s\" \"%08x\"", nlpath, linecnt, MBSE_SS(k), (*tmpm)->name, (*tmpm)->value);
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -161,8 +160,6 @@ static int getmdm(char **dest)
|
|||||||
tmp2 = strtoul(q, NULL, 0);
|
tmp2 = strtoul(q, NULL, 0);
|
||||||
(*tmpm)->mask = tmp1;
|
(*tmpm)->mask = tmp1;
|
||||||
(*tmpm)->value = tmp2;
|
(*tmpm)->value = tmp2;
|
||||||
// Syslog('n', "getmdm: %s(%d): \"%s\" \"%s\" \"%08x\" \"%08x\"", nlpath, linecnt, MBSE_SS(k),
|
|
||||||
// (*tmpm)->name, (*tmpm)->mask, (*tmpm)->value);
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -185,7 +182,6 @@ static int getarr(char **dest)
|
|||||||
(*tmpm) = (nodelist_array *) xmalloc(sizeof(nodelist_array));
|
(*tmpm) = (nodelist_array *) xmalloc(sizeof(nodelist_array));
|
||||||
(*tmpm)->next = NULL;
|
(*tmpm)->next = NULL;
|
||||||
(*tmpm)->name = xstrcpy(v);
|
(*tmpm)->name = xstrcpy(v);
|
||||||
// Syslog('n', "getarr: %s(%d): \"%s\" \"%s\"", nlpath, linecnt, MBSE_SS(k), (*tmpm)->name);
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -216,7 +212,6 @@ static int getdom(char **dest)
|
|||||||
tmp = strtod(v, NULL);
|
tmp = strtod(v, NULL);
|
||||||
(*tmpm)->zone = tmp;
|
(*tmpm)->zone = tmp;
|
||||||
(*tmpm)->name = xstrcpy(p);
|
(*tmpm)->name = xstrcpy(p);
|
||||||
// Syslog('n', "getdom: %s(%d): \"%s\" \"%d\" \"%s\"", nlpath, linecnt, MBSE_SS(k), (*tmpm)->zone, (*tmpm)->name);
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -259,8 +254,6 @@ static int getsrv(char **dest)
|
|||||||
(*tmpm)->service = xstrcpy(p);
|
(*tmpm)->service = xstrcpy(p);
|
||||||
tmp = strtoul(q, NULL, 0);
|
tmp = strtoul(q, NULL, 0);
|
||||||
(*tmpm)->port = tmp;
|
(*tmpm)->port = tmp;
|
||||||
// Syslog('n', "getsrv: %s(%d): \"%s\" \"%s\" \"%s\" \"%d\"", nlpath, linecnt, MBSE_SS(k),
|
|
||||||
// (*tmpm)->flag, (*tmpm)->service, (*tmpm)->port);
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -459,8 +452,6 @@ int initnl(void)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Syslog('n', "\"%s\" \"%s\" - parsed", MBSE_SS(k), MBSE_SS(v));
|
|
||||||
|
|
||||||
for (i = 0; keytab[i].key; i++)
|
for (i = 0; keytab[i].key; i++)
|
||||||
if (strcasecmp(k,keytab[i].key) == 0)
|
if (strcasecmp(k,keytab[i].key) == 0)
|
||||||
break;
|
break;
|
||||||
@ -636,12 +627,18 @@ node *getnlent(faddr *addr)
|
|||||||
fread(&fidonethdr, sizeof(fidonethdr), 1, fp);
|
fread(&fidonethdr, sizeof(fidonethdr), 1, fp);
|
||||||
while (fread(&fidonet, fidonethdr.recsize, 1, fp) == 1) {
|
while (fread(&fidonet, fidonethdr.recsize, 1, fp) == 1) {
|
||||||
for (i = 0; i < 6; i++) {
|
for (i = 0; i < 6; i++) {
|
||||||
if (addr->zone == fidonet.zone[i])
|
if (addr->zone == fidonet.zone[i]) {
|
||||||
nodebuf.addr.domain = xstrcpy(fidonet.domain);
|
nodebuf.addr.domain = xstrcpy(fidonet.domain);
|
||||||
|
Found = TRUE;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (Found)
|
||||||
|
break;
|
||||||
|
}
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
}
|
}
|
||||||
|
Found = FALSE;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* First, lookup node in index. NOTE -- NOT 5D YET
|
* First, lookup node in index. NOTE -- NOT 5D YET
|
||||||
@ -735,7 +732,6 @@ node *getnlent(faddr *addr)
|
|||||||
if ((addr->zone == nd.Aka[i].zone) && (addr->net == nd.Aka[i].net) &&
|
if ((addr->zone == nd.Aka[i].zone) && (addr->net == nd.Aka[i].net) &&
|
||||||
(addr->node == nd.Aka[i].node) && (addr->point == nd.Aka[i].point)) {
|
(addr->node == nd.Aka[i].node) && (addr->point == nd.Aka[i].point)) {
|
||||||
ndrecord = TRUE;
|
ndrecord = TRUE;
|
||||||
Syslog('n', "getnlent: node record is present");
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -783,7 +779,7 @@ node *getnlent(faddr *addr)
|
|||||||
if ((q=strchr(p,',')))
|
if ((q=strchr(p,',')))
|
||||||
*q++ = '\0';
|
*q++ = '\0';
|
||||||
if (ndrecord && strlen(nd.Nl_hostname)) {
|
if (ndrecord && strlen(nd.Nl_hostname)) {
|
||||||
Syslog('n', "getnlent: system name override with %s", nd.Nl_hostname);
|
Syslog('+', "getnlent: %s system name override with %s", ascfnode(addr,0xff), nd.Nl_hostname);
|
||||||
nodebuf.name = nd.Nl_hostname;
|
nodebuf.name = nd.Nl_hostname;
|
||||||
} else
|
} else
|
||||||
nodebuf.name = p;
|
nodebuf.name = p;
|
||||||
@ -843,7 +839,7 @@ node *getnlent(faddr *addr)
|
|||||||
* Process the nodelist flags.
|
* Process the nodelist flags.
|
||||||
*/
|
*/
|
||||||
if (ndrecord && strlen(nd.Nl_flags)) {
|
if (ndrecord && strlen(nd.Nl_flags)) {
|
||||||
Syslog('n', "getnlent: flags override %s", nd.Nl_flags);
|
Syslog('+', "getnlent: %s flags override %s", ascfnode(addr,0xff), nd.Nl_flags);
|
||||||
q = nd.Nl_flags;
|
q = nd.Nl_flags;
|
||||||
}
|
}
|
||||||
ixflag = 0;
|
ixflag = 0;
|
||||||
@ -900,7 +896,7 @@ node *getnlent(faddr *addr)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
* Linse starting with ;E space are real errors.
|
* Lines starting with ;E space are real errors.
|
||||||
*/
|
*/
|
||||||
if (strncmp(ebuf, (char *)";E ", 3) == 0)
|
if (strncmp(ebuf, (char *)";E ", 3) == 0)
|
||||||
break;
|
break;
|
||||||
@ -1011,7 +1007,6 @@ node *getnlent(faddr *addr)
|
|||||||
for (p = q; p; p = q) {
|
for (p = q; p; p = q) {
|
||||||
if ((q = strchr(p, ',')))
|
if ((q = strchr(p, ',')))
|
||||||
*q++ = '\0';
|
*q++ = '\0';
|
||||||
Syslog('n', "\"%s\"", MBSE_SS(p));
|
|
||||||
if ((r = strchr(p, ':'))) {
|
if ((r = strchr(p, ':'))) {
|
||||||
r++;
|
r++;
|
||||||
/*
|
/*
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
* Purpose ...............: Read mailer last call status
|
* Purpose ...............: Read mailer last call status
|
||||||
*
|
*
|
||||||
*****************************************************************************
|
*****************************************************************************
|
||||||
* Copyright (C) 1997-2002
|
* Copyright (C) 1997-2003
|
||||||
*
|
*
|
||||||
* Michiel Broek FIDO: 2:280/2802
|
* Michiel Broek FIDO: 2:280/2802
|
||||||
* Beekmansbos 10
|
* Beekmansbos 10
|
||||||
@ -42,8 +42,7 @@ char *stsname(faddr *);
|
|||||||
char *stsname(faddr *addr)
|
char *stsname(faddr *addr)
|
||||||
{
|
{
|
||||||
static char buf[PATH_MAX];
|
static char buf[PATH_MAX];
|
||||||
char *p, *domain=NULL;
|
char *p, *domain=NULL, zpref[8];
|
||||||
char zpref[8];
|
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
sprintf(buf, "%s", CFG.outbound);
|
sprintf(buf, "%s", CFG.outbound);
|
||||||
@ -67,8 +66,7 @@ char *stsname(faddr *addr)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((domain != NULL) && (strlen(CFG.aka[0].domain) != 0) &&
|
if ((domain != NULL) && (strlen(CFG.aka[0].domain) != 0) && (strcasecmp(domain,CFG.aka[0].domain) != 0)) {
|
||||||
(strcasecmp(domain,CFG.aka[0].domain) != 0)) {
|
|
||||||
if ((p = strrchr(buf,'/')))
|
if ((p = strrchr(buf,'/')))
|
||||||
p++;
|
p++;
|
||||||
else
|
else
|
||||||
@ -77,8 +75,7 @@ char *stsname(faddr *addr)
|
|||||||
for (; *p; p++)
|
for (; *p; p++)
|
||||||
*p = tolower(*p);
|
*p = tolower(*p);
|
||||||
for (i = 0; i < 40; i++)
|
for (i = 0; i < 40; i++)
|
||||||
if ((strlen(CFG.aka[i].domain)) &&
|
if ((strlen(CFG.aka[i].domain)) && (strcasecmp(CFG.aka[i].domain, domain) == 0))
|
||||||
(strcasecmp(CFG.aka[i].domain, domain) == 0))
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
* Purpose ...............: mbtask - Scan mail outbound status
|
* Purpose ...............: mbtask - Scan mail outbound status
|
||||||
*
|
*
|
||||||
*****************************************************************************
|
*****************************************************************************
|
||||||
* Copyright (C) 1997-2002
|
* Copyright (C) 1997-2003
|
||||||
*
|
*
|
||||||
* Michiel Broek FIDO: 2:280/2802
|
* Michiel Broek FIDO: 2:280/2802
|
||||||
* Beekmansbos 10
|
* Beekmansbos 10
|
||||||
@ -395,7 +395,6 @@ int outstat()
|
|||||||
else
|
else
|
||||||
tmin = 30;
|
tmin = 30;
|
||||||
sprintf(be, "%02d:%02d", thour, tmin);
|
sprintf(be, "%02d:%02d", thour, tmin);
|
||||||
// Syslog('o', "Setting next hour for Txx node at %s", be);
|
|
||||||
set_next(thour, tmin);
|
set_next(thour, tmin);
|
||||||
if (strcmp(as, be) > 0) {
|
if (strcmp(as, be) > 0) {
|
||||||
/*
|
/*
|
||||||
@ -609,7 +608,6 @@ int each(faddr *addr, char flavor, int isflo, char *fname)
|
|||||||
(strcasecmp((*tmp)->addr.domain,addr->domain) == 0)))
|
(strcasecmp((*tmp)->addr.domain,addr->domain) == 0)))
|
||||||
break;
|
break;
|
||||||
if (*tmp == NULL) {
|
if (*tmp == NULL) {
|
||||||
Syslog('-', "%s", ascfnode(addr, 0xff));
|
|
||||||
nlent = getnlent(addr);
|
nlent = getnlent(addr);
|
||||||
*tmp = (struct _alist *)malloc(sizeof(struct _alist));
|
*tmp = (struct _alist *)malloc(sizeof(struct _alist));
|
||||||
(*tmp)->next = NULL;
|
(*tmp)->next = NULL;
|
||||||
@ -679,7 +677,8 @@ int each(faddr *addr, char flavor, int isflo, char *fname)
|
|||||||
if (*p == '\\')
|
if (*p == '\\')
|
||||||
*p='/';
|
*p='/';
|
||||||
for (p = buf; *p && isspace(*p); p++);
|
for (p = buf; *p && isspace(*p); p++);
|
||||||
if (*p == '~') continue;
|
if (*p == '~')
|
||||||
|
continue;
|
||||||
if ((*p == '#') || (*p == '-') || (*p == '^') || (*p == '@'))
|
if ((*p == '#') || (*p == '-') || (*p == '^') || (*p == '@'))
|
||||||
p++;
|
p++;
|
||||||
if (stat(p, &st) != 0) {
|
if (stat(p, &st) != 0) {
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
* Purpose ...............: Outbound scanning
|
* Purpose ...............: Outbound scanning
|
||||||
*
|
*
|
||||||
*****************************************************************************
|
*****************************************************************************
|
||||||
* Copyright (C) 1997-2002
|
* Copyright (C) 1997-2003
|
||||||
*
|
*
|
||||||
* Michiel Broek FIDO: 2:280/2802
|
* Michiel Broek FIDO: 2:280/2802
|
||||||
* Beekmansbos 10
|
* Beekmansbos 10
|
||||||
@ -55,15 +55,13 @@ extern struct _fidonet fidonet;
|
|||||||
static int scan_dir(int (*)(faddr*, char, int, char *), char *, int);
|
static int scan_dir(int (*)(faddr*, char, int, char *), char *, int);
|
||||||
static int scan_dir(int (*fn)(faddr *, char, int, char *), char *dname, int ispoint)
|
static int scan_dir(int (*fn)(faddr *, char, int, char *), char *dname, int ispoint)
|
||||||
{
|
{
|
||||||
char fname[PATH_MAX];
|
char fname[PATH_MAX], flavor = '?';
|
||||||
char flavor = '?';
|
|
||||||
DIR *dp = NULL;
|
DIR *dp = NULL;
|
||||||
struct dirent *de;
|
struct dirent *de;
|
||||||
int rc = 0, isflo, fage;
|
int rc = 0, isflo, fage;
|
||||||
time_t t_start;
|
time_t t_start;
|
||||||
|
|
||||||
t_start = time(NULL);
|
t_start = time(NULL);
|
||||||
// Syslog('o' ,"scan_dir \"%s\" (%s)",MBSE_SS(dname),ispoint?"point":"node");
|
|
||||||
|
|
||||||
if ((dp = opendir(dname)) == NULL) {
|
if ((dp = opendir(dname)) == NULL) {
|
||||||
Syslog('-', "Creating directory %s", dname);
|
Syslog('-', "Creating directory %s", dname);
|
||||||
@ -78,10 +76,8 @@ static int scan_dir(int (*fn)(faddr *, char, int, char *), char *dname, int ispo
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
while ((de=readdir(dp)))
|
while ((de=readdir(dp))) {
|
||||||
if ((strlen(de->d_name) == 12) && (de->d_name[8] == '.') &&
|
if ((strlen(de->d_name) == 12) && (de->d_name[8] == '.') && (strspn(de->d_name,"0123456789abcdefABCDEF") == 8)) {
|
||||||
(strspn(de->d_name,"0123456789abcdefABCDEF") == 8)) {
|
|
||||||
// Syslog('o' ,"checking: \"%s\"",de->d_name);
|
|
||||||
addr.point= 0;
|
addr.point= 0;
|
||||||
strncpy(fname,dname,PATH_MAX-2);
|
strncpy(fname,dname,PATH_MAX-2);
|
||||||
strcat(fname,"/");
|
strcat(fname,"/");
|
||||||
@ -124,7 +120,6 @@ static int scan_dir(int (*fn)(faddr *, char, int, char *), char *dname, int ispo
|
|||||||
isflo=OUT_POL;
|
isflo=OUT_POL;
|
||||||
else
|
else
|
||||||
isflo=-1;
|
isflo=-1;
|
||||||
// Syslog('o' ,"%s \"%s\"", (isflo == OUT_FLO) ? "flo file" : "packet", de->d_name);
|
|
||||||
if ((rc=fn(&addr,flavor,isflo,fname)))
|
if ((rc=fn(&addr,flavor,isflo,fname)))
|
||||||
goto exout;
|
goto exout;
|
||||||
} else if ((strncasecmp(de->d_name+9,"su",2) == 0) ||
|
} else if ((strncasecmp(de->d_name+9,"su",2) == 0) ||
|
||||||
@ -138,12 +133,10 @@ static int scan_dir(int (*fn)(faddr *, char, int, char *), char *dname, int ispo
|
|||||||
if ((rc = fn(&addr, flavor, isflo, fname)))
|
if ((rc = fn(&addr, flavor, isflo, fname)))
|
||||||
goto exout;
|
goto exout;
|
||||||
|
|
||||||
// Syslog('o' ,"arcmail file \"%s\"",de->d_name);
|
|
||||||
sprintf(fname, "%s/%s", dname, de->d_name);
|
sprintf(fname, "%s/%s", dname, de->d_name);
|
||||||
fage = (int)((t_start - file_time(fname)) / 86400);
|
fage = (int)((t_start - file_time(fname)) / 86400);
|
||||||
|
|
||||||
if (file_size(fname) == 0) {
|
if (file_size(fname) == 0) {
|
||||||
// Syslog('o', "Age %d days", fage);
|
|
||||||
/*
|
/*
|
||||||
* Remove truncated ARCmail that has a day extension
|
* Remove truncated ARCmail that has a day extension
|
||||||
* other then the current day or if the file is older
|
* other then the current day or if the file is older
|
||||||
@ -162,8 +155,7 @@ static int scan_dir(int (*fn)(faddr *, char, int, char *), char *dname, int ispo
|
|||||||
if (unlink(fname) == 0)
|
if (unlink(fname) == 0)
|
||||||
Syslog('+', "Removed ARCmail %s, %d days", fname, fage);
|
Syslog('+', "Removed ARCmail %s, %d days", fname, fage);
|
||||||
}
|
}
|
||||||
} else {
|
}
|
||||||
// Syslog('o' ,"skipping \"%s\"",de->d_name);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -178,8 +170,7 @@ int scanout(int (*fn)(faddr *, char, int, char *))
|
|||||||
{
|
{
|
||||||
int i, j, rc = 0;
|
int i, j, rc = 0;
|
||||||
unsigned short zone = 0;
|
unsigned short zone = 0;
|
||||||
char fext[5];
|
char fext[5], *p = NULL, *q = NULL;
|
||||||
char *p = NULL, *q = NULL;
|
|
||||||
DIR *dp;
|
DIR *dp;
|
||||||
|
|
||||||
if ((dp = opendir(CFG.outbound)) == NULL) {
|
if ((dp = opendir(CFG.outbound)) == NULL) {
|
||||||
@ -197,8 +188,7 @@ int scanout(int (*fn)(faddr *, char, int, char *))
|
|||||||
if (SearchFidonet(zone)) {
|
if (SearchFidonet(zone)) {
|
||||||
for (j = 0; j < 6; j++) {
|
for (j = 0; j < 6; j++) {
|
||||||
/*
|
/*
|
||||||
* Create outbound directory name for
|
* Create outbound directory name for the primary aka of that zone.
|
||||||
* the primary aka of that zone.
|
|
||||||
*/
|
*/
|
||||||
p = xstrcpy(CFG.outbound);
|
p = xstrcpy(CFG.outbound);
|
||||||
if (zone != CFG.aka[0].zone) {
|
if (zone != CFG.aka[0].zone) {
|
||||||
@ -209,18 +199,15 @@ int scanout(int (*fn)(faddr *, char, int, char *))
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Not primary zones in the domain get
|
* Not primary zones in the domain get a directory extension.
|
||||||
* a directory extension.
|
|
||||||
*/
|
*/
|
||||||
if (fidonet.zone[j]) {
|
if (fidonet.zone[j]) {
|
||||||
if (j) {
|
if (j) {
|
||||||
sprintf(fext, ".%03x", fidonet.zone[j]);
|
sprintf(fext, ".%03x", fidonet.zone[j]);
|
||||||
p = xstrcat(p, fext);
|
p = xstrcat(p, fext);
|
||||||
}
|
}
|
||||||
// Syslog('o', "Zone %d Dir %s", fidonet.zone[j], p);
|
|
||||||
addr.zone = fidonet.zone[j];
|
addr.zone = fidonet.zone[j];
|
||||||
addr.domain = fidonet.domain;
|
addr.domain = fidonet.domain;
|
||||||
|
|
||||||
if ((rc = scan_dir(fn, p, 0))) {
|
if ((rc = scan_dir(fn, p, 0))) {
|
||||||
if (p)
|
if (p)
|
||||||
free(p);
|
free(p);
|
||||||
|
Reference in New Issue
Block a user