Added safety for toplevel areamgr systems
This commit is contained in:
parent
57a3751b32
commit
49dbc82685
@ -641,7 +641,7 @@ void A_Connect(faddr *t, char *Area, FILE *tmp)
|
||||
while ((fread(&mgroup, mgrouphdr.recsize, 1, gp)) == 1) {
|
||||
if ((mgroup.UseAka.zone == t->zone) && (mgroup.UseAka.net == t->net) && mgroup.UpLink.zone &&
|
||||
strlen(mgroup.AreaFile) && mgroup.Active && mgroup.UserChange) {
|
||||
if (CheckEchoGroup(Area, TRUE, t) == 0) {
|
||||
if (CheckEchoGroup(Area, mgroup.UpLink.zone, t) == 0) {
|
||||
MacroVars("SsP", "sss", CFG.sysop_name, nodes.Sysop,"Areamgr");
|
||||
MacroVars("RABCDE", "ssssss","ERR_CONN_FORWARD",Area,aka2str(mgroup.UpLink),"","","");
|
||||
MsgResult("areamgr.responses",tmp);
|
||||
|
@ -472,7 +472,7 @@ void F_Connect(faddr *t, char *Area, FILE *tmp)
|
||||
while ((fread(&fgroup, fgrouphdr.recsize, 1, gp)) == 1) {
|
||||
if ((fgroup.UseAka.zone == t->zone) && (fgroup.UseAka.net == t->net) && fgroup.UpLink.zone &&
|
||||
strlen(fgroup.AreaFile) && fgroup.Active && fgroup.UserChange) {
|
||||
if (CheckTicGroup(Area, TRUE, t) == 0) {
|
||||
if (CheckTicGroup(Area, fgroup.UpLink.zone, t) == 0) {
|
||||
MacroVars("SsP", "sss", CFG.sysop_name, nodes.Sysop,"Filemgr");
|
||||
MacroVars("RABCDE", "ssssss","ERR_CONN_FORWARD",Area,aka2str(fgroup.UpLink),"","","");
|
||||
MsgResult("filemgr.responses",tmp);
|
||||
|
@ -686,10 +686,14 @@ int Areas(void)
|
||||
/*
|
||||
* Sent one uplink command with additions and deletions
|
||||
*/
|
||||
if (UplinkRequest(fido2faddr(mgroup.UpLink), FALSE, cmd)) {
|
||||
WriteError("Uplink request failed");
|
||||
if (mgroup.UpLink.zone) {
|
||||
if (UplinkRequest(fido2faddr(mgroup.UpLink), FALSE, cmd)) {
|
||||
WriteError("Uplink request failed");
|
||||
} else {
|
||||
Syslog('+', "AreaMgr request sent to %s", aka2str(mgroup.UpLink));
|
||||
}
|
||||
} else {
|
||||
Syslog('+', "AreaMgr request sent to %s", aka2str(mgroup.UpLink));
|
||||
Syslog('+', "No uplink defined, not sending a AreaMgr request");
|
||||
}
|
||||
free(cmd);
|
||||
cmd = NULL;
|
||||
@ -936,10 +940,14 @@ int Areas(void)
|
||||
/*
|
||||
* Sent one uplink command with additions and deletions
|
||||
*/
|
||||
if (UplinkRequest(fido2faddr(fgroup.UpLink), TRUE, cmd)) {
|
||||
WriteError("Uplink request failed");
|
||||
if (fgroup.UpLink.zone) {
|
||||
if (UplinkRequest(fido2faddr(fgroup.UpLink), TRUE, cmd)) {
|
||||
WriteError("Uplink request failed");
|
||||
} else {
|
||||
Syslog('+', "AreaMgr request sent to %s", aka2str(fgroup.UpLink));
|
||||
}
|
||||
} else {
|
||||
Syslog('+', "AreaMgr request sent to %s", aka2str(fgroup.UpLink));
|
||||
Syslog('+', "No uplink defined, not sending a FileMgr request");
|
||||
}
|
||||
free(cmd);
|
||||
cmd = NULL;
|
||||
|
@ -451,7 +451,12 @@ int EditFGrpRec(int Area)
|
||||
case 17:E_INT( 13,46, fgroup.AddProm, "The ^Promillage^ to add or substract of the filecost")
|
||||
case 18:E_BOOL(14,46, fgroup.DivideCost, "^Divide^ the cost over all downlinks or charge each link full cost")
|
||||
case 19:E_BOOL(15,46, fgroup.AutoChange, "^Automatic change areas^ when a new arealist is received")
|
||||
case 20:E_BOOL(16,46, fgroup.UserChange, "Create new areas when ^users^ request new tic areas")
|
||||
case 20:tmp = edit_bool(16,46, fgroup.UserChange, (char *)"Create new areas when ^users^ request new tic areas");
|
||||
if (tmp && !fgroup.UpLink.zone)
|
||||
errmsg("It looks like you are at the toplevel, no Uplink defined");
|
||||
else
|
||||
fgroup.UserChange = tmp;
|
||||
break;
|
||||
case 21:E_BOOL(17,46, fgroup.Replace, "Set ^Replace^ in new created tic areas")
|
||||
case 22:E_BOOL(18,46, fgroup.DupCheck, "Set ^Dupe check^ in new created tic areas")
|
||||
case 23:E_BOOL(19,46, fgroup.Secure, "Set ^Secure^ tic processing in new created tic areas")
|
||||
|
@ -394,7 +394,12 @@ int EditMGrpRec(int Area)
|
||||
break;
|
||||
E_BOOL(13,57, mgroup.Deleted, "Is this group ^Deleted^")
|
||||
case 14:E_BOOL(14,57, mgroup.AutoChange, "^Auto change^ areas from new areas lists")
|
||||
case 15:E_BOOL(15,57, mgroup.UserChange, "^Auto add/delete^ areas from downlinks requests")
|
||||
case 15:tmp = edit_bool(15,57, mgroup.UserChange, (char *)"^Auto add/delete^ areas from downlinks requests");
|
||||
if (tmp && !mgroup.UpLink.zone)
|
||||
errmsg("It looks like you are the toplevel, no Uplink defined");
|
||||
else
|
||||
mgroup.UserChange = tmp;
|
||||
break;
|
||||
case 16:tmp = PickAka((char *)"9.1.16", TRUE);
|
||||
if (tmp != -1)
|
||||
memcpy(&mgroup.UseAka, &CFG.aka[tmp], sizeof(fidoaddr));
|
||||
|
Reference in New Issue
Block a user