Updated TODO
This commit is contained in:
parent
c672771758
commit
126cba5e3c
@ -19,6 +19,8 @@ v0.37.5 12-Jul-2003
|
|||||||
mbsebbs:
|
mbsebbs:
|
||||||
Added check for maximum simultaneous logins.
|
Added check for maximum simultaneous logins.
|
||||||
Removed debug logging for userrecord i/o
|
Removed debug logging for userrecord i/o
|
||||||
|
During virusscan of file uploads, the mbtask timeout timer is
|
||||||
|
set to one hour to support very long scans.
|
||||||
|
|
||||||
mbsetup:
|
mbsetup:
|
||||||
Added menu entry 1.5.21 for setting maximum allowed logins.
|
Added menu entry 1.5.21 for setting maximum allowed logins.
|
||||||
|
6
TODO
6
TODO
@ -99,9 +99,6 @@ mbfido:
|
|||||||
N: Add statistic mail messages.
|
N: Add statistic mail messages.
|
||||||
|
|
||||||
mbcico:
|
mbcico:
|
||||||
N: Doesn't poll internet nodes with non-standard ports when the
|
|
||||||
FQDN:port is in the override field. -- Check this !
|
|
||||||
|
|
||||||
N: See if it is possible with binkp protocol to resume aborted
|
N: See if it is possible with binkp protocol to resume aborted
|
||||||
transfers. -- ND option ??
|
transfers. -- ND option ??
|
||||||
|
|
||||||
@ -116,9 +113,6 @@ mbfile:
|
|||||||
|
|
||||||
L: Possibility to skip file areas from checking and reindexing.
|
L: Possibility to skip file areas from checking and reindexing.
|
||||||
|
|
||||||
N: Override timeout during virus scan when files are imported.
|
|
||||||
-- Check, already done?
|
|
||||||
|
|
||||||
N: Add area sorting
|
N: Add area sorting
|
||||||
|
|
||||||
mbmsg:
|
mbmsg:
|
||||||
|
@ -411,58 +411,58 @@ int iLC(int Lines)
|
|||||||
*/
|
*/
|
||||||
int ShowOneFile()
|
int ShowOneFile()
|
||||||
{
|
{
|
||||||
int y, z, fg, bg;
|
int y, z, fg, bg;
|
||||||
|
|
||||||
if ((!file.Deleted) && (!file.Missing)) {
|
if ((!file.Deleted) && (!file.Missing)) {
|
||||||
|
|
||||||
colour(7, 0);
|
colour(7, 0);
|
||||||
printf(" %02d ", Tagnr);
|
printf(" %02d ", Tagnr);
|
||||||
|
|
||||||
colour(CFG.FilenameF, CFG.FilenameB);
|
colour(CFG.FilenameF, CFG.FilenameB);
|
||||||
printf("%-12s", file.Name);
|
printf("%-12s", file.Name);
|
||||||
|
|
||||||
colour(CFG.FilesizeF, CFG.FilesizeB);
|
colour(CFG.FilesizeF, CFG.FilesizeB);
|
||||||
printf("%10lu ", (long)(file.Size));
|
printf("%10lu ", (long)(file.Size));
|
||||||
|
|
||||||
colour(CFG.FiledateF, CFG.FiledateB);
|
colour(CFG.FiledateF, CFG.FiledateB);
|
||||||
printf("%-10s ", StrDateDMY(file.UploadDate));
|
printf("%-10s ", StrDateDMY(file.UploadDate));
|
||||||
|
|
||||||
colour(12, 0);
|
colour(12, 0);
|
||||||
printf("[%4ld] ", file.TimesDL);
|
printf("[%4ld] ", file.TimesDL);
|
||||||
|
|
||||||
if((strcmp(file.Uploader, "")) == 0)
|
if ((strcmp(file.Uploader, "")) == 0)
|
||||||
strcpy(file.Uploader, "SysOp");
|
strcpy(file.Uploader, "SysOp");
|
||||||
|
|
||||||
colour(CFG.HiliteF, CFG.HiliteB);
|
colour(CFG.HiliteF, CFG.HiliteB);
|
||||||
printf("%s%s\n", (char *) Language(238), file.Uploader);
|
printf("%s%s\n", (char *) Language(238), file.Uploader);
|
||||||
|
|
||||||
|
if (iLC(1) == 1)
|
||||||
|
return 1;
|
||||||
|
|
||||||
|
for (z = 0; z <= 25; z++) {
|
||||||
|
if ((y = strlen(file.Desc[z])) > 1) {
|
||||||
|
if ((file.Desc[z][0] == '@') && (file.Desc[z][1] == 'X')) {
|
||||||
|
/*
|
||||||
|
* Color formatted description lines.
|
||||||
|
*/
|
||||||
|
if (file.Desc[z][3] > '9')
|
||||||
|
fg = (int)file.Desc[z][3] - 55;
|
||||||
|
else
|
||||||
|
fg = (int)file.Desc[z][3] - 48;
|
||||||
|
bg = (int)file.Desc[z][2] - 48;
|
||||||
|
colour(fg, bg);
|
||||||
|
printf(" %s\n",file.Desc[z]+4);
|
||||||
|
} else {
|
||||||
|
colour(CFG.FiledescF, CFG.FiledescB);
|
||||||
|
printf(" %s\n",file.Desc[z]);
|
||||||
|
}
|
||||||
|
|
||||||
if (iLC(1) == 1)
|
if (iLC(1) == 1)
|
||||||
return 1;
|
return 1;
|
||||||
|
}
|
||||||
for(z = 0; z <= 25; z++) {
|
|
||||||
if ((y = strlen(file.Desc[z])) > 1) {
|
|
||||||
if ((file.Desc[z][0] == '@') && (file.Desc[z][1] == 'X')) {
|
|
||||||
/*
|
|
||||||
* Color formatted description lines.
|
|
||||||
*/
|
|
||||||
if (file.Desc[z][3] > '9')
|
|
||||||
fg = (int)file.Desc[z][3] - 55;
|
|
||||||
else
|
|
||||||
fg = (int)file.Desc[z][3] - 48;
|
|
||||||
bg = (int)file.Desc[z][2] - 48;
|
|
||||||
colour(fg, bg);
|
|
||||||
printf(" %s\n",file.Desc[z]+4);
|
|
||||||
} else {
|
|
||||||
colour(CFG.FiledescF, CFG.FiledescB);
|
|
||||||
printf(" %s\n",file.Desc[z]);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (iLC(1) == 1)
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return 0;
|
}
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -501,12 +501,12 @@ int CheckBytesAvailable(long CostSize)
|
|||||||
*/
|
*/
|
||||||
void Home()
|
void Home()
|
||||||
{
|
{
|
||||||
char *temp;
|
char *temp;
|
||||||
|
|
||||||
temp = calloc(PATH_MAX, sizeof(char));
|
temp = calloc(PATH_MAX, sizeof(char));
|
||||||
sprintf(temp, "%s/%s", CFG.bbs_usersdir, exitinfo.Name);
|
sprintf(temp, "%s/%s", CFG.bbs_usersdir, exitinfo.Name);
|
||||||
chdir(temp);
|
chdir(temp);
|
||||||
free(temp);
|
free(temp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -516,45 +516,48 @@ void Home()
|
|||||||
*/
|
*/
|
||||||
int ScanDirect(char *fn)
|
int ScanDirect(char *fn)
|
||||||
{
|
{
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
int err, Found = FALSE;
|
int err, Found = FALSE;
|
||||||
char *temp, *temp1;
|
char *temp, *temp1;
|
||||||
|
|
||||||
temp = calloc(PATH_MAX, sizeof(char));
|
temp = calloc(PATH_MAX, sizeof(char));
|
||||||
temp1 = calloc(PATH_MAX, sizeof(char));
|
temp1 = calloc(PATH_MAX, sizeof(char));
|
||||||
sprintf(temp, "%s/%s/upl/%s", CFG.bbs_usersdir, exitinfo.Name, fn);
|
sprintf(temp, "%s/%s/upl/%s", CFG.bbs_usersdir, exitinfo.Name, fn);
|
||||||
sprintf(temp1, "%s/etc/virscan.data", getenv("MBSE_ROOT"));
|
sprintf(temp1, "%s/etc/virscan.data", getenv("MBSE_ROOT"));
|
||||||
|
|
||||||
if ((fp = fopen(temp1, "r")) != NULL) {
|
if ((fp = fopen(temp1, "r")) != NULL) {
|
||||||
fread(&virscanhdr, sizeof(virscanhdr), 1, fp);
|
fread(&virscanhdr, sizeof(virscanhdr), 1, fp);
|
||||||
|
|
||||||
while (fread(&virscan, virscanhdr.recsize, 1, fp) == 1) {
|
while (fread(&virscan, virscanhdr.recsize, 1, fp) == 1) {
|
||||||
|
|
||||||
if (virscan.available) {
|
if (virscan.available) {
|
||||||
colour(CFG.TextColourF, CFG.TextColourB);
|
colour(CFG.TextColourF, CFG.TextColourB);
|
||||||
/* Scanning */ /* with */
|
/* Scanning */ /* with */
|
||||||
printf("%s %s %s %s ", (char *) Language(132), fn, (char *) Language(133), virscan.comment);
|
printf("%s %s %s %s ", (char *) Language(132), fn, (char *) Language(133), virscan.comment);
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
|
|
||||||
if ((err = execute(virscan.scanner, virscan.options, temp, (char *)"/dev/null",
|
Altime(3600);
|
||||||
|
if ((err = execute(virscan.scanner, virscan.options, temp, (char *)"/dev/null",
|
||||||
(char *)"/dev/null" , (char *)"/dev/null")) != virscan.error) {
|
(char *)"/dev/null" , (char *)"/dev/null")) != virscan.error) {
|
||||||
WriteError("VIRUS ALERT: Result %d (%s)", err, virscan.comment);
|
WriteError("VIRUS ALERT: Result %d (%s)", err, virscan.comment);
|
||||||
colour(CFG.HiliteF, CFG.HiliteB);
|
colour(CFG.HiliteF, CFG.HiliteB);
|
||||||
/* Possible VIRUS found! */
|
/* Possible VIRUS found! */
|
||||||
printf("%s\n", (char *) Language(199));
|
printf("%s\n", (char *) Language(199));
|
||||||
Found = TRUE;
|
Found = TRUE;
|
||||||
} else
|
} else {
|
||||||
/* Ok */
|
/* Ok */
|
||||||
printf("%s\n", (char *) Language(200));
|
printf("%s\n", (char *) Language(200));
|
||||||
fflush(stdout);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
fclose(fp);
|
Altime(0);
|
||||||
|
fflush(stdout);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
fclose(fp);
|
||||||
|
}
|
||||||
|
|
||||||
free(temp);
|
free(temp);
|
||||||
free(temp1);
|
free(temp1);
|
||||||
return Found;
|
return Found;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -644,6 +647,7 @@ int ScanArchive(char *fn, char *ftype)
|
|||||||
printf("%s %s %s %s ", (char *) Language(132), fn, (char *) Language(133), virscan.comment);
|
printf("%s %s %s %s ", (char *) Language(132), fn, (char *) Language(133), virscan.comment);
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
|
|
||||||
|
Altime(3600);
|
||||||
err = execute(virscan.scanner, virscan.options, (char *)"*", (char *)"/dev/null",
|
err = execute(virscan.scanner, virscan.options, (char *)"*", (char *)"/dev/null",
|
||||||
(char *)"/dev/null", (char *)"/dev/null");
|
(char *)"/dev/null", (char *)"/dev/null");
|
||||||
if (err != virscan.error) {
|
if (err != virscan.error) {
|
||||||
@ -657,6 +661,7 @@ int ScanArchive(char *fn, char *ftype)
|
|||||||
printf("%s\n", (char *) Language(200));
|
printf("%s\n", (char *) Language(200));
|
||||||
}
|
}
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
|
Altime(0);
|
||||||
Nopper();
|
Nopper();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -762,77 +767,52 @@ char *GetFileType(char *fn)
|
|||||||
*/
|
*/
|
||||||
int ImportFile(char *fn, int Area, int fileid, time_t iTime, off_t Size)
|
int ImportFile(char *fn, int Area, int fileid, time_t iTime, off_t Size)
|
||||||
{
|
{
|
||||||
char *temp, *temp1;
|
char *temp, *temp1;
|
||||||
// int i, x;
|
|
||||||
// char *token;
|
|
||||||
|
|
||||||
temp = calloc(PATH_MAX, sizeof(char));
|
temp = calloc(PATH_MAX, sizeof(char));
|
||||||
temp1 = calloc(PATH_MAX, sizeof(char));
|
temp1 = calloc(PATH_MAX, sizeof(char));
|
||||||
sprintf(temp, "%s/%s", area.Path, fn);
|
sprintf(temp, "%s/%s", area.Path, fn);
|
||||||
sprintf(temp1, "%s/%s/upl/%s", CFG.bbs_usersdir, exitinfo.Name, fn);
|
sprintf(temp1, "%s/%s/upl/%s", CFG.bbs_usersdir, exitinfo.Name, fn);
|
||||||
|
|
||||||
if ((file_mv(temp1, temp))) {
|
if ((file_mv(temp1, temp))) {
|
||||||
WriteError("$Can't move %s to %s", fn, area.Path);
|
WriteError("$Can't move %s to %s", fn, area.Path);
|
||||||
} else {
|
} else {
|
||||||
chmod(temp, 0664);
|
chmod(temp, 0664);
|
||||||
if (Addfile(fn, Area, fileid)) {
|
if (Addfile(fn, Area, fileid)) {
|
||||||
|
|
||||||
ReadExitinfo();
|
ReadExitinfo();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If Size is equal to Zero, don't increase file counters else
|
* If Size is equal to Zero, don't increase file counters else
|
||||||
* Increase file counters if any other size
|
* Increase file counters if any other size
|
||||||
*/
|
*/
|
||||||
if (Size) {
|
if (Size) {
|
||||||
exitinfo.Uploads++;
|
exitinfo.Uploads++;
|
||||||
exitinfo.UploadK += (Size / 1024);
|
exitinfo.UploadK += (Size / 1024);
|
||||||
exitinfo.UploadKToday += (Size / 1024);
|
exitinfo.UploadKToday += (Size / 1024);
|
||||||
Syslog('b', "Uploads %d, Kb %d, Kb today %d", exitinfo.Uploads,
|
Syslog('b', "Uploads %d, Kb %d, Kb today %d", exitinfo.Uploads, exitinfo.UploadK, exitinfo.UploadKToday);
|
||||||
exitinfo.UploadK, exitinfo.UploadKToday);
|
/* You have */ /* extra download KBytes. */
|
||||||
|
printf("%s %ld %s\n", (char *) Language(249), (long)(Size / 1024), (char *) Language(250));
|
||||||
|
|
||||||
/*
|
exitinfo.DownloadKToday += (Size / 1024);
|
||||||
* Give back the user his bytes from the upload
|
Syslog('b', "DownloadKToday %d", exitinfo.DownloadKToday);
|
||||||
* Work out byte ratio, then give time back to user
|
}
|
||||||
*/
|
|
||||||
// strcpy(temp, CFG.sByteRatio);
|
|
||||||
// token = strtok(temp, ":");
|
|
||||||
// i = atoi(token);
|
|
||||||
// token = strtok(NULL, "\0");
|
|
||||||
// x = atoi(token);
|
|
||||||
// Size *= i / x;
|
|
||||||
/* You have */ /* extra download KBytes. */
|
|
||||||
printf("%s %ld %s\n", (char *) Language(249), (long)(Size / 1024), (char *) Language(250));
|
|
||||||
|
|
||||||
exitinfo.DownloadKToday += (Size / 1024);
|
iTime /= 60; /* Divide Seconds by 60 to give minutes */
|
||||||
Syslog('b', "DownloadKToday %d", exitinfo.DownloadKToday);
|
/* You have */ /* extra minutes. */
|
||||||
}
|
printf("%s %ld %s\n", (char *) Language(249), iTime, (char *) Language(259));
|
||||||
|
exitinfo.iTimeLeft += iTime;
|
||||||
|
|
||||||
/*
|
WriteExitinfo();
|
||||||
* Give back the user his time that he used to upload
|
free(temp);
|
||||||
* Work out time ratio, then give time back to user
|
free(temp1);
|
||||||
* Ratio 3:1, Upload time: times by 3 / 1
|
return TRUE;
|
||||||
*/
|
|
||||||
// strcpy(temp, CFG.sTimeRatio);
|
|
||||||
// token = strtok(temp, ":");
|
|
||||||
// i = atoi(token);
|
|
||||||
// token = strtok(NULL, "\0");
|
|
||||||
// x = atoi(token);
|
|
||||||
|
|
||||||
// iTime *= i / x;
|
|
||||||
iTime /= 60; /* Divide Seconds by 60 to give minutes */
|
|
||||||
/* You have */ /* extra minutes. */
|
|
||||||
printf("%s %ld %s\n", (char *) Language(249), iTime, (char *) Language(259));
|
|
||||||
|
|
||||||
exitinfo.iTimeLeft += iTime;
|
|
||||||
|
|
||||||
WriteExitinfo();
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
free(temp);
|
free(temp);
|
||||||
free(temp1);
|
free(temp1);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1072,75 +1052,78 @@ int Addfile(char *File, int AreaNum, int fileid)
|
|||||||
*/
|
*/
|
||||||
void SetFileArea(unsigned long AreaNum)
|
void SetFileArea(unsigned long AreaNum)
|
||||||
{
|
{
|
||||||
FILE *pArea;
|
FILE *pArea;
|
||||||
long offset;
|
long offset;
|
||||||
|
|
||||||
memset(&area, 0, sizeof(area));
|
memset(&area, 0, sizeof(area));
|
||||||
|
|
||||||
if ((pArea = OpenFareas(FALSE)) == NULL)
|
if ((pArea = OpenFareas(FALSE)) == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
offset = areahdr.hdrsize + ((AreaNum - 1) * areahdr.recsize);
|
offset = areahdr.hdrsize + ((AreaNum - 1) * areahdr.recsize);
|
||||||
if (fseek(pArea, offset, 0) != 0) {
|
if (fseek(pArea, offset, 0) != 0) {
|
||||||
WriteError("$Seek error in fareas.data, area %ld", AreaNum);
|
WriteError("$Seek error in fareas.data, area %ld", AreaNum);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
fread(&area, areahdr.recsize, 1, pArea);
|
fread(&area, areahdr.recsize, 1, pArea);
|
||||||
strcpy(sAreaDesc, area.Name);
|
strcpy(sAreaDesc, area.Name);
|
||||||
strcpy(sAreaPath, area.Path);
|
strcpy(sAreaPath, area.Path);
|
||||||
iAreaNumber = AreaNum;
|
iAreaNumber = AreaNum;
|
||||||
fclose(pArea);
|
fclose(pArea);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Return size in bytes of all files in the users wrk directory.
|
||||||
|
*/
|
||||||
unsigned long Quota()
|
unsigned long Quota()
|
||||||
{
|
{
|
||||||
DIR *dirp;
|
DIR *dirp;
|
||||||
char *FileName, *temp;
|
char *FileName, *temp;
|
||||||
unsigned long Bytes = 0;
|
unsigned long Bytes = 0;
|
||||||
struct dirent *dp;
|
struct dirent *dp;
|
||||||
struct stat statfile;
|
struct stat statfile;
|
||||||
|
|
||||||
FileName = calloc(PATH_MAX, sizeof(char));
|
FileName = calloc(PATH_MAX, sizeof(char));
|
||||||
temp = calloc(PATH_MAX, sizeof(char));
|
temp = calloc(PATH_MAX, sizeof(char));
|
||||||
|
|
||||||
sprintf(temp, "%s/%s/wrk", CFG.bbs_usersdir, exitinfo.Name);
|
sprintf(temp, "%s/%s/wrk", CFG.bbs_usersdir, exitinfo.Name);
|
||||||
|
|
||||||
if ((dirp = opendir(temp)) == NULL) {
|
if ((dirp = opendir(temp)) == NULL) {
|
||||||
WriteError("$Can't open dir %s", temp);
|
WriteError("$Can't open dir %s", temp);
|
||||||
} else {
|
} else {
|
||||||
while ((dp = readdir(dirp)) != NULL) {
|
while ((dp = readdir(dirp)) != NULL) {
|
||||||
sprintf(FileName, "%s/%s", temp, dp->d_name);
|
sprintf(FileName, "%s/%s", temp, dp->d_name);
|
||||||
|
|
||||||
if (*(dp->d_name) != '.')
|
if (*(dp->d_name) != '.')
|
||||||
if (stat(FileName, &statfile) == 0)
|
if (stat(FileName, &statfile) == 0)
|
||||||
Bytes += statfile.st_size;
|
Bytes += statfile.st_size;
|
||||||
}
|
|
||||||
|
|
||||||
closedir(dirp);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
free(FileName);
|
closedir(dirp);
|
||||||
free(temp);
|
}
|
||||||
return Bytes;
|
|
||||||
|
free(FileName);
|
||||||
|
free(temp);
|
||||||
|
return Bytes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void ImportHome(char *fn)
|
void ImportHome(char *fn)
|
||||||
{
|
{
|
||||||
char *temp1, *temp2;
|
char *temp1, *temp2;
|
||||||
|
|
||||||
temp1 = calloc(PATH_MAX, sizeof(char));
|
temp1 = calloc(PATH_MAX, sizeof(char));
|
||||||
temp2 = calloc(PATH_MAX, sizeof(char));
|
temp2 = calloc(PATH_MAX, sizeof(char));
|
||||||
sprintf(temp1, "%s/%s/wrk/%s", CFG.bbs_usersdir, exitinfo.Name, fn);
|
sprintf(temp1, "%s/%s/wrk/%s", CFG.bbs_usersdir, exitinfo.Name, fn);
|
||||||
sprintf(temp2, "%s/%s/upl/%s", CFG.bbs_usersdir, exitinfo.Name, fn);
|
sprintf(temp2, "%s/%s/upl/%s", CFG.bbs_usersdir, exitinfo.Name, fn);
|
||||||
|
|
||||||
Syslog('+', "Move %s to home, result %d", fn, file_mv(temp2, temp1));
|
Syslog('+', "Move %s to home, result %d", fn, file_mv(temp2, temp1));
|
||||||
free(temp1);
|
free(temp1);
|
||||||
free(temp2);
|
free(temp2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user