MBSE BBS file permissions auto update added

This commit is contained in:
Michiel Broek
2002-02-07 21:53:04 +00:00
parent 568008a5e3
commit dfaee3d490
3 changed files with 10 additions and 2 deletions

View File

@@ -68,6 +68,7 @@ int ChkFiles()
sDataFile = calloc(PATH_MAX, sizeof(char));
temp = calloc(PATH_MAX, sizeof(char));
sprintf(sDataFile, "%s/etc/sysinfo.data", getenv("MBSE_ROOT"));
chmod(sDataFile, 0660);
/*
* Check if users.data exists, if not create a new one.
@@ -180,8 +181,8 @@ void SaveLastCallers()
Syslog('+', "Created new lastcall.data");
}
fclose(pGLC);
chmod(sFileName, 0660);
}
chmod(sFileName, 0660);
if ((pGLC = fopen(sFileName,"a+")) == NULL) {
WriteError("$Can't open %s", sFileName);

View File

@@ -75,7 +75,11 @@ void GetLastUser(void)
sDataFile = calloc(PATH_MAX, sizeof(char));
sprintf(sDataFile, "%s/etc/sysinfo.data", getenv("MBSE_ROOT"));
/*
* Fix security in case it is wrong.
*/
chmod(sDataFile, 0660);
if((pCallerLog = fopen(sDataFile, "r+")) == NULL)
WriteError("GetLastUser: Can't open file: %s", sDataFile);
else {