From a54a3283fa43d1c59438f5f6ba4a27eac27ef397 Mon Sep 17 00:00:00 2001 From: piaip Date: Sat, 26 Nov 2011 17:17:57 +0000 Subject: add timebomb for .forward transition git-svn-id: http://opensvn.csie.org/pttbbs/trunk@5475 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- pttbbs/mbbsd/mail.c | 5 +++++ pttbbs/mbbsd/record.c | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/pttbbs/mbbsd/mail.c b/pttbbs/mbbsd/mail.c index e86107a7..bc9eeccb 100644 --- a/pttbbs/mbbsd/mail.c +++ b/pttbbs/mbbsd/mail.c @@ -554,6 +554,11 @@ setforward(void) { if ((fp = fopen(buf, "r"))) { fscanf(fp, "%" toSTR(sizeof(ip)) "s", ip); fclose(fp); +#ifdef UNTRUSTED_FORWARD_TIMEBOME + if (dasht(buf) < UNTRUSTED_FORWARD_TIMEBOME) + unlink(buf); +#endif + } chomp(ip); prints("目前設定自動轉寄為: %s", diff --git a/pttbbs/mbbsd/record.c b/pttbbs/mbbsd/record.c index 4e73fe6f..8c36d052 100644 --- a/pttbbs/mbbsd/record.c +++ b/pttbbs/mbbsd/record.c @@ -525,6 +525,13 @@ append_record_forward(char *fpath, fileheader_t * record, int size, const char * fclose(fp); strip_blank(address, address); +#ifdef UNTRUSTED_FORWARD_TIMEBOME + if (dasht(buf) < UNTRUSTED_FORWARD_TIMEBOME) { + unlink(buf); + return 0; + } +#endif + if (get_num_records(fpath, sizeof(fileheader_t)) > MAX_KEEPMAIL_HARDLIMIT) { unlink(buf); // TODO add a mail so that origid knows what happened. -- cgit v1.2.3