Updated datafile security modes

This commit is contained in:
Michiel Broek 2001-11-14 21:37:58 +00:00
parent 1febff88c3
commit 5f06e6e421
41 changed files with 111 additions and 122 deletions

View File

@ -4286,6 +4286,8 @@ v0.33.19 26-Oct-2001
mbtask: mbtask:
Changed to handle the External Doors flag in the lastcaller Changed to handle the External Doors flag in the lastcaller
information. information.
On new systems, ~/etc/config.data and ~/etc/task.data are
created with mode 0640.
mbmon: mbmon:
Changed the lastcaller screen to display the External Door Changed the lastcaller screen to display the External Door

View File

@ -1,8 +1,7 @@
/***************************************************************************** /*****************************************************************************
* *
* File ..................: jammsg.c * $Id$
* Purpose ...............: JAM message base functions * Purpose ...............: JAM message base functions
* Last modification date : 30-Aug-2001
* *
***************************************************************************** *****************************************************************************
* *
@ -517,7 +516,7 @@ int JAM_Open(char *Msgbase)
File = calloc(PATH_MAX, sizeof(char)); File = calloc(PATH_MAX, sizeof(char));
sprintf(File, "%s%s", Msgbase, EXT_HDRFILE); sprintf(File, "%s%s", Msgbase, EXT_HDRFILE);
if ((fdHdr = open(File, O_RDWR|O_CREAT, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH)) != -1) { if ((fdHdr = open(File, O_RDWR|O_CREAT, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP)) != -1) {
if (read(fdHdr, &jamHdrInfo, sizeof(JAMHDRINFO)) != sizeof(JAMHDRINFO)) { if (read(fdHdr, &jamHdrInfo, sizeof(JAMHDRINFO)) != sizeof(JAMHDRINFO)) {
memset(&jamHdrInfo, 0, sizeof(JAMHDRINFO)); memset(&jamHdrInfo, 0, sizeof(JAMHDRINFO));
jamHdrInfo.Signature[0] = Signature[0]; jamHdrInfo.Signature[0] = Signature[0];
@ -536,11 +535,11 @@ int JAM_Open(char *Msgbase)
jamHdrInfo.Signature[2] == Signature[2] && jamHdrInfo.Signature[2] == Signature[2] &&
jamHdrInfo.Signature[3] == Signature[3]) { jamHdrInfo.Signature[3] == Signature[3]) {
sprintf(File, "%s%s", Msgbase, EXT_TXTFILE); sprintf(File, "%s%s", Msgbase, EXT_TXTFILE);
fdJdt = open(File, O_RDWR|O_CREAT, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH); fdJdt = open(File, O_RDWR|O_CREAT, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP);
sprintf(File, "%s%s", Msgbase, EXT_IDXFILE); sprintf(File, "%s%s", Msgbase, EXT_IDXFILE);
fdJdx = open(File, O_RDWR|O_CREAT, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH); fdJdx = open(File, O_RDWR|O_CREAT, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP);
sprintf(File, "%s%s", Msgbase, EXT_LRDFILE); sprintf(File, "%s%s", Msgbase, EXT_LRDFILE);
fdJlr = open(File, O_RDWR|O_CREAT, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH); fdJlr = open(File, O_RDWR|O_CREAT, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP);
RetVal = TRUE; RetVal = TRUE;
strcpy(BaseName, Msgbase); strcpy(BaseName, Msgbase);
@ -575,13 +574,13 @@ void JAM_Pack(void)
File = calloc(PATH_MAX, sizeof(char)); File = calloc(PATH_MAX, sizeof(char));
New = calloc(PATH_MAX, sizeof(char)); New = calloc(PATH_MAX, sizeof(char));
sprintf(File, "%s%s", BaseName, ".$dr"); sprintf(File, "%s%s", BaseName, ".$dr");
fdnHdr = open(File, O_RDWR|O_CREAT|O_TRUNC, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH); fdnHdr = open(File, O_RDWR|O_CREAT|O_TRUNC, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP);
sprintf(File, "%s%s", BaseName, ".$dt"); sprintf(File, "%s%s", BaseName, ".$dt");
fdnJdt = open(File, O_RDWR|O_CREAT|O_TRUNC, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH); fdnJdt = open(File, O_RDWR|O_CREAT|O_TRUNC, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP);
sprintf(File, "%s%s", BaseName, ".$dx"); sprintf(File, "%s%s", BaseName, ".$dx");
fdnJdx = open(File, O_RDWR|O_CREAT|O_TRUNC, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH); fdnJdx = open(File, O_RDWR|O_CREAT|O_TRUNC, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP);
sprintf(File, "%s%s", BaseName, ".$lr"); sprintf(File, "%s%s", BaseName, ".$lr");
fdnJlr = open(File, O_RDWR|O_CREAT|O_TRUNC, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH); fdnJlr = open(File, O_RDWR|O_CREAT|O_TRUNC, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP);
if (fdnHdr != -1 && fdnJdt != -1 && fdnJdx != -1 && fdnJlr != -1) { if (fdnHdr != -1 && fdnJdt != -1 && fdnJdx != -1 && fdnJlr != -1) {
lseek(fdHdr, 0L, SEEK_SET); lseek(fdHdr, 0L, SEEK_SET);

View File

@ -18,7 +18,7 @@ HDRS = bank.h commonio.h filesub.h language.h mbsebbs.h misc.h offline.h \
mbstat.h msgutil.h oneline.h sgetpwent.h user.h bye.h morefile.h \ mbstat.h msgutil.h oneline.h sgetpwent.h user.h bye.h morefile.h \
encrypt.h funcs.h mail.h mbuser.h myname.h page.h pwio.h shadowio.h \ encrypt.h funcs.h mail.h mbuser.h myname.h page.h pwio.h shadowio.h \
xmalloc.h change.h exitinfo.h mball.h mbuseradd.h newuser.h \ xmalloc.h change.h exitinfo.h mball.h mbuseradd.h newuser.h \
pinfo.h rad64.h statetbl.h chat.h file.h getdef.h mbpasswd.h menu.h \ pinfo.h rad64.h chat.h file.h getdef.h mbpasswd.h menu.h \
nextuser.h pop3.h safe.h timecheck.h mbnewusr.h input.h whoson.h \ nextuser.h pop3.h safe.h timecheck.h mbnewusr.h input.h whoson.h \
door.h dispfile.h userlist.h timestats.h logentry.h lastcallers.h door.h dispfile.h userlist.h timestats.h logentry.h lastcallers.h
MBSEBBS_OBJS = bank.o bbslist.o chat.o file.o funcs.o mail.o menu.o \ MBSEBBS_OBJS = bank.o bbslist.o chat.o file.o funcs.o mail.o menu.o \
@ -164,9 +164,9 @@ oneline.o: ../lib/libs.h ../lib/mbse.h ../lib/structs.h ../lib/records.h ../lib/
sgetpwent.o: ../config.h sgetpwent.h sgetpwent.o: ../config.h sgetpwent.h
xmalloc.o: ../config.h xmalloc.h xmalloc.o: ../config.h xmalloc.h
bbslist.o: ../lib/libs.h ../lib/mbse.h ../lib/structs.h ../lib/records.h ../lib/clcomm.h ../lib/common.h bbslist.h funcs.h input.h language.h bbslist.o: ../lib/libs.h ../lib/mbse.h ../lib/structs.h ../lib/records.h ../lib/clcomm.h ../lib/common.h bbslist.h funcs.h input.h language.h
morefile.o: ../lib/libs.h ../lib/mbse.h ../lib/structs.h ../lib/records.h ../lib/clcomm.h ../lib/common.h morefile.h morefile.o: ../lib/libs.h ../lib/mbse.h ../lib/structs.h ../lib/records.h ../lib/clcomm.h ../lib/common.h input.h language.h morefile.h timeout.h
email.o: ../lib/libs.h ../lib/mbse.h ../lib/structs.h ../lib/records.h ../lib/msgtext.h ../lib/msg.h ../lib/common.h ../lib/clcomm.h ../lib/mbinet.h exitinfo.h language.h mail.h timeout.h msgutil.h input.h email.h whoson.h email.o: ../lib/libs.h ../lib/mbse.h ../lib/structs.h ../lib/records.h ../lib/msgtext.h ../lib/msg.h ../lib/common.h ../lib/clcomm.h ../lib/mbinet.h exitinfo.h language.h mail.h timeout.h msgutil.h input.h email.h whoson.h
fsedit.o: ../lib/libs.h ../lib/mbse.h ../lib/structs.h ../lib/records.h ../lib/ansi.h ../lib/common.h ../lib/clcomm.h mail.h funcs.h language.h timeout.h pinfo.h fsedit.h fsedit.o: ../lib/libs.h ../lib/mbse.h ../lib/structs.h ../lib/records.h ../lib/ansi.h ../lib/common.h ../lib/clcomm.h mail.h input.h language.h timeout.h pinfo.h fsedit.h
lineedit.o: ../lib/libs.h ../lib/mbse.h ../lib/structs.h ../lib/records.h ../lib/common.h ../lib/clcomm.h mail.h input.h language.h timeout.h lineedit.h lineedit.o: ../lib/libs.h ../lib/mbse.h ../lib/structs.h ../lib/records.h ../lib/common.h ../lib/clcomm.h mail.h input.h language.h timeout.h lineedit.h
mblang.o: ../lib/libs.h ../lib/structs.h ../lib/records.h mblang.o: ../lib/libs.h ../lib/structs.h ../lib/records.h
mbuser.o: ../lib/libs.h ../lib/structs.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/dbcfg.h mbuser.h mbuser.o: ../lib/libs.h ../lib/structs.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/dbcfg.h mbuser.h
@ -203,7 +203,7 @@ misc.o: ../lib/libs.h ../lib/mbse.h ../lib/structs.h ../lib/records.h ../lib/clc
offline.o: ../lib/libs.h ../lib/structs.h ../lib/mbse.h ../lib/records.h ../lib/bluewave.h ../lib/common.h ../lib/clcomm.h ../lib/msgtext.h ../lib/msg.h mail.h funcs.h input.h language.h file.h filesub.h exitinfo.h timeout.h msgutil.h pop3.h offline.h whoson.h offline.o: ../lib/libs.h ../lib/structs.h ../lib/mbse.h ../lib/records.h ../lib/bluewave.h ../lib/common.h ../lib/clcomm.h ../lib/msgtext.h ../lib/msg.h mail.h funcs.h input.h language.h file.h filesub.h exitinfo.h timeout.h msgutil.h pop3.h offline.h whoson.h
putpwent.o: ../config.h putpwent.h putpwent.o: ../config.h putpwent.h
salt.o: ../config.h rad64.h getdef.h salt.o: ../config.h rad64.h getdef.h
user.o: ../lib/libs.h ../lib/mbse.h ../lib/structs.h ../lib/records.h ../lib/common.h ../lib/clcomm.h timeout.h user.h dispfile.h funcs.h input.h misc.h bye.h file.h mail.h change.h menu.h exitinfo.h language.h offline.h statetbl.h email.h user.o: ../lib/libs.h ../lib/mbse.h ../lib/structs.h ../lib/records.h ../lib/common.h ../lib/clcomm.h timeout.h user.h dispfile.h funcs.h input.h misc.h bye.h file.h mail.h change.h menu.h exitinfo.h language.h offline.h email.h
mbnewusr.o: ../lib/libs.h ../lib/mbse.h ../lib/structs.h ../lib/records.h ../lib/common.h ../lib/clcomm.h mbnewusr.h funcs.h input.h language.h misc.h timeout.h newuser.h mbnewusr.o: ../lib/libs.h ../lib/mbse.h ../lib/structs.h ../lib/records.h ../lib/common.h ../lib/clcomm.h mbnewusr.h funcs.h input.h language.h misc.h timeout.h newuser.h
input.o: ../lib/libs.h ../lib/mbse.h ../lib/structs.h ../lib/records.h ../lib/clcomm.h ../lib/common.h input.h timeout.h language.h input.o: ../lib/libs.h ../lib/mbse.h ../lib/structs.h ../lib/records.h ../lib/clcomm.h ../lib/common.h input.h timeout.h language.h
whoson.o: ../lib/libs.h ../lib/mbse.h ../lib/structs.h ../lib/records.h ../lib/common.h ../lib/clcomm.h input.h language.h exitinfo.h whoson.h whoson.o: ../lib/libs.h ../lib/mbse.h ../lib/structs.h ../lib/records.h ../lib/common.h ../lib/clcomm.h input.h language.h exitinfo.h whoson.h

View File

@ -88,6 +88,7 @@ void Bank()
bankhdr.recsize = sizeof(bank); bankhdr.recsize = sizeof(bank);
fwrite(&bankhdr, sizeof(bankhdr), 1, pBank); fwrite(&bankhdr, sizeof(bankhdr), 1, pBank);
fclose(pBank); fclose(pBank);
chmod(temp, 0660);
Syslog('-', "Created %s", temp); Syslog('-', "Created %s", temp);
AddAccount(); AddAccount();
if ((pBank = fopen(temp, "r+")) == NULL) { if ((pBank = fopen(temp, "r+")) == NULL) {

View File

@ -197,6 +197,7 @@ void BBS_Add(void)
fwrite(&bbs, sizeof(bbs), 1, pBBSList); fwrite(&bbs, sizeof(bbs), 1, pBBSList);
fclose(pBBSList); fclose(pBBSList);
chmod(sFileName, 0660);
free(temp); free(temp);
free(sFileName); free(sFileName);
} }
@ -702,6 +703,7 @@ void BBS_Delete(void)
} }
fclose(pBBSLine); fclose(pBBSLine);
chmod(sFileName, 0660);
} }

View File

@ -1,9 +1,7 @@
/***************************************************************************** /*****************************************************************************
* $Id$
* *
* File ..................: mbsebbs/fsedit.c * $Id$
* Purpose ...............: FullScreen Message editor. * Purpose ...............: FullScreen Message editor.
* Last modification date : 29-Oct-2001
* *
***************************************************************************** *****************************************************************************
* Copyright (C) 1997-2001 * Copyright (C) 1997-2001
@ -39,7 +37,7 @@
#include "../lib/common.h" #include "../lib/common.h"
#include "../lib/clcomm.h" #include "../lib/clcomm.h"
#include "mail.h" #include "mail.h"
#include "funcs.h" #include "input.h"
#include "language.h" #include "language.h"
#include "timeout.h" #include "timeout.h"
#include "pinfo.h" #include "pinfo.h"

View File

@ -454,6 +454,7 @@ void closepage(FILE *fa, char *Path, int inArea, int Current)
rename(temp2, temp1); rename(temp2, temp1);
free(temp1); free(temp1);
free(temp2); free(temp2);
chmod(temp1, 0644);
fa = NULL; fa = NULL;
} }
@ -656,6 +657,7 @@ void MakeIndex()
fclose(fm); fclose(fm);
sprintf(linebuf, "%s/index.html", CFG.ftp_base); sprintf(linebuf, "%s/index.html", CFG.ftp_base);
rename(fn, linebuf); rename(fn, linebuf);
chmod(linebuf, 0644);
fclose(pAreas); fclose(pAreas);
free(sAreas); free(sAreas);

View File

@ -1,8 +1,7 @@
/***************************************************************************** /*****************************************************************************
* *
* File ..................: mbtoberep/mbtoberep.c * $Id$
* Purpose ...............: Show contents of toberep.data * Purpose ...............: Show contents of toberep.data
* Last modification date : 09-Aug-2001
* *
***************************************************************************** *****************************************************************************
* Copyright (C) 1997-2001 * Copyright (C) 1997-2001
@ -91,6 +90,7 @@ int main(int argc, char **argv)
} }
fclose(fp); fclose(fp);
chmod(temp, 0640);
free(temp); free(temp);
#ifdef MEMWATCH #ifdef MEMWATCH
mwTerm(); mwTerm();

View File

@ -354,6 +354,7 @@ void UserPack(int days, int level, int pack)
} }
fclose(fin); fclose(fin);
fclose(fout); fclose(fout);
chmod(fnin, 0660);
Syslog('+', "Userbase is updated, written %d records", record); Syslog('+', "Userbase is updated, written %d records", record);
} }
unlink(fnout); unlink(fnout);

View File

@ -72,7 +72,7 @@ int ChkFiles()
* Check if users.data exists, if not create a new one. * Check if users.data exists, if not create a new one.
*/ */
sprintf(temp, "%s/etc/users.data", getenv("MBSE_ROOT")); sprintf(temp, "%s/etc/users.data", getenv("MBSE_ROOT"));
if((pUsersFile = fopen(temp,"rb")) == NULL) { if ((pUsersFile = fopen(temp,"rb")) == NULL) {
if((pUsersFile = fopen(temp,"wb")) == NULL) { if((pUsersFile = fopen(temp,"wb")) == NULL) {
WriteError("$Can't create %s", temp); WriteError("$Can't create %s", temp);
ExitClient(1); ExitClient(1);
@ -81,13 +81,14 @@ int ChkFiles()
usrconfighdr.recsize = sizeof(usrconfig); usrconfighdr.recsize = sizeof(usrconfig);
fwrite(&usrconfighdr, sizeof(usrconfighdr), 1, pUsersFile); fwrite(&usrconfighdr, sizeof(usrconfighdr), 1, pUsersFile);
fclose(pUsersFile); fclose(pUsersFile);
chmod(temp, 0660);
} }
} }
/* /*
* Check if sysinfo.data exists, if not, create a new one. * Check if sysinfo.data exists, if not, create a new one.
*/ */
if((pCallerLog = fopen(sDataFile, "rb")) == NULL) { if ((pCallerLog = fopen(sDataFile, "rb")) == NULL) {
if((pCallerLog = fopen(sDataFile, "wb")) == NULL) if((pCallerLog = fopen(sDataFile, "wb")) == NULL)
WriteError("$ChkFiles: Can't create %s", sDataFile); WriteError("$ChkFiles: Can't create %s", sDataFile);
else { else {
@ -98,6 +99,7 @@ int ChkFiles()
rewind(pCallerLog); rewind(pCallerLog);
fwrite(&SYSINFO, sizeof(SYSINFO), 1, pCallerLog); fwrite(&SYSINFO, sizeof(SYSINFO), 1, pCallerLog);
fclose(pCallerLog); fclose(pCallerLog);
chmod(sDataFile, 0660);
} }
} }
free(temp); free(temp);
@ -177,9 +179,10 @@ void SaveLastCallers()
Syslog('+', "Created new lastcall.data"); Syslog('+', "Created new lastcall.data");
} }
fclose(pGLC); fclose(pGLC);
chmod(sFileName, 0660);
} }
if(( pGLC = fopen(sFileName,"a+")) == NULL) { if ((pGLC = fopen(sFileName,"a+")) == NULL) {
WriteError("$Can't open %s", sFileName); WriteError("$Can't open %s", sFileName);
return; return;
} else { } else {

View File

@ -58,6 +58,7 @@ void Oneliner_Check()
olhdr.recsize = sizeof(ol); olhdr.recsize = sizeof(ol);
fwrite(&olhdr, sizeof(olhdr), 1, pOneline); fwrite(&olhdr, sizeof(olhdr), 1, pOneline);
fclose(pOneline); fclose(pOneline);
chmod(sFileName, 0660);
Syslog('-', "Created oneliner database"); Syslog('-', "Created oneliner database");
} }
} }

View File

@ -373,6 +373,7 @@ int SafeCheckUser(void)
safe.Opened = 0; safe.Opened = 0;
fwrite(&safe, sizeof(safe), 1, pSafe); fwrite(&safe, sizeof(safe), 1, pSafe);
fclose(pSafe); fclose(pSafe);
chmod(File, 0660);
} }
} else { } else {
while ( fread(&safe, sizeof(safe), 1, pSafe) == 1) { while ( fread(&safe, sizeof(safe), 1, pSafe) == 1) {

View File

@ -1,48 +0,0 @@
#ifndef STATETBL_H
#define STATETBL_H
#define SM_DECL(proc,name) \
int proc(void)\
{\
int sm_success=0;\
char *sm_name=name;
#define SM_STATES \
enum {
#define SM_NAMES \
} sm_state;\
char * sm_sname[] = {
#define SM_EDECL \
};
#define SM_START(x) \
sm_state=x;\
Syslog('S', "Statemachine %s start %s (%d)", sm_name, sm_sname[sm_state], sm_state);\
while (!sm_success) switch (sm_state)\
{\
default: WriteError("Statemachine %s error: state=%d",sm_name,sm_state);\
sm_success=-1;
#define SM_STATE(x) \
break;\
case x:
#define SM_END \
}\
#define SM_RETURN \
return (sm_success != 1);\
}
#define SM_PROCEED(x) \
sm_state=x; break;
#define SM_SUCCESS \
sm_success=1; break;
#define SM_ERROR \
sm_success=-1; break;
#endif

View File

@ -50,7 +50,6 @@
#include "exitinfo.h" #include "exitinfo.h"
#include "language.h" #include "language.h"
#include "offline.h" #include "offline.h"
#include "statetbl.h"
#include "email.h" #include "email.h"

View File

@ -1,8 +1,7 @@
/***************************************************************************** /*****************************************************************************
* *
* File ..................: setup/m_archive.c * $Id$
* Purpose ...............: Setup Archive structure. * Purpose ...............: Setup Archive structure.
* Last modification date : 25-Oct-2001
* *
***************************************************************************** *****************************************************************************
* Copyright (C) 1997-2001 * Copyright (C) 1997-2001
@ -162,6 +161,7 @@ int CountArchive(void)
fwrite(&archiver, sizeof(archiver), 1, fil); fwrite(&archiver, sizeof(archiver), 1, fil);
fclose(fil); fclose(fil);
chmod(ffile, 0640);
return 8; return 8;
} else } else
return -1; return -1;
@ -264,6 +264,7 @@ void CloseArchive(int force)
fclose(fi); fclose(fi);
fclose(fo); fclose(fo);
unlink(fout); unlink(fout);
chmod(fin, 0640);
Syslog('+', "Updated \"archiver.data\""); Syslog('+', "Updated \"archiver.data\"");
return; return;
} }

View File

@ -1,8 +1,7 @@
/***************************************************************************** /*****************************************************************************
* *
* File ..................: m_domain.c * $Id$
* Purpose ...............: Domain Setup * Purpose ...............: Domain Setup
* Last modification date : 19-Oct-2001
* *
***************************************************************************** *****************************************************************************
* Copyright (C) 1997-2001 * Copyright (C) 1997-2001
@ -87,6 +86,7 @@ int CountDomain(void)
sprintf(domtrans.intdom, ".ftn"); sprintf(domtrans.intdom, ".ftn");
fwrite(&domtrans, sizeof(domtrans), 1, fil); fwrite(&domtrans, sizeof(domtrans), 1, fil);
fclose(fil); fclose(fil);
chmod(ffile, 0640);
return 7; return 7;
} else } else
return -1; return -1;
@ -180,6 +180,7 @@ void CloseDomain(int force)
fclose(fi); fclose(fi);
fclose(fo); fclose(fo);
unlink(fout); unlink(fout);
chmod(fin, 0640);
Syslog('+', "Updated \"domtrans.data\""); Syslog('+', "Updated \"domtrans.data\"");
return; return;
} }

View File

@ -1,8 +1,7 @@
/***************************************************************************** /*****************************************************************************
* *
* File ..................: m_farea.c * $Id$
* Purpose ...............: File Setup Program * Purpose ...............: File Setup Program
* Last modification date : 19-Oct-2001
* *
***************************************************************************** *****************************************************************************
* Copyright (C) 1997-2001 * Copyright (C) 1997-2001
@ -66,6 +65,7 @@ int CountFilearea(void)
areahdr.recsize = sizeof(area); areahdr.recsize = sizeof(area);
fwrite(&areahdr, sizeof(areahdr), 1, fil); fwrite(&areahdr, sizeof(areahdr), 1, fil);
fclose(fil); fclose(fil);
chmod(ffile, 0640);
return 0; return 0;
} else } else
return -1; return -1;
@ -146,6 +146,7 @@ void CloseFilearea(int force)
working(1, 0, 0); working(1, 0, 0);
if ((rename(fout, fin)) == 0) if ((rename(fout, fin)) == 0)
unlink(fout); unlink(fout);
chmod(fin, 0640);
Syslog('+', "Updated \"fareas.data\""); Syslog('+', "Updated \"fareas.data\"");
return; return;
} }

View File

@ -1,8 +1,7 @@
/***************************************************************************** /*****************************************************************************
* *
* File ..................: m_ff.c * $Id$
* Purpose ...............: Filefind Setup * Purpose ...............: Filefind Setup
* Last modification date : 19-Oct-2001
* *
***************************************************************************** *****************************************************************************
* Copyright (C) 1997-2001 * Copyright (C) 1997-2001
@ -65,6 +64,7 @@ int CountFilefind(void)
scanmgrhdr.recsize = sizeof(scanmgr); scanmgrhdr.recsize = sizeof(scanmgr);
fwrite(&scanmgrhdr, sizeof(scanmgrhdr), 1, fil); fwrite(&scanmgrhdr, sizeof(scanmgrhdr), 1, fil);
fclose(fil); fclose(fil);
chmod(ffile, 0640);
return 0; return 0;
} else } else
return -1; return -1;
@ -166,6 +166,7 @@ void CloseFilefind(int force)
fclose(fo); fclose(fo);
tidy_stlist(&fff); tidy_stlist(&fff);
unlink(fout); unlink(fout);
chmod(fin, 0640);
Syslog('+', "Updated \"scanmgr.data\""); Syslog('+', "Updated \"scanmgr.data\"");
return; return;
} }

View File

@ -1,8 +1,7 @@
/***************************************************************************** /*****************************************************************************
* *
* File ..................: setup/m_fgroups.c * $Id$
* Purpose ...............: Setup FGroups. * Purpose ...............: Setup FGroups.
* Last modification date : 19-Oct-2001
* *
***************************************************************************** *****************************************************************************
* Copyright (C) 1997-2001 * Copyright (C) 1997-2001
@ -66,6 +65,7 @@ int CountFGroup(void)
fgrouphdr.recsize = sizeof(fgroup); fgrouphdr.recsize = sizeof(fgroup);
fwrite(&fgrouphdr, sizeof(fgrouphdr), 1, fil); fwrite(&fgrouphdr, sizeof(fgrouphdr), 1, fil);
fclose(fil); fclose(fil);
chmod(ffile, 0640);
return 0; return 0;
} else } else
return -1; return -1;
@ -179,6 +179,7 @@ void CloseFGroup(int force)
fclose(fi); fclose(fi);
fclose(fo); fclose(fo);
unlink(fout); unlink(fout);
chmod(fin, 0640);
Syslog('+', "Updated \"fgroups.data\""); Syslog('+', "Updated \"fgroups.data\"");
return; return;
} }

View File

@ -1,8 +1,7 @@
/***************************************************************************** /*****************************************************************************
* *
* File ..................: setup/m_fido.c * $Id$
* Purpose ...............: Setup Fidonet structure. * Purpose ...............: Setup Fidonet structure.
* Last modification date : 25-Oct-2001
* *
***************************************************************************** *****************************************************************************
* Copyright (C) 1997-2001 * Copyright (C) 1997-2001
@ -91,6 +90,7 @@ int CountFidonet(void)
fwrite(&fidonet, sizeof(fidonet), 1, fil); fwrite(&fidonet, sizeof(fidonet), 1, fil);
fclose(fil); fclose(fil);
exp_golded = TRUE; exp_golded = TRUE;
chmod(ffile, 0640);
return 2; return 2;
} else } else
return -1; return -1;
@ -196,6 +196,7 @@ void CloseFidonet(int force)
fclose(fo); fclose(fo);
unlink(fout); unlink(fout);
tidy_stlist(&fid); tidy_stlist(&fid);
chmod(fin, 0640);
Syslog('+', "Updated \"fidonet.data\""); Syslog('+', "Updated \"fidonet.data\"");
return; return;

View File

@ -89,12 +89,13 @@ int config_read(void)
int config_write(void) int config_write(void)
{ {
some_fd = open(some_fn, O_CREAT | O_WRONLY, S_IRUSR | S_IWUSR); some_fd = open(some_fn, O_CREAT | O_WRONLY, S_IRUSR | S_IWUSR | S_IRGRP);
if (some_fd == -1) if (some_fd == -1)
return -1; return -1;
write(some_fd, &CFG, sizeof(CFG)); write(some_fd, &CFG, sizeof(CFG));
close(some_fd); close(some_fd);
chmod(some_fn, 0640);
exp_golded = TRUE; exp_golded = TRUE;
return 0; return 0;
} }

View File

@ -1,8 +1,7 @@
/***************************************************************************** /*****************************************************************************
* *
* File ..................: m_hatch.c * $Id$
* Purpose ...............: Hatch Setup * Purpose ...............: Hatch Setup
* Last modification date : 19-Oct-2001
* *
***************************************************************************** *****************************************************************************
* Copyright (C) 1997-2001 * Copyright (C) 1997-2001
@ -75,6 +74,7 @@ int CountHatch(void)
hatchhdr.lastupd = time(NULL); hatchhdr.lastupd = time(NULL);
fwrite(&hatchhdr, sizeof(hatchhdr), 1, fil); fwrite(&hatchhdr, sizeof(hatchhdr), 1, fil);
fclose(fil); fclose(fil);
chmod(ffile, 0640);
return 0; return 0;
} else } else
return -1; return -1;
@ -185,6 +185,7 @@ void CloseHatch(int force)
fclose(fi); fclose(fi);
fclose(fo); fclose(fo);
unlink(fout); unlink(fout);
chmod(fin, 0640);
Syslog('+', "Updated \"hatch.data\""); Syslog('+', "Updated \"hatch.data\"");
return; return;
} }

View File

@ -1,8 +1,7 @@
/***************************************************************************** /*****************************************************************************
* *
* File ..................: setup/m_language.c * $Id$
* Purpose ...............: Setup Languages. * Purpose ...............: Setup Languages.
* Last modification date : 19-Oct-2001
* *
***************************************************************************** *****************************************************************************
* Copyright (C) 1997-2001 * Copyright (C) 1997-2001
@ -118,7 +117,8 @@ int CountLanguage(void)
fwrite(&lang, sizeof(lang), 1, fil); fwrite(&lang, sizeof(lang), 1, fil);
fclose(fil); fclose(fil);
return 2; chmod(ffile, 0640);
return 5;
} else } else
return -1; return -1;
} }
@ -220,6 +220,7 @@ void CloseLanguage(int force)
fclose(fo); fclose(fo);
unlink(fout); unlink(fout);
tidy_stlist(&lan); tidy_stlist(&lan);
chmod(fin, 0640);
Syslog('+', "Updated \"language.data\""); Syslog('+', "Updated \"language.data\"");
return; return;
} }

View File

@ -1,8 +1,7 @@
/***************************************************************************** /*****************************************************************************
* *
* File ..................: setup/m_limits.c * $Id$
* Purpose ...............: Setup Limits. * Purpose ...............: Setup Limits.
* Last modification date : 19-Oct-2001
* *
***************************************************************************** *****************************************************************************
* Copyright (C) 1997-2001 * Copyright (C) 1997-2001
@ -128,6 +127,7 @@ int CountLimits(void)
fwrite(&LIMIT, sizeof(LIMIT), 1, fil); fwrite(&LIMIT, sizeof(LIMIT), 1, fil);
fclose(fil); fclose(fil);
chmod(ffile, 0640);
return 7; return 7;
} else } else
return -1; return -1;
@ -232,6 +232,7 @@ void CloseLimits(int force)
fclose(fi); fclose(fi);
fclose(fo); fclose(fo);
unlink(fout); unlink(fout);
chmod(fin, 0640);
Syslog('+', "Updated \"limits.data\""); Syslog('+', "Updated \"limits.data\"");
return; return;
} }

View File

@ -1,8 +1,7 @@
/***************************************************************************** /*****************************************************************************
* *
* File ..................: setup/m_magic.c * $Id$
* Purpose ...............: Edit Magics * Purpose ...............: Edit Magics
* Last modification date : 19-Oct-2001
* *
***************************************************************************** *****************************************************************************
* Copyright (C) 1997-2001 * Copyright (C) 1997-2001
@ -65,6 +64,7 @@ int CountMagics(void)
magichdr.recsize = sizeof(magic); magichdr.recsize = sizeof(magic);
fwrite(&magichdr, sizeof(magichdr), 1, fil); fwrite(&magichdr, sizeof(magichdr), 1, fil);
fclose(fil); fclose(fil);
chmod(ffile, 0640);
return 0; return 0;
} else } else
return -1; return -1;
@ -176,6 +176,7 @@ void CloseMagics(int force)
fclose(fo); fclose(fo);
tidy_stlist(&mag); tidy_stlist(&mag);
unlink(fout); unlink(fout);
chmod(fin, 0640);
Syslog('+', "Updated \"magic.data\""); Syslog('+', "Updated \"magic.data\"");
return; return;
} }

View File

@ -1,8 +1,7 @@
/***************************************************************************** /*****************************************************************************
* *
* File ..................: m_marea.c * $Id$
* Purpose ...............: Message Areas Setup * Purpose ...............: Message Areas Setup
* Last modification date : 25-Oct-2001
* *
***************************************************************************** *****************************************************************************
* Copyright (C) 1997-2001 * Copyright (C) 1997-2001
@ -72,6 +71,7 @@ int CountMsgarea(void)
fwrite(&msgshdr, sizeof(msgshdr), 1, fil); fwrite(&msgshdr, sizeof(msgshdr), 1, fil);
fclose(fil); fclose(fil);
exp_golded = TRUE; exp_golded = TRUE;
chmod(ffile, 0660);
return 0; return 0;
} else } else
return -1; return -1;
@ -194,6 +194,7 @@ void CloseMsgarea(int Force)
exp_golded = TRUE; exp_golded = TRUE;
if ((rename(fout, fin)) == 0) if ((rename(fout, fin)) == 0)
unlink(fout); unlink(fout);
chmod(fin, 0660);
Syslog('+', "Updated \"mareas.data\""); Syslog('+', "Updated \"mareas.data\"");
return; return;
} }

View File

@ -1,8 +1,7 @@
/***************************************************************************** /*****************************************************************************
* *
* File ..................: mbsetup/m_menu.c * $Id$
* Purpose ...............: Edit BBS menus * Purpose ...............: Edit BBS menus
* Last modification date : 27-Oct-2001
* *
***************************************************************************** *****************************************************************************
* Copyright (C) 1997-2001 * Copyright (C) 1997-2001
@ -346,6 +345,7 @@ void EditMenu(char *Name)
fwrite(&menus, sizeof(menus), 1, fil); fwrite(&menus, sizeof(menus), 1, fil);
} }
fclose(fil); fclose(fil);
chmod(temp, 0640);
} }
working(0, 0, 0); working(0, 0, 0);
} }
@ -519,6 +519,7 @@ void EditMenus(void)
errmsg("Can't create menu %s", temp); errmsg("Can't create menu %s", temp);
} else { } else {
fclose(fil); fclose(fil);
chmod(p, 0640);
Syslog('+', "Created menufile %s", p); Syslog('+', "Created menufile %s", p);
} }
} else { } else {

View File

@ -1,8 +1,7 @@
/***************************************************************************** /*****************************************************************************
* *
* File ..................: setup/m_mgroups.c * $Id$
* Purpose ...............: Setup MGroups. * Purpose ...............: Setup MGroups.
* Last modification date : 19-Oct-2001
* *
***************************************************************************** *****************************************************************************
* Copyright (C) 1997-2001 * Copyright (C) 1997-2001
@ -66,6 +65,7 @@ int CountMGroup(void)
mgrouphdr.recsize = sizeof(mgroup); mgrouphdr.recsize = sizeof(mgroup);
fwrite(&mgrouphdr, sizeof(mgrouphdr), 1, fil); fwrite(&mgrouphdr, sizeof(mgrouphdr), 1, fil);
fclose(fil); fclose(fil);
chmod(ffile, 0640);
return 0; return 0;
} else } else
return -1; return -1;
@ -179,6 +179,7 @@ void CloseMGroup(int force)
fclose(fi); fclose(fi);
fclose(fo); fclose(fo);
unlink(fout); unlink(fout);
chmod(fin, 0640);
Syslog('+', "Updated \"mgroups.data\""); Syslog('+', "Updated \"mgroups.data\"");
return; return;
} }

View File

@ -1,8 +1,7 @@
/***************************************************************************** /*****************************************************************************
* *
* File ..................: setup/m_modem.c * $Id$
* Purpose ...............: Setup Modem structure. * Purpose ...............: Setup Modem structure.
* Last modification date : 19-Oct-2001
* *
***************************************************************************** *****************************************************************************
* Copyright (C) 1997-2001 * Copyright (C) 1997-2001
@ -145,6 +144,7 @@ int CountModem(void)
fwrite(&modem, sizeof(modem), 1, fil); fwrite(&modem, sizeof(modem), 1, fil);
fclose(fil); fclose(fil);
chmod(ffile, 0640);
return 4; return 4;
} else } else
return -1; return -1;
@ -247,6 +247,7 @@ void CloseModem(int force)
fclose(fi); fclose(fi);
fclose(fo); fclose(fo);
unlink(fout); unlink(fout);
chmod(fin, 0640);
Syslog('+', "Updated \"modem.data\""); Syslog('+', "Updated \"modem.data\"");
return; return;
} }

View File

@ -1,8 +1,7 @@
/***************************************************************************** /*****************************************************************************
* *
* File ..................: m_fnewfiles.c * $id$
* Purpose ...............: Newfiles Setup * Purpose ...............: Newfiles Setup
* Last modification date : 19-Oct-2001
* *
***************************************************************************** *****************************************************************************
* Copyright (C) 1997-2001 * Copyright (C) 1997-2001
@ -68,6 +67,7 @@ int CountNewfiles(void)
newfileshdr.grpsize = CFG.new_groups * 13; newfileshdr.grpsize = CFG.new_groups * 13;
fwrite(&newfileshdr, sizeof(newfileshdr), 1, fil); fwrite(&newfileshdr, sizeof(newfileshdr), 1, fil);
fclose(fil); fclose(fil);
chmod(ffile, 0640);
return 0; return 0;
} else } else
return -1; return -1;
@ -201,6 +201,7 @@ void CloseNewfiles(int force)
fclose(fo); fclose(fo);
tidy_stlist(&new); tidy_stlist(&new);
unlink(fout); unlink(fout);
chmod(fin, 0640);
Syslog('+', "Updated \"newfiles.data\""); Syslog('+', "Updated \"newfiles.data\"");
return; return;
} }

View File

@ -1,8 +1,7 @@
/***************************************************************************** /*****************************************************************************
* *
* File ..................: setup/m_ngroups.c * $Id$
* Purpose ...............: Setup NGroups. * Purpose ...............: Setup NGroups.
* Last modification date : 19-Oct-2001
* *
***************************************************************************** *****************************************************************************
* Copyright (C) 1997-2001 * Copyright (C) 1997-2001
@ -64,6 +63,7 @@ int CountNGroup(void)
ngrouphdr.recsize = sizeof(ngroup); ngrouphdr.recsize = sizeof(ngroup);
fwrite(&ngrouphdr, sizeof(ngrouphdr), 1, fil); fwrite(&ngrouphdr, sizeof(ngrouphdr), 1, fil);
fclose(fil); fclose(fil);
chmod(ffile, 0640);
return 0; return 0;
} else } else
return -1; return -1;
@ -175,6 +175,7 @@ void CloseNGroup(int force)
fclose(fi); fclose(fi);
fclose(fo); fclose(fo);
unlink(fout); unlink(fout);
chmod(fin, 0640);
Syslog('+', "Updated \"ngroups.data\""); Syslog('+', "Updated \"ngroups.data\"");
return; return;
} }

View File

@ -1,8 +1,7 @@
/***************************************************************************** /*****************************************************************************
* *
* File ..................: m_node.c * $Id$
* Purpose ...............: Nodes Setup Program * Purpose ...............: Nodes Setup Program
* Last modification date : 25-Oct-2001
* *
***************************************************************************** *****************************************************************************
* Copyright (C) 1997-2001 * Copyright (C) 1997-2001
@ -70,6 +69,7 @@ int CountNoderec(void)
nodeshdr.mailgrp = CFG.toss_groups * 13; nodeshdr.mailgrp = CFG.toss_groups * 13;
fwrite(&nodeshdr, sizeof(nodeshdr), 1, fil); fwrite(&nodeshdr, sizeof(nodeshdr), 1, fil);
fclose(fil); fclose(fil);
chmod(ffile, 0640);
return 0; return 0;
} else } else
return -1; return -1;
@ -234,6 +234,7 @@ void CloseNoderec(int Force)
fclose(fi); fclose(fi);
fclose(fo); fclose(fo);
unlink(fout); unlink(fout);
chmod(fin, 0640);
Syslog('+', "Updated \"nodes.data\""); Syslog('+', "Updated \"nodes.data\"");
return; return;
} }

View File

@ -1,8 +1,7 @@
/***************************************************************************** /*****************************************************************************
* *
* File ..................: setup/m_ol.c * $Id$
* Purpose ...............: Setup Oneliners. * Purpose ...............: Setup Oneliners.
* Last modification date : 19-Oct-2001
* *
***************************************************************************** *****************************************************************************
* Copyright (C) 1997-2001 * Copyright (C) 1997-2001
@ -63,6 +62,7 @@ int CountOneline(void)
olhdr.recsize = sizeof(ol); olhdr.recsize = sizeof(ol);
fwrite(&olhdr, sizeof(olhdr), 1, fil); fwrite(&olhdr, sizeof(olhdr), 1, fil);
fclose(fil); fclose(fil);
chmod(ffile, 0660);
return 0; return 0;
} else } else
return -1; return -1;
@ -148,6 +148,7 @@ void CloseOneline(int force)
working(1, 0, 0); working(1, 0, 0);
if ((rename(fout, fin)) == 0) if ((rename(fout, fin)) == 0)
unlink(fout); unlink(fout);
chmod(fin, 0660);
Syslog('+', "Updated \"oneline.data\""); Syslog('+', "Updated \"oneline.data\"");
return; return;
} }

View File

@ -1,8 +1,7 @@
/***************************************************************************** /*****************************************************************************
* *
* File ..................: mbsetup/m_protocol.c * $Id$
* Purpose ...............: Setup Protocols. * Purpose ...............: Setup Protocols.
* Last modification date : 19-Oct-2001
* *
***************************************************************************** *****************************************************************************
* Copyright (C) 1997-2001 * Copyright (C) 1997-2001
@ -108,6 +107,7 @@ int CountProtocol(void)
fwrite(&PROT, sizeof(PROT), 1, fil); fwrite(&PROT, sizeof(PROT), 1, fil);
fclose(fil); fclose(fil);
chmod(ffile, 0640);
return 4; return 4;
} else } else
return -1; return -1;
@ -209,6 +209,7 @@ void CloseProtocol(int force)
fclose(fi); fclose(fi);
fclose(fo); fclose(fo);
unlink(fout); unlink(fout);
chmod(fin, 0640);
tidy_stlist(&pro); tidy_stlist(&pro);
Syslog('+', "Updated \"protocol.data\""); Syslog('+', "Updated \"protocol.data\"");
return; return;

View File

@ -1,8 +1,7 @@
/***************************************************************************** /*****************************************************************************
* *
* File ..................: m_service.c * $Id$
* Purpose ...............: Service Setup * Purpose ...............: Service Setup
* Last modification date : 19-Oct-2001
* *
***************************************************************************** *****************************************************************************
* Copyright (C) 1997-2001 * Copyright (C) 1997-2001
@ -83,6 +82,7 @@ int CountService(void)
sprintf(servrec.Service, "raid"); sprintf(servrec.Service, "raid");
fwrite(&servrec, sizeof(servrec), 1, fil); fwrite(&servrec, sizeof(servrec), 1, fil);
fclose(fil); fclose(fil);
chmod(ffile, 0640);
return 6; return 6;
} else } else
return -1; return -1;
@ -184,6 +184,7 @@ void CloseService(int force)
fclose(fi); fclose(fi);
fclose(fo); fclose(fo);
unlink(fout); unlink(fout);
chmod(fin, 0640);
Syslog('+', "Updated \"servrec.data\""); Syslog('+', "Updated \"servrec.data\"");
return; return;
} }

View File

@ -1,8 +1,7 @@
/***************************************************************************** /*****************************************************************************
* *
* File ..................: setup/m_task.c * $Id$
* Purpose ...............: Setup TaskManager. * Purpose ...............: Setup TaskManager.
* Last modification date : 19-Oct-2001
* *
***************************************************************************** *****************************************************************************
* Copyright (C) 1997-2001 * Copyright (C) 1997-2001
@ -84,6 +83,7 @@ void CloseTask(void)
if ((fp = fopen(fin, "w+")) != NULL) { if ((fp = fopen(fin, "w+")) != NULL) {
fwrite(&TCFG, sizeof(TCFG), 1, fp); fwrite(&TCFG, sizeof(TCFG), 1, fp);
fclose(fp); fclose(fp);
chmod(fin, 0640);
Syslog('+', "Updated \"task.data\""); Syslog('+', "Updated \"task.data\"");
} }
} }

View File

@ -1,8 +1,7 @@
/***************************************************************************** /*****************************************************************************
* *
* File ..................: m_ticareas.c * $Id$
* Purpose ...............: TIC Areas Setup Program * Purpose ...............: TIC Areas Setup Program
* Last modification date : 19-Oct-2001
* *
***************************************************************************** *****************************************************************************
* Copyright (C) 1997-2001 * Copyright (C) 1997-2001
@ -73,6 +72,7 @@ int CountTicarea(void)
tichdr.lastupd = time(NULL); tichdr.lastupd = time(NULL);
fwrite(&tichdr, sizeof(tichdr), 1, fil); fwrite(&tichdr, sizeof(tichdr), 1, fil);
fclose(fil); fclose(fil);
chmod(ffile, 0640);
return 0; return 0;
} else } else
return -1; return -1;
@ -219,6 +219,7 @@ void CloseTicarea(int Force)
fclose(fi); fclose(fi);
fclose(fo); fclose(fo);
unlink(fout); unlink(fout);
chmod(fin, 0640);
Syslog('+', "Updated \"tic.data\""); Syslog('+', "Updated \"tic.data\"");
return; return;
} }

View File

@ -1,8 +1,7 @@
/***************************************************************************** /*****************************************************************************
* *
* File ..................: setup/m_tty.c * $Id$
* Purpose ...............: Setup Ttyinfo structure. * Purpose ...............: Setup Ttyinfo structure.
* Last modification date : 19-Oct-2001
* *
***************************************************************************** *****************************************************************************
* Copyright (C) 1997-2001 * Copyright (C) 1997-2001
@ -139,6 +138,7 @@ int CountTtyinfo(void)
} }
fclose(fil); fclose(fil);
chmod(ffile, 0640);
return 34; return 34;
} else } else
return -1; return -1;
@ -241,6 +241,7 @@ void CloseTtyinfo(int force)
fclose(fi); fclose(fi);
fclose(fo); fclose(fo);
unlink(fout); unlink(fout);
chmod(fin, 0640);
Syslog('+', "Updated \"ttyinfo.data\""); Syslog('+', "Updated \"ttyinfo.data\"");
return; return;
} }

View File

@ -65,6 +65,7 @@ int CountUsers(void)
usrconfighdr.recsize = sizeof(usrconfig); usrconfighdr.recsize = sizeof(usrconfig);
fwrite(&usrconfighdr, sizeof(usrconfighdr), 1, fil); fwrite(&usrconfighdr, sizeof(usrconfighdr), 1, fil);
fclose(fil); fclose(fil);
chmod(ffile, 0660);
return 0; return 0;
} else } else
return -1; return -1;
@ -150,6 +151,7 @@ void CloseUsers(int force)
working(1, 0, 0); working(1, 0, 0);
if ((rename(fout, fin)) == 0) if ((rename(fout, fin)) == 0)
unlink(fout); unlink(fout);
chmod(fin, 0660);
Syslog('+', "Updated \"users.data\""); Syslog('+', "Updated \"users.data\"");
return; return;
} }

View File

@ -1,8 +1,7 @@
/***************************************************************************** /*****************************************************************************
* *
* File ..................: setup/m_virus.c * $Id$
* Purpose ...............: Setup Virus structure. * Purpose ...............: Setup Virus structure.
* Last modification date : 25-Oct-2001
* *
***************************************************************************** *****************************************************************************
* Copyright (C) 1997-2001 * Copyright (C) 1997-2001
@ -86,6 +85,7 @@ int CountVirus(void)
fwrite(&virscan, sizeof(virscan), 1, fil); fwrite(&virscan, sizeof(virscan), 1, fil);
fclose(fil); fclose(fil);
chmod(ffile, 0640);
return 3; return 3;
} else } else
return -1; return -1;
@ -188,6 +188,7 @@ void CloseVirus(int force)
fclose(fi); fclose(fi);
fclose(fo); fclose(fo);
unlink(fout); unlink(fout);
chmod(fin, 0640);
Syslog('+', "Updated \"virscan.data\""); Syslog('+', "Updated \"virscan.data\"");
return; return;
} }

View File

@ -396,6 +396,7 @@ void load_maincfg(void)
} }
fwrite(&CFG, sizeof(CFG), 1, fp); fwrite(&CFG, sizeof(CFG), 1, fp);
fclose(fp); fclose(fp);
chmod(cfgfn, 0640);
} else { } else {
fread(&CFG, sizeof(CFG), 1, fp); fread(&CFG, sizeof(CFG), 1, fp);
fclose(fp); fclose(fp);
@ -436,6 +437,7 @@ void load_taskcfg(void)
} }
fwrite(&TCFG, sizeof(TCFG), 1, fp); fwrite(&TCFG, sizeof(TCFG), 1, fp);
fclose(fp); fclose(fp);
chmod(tcfgfn, 0640);
tasklog('+', "Created new %s", tcfgfn); tasklog('+', "Created new %s", tcfgfn);
} else { } else {
fread(&TCFG, sizeof(TCFG), 1, fp); fread(&TCFG, sizeof(TCFG), 1, fp);