From b7cffd671030070399a3f03b8177f64783b4063b Mon Sep 17 00:00:00 2001 From: Michiel Broek Date: Mon, 4 Jun 2007 18:37:22 +0000 Subject: [PATCH] Fixed upload crash when a FILE_ID.DIZ is found but the bbs is not allowed to open for reading --- ChangeLog | 4 ++++ mbsebbs/filesub.c | 7 ++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index cff0a77d..86624b1d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,6 +6,10 @@ v0.91.9 16-May-2007 general: Fixed building on FreeBSD, tested on 5.3 + mbsebbs: + Fixed upload crash when a FILE_ID.DIZ is found but the bbs is + not allowed to open for reading. + mbpasswd: Added check for FreeBSD > 6.0 and use sysctl for security check. diff --git a/mbsebbs/filesub.c b/mbsebbs/filesub.c index c49760f7..a1df8e54 100644 --- a/mbsebbs/filesub.c +++ b/mbsebbs/filesub.c @@ -930,8 +930,7 @@ int Addfile(char *File, int AreaNum, int fileid) lines = 0; if ((id = fopen(idname, "r")) != NULL) { /* - * Import FILE_ID.DIZ, format to max. 25 - * lines, 48 chars width. + * Import FILE_ID.DIZ, format to max. 25 * lines, 48 chars width. */ while (((fgets(temp1, PATH_MAX -1, id)) != NULL) && (lines < 25)) { Striplf(temp1); @@ -966,8 +965,10 @@ int Addfile(char *File, int AreaNum, int fileid) lines++; } } + fclose(id); + } else { + GotId = FALSE; } - fclose(id); unlink(idname); if (GotId) {