Added security editing, some bugfixes and bumped version number

This commit is contained in:
Michiel Broek 2002-09-29 20:08:32 +00:00
parent 3acdbd8239
commit b4b6e15cb7
16 changed files with 1258 additions and 1072 deletions

View File

@ -5,10 +5,44 @@ WARNING: Extra debug logging enabled for checking internet news dupes.
Since 28-08-2002 mbfido news produces real big logs!! Since 28-08-2002 mbfido news produces real big logs!!
Extra debug logging will be removed around 14 Oct 2002. Extra debug logging will be removed around 14 Oct 2002.
NOTE: Areas security editing is present but doesn't do anything yet.
Work in progress!
MBSEBBS History. MBSEBBS History.
v0.35.03 06-Jul-2002
v0.35.04 29-Sep-2002
general:
upgrade:
Start mbsetup, enter global configuration and exit and save.
This will set defaults for area-/filemgr logging and security.
The noderecords are updated with new security flags.
The filegroups, ticgroups, tic areas and message areas are
updated with default security flags.
clcomm.a:
Added Mgrlog function, logs default to manager.log. Does also
log to Syslog with level '+'.
mbfido:
Area- and FileMgr requests are now also logged in manager.log
Auto created and removed areas are also logged in manager.log
Auto created area now get the link security from the group.
With message areas auto update it should now only delete
missing echomail areas.
mbsetup:
Added setup for the nodes record for security flags.
Added setup for the ticgroups default security flags.
Added setup for the mailgroups default security flags.
Added setup for the tic areas security flags.
Added setup for the message areas security flags.
Menu 14, edit files database had the wrong selection prompt.
v0.35.03 06-Jul-2002 - 29-Sep-2002
general: general:
Now compiles and installs on HP-PARISC hardware, tested with Now compiles and installs on HP-PARISC hardware, tested with
@ -18,18 +52,13 @@ v0.35.03 06-Jul-2002
After installation restart mbtask. After installation restart mbtask.
Start mbsetup, enter global configuration and exit and save. Start mbsetup, enter global configuration and exit and save.
This will setup the new outbound queue path, default is This will setup the new outbound queue path, default is
/opt/mbse/var/queue. This will also set defaults for area- /opt/mbse/var/queue.
filemgr logging and security.
common.a: common.a:
Added nodelist override to the nodelist lookup function. Added nodelist override to the nodelist lookup function.
Added protection against emty rfc headers with only a space. Added protection against emty rfc headers with only a space.
Added test for HA archiver. Added test for HA archiver.
clcomm.a:
Added Mgrlog function, logs default to manager.log. Does also
log to Syslog with level '+'.
mbinet.a: mbinet.a:
If during a connect a newsserver refuses the connection then If during a connect a newsserver refuses the connection then
don't close our side of the connection. This is a temporary don't close our side of the connection. This is a temporary
@ -76,8 +105,6 @@ v0.35.03 06-Jul-2002
made, this must prevent destroying a another lock. made, this must prevent destroying a another lock.
Added extra check to unlock directory function to check that Added extra check to unlock directory function to check that
only the owned lock is removed. only the owned lock is removed.
Area- and FileMgr requests are now also logged in manager.log
Auto created and removed areas are also logged in manager.log
newuser: newuser:
Check for Unix accounts is now case sensitive. Check for Unix accounts is now case sensitive.
@ -125,7 +152,6 @@ v0.35.03 06-Jul-2002
Added setup setting for outbound queue in global setup. Added setup setting for outbound queue in global setup.
Added support for default setup of the HA archiver. Added support for default setup of the HA archiver.
Changed Rubout key to do the same as Backspace. (experimental) Changed Rubout key to do the same as Backspace. (experimental)
Added setup to the nodes record for security flags.
mbmon: mbmon:
Changed Rubout key to do the same as Backspace. (experimental) Changed Rubout key to do the same as Backspace. (experimental)

6
TODO
View File

@ -1,6 +1,6 @@
$Id$ $Id$
MBSE BBS V0.35.03 TODO list. MBSE BBS V0.35.04 TODO list.
---------------------------- ----------------------------
These are a list of things that must be implemented one way or These are a list of things that must be implemented one way or
@ -138,8 +138,6 @@ mbsetup:
N: Add switch for file area to skip checking and indexing. N: Add switch for file area to skip checking and indexing.
N: Add logging info about added/removed areas.
L: Generate crossreference document: L: Generate crossreference document:
File Areas <=> BBS groups File Areas <=> BBS groups
File Areas <=> Newfiles groups File Areas <=> Newfiles groups
@ -160,8 +158,6 @@ mbsetup:
Fileecho groups <=> Newfile reports Fileecho groups <=> Newfile reports
Fileecho groups <=> BBS Areas Fileecho groups <=> BBS Areas
N: Add areas security flags.
N: Add backspace test and store result in global setup. N: Add backspace test and store result in global setup.
Note: experimental patch to test Rubout key as backspace. Note: experimental patch to test Rubout key as backspace.

2
configure vendored
View File

@ -1196,7 +1196,7 @@ SUBDIRS="lib mbcico mbfido mbmon mbsebbs mbtask mbsetup unix lang examples html
PACKAGE="mbsebbs" PACKAGE="mbsebbs"
VERSION="0.35.03" VERSION="0.35.04"
COPYRIGHT="Copyright (C) 1997-2002 Michiel Broek, All Rights Reserved" COPYRIGHT="Copyright (C) 1997-2002 Michiel Broek, All Rights Reserved"
SHORTRIGHT="Copyright (C) 1997-2002 M. Broek" SHORTRIGHT="Copyright (C) 1997-2002 M. Broek"
GROUP="bbs" GROUP="bbs"

View File

@ -9,7 +9,7 @@ AC_SUBST(SUBDIRS)
dnl General settings for MBSE BBS dnl General settings for MBSE BBS
dnl After changeing the version number, run autoconf! dnl After changeing the version number, run autoconf!
PACKAGE="mbsebbs" PACKAGE="mbsebbs"
VERSION="0.35.03" VERSION="0.35.04"
COPYRIGHT="Copyright (C) 1997-2002 Michiel Broek, All Rights Reserved" COPYRIGHT="Copyright (C) 1997-2002 Michiel Broek, All Rights Reserved"
SHORTRIGHT="Copyright (C) 1997-2002 M. Broek" SHORTRIGHT="Copyright (C) 1997-2002 M. Broek"
GROUP="bbs" GROUP="bbs"

View File

@ -919,6 +919,7 @@ struct msgareas {
int Rfccode; /* RFC characterset */ int Rfccode; /* RFC characterset */
int Ftncode; /* FTN characterset */ int Ftncode; /* FTN characterset */
int MaxArticles; /* Max. newsarticles to get */ int MaxArticles; /* Max. newsarticles to get */
securityrec LinkSec; /* Link security flags */
}; };
@ -1160,6 +1161,7 @@ struct _tic {
unsigned Deleted : 1; /* If this area is deleted */ unsigned Deleted : 1; /* If this area is deleted */
statcnt Files; /* Total processed files */ statcnt Files; /* Total processed files */
statcnt KBytes; /* Total processed KBytes */ statcnt KBytes; /* Total processed KBytes */
securityrec LinkSec; /* Link security flags */
}; };
@ -1350,6 +1352,7 @@ struct _fgroup {
char BbsGroup[13]; /* BBS Group */ char BbsGroup[13]; /* BBS Group */
char AnnGroup[13]; /* BBS Announce Group */ char AnnGroup[13]; /* BBS Announce Group */
unsigned Upload; /* Upload area */ unsigned Upload; /* Upload area */
securityrec LinkSec; /* Default link security */
}; };
@ -1391,6 +1394,7 @@ struct _mgroup {
unsigned xRes7 : 1; unsigned xRes7 : 1;
unsigned xRes8 : 1; unsigned xRes8 : 1;
unsigned StartArea; /* Start at area number */ unsigned StartArea; /* Start at area number */
securityrec LinkSec; /* Default link security */
}; };

View File

@ -365,6 +365,9 @@ int CheckTicGroup(char *Area, int SendUplink, faddr *f)
tic.ConvertAll = fgroup.ConvertAll; tic.ConvertAll = fgroup.ConvertAll;
tic.SendOrg = fgroup.SendOrg; tic.SendOrg = fgroup.SendOrg;
tic.Active = TRUE; tic.Active = TRUE;
tic.LinkSec.level = fgroup.LinkSec.level;
tic.LinkSec.flags = fgroup.LinkSec.flags;
tic.LinkSec.notflags = fgroup.LinkSec.notflags;
fwrite(&tic, sizeof(tic), 1, mp); fwrite(&tic, sizeof(tic), 1, mp);
memset(&System, 0, sizeof(System)); memset(&System, 0, sizeof(System));

View File

@ -231,6 +231,7 @@ int CheckEchoGroup(char *Area, int SendUplink, faddr *f)
msgs.RDSec = mgroup.RDSec; msgs.RDSec = mgroup.RDSec;
msgs.WRSec = mgroup.WRSec; msgs.WRSec = mgroup.WRSec;
msgs.SYSec = mgroup.SYSec; msgs.SYSec = mgroup.SYSec;
msgs.LinkSec = mgroup.LinkSec;
strncpy(msgs.Group, mgroup.Name, 12); strncpy(msgs.Group, mgroup.Name, 12);
msgs.Aka = mgroup.UseAka; msgs.Aka = mgroup.UseAka;
strncpy(msgs.Origin, CFG.origin, 50); strncpy(msgs.Origin, CFG.origin, 50);

View File

@ -584,7 +584,7 @@ int Areas(void)
} }
fseek(fp, msgshdr.hdrsize, SEEK_SET); fseek(fp, msgshdr.hdrsize, SEEK_SET);
while (fread(&msgs, msgshdr.recsize, 1, fp) == 1) { while (fread(&msgs, msgshdr.recsize, 1, fp) == 1) {
if (msgs.Active && !strcmp(msgs.Group, mgroup.Name)) { if (msgs.Active && !strcmp(msgs.Group, mgroup.Name) && (msgs.Type == ECHOMAIL)) {
Found = FALSE; Found = FALSE;
for (tmp = alist; tmp; tmp = tmp->next) { for (tmp = alist; tmp; tmp = tmp->next) {
if (!strcmp(msgs.Tag, tmp->Name)) if (!strcmp(msgs.Tag, tmp->Name))

View File

@ -1186,6 +1186,9 @@ char *getflag(unsigned long flag, unsigned long not)
/*
* Show bbs security
*/
void show_sec(int y, int x, securityrec sec) void show_sec(int y, int x, securityrec sec)
{ {
show_int(y, x, sec.level); show_int(y, x, sec.level);
@ -1194,6 +1197,9 @@ void show_sec(int y, int x, securityrec sec)
/*
* Edit bbs security for users access
*/
securityrec edit_sec(int y, int x, securityrec sec, char *shdr) securityrec edit_sec(int y, int x, securityrec sec, char *shdr)
{ {
int c, i, xx, yy, s; int c, i, xx, yy, s;
@ -1274,6 +1280,9 @@ securityrec edit_sec(int y, int x, securityrec sec, char *shdr)
/*
* Edit security for bbs users.
*/
securityrec edit_usec(int y, int x, securityrec sec, char *shdr) securityrec edit_usec(int y, int x, securityrec sec, char *shdr)
{ {
int c, i, xx, yy, s; int c, i, xx, yy, s;
@ -1349,6 +1358,9 @@ securityrec edit_usec(int y, int x, securityrec sec, char *shdr)
/*
* Edit securityflags for filegroups, mailgroups, tic areas and mail areas.
*/
securityrec edit_asec(securityrec sec, char *shdr) securityrec edit_asec(securityrec sec, char *shdr)
{ {
int c, i, xx, yy, s; int c, i, xx, yy, s;
@ -1423,6 +1435,78 @@ securityrec edit_asec(securityrec sec, char *shdr)
/*
* Edit security flags for nodes.
*/
securityrec edit_nsec(securityrec sec, char *shdr)
{
int c, i, xx, yy, s;
clr_index();
set_color(WHITE, BLACK);
mvprintw(4,3,shdr);
set_color(CYAN, BLACK);
xx = 3;
yy = 6;
for (i = 0; i < 32; i++) {
if (i == 11) {
xx = 28;
yy = 6;
}
if (i == 22) {
xx = 53;
yy = 6;
}
set_color(CYAN,BLACK);
mvprintw(yy, xx, (char *)"%2d. %-16s", i+1, CFG.aname[i]);
yy++;
}
for (;;) {
set_color(WHITE, BLACK);
xx = 24;
yy = 6;
for (i = 0; i < 32; i++) {
if (i == 11) {
xx = 49;
yy = 6;
}
if (i == 22) {
xx = 74;
yy = 6;
}
c = '-';
if ((sec.flags >> i) & 1)
c = 'X';
if ((sec.notflags >> i) & 1)
c = 'O';
/*
* The next one may never show up
*/
if (((sec.flags >> i) & 1) && ((sec.notflags >> i) & 1))
c = '!';
mvprintw(yy,xx,(char *)"%c", c);
yy++;
}
s = select_menu(32);
switch(s) {
case 0: return sec;
default: if ((sec.flags >> (s - 1)) & 1) {
sec.flags = (sec.flags ^ (1 << (s - 1)));
break;
}
sec.flags = (sec.flags | (1 << (s - 1)));
break;
}
}
}
char *get_secstr(securityrec S) char *get_secstr(securityrec S)
{ {
static char temp[45]; static char temp[45];

View File

@ -35,6 +35,7 @@ void show_sec(int, int, securityrec);
securityrec edit_sec(int, int, securityrec, char *); securityrec edit_sec(int, int, securityrec, char *);
securityrec edit_usec(int, int, securityrec, char *); securityrec edit_usec(int, int, securityrec, char *);
securityrec edit_asec(securityrec, char *); securityrec edit_asec(securityrec, char *);
securityrec edit_nsec(securityrec, char *);
char *get_secstr(securityrec); char *get_secstr(securityrec);
void show_int(int, int, int); void show_int(int, int, int);
int edit_int(int, int, int, char *); int edit_int(int, int, int, char *);

View File

@ -331,7 +331,7 @@ void EditFDB()
} }
} }
working(0, 0, 0); working(0, 0, 0);
strcpy(pick, select_record(records, 20)); strcpy(pick, select_pick(records, 20));
if (strncmp(pick, "-", 1) == 0) { if (strncmp(pick, "-", 1) == 0) {
return; return;

View File

@ -139,7 +139,7 @@ int OpenFGroup(void)
/* /*
* Now set defaults * Now set defaults
*/ */
if (FGrpUpdated) { if (FGrpUpdated && !strlen(fgroup.BasePath)) {
fgroup.DupCheck = TRUE; fgroup.DupCheck = TRUE;
fgroup.Secure = TRUE; fgroup.Secure = TRUE;
fgroup.VirScan = TRUE; fgroup.VirScan = TRUE;
@ -150,7 +150,10 @@ int OpenFGroup(void)
strcpy(temp, fgroup.Name); strcpy(temp, fgroup.Name);
sprintf(fgroup.BasePath, "%s/ftp/pub/%s", getenv("MBSE_ROOT"), tl(temp)); sprintf(fgroup.BasePath, "%s/ftp/pub/%s", getenv("MBSE_ROOT"), tl(temp));
} }
if (FGrpUpdated && !fgroup.LinkSec.level) {
fgroup.LinkSec.level = 1;
fgroup.LinkSec.flags = 1;
}
fwrite(&fgroup, sizeof(fgroup), 1, fout); fwrite(&fgroup, sizeof(fgroup), 1, fout);
memset(&fgroup, 0, sizeof(fgroup)); memset(&fgroup, 0, sizeof(fgroup));
} }
@ -228,6 +231,8 @@ int AppendFGroup(void)
fgroup.FileId = TRUE; fgroup.FileId = TRUE;
fgroup.DupCheck = TRUE; fgroup.DupCheck = TRUE;
fgroup.Replace = TRUE; fgroup.Replace = TRUE;
fgroup.LinkSec.level = 1;
fgroup.LinkSec.flags = 1;
fwrite(&fgroup, sizeof(fgroup), 1, fil); fwrite(&fgroup, sizeof(fgroup), 1, fil);
fclose(fil); fclose(fil);
FGrpUpdated = 1; FGrpUpdated = 1;
@ -301,6 +306,7 @@ void FgScreen(void)
mvprintw(17,56, "32. UP sec"); mvprintw(17,56, "32. UP sec");
mvprintw(18,56, "33. LT sec"); mvprintw(18,56, "33. LT sec");
mvprintw(19,56, "34. Upl. area"); mvprintw(19,56, "34. Upl. area");
mvprintw(20,56, "35. Link sec");
} }
@ -378,7 +384,7 @@ int EditFGrpRec(int Area)
show_int( 18,70, fgroup.LTSec.level); show_int( 18,70, fgroup.LTSec.level);
show_int( 19,70, fgroup.Upload); show_int( 19,70, fgroup.Upload);
j = select_menu(34); j = select_menu(35);
switch(j) { switch(j) {
case 0: if (!fgroup.StartArea && strlen(fgroup.AreaFile)) { case 0: if (!fgroup.StartArea && strlen(fgroup.AreaFile)) {
errmsg("Areas file defined but no BBS start area"); errmsg("Areas file defined but no BBS start area");
@ -482,6 +488,9 @@ int EditFGrpRec(int Area)
case 32:E_SEC( 17,70, fgroup.UPSec, "10.1.32 FILE GROUP UPLOAD SECURITY", FgScreen) case 32:E_SEC( 17,70, fgroup.UPSec, "10.1.32 FILE GROUP UPLOAD SECURITY", FgScreen)
case 33:E_SEC( 18,70, fgroup.LTSec, "10.1.33 FILE GROUP LIST SECURITY", FgScreen) case 33:E_SEC( 18,70, fgroup.LTSec, "10.1.33 FILE GROUP LIST SECURITY", FgScreen)
case 34:E_INT( 19,70, fgroup.Upload, "Set the default ^Upload area^ in new created file areas") case 34:E_INT( 19,70, fgroup.Upload, "Set the default ^Upload area^ in new created file areas")
case 35:fgroup.LinkSec = edit_asec(fgroup.LinkSec, (char *)"10.1.35 DEFAULT NEW TIC AREAS SECURITY");
FgScreen();
break;
} }
} }
@ -750,6 +759,7 @@ int tic_group_doc(FILE *fp, FILE *toc, int page)
fprintf(fp, " Download sec. %s\n", get_secstr(fgroup.DLSec)); fprintf(fp, " Download sec. %s\n", get_secstr(fgroup.DLSec));
fprintf(fp, " Upload sec. %s\n", get_secstr(fgroup.UPSec)); fprintf(fp, " Upload sec. %s\n", get_secstr(fgroup.UPSec));
fprintf(fp, " List security %s\n", get_secstr(fgroup.LTSec)); fprintf(fp, " List security %s\n", get_secstr(fgroup.LTSec));
fprintf(fp, " Def. tic sec. %s\n", getflag(fgroup.LinkSec.flags, fgroup.LinkSec.notflags));
fprintf(fp, " BBS group %s\n", fgroup.BbsGroup); fprintf(fp, " BBS group %s\n", fgroup.BbsGroup);
fprintf(fp, " Announce group %s\n", fgroup.AnnGroup); fprintf(fp, " Announce group %s\n", fgroup.AnnGroup);
fprintf(fp, " Upload area %d\n", fgroup.Upload); fprintf(fp, " Upload area %d\n", fgroup.Upload);

File diff suppressed because it is too large Load Diff

View File

@ -156,6 +156,10 @@ int OpenMGroup(void)
} }
sprintf(mgroup.BasePath, "%s/var/mail/%s", getenv("MBSE_ROOT"), temp); sprintf(mgroup.BasePath, "%s/var/mail/%s", getenv("MBSE_ROOT"), temp);
} }
if (MGrpUpdated && !mgroup.LinkSec.level) {
mgroup.LinkSec.level = 1;
mgroup.LinkSec.flags = 1;
}
fwrite(&mgroup, sizeof(mgroup), 1, fout); fwrite(&mgroup, sizeof(mgroup), 1, fout);
memset(&mgroup, 0, sizeof(mgroup)); memset(&mgroup, 0, sizeof(mgroup));
} }
@ -225,6 +229,8 @@ int AppendMGroup(void)
if ((fil = fopen(ffile, "a")) != NULL) { if ((fil = fopen(ffile, "a")) != NULL) {
memset(&mgroup, 0, sizeof(mgroup)); memset(&mgroup, 0, sizeof(mgroup));
mgroup.StartDate = time(NULL); mgroup.StartDate = time(NULL);
mgroup.LinkSec.level = 1;
mgroup.LinkSec.flags = 1;
fwrite(&mgroup, sizeof(mgroup), 1, fil); fwrite(&mgroup, sizeof(mgroup), 1, fil);
fclose(fil); fclose(fil);
MGrpUpdated = 1; MGrpUpdated = 1;
@ -247,19 +253,20 @@ void MgScreen(void)
mvprintw(10, 2, "4. Read sec"); mvprintw(10, 2, "4. Read sec");
mvprintw(11, 2, "5. Write sec"); mvprintw(11, 2, "5. Write sec");
mvprintw(12, 2, "6. Sysop sec"); mvprintw(12, 2, "6. Sysop sec");
mvprintw(13, 2, "7. Start at"); mvprintw(13, 2, "7. Link sec");
mvprintw(14, 2, "8. Net reply"); mvprintw(14, 2, "8. Start at");
mvprintw(15, 2, "9. Users del"); mvprintw(15, 2, "9. Net reply");
mvprintw(16, 2, "10. Aliases"); mvprintw(16, 2, "10. Users del");
mvprintw(17, 2, "11. Quotes"); mvprintw(17, 2, "11. Aliases");
mvprintw(18, 2, "12. Active"); mvprintw(18, 2, "12. Quotes");
mvprintw(19, 2, "13. Active");
mvprintw(13,41, "13. Deleted"); mvprintw(14,41, "14. Deleted");
mvprintw(14,41, "14. Auto change"); mvprintw(15,41, "15. Auto change");
mvprintw(15,41, "15. User change"); mvprintw(16,41, "16. User change");
mvprintw(16,41, "16. Use Aka"); mvprintw(17,41, "17. Use Aka");
mvprintw(17,41, "17. Uplink"); mvprintw(18,41, "18. Uplink");
mvprintw(18,41, "18. Areas"); mvprintw(19,41, "19. Areas");
} }
@ -324,24 +331,25 @@ int EditMGrpRec(int Area)
show_str( 7,16,12, mgroup.Name); show_str( 7,16,12, mgroup.Name);
show_str( 8,16,55, mgroup.Comment); show_str( 8,16,55, mgroup.Comment);
show_str( 9,16,64, mgroup.BasePath); show_str( 9,16,64, mgroup.BasePath);
show_int( 10,16, mgroup.RDSec.level); show_sec( 10,16, mgroup.RDSec);
show_int( 11,16, mgroup.WRSec.level); show_sec( 11,16, mgroup.WRSec);
show_int( 12,16, mgroup.SYSec.level); show_sec( 12,16, mgroup.SYSec);
show_int( 13,16, mgroup.StartArea); mvprintw( 13,22, getflag(mgroup.LinkSec.flags, mgroup.LinkSec.notflags));
show_int( 14,16, mgroup.NetReply); show_int( 14,16, mgroup.StartArea);
show_bool(15,16, mgroup.UsrDelete); show_int( 15,16, mgroup.NetReply);
show_bool(16,16, mgroup.Aliases); show_bool(16,16, mgroup.UsrDelete);
show_bool(17,16, mgroup.Quotes); show_bool(17,16, mgroup.Aliases);
show_bool(18,16, mgroup.Active); show_bool(18,16, mgroup.Quotes);
show_bool(19,16, mgroup.Active);
show_bool(13,57, mgroup.Deleted); show_bool(14,57, mgroup.Deleted);
show_bool(14,57, mgroup.AutoChange); show_bool(15,57, mgroup.AutoChange);
show_bool(15,57, mgroup.UserChange); show_bool(16,57, mgroup.UserChange);
show_aka( 16,57, mgroup.UseAka); show_aka( 17,57, mgroup.UseAka);
show_aka( 17,57, mgroup.UpLink); show_aka( 18,57, mgroup.UpLink);
show_str( 18,57,12, mgroup.AreaFile); show_str( 19,57,12, mgroup.AreaFile);
j = select_menu(18); j = select_menu(19);
switch(j) { switch(j) {
case 0: if (!mgroup.StartArea && strlen(mgroup.AreaFile)) { case 0: if (!mgroup.StartArea && strlen(mgroup.AreaFile)) {
errmsg("Areas file defined but no BBS start area"); errmsg("Areas file defined but no BBS start area");
@ -387,33 +395,36 @@ int EditMGrpRec(int Area)
case 4: E_SEC( 10,16, mgroup.RDSec, "9.1.4 MESSAGE GROUP READ SECURITY", MgScreen) case 4: E_SEC( 10,16, mgroup.RDSec, "9.1.4 MESSAGE GROUP READ SECURITY", MgScreen)
case 5: E_SEC( 11,16, mgroup.WRSec, "9.1.5 MESSAGE GROUP WRITE SECURITY", MgScreen) case 5: E_SEC( 11,16, mgroup.WRSec, "9.1.5 MESSAGE GROUP WRITE SECURITY", MgScreen)
case 6: E_SEC( 12,16, mgroup.SYSec, "9.1.6 MESSAGE GROUP SYSOP SECURITY", MgScreen) case 6: E_SEC( 12,16, mgroup.SYSec, "9.1.6 MESSAGE GROUP SYSOP SECURITY", MgScreen)
case 7: E_INT( 13,16, mgroup.StartArea, "The ^Start area number^ from where to add areas") case 7: mgroup.LinkSec = edit_asec(mgroup.LinkSec, (char *)"9.1.7 DEFAULT SECURITY FOR NEW AREAS");
case 8: E_INT( 14,16, mgroup.NetReply, "The ^Area Number^ for netmail replies") MgScreen();
case 9: E_BOOL(15,16, mgroup.UsrDelete, "Allow users to ^Delete^ their messages") break;
case 10:E_BOOL(16,16, mgroup.Aliases, "Allow ^Aliases^ or real names only") case 8: E_INT( 14,16, mgroup.StartArea, "The ^Start area number^ from where to add areas")
case 11:E_BOOL(17,16, mgroup.Quotes, "Allow random ^quotes^ to new messages") case 9: E_INT( 15,16, mgroup.NetReply, "The ^Area Number^ for netmail replies")
case 12:if (CheckMgroup()) case 10:E_BOOL(16,16, mgroup.UsrDelete, "Allow users to ^Delete^ their messages")
break; case 11:E_BOOL(17,16, mgroup.Aliases, "Allow ^Aliases^ or real names only")
E_BOOL(18,16, mgroup.Active, "Is this message group ^active^") case 12:E_BOOL(18,16, mgroup.Quotes, "Allow random ^quotes^ to new messages")
case 13:if (CheckMgroup()) case 13:if (CheckMgroup())
break; break;
E_BOOL(13,57, mgroup.Deleted, "Is this group ^Deleted^") E_BOOL(19,16, mgroup.Active, "Is this message group ^active^")
case 14:E_BOOL(14,57, mgroup.AutoChange, "^Auto change^ areas from new areas lists") case 14:if (CheckMgroup())
case 15:tmp = edit_bool(15,57, mgroup.UserChange, (char *)"^Auto add/delete^ areas from downlinks requests"); break;
E_BOOL(14,57, mgroup.Deleted, "Is this group ^Deleted^")
case 15:E_BOOL(15,57, mgroup.AutoChange, "^Auto change^ areas from new areas lists")
case 16:tmp = edit_bool(16,57, mgroup.UserChange, (char *)"^Auto add/delete^ areas from downlinks requests");
if (tmp && !mgroup.UpLink.zone) if (tmp && !mgroup.UpLink.zone)
errmsg("It looks like you are the toplevel, no Uplink defined"); errmsg("It looks like you are the toplevel, no Uplink defined");
else else
mgroup.UserChange = tmp; mgroup.UserChange = tmp;
break; break;
case 16:tmp = PickAka((char *)"9.1.16", TRUE); case 17:tmp = PickAka((char *)"9.1.17", TRUE);
if (tmp != -1) if (tmp != -1)
memcpy(&mgroup.UseAka, &CFG.aka[tmp], sizeof(fidoaddr)); memcpy(&mgroup.UseAka, &CFG.aka[tmp], sizeof(fidoaddr));
MgScreen(); MgScreen();
break; break;
case 17:mgroup.UpLink = PullUplink((char *)"9.1.17"); case 18:mgroup.UpLink = PullUplink((char *)"9.1.18");
MgScreen(); MgScreen();
break; break;
case 18:E_STR( 18,57,12, mgroup.AreaFile, "The name of the ^Areas File^ from the uplink") case 19:E_STR( 19,57,12, mgroup.AreaFile, "The name of the ^Areas File^ from the uplink")
} }
} }
@ -660,6 +671,7 @@ int mail_group_doc(FILE *fp, FILE *toc, int page)
fprintf(fp, " Read security %s\n", get_secstr(mgroup.RDSec)); fprintf(fp, " Read security %s\n", get_secstr(mgroup.RDSec));
fprintf(fp, " Write security %s\n", get_secstr(mgroup.WRSec)); fprintf(fp, " Write security %s\n", get_secstr(mgroup.WRSec));
fprintf(fp, " Sysop security %s\n", get_secstr(mgroup.SYSec)); fprintf(fp, " Sysop security %s\n", get_secstr(mgroup.SYSec));
fprintf(fp, " Def. link security %s\n", getflag(mgroup.LinkSec.flags, mgroup.LinkSec.notflags));
fprintf(fp, " Use aliases %s\n", getboolean(mgroup.Aliases)); fprintf(fp, " Use aliases %s\n", getboolean(mgroup.Aliases));
fprintf(fp, " Add quotes %s\n", getboolean(mgroup.Quotes)); fprintf(fp, " Add quotes %s\n", getboolean(mgroup.Quotes));
fprintf(fp, " Auto add/del areas %s\n", getboolean(mgroup.AutoChange)); fprintf(fp, " Auto add/del areas %s\n", getboolean(mgroup.AutoChange));

View File

@ -1169,7 +1169,7 @@ int EditNodeRec(int Area)
break; break;
case 8: DirectoryEdit(); case 8: DirectoryEdit();
break; break;
case 9: nodes.Security = edit_asec(nodes.Security, (char *)"7.9 SECURITY FLAGS"); case 9: nodes.Security = edit_nsec(nodes.Security, (char *)"7.9 NODE SECURITY FLAGS");
break; break;
case 10:S_Stat(); case 10:S_Stat();
break; break;

View File

@ -147,6 +147,10 @@ int OpenTicarea(void)
*/ */
memset(&tic, 0, sizeof(tic)); memset(&tic, 0, sizeof(tic));
while (fread(&tic, oldsize, 1, fin) == 1) { while (fread(&tic, oldsize, 1, fin) == 1) {
if (TicUpdated && !tic.LinkSec.level) {
tic.LinkSec.level = 1;
tic.LinkSec.flags = 1;
}
fwrite(&tic, sizeof(tic), 1, fout); fwrite(&tic, sizeof(tic), 1, fout);
memset(&tic, 0, sizeof(tic)); memset(&tic, 0, sizeof(tic));
/* /*
@ -256,6 +260,8 @@ int AppendTicarea(void)
tic.FileId = TRUE; tic.FileId = TRUE;
tic.Active = TRUE; tic.Active = TRUE;
tic.AreaStart = time(NULL); tic.AreaStart = time(NULL);
tic.LinkSec.level = 1;
tic.LinkSec.flags = 1;
fwrite(&tic, sizeof(tic), 1, fil); fwrite(&tic, sizeof(tic), 1, fil);
memset(&syscon, 0, sizeof(syscon)); memset(&syscon, 0, sizeof(syscon));
for (i = 1; i <= CFG.tic_systems; i++) for (i = 1; i <= CFG.tic_systems; i++)
@ -406,37 +412,39 @@ int EditTicConnections(FILE *fil)
void SetTicScreen(void); void SetTicScreen(void);
void SetTicScreen(void) void SetTicScreen(void)
{ {
clr_index(); clr_index();
set_color(WHITE, BLACK); set_color(WHITE, BLACK);
mvprintw( 4, 2, "10.2 EDIT TIC AREA"); mvprintw( 4, 2, "10.2 EDIT TIC AREA");
set_color(CYAN, BLACK); set_color(CYAN, BLACK);
mvprintw( 6, 2, "1. Comment");
mvprintw( 7, 2, "2. Area tag");
mvprintw( 8, 2, "3. BBS area");
mvprintw( 9, 2, "4. Message");
mvprintw(10, 2, "5. Group");
mvprintw(11, 2, "6. Keep #");
mvprintw(12, 2, "7. Fido aka");
mvprintw(13, 2, "8. Convert");
mvprintw(14, 2, "9. Banner");
mvprintw(15, 2, "10. Replace");
mvprintw( 7,41, "11. Dupecheck"); mvprintw( 6, 2, "1. Comment");
mvprintw( 8,41, "12. Secure"); mvprintw( 7, 2, "2. Area tag");
mvprintw( 9,41, "13. Touch"); mvprintw( 8, 2, "3. Security");
mvprintw(10,41, "14. Virus sc."); mvprintw( 9, 2, "4. BBS area");
mvprintw(11,41, "15. Announce"); mvprintw(10, 2, "5. Message");
mvprintw(12,41, "16. Upd magic"); mvprintw(11, 2, "6. Group");
mvprintw(13,41, "17. File_id"); mvprintw(12, 2, "7. Keep #");
mvprintw(14,41, "18. Conv.all"); mvprintw(13, 2, "8. Fido aka");
mvprintw(15,41, "19. Send org."); mvprintw(14, 2, "9. Convert");
mvprintw(15, 2, "10. Banner");
mvprintw(16, 2, "11. Replace");
mvprintw( 7,63, "20. Mandatory"); mvprintw( 9,41, "12. Dupecheck");
mvprintw( 8,63, "21. Notified"); mvprintw(10,41, "13. Secure");
mvprintw( 9,63, "22. Upl discon"); mvprintw(11,41, "14. Touch");
mvprintw(10,63, "23. Deleted"); mvprintw(12,41, "15. Virus sc.");
mvprintw(11,63, "24. Active"); mvprintw(13,41, "16. Announce");
mvprintw(12,63, "25. Systems"); mvprintw(14,41, "17. Upd magic");
mvprintw(15,41, "18. File_id");
mvprintw(16,41, "19. Conv.all");
mvprintw( 9,63, "20. Send org.");
mvprintw(10,63, "21. Mandatory");
mvprintw(11,63, "22. Notified");
mvprintw(12,63, "23. Upl discon");
mvprintw(13,63, "24. Deleted");
mvprintw(14,63, "25. Active");
mvprintw(15,63, "26. Systems");
} }
@ -550,244 +558,256 @@ void ShowTicStatus(sysconnect S)
void TicGlobal(void); void TicGlobal(void);
void TicGlobal(void) void TicGlobal(void)
{ {
gr_list *mgr = NULL, *tmp; gr_list *mgr = NULL, *tmp;
char *p, tfile[PATH_MAX]; char *p, tfile[PATH_MAX];
FILE *fil; FILE *fil;
fidoaddr a1, a2; fidoaddr a1, a2;
int menu = 0, areanr, Areas, akan = 0, Found; int menu = 0, areanr, Areas, akan = 0, Found;
int Total, Done; int Total, Done;
long offset; long offset;
sysconnect S, Sc; sysconnect S, Sc;
securityrec as;
/* /*
* Build the groups select array * Build the groups select array
*/ */
working(1, 0, 0); working(1, 0, 0);
sprintf(tfile, "%s/etc/fgroups.data", getenv("MBSE_ROOT")); sprintf(tfile, "%s/etc/fgroups.data", getenv("MBSE_ROOT"));
if ((fil = fopen(tfile, "r")) != NULL) { if ((fil = fopen(tfile, "r")) != NULL) {
fread(&fgrouphdr, sizeof(fgrouphdr), 1, fil); fread(&fgrouphdr, sizeof(fgrouphdr), 1, fil);
while (fread(&fgroup, fgrouphdr.recsize, 1, fil) == 1) while (fread(&fgroup, fgrouphdr.recsize, 1, fil) == 1)
fill_grlist(&mgr, fgroup.Name); fill_grlist(&mgr, fgroup.Name);
fclose(fil); fclose(fil);
sort_grlist(&mgr); sort_grlist(&mgr);
}
working(0, 0, 0);
/*
* Initialize some variables
*/
memset(&S, 0, sizeof(sysconnect));
S.sendto = TRUE;
S.receivefrom = FALSE;
as.level = 1;
as.flags = 1;
as.notflags = 0;
for (;;) {
clr_index();
set_color(WHITE, BLACK);
mvprintw( 5, 6, "10.2 GLOBAL EDIT TIC AREAS");
set_color(CYAN, BLACK);
mvprintw( 7, 6, "1. Delete connection");
mvprintw( 8, 6, "2. Add new connection");
mvprintw( 9, 6, "3. Replace connection");
mvprintw(10, 6, "4. Change connection status");
mvprintw(11, 6, "5. Change aka to use");
mvprintw(12, 6, "6. Change security flags");
mvprintw(13, 6, "7. Delete TIC area");
memset(&a1, 0, sizeof(fidoaddr));
memset(&a2, 0, sizeof(fidoaddr));
menu = select_menu(7);
switch (menu) {
case 0: return;
case 1: a1 = PullUplink((char *)"AKA TO DELETE");
break;
case 2: a2 = PullUplink((char *)"AKA TO ADD");
break;
case 3: a1 = PullUplink((char *)"AKA TO REPLACE");
a2 = PullUplink((char *)"NEW AKA");
break;
case 4: S.aka = PullUplink((char *)"AKA TO CHANGE STATUS");
ShowTicStatus(S);
S.sendto = edit_bool(8,16,S.sendto, (char *)"^Send^ files to this node");
S.receivefrom = edit_bool(9,16,S.receivefrom, (char *)"^Receive^ files from this node");
S.pause = edit_bool(10,16,S.pause, (char *)"Is this node ^paused^");
break;
case 5: akan = PickAka((char *)"10.2.5", TRUE);
break;
case 6: as = edit_asec(as, (char *)"10.2.6 EDIT LINK SECURITY");
break;
} }
working(0, 0, 0);
E_Group(&mgr, (char *)"SELECT TIC GROUPS TO CHANGE");
/* /*
* Initialize some variables * Show settings before proceeding
*/ */
memset(&S, 0, sizeof(sysconnect)); switch (menu) {
S.sendto = TRUE; case 1: mvprintw(7, 6, "Delete aka %s", aka2str(a1));
S.receivefrom = FALSE; break;
case 2: mvprintw(7, 6, "Add aka %s", aka2str(a2));
break;
case 3: p = xstrcpy(aka2str(a1));
mvprintw(7, 6, "Replace aka %s with %s", p, aka2str(a2));
free(p);
break;
case 4: ShowTicStatus(S);
mvprintw(14, 6, "Change the link status");
case 5: if (akan != -1)
mvprintw( 7, 6, "Set %s as new aka to use", aka2str(CFG.aka[akan]));
break;
case 6: set_color(CYAN, BLACK);
mvprintw(7, 6, "Link security");
set_color(WHITE, BLACK);
mvprintw(7,21, getflag(as.flags, as.notflags));
break;
case 7: mvprintw(7, 6, "Delete TIC areas");
break;
}
for (;;) { if (yes_no((char *)"Perform changes")) {
clr_index(); working(1, 0, 0);
set_color(WHITE, BLACK); Areas = CountTicarea();
mvprintw( 5, 6, "10.2 GLOBAL EDIT TIC AREAS"); Total = Done = 0;
set_color(CYAN, BLACK);
mvprintw( 7, 6, "1. Delete connection");
mvprintw( 8, 6, "2. Add new connection");
mvprintw( 9, 6, "3. Replace connection");
mvprintw(10, 6, "4. Change connection status");
mvprintw(11, 6, "5. Change aka to use");
mvprintw(12, 6, "6. Delete TIC area");
memset(&a1, 0, sizeof(fidoaddr)); for (areanr = 1; areanr <= Areas; areanr++) {
memset(&a2, 0, sizeof(fidoaddr)); offset = LoadTicRec(areanr, FALSE);
if (tic.Active && strlen(tic.Group)) {
menu = select_menu(6); for (tmp = mgr; tmp; tmp = tmp->next) {
switch (menu) { if (tmp->tagged && (strcmp(tmp->group, tic.Group) == 0)) {
case 0: return; Total++;
case 1: a1 = PullUplink((char *)"AKA TO DELETE"); switch (menu) {
break; case 1: fseek(ttfil, 0, SEEK_SET);
case 2: a2 = PullUplink((char *)"AKA TO ADD"); while (fread(&Sc, sizeof(sysconnect), 1, ttfil) == 1) {
break; if ((Sc.aka.zone == a1.zone) && (Sc.aka.net == a1.net) &&
case 3: a1 = PullUplink((char *)"AKA TO REPLACE"); (Sc.aka.node == a1.node) && (Sc.aka.point == a1.point)) {
a2 = PullUplink((char *)"NEW AKA"); fseek(ttfil, - sizeof(sysconnect), SEEK_CUR);
break; memset(&Sc, 0, sizeof(sysconnect));
case 4: S.aka = PullUplink((char *)"AKA TO CHANGE STATUS"); fwrite(&Sc, sizeof(sysconnect), 1, ttfil);
ShowTicStatus(S); if (SaveTicRec(areanr, FALSE) == 0) {
S.sendto = edit_bool(8,16,S.sendto, (char *)"^Send^ files to this node"); Done++;
S.receivefrom = edit_bool(9,16,S.receivefrom, (char *)"^Receive^ files from this node"); Syslog('+', "Deleted %s from %s", aka2str(a1), tic.Name);
S.pause = edit_bool(10,16,S.pause, (char *)"Is this node ^paused^");
break;
case 5: akan = PickAka((char *)"10.2.5", TRUE);
break;
}
E_Group(&mgr, (char *)"SELECT TIC GROUPS TO CHANGE");
/*
* Show settings before proceeding
*/
switch (menu) {
case 1: mvprintw(7, 6, "Delete aka %s", aka2str(a1));
break;
case 2: mvprintw(7, 6, "Add aka %s", aka2str(a2));
break;
case 3: p = xstrcpy(aka2str(a1));
mvprintw(7, 6, "Replace aka %s with %s", p, aka2str(a2));
free(p);
break;
case 4: ShowTicStatus(S);
mvprintw(14, 6, "Change the link status");
case 5: if (akan != -1)
mvprintw( 7, 6, "Set %s as new aka to use", aka2str(CFG.aka[akan]));
break;
case 6: mvprintw(7, 6, "Delete TIC areas");
break;
}
if (yes_no((char *)"Perform changes")) {
working(1, 0, 0);
Areas = CountTicarea();
Total = Done = 0;
for (areanr = 1; areanr <= Areas; areanr++) {
offset = LoadTicRec(areanr, FALSE);
if (tic.Active && strlen(tic.Group)) {
for (tmp = mgr; tmp; tmp = tmp->next) {
if (tmp->tagged && (strcmp(tmp->group, tic.Group) == 0)) {
Total++;
switch (menu) {
case 1: fseek(ttfil, 0, SEEK_SET);
while (fread(&Sc, sizeof(sysconnect), 1, ttfil) == 1) {
if ((Sc.aka.zone == a1.zone) &&
(Sc.aka.net == a1.net) &&
(Sc.aka.node == a1.node) &&
(Sc.aka.point == a1.point)) {
fseek(ttfil, - sizeof(sysconnect), SEEK_CUR);
memset(&Sc, 0, sizeof(sysconnect));
fwrite(&Sc, sizeof(sysconnect), 1, ttfil);
if (SaveTicRec(areanr, FALSE) == 0) {
Done++;
Syslog('+', "Deleted %s from %s", aka2str(a1), tic.Name);
}
break;
}
}
break;
case 2: fseek(ttfil, 0, SEEK_SET);
Found = FALSE;
while (fread(&Sc, sizeof(sysconnect), 1, ttfil) == 1)
if ((Sc.aka.zone == a2.zone) &&
(Sc.aka.net == a2.net) &&
(Sc.aka.node == a2.node) &&
(Sc.aka.point == a2.point)) {
Found = TRUE;
break;
}
if (Found)
break;
fseek(ttfil, 0, SEEK_SET);
while (fread(&Sc, sizeof(sysconnect), 1, ttfil) == 1) {
if (Sc.aka.zone == 0) {
fseek(ttfil, - sizeof(sysconnect), SEEK_CUR);
memset(&Sc, 0, sizeof(sysconnect));
Sc.aka.zone = a2.zone;
Sc.aka.net = a2.net;
Sc.aka.node = a2.node;
Sc.aka.point = a2.point;
Sc.sendto = TRUE;
Sc.receivefrom = FALSE;
sprintf(Sc.aka.domain, "%s", a2.domain);
fwrite(&Sc, sizeof(sysconnect), 1, ttfil);
if (SaveTicRec(areanr, FALSE) == 0) {
Done++;
Syslog('+', "Added %s to area %s", aka2str(a2), tic.Name);
}
break;
}
}
break;
case 3: fseek(ttfil, 0, SEEK_SET);
while (fread(&Sc, sizeof(sysconnect), 1, ttfil) == 1) {
if ((Sc.aka.zone == a1.zone) &&
(Sc.aka.net == a1.net) &&
(Sc.aka.node == a1.node) &&
(Sc.aka.point == a1.point)) {
Sc.aka.zone = a2.zone;
Sc.aka.net = a2.net;
Sc.aka.node = a2.node;
Sc.aka.point = a2.point;
sprintf(Sc.aka.domain, "%s", a2.domain);
fseek(ttfil, - sizeof(sysconnect), SEEK_CUR);
fwrite(&Sc, sizeof(sysconnect), 1, ttfil);
if (SaveTicRec(areanr, FALSE) == 0) {
Done++;
p = xstrcpy(aka2str(a1));
Syslog('+', "Changed %s into %s in area %s", p, aka2str(a2), tic.Name);
free(p);
}
break;
}
}
break;
case 4: fseek(ttfil, 0, SEEK_SET);
while (fread(&Sc, sizeof(sysconnect), 1, ttfil) == 1) {
if ((Sc.aka.zone == S.aka.zone) &&
(Sc.aka.net == S.aka.net) &&
(Sc.aka.node == S.aka.node) &&
(Sc.aka.point == S.aka.point)) {
Sc.sendto = S.sendto;
Sc.receivefrom = S.receivefrom;
Sc.pause = S.pause;
Sc.cutoff = S.cutoff;
fseek(ttfil, - sizeof(sysconnect), SEEK_CUR);
fwrite(&Sc, sizeof(sysconnect), 1, ttfil);
if (SaveTicRec(areanr, FALSE) == 0) {
Done++;
Syslog('+', "Changed status of %s in area %s", aka2str(S.aka), tic.Name);
}
break;
}
}
break;
case 5: if (akan != -1) {
if ((tic.Aka.zone != CFG.aka[akan].zone) ||
(tic.Aka.net != CFG.aka[akan].net) ||
(tic.Aka.node != CFG.aka[akan].node) ||
(tic.Aka.point != CFG.aka[akan].point)) {
tic.Aka.zone = CFG.aka[akan].zone;
tic.Aka.net = CFG.aka[akan].net;
tic.Aka.node = CFG.aka[akan].node;
tic.Aka.point = CFG.aka[akan].point;
sprintf(tic.Aka.domain, "%s", CFG.aka[akan].domain);
if (SaveTicRec(areanr, FALSE) == 0) {
Done++;
Syslog('+', "Area %s now uses aka %s", tic.Name, aka2str(tic.Aka));
}
}
}
break;
case 6: if (tic.Active) {
tic.Active = FALSE;
tic.Deleted = TRUE;
if (SaveTicRec(areanr, FALSE) == 0) {
Done++;
Syslog('+', "Deleted TIC area %s", tic.Name);
}
}
break;
}
} }
break;
}
} }
} break;
if (ttfil != NULL) case 2: fseek(ttfil, 0, SEEK_SET);
fclose(ttfil); Found = FALSE;
while (fread(&Sc, sizeof(sysconnect), 1, ttfil) == 1)
if ((Sc.aka.zone == a2.zone) && (Sc.aka.net == a2.net) &&
(Sc.aka.node == a2.node) && (Sc.aka.point == a2.point)) {
Found = TRUE;
break;
}
if (Found)
break;
fseek(ttfil, 0, SEEK_SET);
while (fread(&Sc, sizeof(sysconnect), 1, ttfil) == 1) {
if (Sc.aka.zone == 0) {
fseek(ttfil, - sizeof(sysconnect), SEEK_CUR);
memset(&Sc, 0, sizeof(sysconnect));
Sc.aka.zone = a2.zone;
Sc.aka.net = a2.net;
Sc.aka.node = a2.node;
Sc.aka.point = a2.point;
Sc.sendto = TRUE;
Sc.receivefrom = FALSE;
sprintf(Sc.aka.domain, "%s", a2.domain);
fwrite(&Sc, sizeof(sysconnect), 1, ttfil);
if (SaveTicRec(areanr, FALSE) == 0) {
Done++;
Syslog('+', "Added %s to area %s", aka2str(a2), tic.Name);
}
break;
}
}
break;
case 3: fseek(ttfil, 0, SEEK_SET);
while (fread(&Sc, sizeof(sysconnect), 1, ttfil) == 1) {
if ((Sc.aka.zone == a1.zone) && (Sc.aka.net == a1.net) &&
(Sc.aka.node == a1.node) && (Sc.aka.point == a1.point)) {
Sc.aka.zone = a2.zone;
Sc.aka.net = a2.net;
Sc.aka.node = a2.node;
Sc.aka.point = a2.point;
sprintf(Sc.aka.domain, "%s", a2.domain);
fseek(ttfil, - sizeof(sysconnect), SEEK_CUR);
fwrite(&Sc, sizeof(sysconnect), 1, ttfil);
if (SaveTicRec(areanr, FALSE) == 0) {
Done++;
p = xstrcpy(aka2str(a1));
Syslog('+', "Changed %s into %s in area %s", p, aka2str(a2), tic.Name);
free(p);
}
break;
}
}
break;
case 4: fseek(ttfil, 0, SEEK_SET);
while (fread(&Sc, sizeof(sysconnect), 1, ttfil) == 1) {
if ((Sc.aka.zone == S.aka.zone) && (Sc.aka.net == S.aka.net) &&
(Sc.aka.node == S.aka.node) && (Sc.aka.point == S.aka.point)) {
Sc.sendto = S.sendto;
Sc.receivefrom = S.receivefrom;
Sc.pause = S.pause;
Sc.cutoff = S.cutoff;
fseek(ttfil, - sizeof(sysconnect), SEEK_CUR);
fwrite(&Sc, sizeof(sysconnect), 1, ttfil);
if (SaveTicRec(areanr, FALSE) == 0) {
Done++;
Syslog('+', "Changed status of %s in area %s", aka2str(S.aka), tic.Name);
}
break;
}
}
break;
case 5: if (akan != -1) {
if ((tic.Aka.zone != CFG.aka[akan].zone) ||
(tic.Aka.net != CFG.aka[akan].net) ||
(tic.Aka.node != CFG.aka[akan].node) ||
(tic.Aka.point != CFG.aka[akan].point)) {
tic.Aka.zone = CFG.aka[akan].zone;
tic.Aka.net = CFG.aka[akan].net;
tic.Aka.node = CFG.aka[akan].node;
tic.Aka.point = CFG.aka[akan].point;
sprintf(tic.Aka.domain, "%s", CFG.aka[akan].domain);
if (SaveTicRec(areanr, FALSE) == 0) {
Done++;
Syslog('+', "Area %s now uses aka %s", tic.Name, aka2str(tic.Aka));
}
}
}
break;
case 6: if ((tic.LinkSec.flags != as.flags) || (tic.LinkSec.notflags != as.notflags)) {
memcpy(&tic.LinkSec, &as, sizeof(securityrec));
if (SaveTicRec(areanr, FALSE) == 0) {
Done++;
Syslog('+', "Area %s changed link security flags", tic.Name);
}
}
break;
case 7: if (tic.Active) {
tic.Active = FALSE;
tic.Deleted = TRUE;
if (SaveTicRec(areanr, FALSE) == 0) {
Done++;
Syslog('+', "Deleted TIC area %s", tic.Name);
}
}
break;
}
} }
}
working(0, 0, 0);
mvprintw(LINES -3, 6,"Made %d changes in %d possible areas", Done, Total);
(void)readkey(LINES -3, 50, LIGHTGRAY, BLACK);
if (Done)
TicUpdated = TRUE;
} }
} if (ttfil != NULL)
fclose(ttfil);
}
tidy_grlist(&mgr); working(0, 0, 0);
mvprintw(LINES -3, 6,"Made %d changes in %d possible areas", Done, Total);
(void)readkey(LINES -3, 50, LIGHTGRAY, BLACK);
if (Done)
TicUpdated = TRUE;
}
}
tidy_grlist(&mgr);
} }
@ -799,176 +819,180 @@ void TicGlobal(void)
int EditTicRec(int); int EditTicRec(int);
int EditTicRec(int Area) int EditTicRec(int Area)
{ {
unsigned long crc1; unsigned long crc1;
int tmp, i, connections = 0, changed = FALSE; int tmp, i, connections = 0, changed = FALSE;
sysconnect System; sysconnect System;
char *temp; char *temp;
FILE *fp; FILE *fp;
clr_index(); clr_index();
IsDoing("Edit Tic Area"); IsDoing("Edit Tic Area");
if (LoadTicRec(Area, TRUE) == -1) if (LoadTicRec(Area, TRUE) == -1)
return -1; return -1;
temp = calloc(PATH_MAX, sizeof(char)); temp = calloc(PATH_MAX, sizeof(char));
SetTicScreen(); SetTicScreen();
for (;;) { for (;;) {
sprintf(temp, "%s/etc/fareas.data", getenv("MBSE_ROOT")); sprintf(temp, "%s/etc/fareas.data", getenv("MBSE_ROOT"));
if ((fp = fopen(temp, "r")) != NULL) { if ((fp = fopen(temp, "r")) != NULL) {
fread(&areahdr, sizeof(areahdr), 1, fp); fread(&areahdr, sizeof(areahdr), 1, fp);
fseek(fp, ((tic.FileArea - 1) * areahdr.recsize) + areahdr.hdrsize, SEEK_SET); fseek(fp, ((tic.FileArea - 1) * areahdr.recsize) + areahdr.hdrsize, SEEK_SET);
fread(&area, areahdr.recsize, 1, fp); fread(&area, areahdr.recsize, 1, fp);
sprintf(temp, "%ld: %s", tic.FileArea, area.Name); sprintf(temp, "%ld: %s", tic.FileArea, area.Name);
temp[24] = '\0'; temp[24] = '\0';
fclose(fp); fclose(fp);
} else { } else {
sprintf(temp, "%ld", tic.FileArea); sprintf(temp, "%ld", tic.FileArea);
}
set_color(WHITE, BLACK);
show_str( 6,16,55, tic.Comment);
show_str( 7,16,20, tic.Name);
show_str( 8,16,24, temp);
show_str( 9,16,14, tic.Message);
show_str(10,16,12, tic.Group);
show_int(11,16, tic.KeepLatest);
show_str(12,16,20, aka2str(tic.Aka));
show_str(13,16,5, tic.Convert);
show_str(14,16,14, tic.Banner);
show_bool(15,16, tic.Replace);
show_bool( 7,55, tic.DupCheck);
show_bool( 8,55, tic.Secure);
show_bool( 9,55, tic.Touch);
show_bool(10,55, tic.VirScan);
show_bool(11,55, tic.Announce);
show_bool(12,55, tic.UpdMagic);
show_bool(13,55, tic.FileId);
show_bool(14,55, tic.ConvertAll);
show_bool(15,55, tic.SendOrg);
show_bool( 7,77, tic.Mandat);
show_bool( 8,77, tic.Notified);
show_bool( 9,77, tic.UplDiscon);
show_bool(10,77, tic.Deleted);
show_bool(11,77, tic.Active);
fseek(ttfil, 0, SEEK_SET);
connections = 0;
while (fread(&System, sizeof(System), 1, ttfil) == 1) {
if (System.aka.zone)
connections++;
}
show_int( 12,77, connections);
switch(select_menu(25)) {
case 0:
crc1 = 0xffffffff;
crc1 = upd_crc32((char *)&tic, crc1, tichdr.recsize);
fseek(ttfil, 0, 0);
for (i = 0; i < (tichdr.syssize / sizeof(sysconnect)); i++) {
fread(&System, sizeof(sysconnect), 1, ttfil);
crc1 = upd_crc32((char *)&System, crc1, sizeof(sysconnect));
}
if ((TicCrc != crc1) || (changed)) {
if (yes_no((char *)"Record is changed, save") == 1) {
if (SaveTicRec(Area, TRUE) == -1)
return -1;
TicUpdated = 1;
Syslog('+', "Saved tic record %d", Area);
}
}
IsDoing("Browsing Menu");
free(temp);
return 0;
case 1: E_STR( 6,16,55, tic.Comment, "The ^description^ for this area.");
case 2: E_STR( 7,16,20, tic.Name, "The ^name^ of this ^TIC^ area.");
case 3: tmp = PickFilearea((char *)"10.2.3");
if (tmp != 0)
tic.FileArea = tmp;
SetTicScreen();
break;
case 4: E_STR( 9,16,14, tic.Message, "The ^message^ to include with the .tic files.");
case 5: tmp = strlen(tic.Group);
strcpy(tic.Group, PickFGroup((char *)"10.2.5"));
if (strlen(tic.Group) && !tmp) {
/*
* If set the first time, fill in defaults
*/
tic.Aka = fgroup.UseAka;
strncpy(tic.Convert, fgroup.Convert, 5);
strncpy(tic.Banner, fgroup.Banner, 14);
tic.Replace = fgroup.Replace;
tic.DupCheck = fgroup.DupCheck;
tic.Secure = fgroup.Secure;
tic.Touch = fgroup.Touch;
tic.VirScan = fgroup.VirScan;
tic.Announce = fgroup.Announce;
tic.UpdMagic = fgroup.UpdMagic;
tic.FileId = fgroup.FileId;
tic.ConvertAll = fgroup.ConvertAll;
tic.SendOrg = fgroup.SendOrg;
/*
* If there is an uplink defined in the group,
* and the first connected system is empty,
* copy the uplink as default connection.
*/
if (fgroup.UpLink.zone) {
fseek(ttfil, 0, SEEK_SET);
fread(&System, sizeof(sysconnect), 1, ttfil);
if (!System.aka.zone) {
memset(&System, 0, sizeof(sysconnect));
System.aka = fgroup.UpLink;
System.receivefrom = TRUE;
fseek(ttfil, 0, SEEK_SET);
fwrite(&System, sizeof(sysconnect), 1, ttfil);
}
}
}
SetTicScreen();
break;
case 6: E_INT(11,16, tic.KeepLatest, "^Keep^ the ^latest^ number of files.");
case 7: tmp = PickAka((char *)"10.2.7", TRUE);
if (tmp != -1)
tic.Aka = CFG.aka[tmp];
SetTicScreen();
break;
case 8: strcpy(tic.Convert, PickArchive((char *)"10.2.8"));
SetTicScreen();
break;
case 9: E_STR(14,16,14, tic.Banner, "The ^banner^ to put in the file archives");
case 10:E_BOOL(15,16, tic.Replace, "Allow ^Replace^ files command");
case 11:E_BOOL( 7,55, tic.DupCheck, "Check for ^duplicates^ in received files");
case 12:E_BOOL( 8,55, tic.Secure, "Check for ^secure^ systems");
case 13:E_BOOL( 9,55, tic.Touch, "^Touch filedate^ on rearchived files to the origininal filedate");
case 14:E_BOOL(10,55, tic.VirScan, "Check received files for ^virusses^");
case 15:E_BOOL(11,55, tic.Announce, "^Announce^ received files");
case 16:E_BOOL(12,55, tic.UpdMagic, "Update files ^magic^ names");
case 17:E_BOOL(13,55, tic.FileId, "Extract ^FILE_ID.DIZ^ from received files");
case 18:tmp = edit_bool(14,55, tic.ConvertAll, (char *)"^Convert^ archive always");
if (tmp && !tic.ConvertAll && strlen(tic.Convert) == 0)
errmsg("No archiver configured to convert to, edit 8 first");
else
tic.ConvertAll = tmp;
break;
case 19:E_BOOL(15,55, tic.SendOrg, "^Send original^ file to downlinks");
case 20:E_BOOL( 7,77, tic.Mandat, "Is this area ^mandatory^");
case 21:E_BOOL( 8,77, tic.Notified, "Is the sysop ^notified^ if this area is (dis)connected");
case 22:E_BOOL( 9,77, tic.UplDiscon, "Is the uplink ^disconnected^ from this area");
case 23:E_BOOL(10,77, tic.Deleted, "Is this area ^deleted^");
case 24:E_BOOL(11,77, tic.Active, "Is this area ^active^");
case 25:
if (EditTicConnections(ttfil))
changed = TRUE;
SetTicScreen();
break;
}
} }
set_color(WHITE, BLACK);
show_str( 6,16,55, tic.Comment);
show_str( 7,16,20, tic.Name);
mvprintw( 8,16, getflag(tic.LinkSec.flags, tic.LinkSec.notflags));
show_str( 9,16,24, temp);
show_str(10,16,14, tic.Message);
show_str(11,16,12, tic.Group);
show_int(12,16, tic.KeepLatest);
show_str(13,16,20, aka2str(tic.Aka));
show_str(14,16,5, tic.Convert);
show_str(15,16,14, tic.Banner);
show_bool(16,16, tic.Replace);
show_bool( 9,55, tic.DupCheck);
show_bool(10,55, tic.Secure);
show_bool(11,55, tic.Touch);
show_bool(12,55, tic.VirScan);
show_bool(13,55, tic.Announce);
show_bool(14,55, tic.UpdMagic);
show_bool(15,55, tic.FileId);
show_bool(16,55, tic.ConvertAll);
show_bool( 9,77, tic.SendOrg);
show_bool(10,77, tic.Mandat);
show_bool(11,77, tic.Notified);
show_bool(12,77, tic.UplDiscon);
show_bool(13,77, tic.Deleted);
show_bool(14,77, tic.Active);
fseek(ttfil, 0, SEEK_SET);
connections = 0;
while (fread(&System, sizeof(System), 1, ttfil) == 1) {
if (System.aka.zone)
connections++;
}
show_int( 15,77, connections);
switch(select_menu(25)) {
case 0:
crc1 = 0xffffffff;
crc1 = upd_crc32((char *)&tic, crc1, tichdr.recsize);
fseek(ttfil, 0, 0);
for (i = 0; i < (tichdr.syssize / sizeof(sysconnect)); i++) {
fread(&System, sizeof(sysconnect), 1, ttfil);
crc1 = upd_crc32((char *)&System, crc1, sizeof(sysconnect));
}
if ((TicCrc != crc1) || (changed)) {
if (yes_no((char *)"Record is changed, save") == 1) {
if (SaveTicRec(Area, TRUE) == -1)
return -1;
TicUpdated = 1;
Syslog('+', "Saved tic record %d", Area);
}
}
IsDoing("Browsing Menu");
free(temp);
return 0;
case 1: E_STR( 6,16,55, tic.Comment, "The ^description^ for this area.");
case 2: E_STR( 7,16,20, tic.Name, "The ^name^ of this ^TIC^ area.");
case 3: tic.LinkSec = edit_asec(tic.LinkSec, (char *)"LINK SECURITY FLAGS");
SetTicScreen();
break;
case 4: tmp = PickFilearea((char *)"10.2.4");
if (tmp != 0)
tic.FileArea = tmp;
SetTicScreen();
break;
case 5: E_STR(10,16,14, tic.Message, "The ^message^ to include with the .tic files.");
case 6: tmp = strlen(tic.Group);
strcpy(tic.Group, PickFGroup((char *)"10.2.6"));
if (strlen(tic.Group) && !tmp) {
/*
* If set the first time, fill in defaults
*/
tic.Aka = fgroup.UseAka;
strncpy(tic.Convert, fgroup.Convert, 5);
strncpy(tic.Banner, fgroup.Banner, 14);
tic.Replace = fgroup.Replace;
tic.DupCheck = fgroup.DupCheck;
tic.Secure = fgroup.Secure;
tic.Touch = fgroup.Touch;
tic.VirScan = fgroup.VirScan;
tic.Announce = fgroup.Announce;
tic.UpdMagic = fgroup.UpdMagic;
tic.FileId = fgroup.FileId;
tic.ConvertAll = fgroup.ConvertAll;
tic.SendOrg = fgroup.SendOrg;
tic.LinkSec = fgroup.LinkSec;
/*
* If there is an uplink defined in the group,
* and the first connected system is empty,
* copy the uplink as default connection.
*/
if (fgroup.UpLink.zone) {
fseek(ttfil, 0, SEEK_SET);
fread(&System, sizeof(sysconnect), 1, ttfil);
if (!System.aka.zone) {
memset(&System, 0, sizeof(sysconnect));
System.aka = fgroup.UpLink;
System.receivefrom = TRUE;
fseek(ttfil, 0, SEEK_SET);
fwrite(&System, sizeof(sysconnect), 1, ttfil);
}
}
}
SetTicScreen();
break;
case 7: E_INT(12,16, tic.KeepLatest, "^Keep^ the ^latest^ number of files.");
case 8: tmp = PickAka((char *)"10.2.8", TRUE);
if (tmp != -1)
tic.Aka = CFG.aka[tmp];
SetTicScreen();
break;
case 9: strcpy(tic.Convert, PickArchive((char *)"10.2.9"));
SetTicScreen();
break;
case 10:E_STR(15,16,14, tic.Banner, "The ^banner^ to put in the file archives");
case 11:E_BOOL(16,16, tic.Replace, "Allow ^Replace^ files command");
case 12:E_BOOL( 9,55, tic.DupCheck, "Check for ^duplicates^ in received files");
case 13:E_BOOL(10,55, tic.Secure, "Check for ^secure^ systems");
case 14:E_BOOL(11,55, tic.Touch, "^Touch filedate^ on rearchived files to the origininal filedate");
case 15:E_BOOL(12,55, tic.VirScan, "Check received files for ^virusses^");
case 16:E_BOOL(13,55, tic.Announce, "^Announce^ received files");
case 17:E_BOOL(14,55, tic.UpdMagic, "Update files ^magic^ names");
case 18:E_BOOL(15,55, tic.FileId, "Extract ^FILE_ID.DIZ^ from received files");
case 19:tmp = edit_bool(16,55, tic.ConvertAll, (char *)"^Convert^ archive always");
if (tmp && !tic.ConvertAll && strlen(tic.Convert) == 0)
errmsg("No archiver configured to convert to, edit 8 first");
else
tic.ConvertAll = tmp;
break;
case 20:E_BOOL( 9,77, tic.SendOrg, "^Send original^ file to downlinks");
case 21:E_BOOL(10,77, tic.Mandat, "Is this area ^mandatory^");
case 22:E_BOOL(11,77, tic.Notified, "Is the sysop ^notified^ if this area is (dis)connected");
case 23:E_BOOL(12,77, tic.UplDiscon, "Is the uplink ^disconnected^ from this area");
case 24:E_BOOL(13,77, tic.Deleted, "Is this area ^deleted^");
case 25:E_BOOL(14,77, tic.Active, "Is this area ^active^");
case 26:if (EditTicConnections(ttfil))
changed = TRUE;
SetTicScreen();
break;
}
}
} }
@ -1282,6 +1306,7 @@ int tic_areas_doc(FILE *fp, FILE *toc, int page)
fprintf(fp, " Convert to %s\n", tic.Convert); fprintf(fp, " Convert to %s\n", tic.Convert);
fprintf(fp, " Convert all %s\n", getboolean(tic.ConvertAll)); fprintf(fp, " Convert all %s\n", getboolean(tic.ConvertAll));
fprintf(fp, " Banner file %s\n", tic.Banner); fprintf(fp, " Banner file %s\n", tic.Banner);
fprintf(fp, " Security %s\n", getflag(tic.LinkSec.flags, tic.LinkSec.notflags));
fprintf(fp, " Replace ok. %s\n", getboolean(tic.Replace)); fprintf(fp, " Replace ok. %s\n", getboolean(tic.Replace));
fprintf(fp, " Dupe check %s\n", getboolean(tic.DupCheck)); fprintf(fp, " Dupe check %s\n", getboolean(tic.DupCheck));
fprintf(fp, " Secure %s\n", getboolean(tic.Secure)); fprintf(fp, " Secure %s\n", getboolean(tic.Secure));