From 3e14bd7a8e2dc22b2f2e636d5a17c7adb0746958 Mon Sep 17 00:00:00 2001 From: scw Date: Thu, 25 Jan 2007 03:21:37 +0000 Subject: Mail security * user without PERM_SYSOP can't edit mails * always record source when crossposting from mail * crossposting to Test board does not count as a post git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3480 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- mbbsd/mail.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'mbbsd') diff --git a/mbbsd/mail.c b/mbbsd/mail.c index 17072e5c..6f997979 100644 --- a/mbbsd/mail.c +++ b/mbbsd/mail.c @@ -1196,9 +1196,7 @@ mail_edit(int ent, fileheader_t * fhdr, const char *direct) { char genbuf[200]; - if (!HasUserPerm(PERM_SYSOP) && - strcmp(cuser.userid, fhdr->owner) && - strcmp("[備.忘.錄]", fhdr->owner)) + if (!HasUserPerm(PERM_SYSOP)) return DONOTHING; setdirpath(genbuf, direct, fhdr->filename); @@ -1347,7 +1345,7 @@ mail_cross_post(int ent, fileheader_t * fhdr, const char *direct) xfile.filemode = FILE_LOCAL; } setuserfile(fname, fhdr->filename); - if (ent) { + { const char *save_currboard; xptr = fopen(xfpath, "w"); assert(xptr); @@ -1363,9 +1361,6 @@ mail_cross_post(int ent, fileheader_t * fhdr, const char *direct) b_suckinfile(xptr, fname); addsignature(xptr, 0); fclose(xptr); - } else { - unlink(xfpath); - Copy(fname, xfpath); } setbdir(fname, xboard); @@ -1376,8 +1371,14 @@ mail_cross_post(int ent, fileheader_t * fhdr, const char *direct) #ifdef USE_COOLDOWN if (bcache[getbnum(xboard) - 1].brdattr & BRD_COOLDOWN) add_cooldowntime(usernum, 5); + add_posttimes(usernum, 1); #endif - cuser.numposts++; + + if (strcmp(xboard, "Test") == 0) + outs("測試信件不列入紀錄,敬請包涵。"); + else + cuser.numposts++; + vmsg("文章轉錄完成"); currmode = currmode0; } -- cgit v1.2.3