From 5b04145c15787ca75ff67f19930082920869372f Mon Sep 17 00:00:00 2001 From: Michiel Broek Date: Thu, 25 Oct 2001 15:06:56 +0000 Subject: [PATCH] Fixed some setup issue's --- ChangeLog | 3 ++ mbsetup/m_archive.c | 68 +++++++++++++++++++++++++++++++-------------- mbsetup/m_fido.c | 7 +++-- mbsetup/m_global.c | 9 ++++-- mbsetup/m_marea.c | 5 +++- mbsetup/m_menu.c | 33 +++++++++++----------- mbsetup/m_virus.c | 4 +-- mbsetup/mbsetup.c | 1 - 8 files changed, 83 insertions(+), 47 deletions(-) diff --git a/ChangeLog b/ChangeLog index 031a276b..d688d7d6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4158,6 +4158,9 @@ v0.33.18 27-Jul-2001 A check is build in that mbsetup is started by user mbse. Fixed segfault error during exit of mbsetup when writing the golded.inc file when the bbs is more or less unconfigured. + The file golded.inc is now only rewritten if changes are made + to the main configuration, fidonet data or message areas. + Added default archiver record for the Russian ARJ archiver. mbcico: Renamed sendfile function in zmsend.c to sendzfile to prevent a diff --git a/mbsetup/m_archive.c b/mbsetup/m_archive.c index 2a226584..5cbb6e7a 100644 --- a/mbsetup/m_archive.c +++ b/mbsetup/m_archive.c @@ -2,7 +2,7 @@ * * File ..................: setup/m_archive.c * Purpose ...............: Setup Archive structure. - * Last modification date : 19-Oct-2001 + * Last modification date : 25-Oct-2001 * ***************************************************************************** * Copyright (C) 1997-2001 @@ -69,7 +69,7 @@ int CountArchive(void) memset(&archiver, 0, sizeof(archiver)); sprintf(archiver.comment, "ARC Version 5.21"); sprintf(archiver.name, "ARC"); - archiver.available = TRUE; + archiver.available = FALSE; sprintf(archiver.marc, "/usr/bin/arc anw"); sprintf(archiver.tarc, "/usr/bin/arc tnw"); sprintf(archiver.funarc, "/usr/bin/arc xnw"); @@ -80,7 +80,7 @@ int CountArchive(void) memset(&archiver, 0, sizeof(archiver)); sprintf(archiver.comment, "LHarc"); sprintf(archiver.name, "LHA"); - archiver.available = TRUE; + archiver.available = FALSE; sprintf(archiver.marc, "/usr/bin/lha aq"); sprintf(archiver.tarc, "/usr/bin/lha tq"); sprintf(archiver.funarc, "/usr/bin/lha xqf"); @@ -91,7 +91,7 @@ int CountArchive(void) memset(&archiver, 0, sizeof(archiver)); sprintf(archiver.comment, "RAR by Eugene Roshal"); sprintf(archiver.name, "RAR"); - archiver.available = TRUE; + archiver.available = FALSE; sprintf(archiver.farc, "/usr/bin/rar a -y -r"); sprintf(archiver.marc, "/usr/bin/rar a -y"); sprintf(archiver.barc, "/usr/bin/rar c -y"); @@ -116,13 +116,26 @@ int CountArchive(void) memset(&archiver, 0, sizeof(archiver)); sprintf(archiver.comment, "UNARJ by Robert K Jung"); sprintf(archiver.name, "ARJ"); - archiver.available = TRUE; + archiver.available = FALSE; sprintf(archiver.tarc, "/usr/bin/unarj t"); sprintf(archiver.funarc, "/usr/bin/unarj x"); sprintf(archiver.munarc, "/usr/bin/unarj e"); sprintf(archiver.iunarc, "/usr/bin/unarj e"); fwrite(&archiver, sizeof(archiver), 1, fil); + memset(&archiver, 0, sizeof(archiver)); + sprintf(archiver.comment, "ARJ from ARJ Software Russia"); + sprintf(archiver.name, "ARJ"); + archiver.available = FALSE; + sprintf(archiver.farc, "/usr/bin/arj -2d -y -r a"); + sprintf(archiver.marc, "/usr/bin/arj -2d -y -e a"); + sprintf(archiver.barc, "/usr/bin/arj -2d -y c"); + sprintf(archiver.tarc, "/usr/bin/arj -y t"); + sprintf(archiver.funarc, "/usr/bin/arj -y x"); + sprintf(archiver.munarc, "/usr/bin/arj -y e"); + sprintf(archiver.iunarc, "/usr/bin/arj -y e"); + fwrite(&archiver, sizeof(archiver), 1, fil); + memset(&archiver, 0, sizeof(archiver)); sprintf(archiver.comment, "ZIP and UNZIP by Info-ZIP"); sprintf(archiver.name, "ZIP"); @@ -139,7 +152,7 @@ int CountArchive(void) memset(&archiver, 0, sizeof(archiver)); sprintf(archiver.comment, "ZOO archiver"); sprintf(archiver.name, "ZOO"); - archiver.available = TRUE; + archiver.available = FALSE; sprintf(archiver.farc, "/usr/bin/zoo aq"); sprintf(archiver.marc, "/usr/bin/zoo aq:O"); sprintf(archiver.barc, "/usr/bin/zoo aqC"); @@ -149,7 +162,7 @@ int CountArchive(void) fwrite(&archiver, sizeof(archiver), 1, fil); fclose(fil); - return 7; + return 8; } else return -1; } @@ -383,7 +396,7 @@ int EditArchRec(int Area) void EditArchive(void) { - int records, i, x, y; + int records, i, o, x, y; char pick[12]; FILE *fil; char temp[PATH_MAX]; @@ -408,6 +421,7 @@ void EditArchive(void) return; } working(0, 0, 0); + o = 0; for (;;) { clr_index(); @@ -421,22 +435,24 @@ void EditArchive(void) x = 2; y = 7; set_color(CYAN, BLACK); - for (i = 1; i <= records; i++) { - offset = sizeof(archiverhdr) + ((i - 1) * archiverhdr.recsize); - fseek(fil, offset, 0); - fread(&archiver, archiverhdr.recsize, 1, fil); + for (i = 1; i <= 20; i++) { if (i == 11) { - x = 42; - y = 7; + x = 42; + y = 7; } - if (archiver.available) + if ((o + i) <= records) { + offset = sizeof(archiverhdr) + (((o + i) - 1) * archiverhdr.recsize); + fseek(fil, offset, 0); + fread(&archiver, archiverhdr.recsize, 1, fil); + if (archiver.available) set_color(CYAN, BLACK); - else + else set_color(LIGHTBLUE, BLACK); - sprintf(temp, "%3d. %-32s", i, archiver.comment); - temp[37] = 0; - mvprintw(y, x, temp); - y++; + sprintf(temp, "%3d. %-5s %-26s", i, archiver.name, archiver.comment); + temp[38] = 0; + mvprintw(y, x, temp); + y++; + } } fclose(fil); } @@ -459,8 +475,18 @@ void EditArchive(void) working(0, 0, 0); } - if ((atoi(pick) >= 1) && (atoi(pick) <= records)) + if (strncmp(pick, "N", 1) == 0) + if ((o + 20) < records) + o += 20; + + if (strncmp(pick, "P", 1) == 0) + if ((o - 20) >= 0) + o -= 20; + + if ((atoi(pick) >= 1) && (atoi(pick) <= records)) { EditArchRec(atoi(pick)); + o = ((atoi(pick) -1) / 20) * 20; + } } } diff --git a/mbsetup/m_fido.c b/mbsetup/m_fido.c index fc180cdb..36ff3896 100644 --- a/mbsetup/m_fido.c +++ b/mbsetup/m_fido.c @@ -2,7 +2,7 @@ * * File ..................: setup/m_fido.c * Purpose ...............: Setup Fidonet structure. - * Last modification date : 19-Oct-2001 + * Last modification date : 25-Oct-2001 * ***************************************************************************** * Copyright (C) 1997-2001 @@ -43,7 +43,8 @@ -int FidoUpdated = 0; +int FidoUpdated = 0; +extern int exp_golded; /* @@ -89,6 +90,7 @@ int CountFidonet(void) fidonet.available = TRUE; fwrite(&fidonet, sizeof(fidonet), 1, fil); fclose(fil); + exp_golded = TRUE; return 2; } else return -1; @@ -171,6 +173,7 @@ void CloseFidonet(int force) if (FidoUpdated == 1) { if (force || (yes_no((char *)"Database is changed, save changes") == 1)) { working(1, 0, 0); + exp_golded = TRUE; fi = fopen(fout, "r"); fo = fopen(fin, "w"); fread(&fidonethdr, fidonethdr.hdrsize, 1, fi); diff --git a/mbsetup/m_global.c b/mbsetup/m_global.c index 9cc20e21..d3c481f5 100644 --- a/mbsetup/m_global.c +++ b/mbsetup/m_global.c @@ -2,7 +2,7 @@ * * File ..................: m_global.c * Purpose ...............: Global Setup Program - * Last modification date : 19-Oct-2001 + * Last modification date : 25-Oct-2001 * ***************************************************************************** * Copyright (C) 1997-2001 @@ -44,8 +44,10 @@ #include "m_global.h" -char *some_fn; -int some_fd; +char *some_fn; +int some_fd; +extern int exp_golded; + #define WRLONG cnt = write(some_fd, &longvar, sizeof(longvar)); @@ -94,6 +96,7 @@ int config_write(void) write(some_fd, &CFG, sizeof(CFG)); close(some_fd); + exp_golded = TRUE; return 0; } diff --git a/mbsetup/m_marea.c b/mbsetup/m_marea.c index 44f5d9bf..10ad43c7 100644 --- a/mbsetup/m_marea.c +++ b/mbsetup/m_marea.c @@ -2,7 +2,7 @@ * * File ..................: m_marea.c * Purpose ...............: Message Areas Setup - * Last modification date : 19-Oct-2001 + * Last modification date : 25-Oct-2001 * ***************************************************************************** * Copyright (C) 1997-2001 @@ -47,6 +47,7 @@ int MsgUpdated = 0; unsigned long MsgCrc; FILE *tfil = NULL; +extern int exp_golded; @@ -70,6 +71,7 @@ int CountMsgarea(void) msgshdr.lastupd = time(NULL); fwrite(&msgshdr, sizeof(msgshdr), 1, fil); fclose(fil); + exp_golded = TRUE; return 0; } else return -1; @@ -189,6 +191,7 @@ void CloseMsgarea(int Force) if (MsgUpdated == 1) { if (Force || (yes_no((char *)"Messages database is changed, save changes") == 1)) { working(1, 0, 0); + exp_golded = TRUE; if ((rename(fout, fin)) == 0) unlink(fout); Syslog('+', "Updated \"mareas.data\""); diff --git a/mbsetup/m_menu.c b/mbsetup/m_menu.c index 0cc49665..4249b1ff 100644 --- a/mbsetup/m_menu.c +++ b/mbsetup/m_menu.c @@ -2,7 +2,7 @@ * * File ..................: mbsetup/m_menu.c * Purpose ...............: Edit BBS menus - * Last modification date : 19-Oct-2001 + * Last modification date : 25-Oct-2001 * ***************************************************************************** * Copyright (C) 1997-2001 @@ -111,12 +111,12 @@ void Show_A_Menu(void) mvprintw(16, 2, "9. Credit"); mvprintw(17, 2, "10. Lo-colors"); mvprintw(18, 2, "11. Hi-colors"); - mvprintw(15,42, "12. Autoexec"); + mvprintw(19, 2, "12. Autoexec"); if (menus.MenuType == 7) { - mvprintw(15,42, "13. No door.sys"); - mvprintw(16,42, "14. Y2K style"); - mvprintw(17,42, "15. Use Comport"); - mvprintw(18,42, "16. Run nosuid"); + mvprintw(16,42, "13. No door.sys"); + mvprintw(17,42, "14. Y2K style"); + mvprintw(18,42, "15. Use Comport"); + mvprintw(19,42, "16. Run nosuid"); } set_color(WHITE, BLACK); @@ -135,14 +135,13 @@ void Show_A_Menu(void) show_int(16,16, menus.Credit); S_COL(17,16, "Normal display color", menus.ForeGnd, menus.BackGnd) S_COL(18,16, "Bright display color", menus.HiForeGnd, menus.HiBackGnd) - set_color(WHITE, BLACK); - show_bool(15,58, menus.AutoExec); + show_bool(19,16, menus.AutoExec); if (menus.MenuType == 7) { - show_bool(15,58, menus.NoDoorsys); - show_bool(16,58, menus.Y2Kdoorsys); - show_bool(17,58, menus.Comport); - show_bool(18,58, menus.NoSuid); + show_bool(16,58, menus.NoDoorsys); + show_bool(17,58, menus.Y2Kdoorsys); + show_bool(18,58, menus.Comport); + show_bool(19,58, menus.NoSuid); } } @@ -238,21 +237,21 @@ void Edit_A_Menu(void) case 11:edit_color(&menus.HiForeGnd, &menus.HiBackGnd, (char *)"bright"); Show_A_Menu(); break; - case 12:E_BOOL(15,58, menus.AutoExec, "Is this an ^Autoexecute^ menu item") + case 12:E_BOOL(19,16, menus.AutoExec, "Is this an ^Autoexecute^ menu item") case 13:if (menus.MenuType == 7) { - E_BOOL(15,58, menus.NoDoorsys, "Suppress writing ^door.sys^ dropfile") + E_BOOL(16,58, menus.NoDoorsys, "Suppress writing ^door.sys^ dropfile") } else break; case 14:if (menus.MenuType == 7) { - E_BOOL(16,58, menus.Y2Kdoorsys, "Create ^door.sys^ with 4 digit yearnumbers") + E_BOOL(17,58, menus.Y2Kdoorsys, "Create ^door.sys^ with 4 digit yearnumbers") } else break; case 15:if (menus.MenuType == 7) { - E_BOOL(17,58, menus.Comport, "Write real ^COM port^ in door.sys for Vmodem patch") + E_BOOL(18,58, menus.Comport, "Write real ^COM port^ in door.sys for Vmodem patch") } else break; case 16:if (menus.MenuType == 7) { - E_BOOL(18,58, menus.NoSuid, "Run the door as ^real user (nosuid)^") + E_BOOL(19,58, menus.NoSuid, "Run the door as ^real user (nosuid)^") } else break; } diff --git a/mbsetup/m_virus.c b/mbsetup/m_virus.c index 19c334e9..919dbf09 100644 --- a/mbsetup/m_virus.c +++ b/mbsetup/m_virus.c @@ -2,7 +2,7 @@ * * File ..................: setup/m_virus.c * Purpose ...............: Setup Virus structure. - * Last modification date : 19-Oct-2001 + * Last modification date : 25-Oct-2001 * ***************************************************************************** * Copyright (C) 1997-2001 @@ -86,7 +86,7 @@ int CountVirus(void) fwrite(&virscan, sizeof(virscan), 1, fil); fclose(fil); - return 2; + return 3; } else return -1; } diff --git a/mbsetup/mbsetup.c b/mbsetup/mbsetup.c index 2e0e3810..bd6843a6 100644 --- a/mbsetup/mbsetup.c +++ b/mbsetup/mbsetup.c @@ -84,7 +84,6 @@ static void die(int onsig) if (!init) screen_stop(); - exp_golded = TRUE; if (exp_golded && (config_read() != -1)) { temp = calloc(128, sizeof(char)); sprintf(temp, "%s/etc/golded.inc", getenv("MBSE_ROOT"));