summaryrefslogtreecommitdiffstats
path: root/mbbsd
diff options
context:
space:
mode:
authorscw <scw@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2007-01-25 11:21:37 +0800
committerscw <scw@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2007-01-25 11:21:37 +0800
commit3e14bd7a8e2dc22b2f2e636d5a17c7adb0746958 (patch)
tree5550288e28c282a10a2d312d3d53e84883844f61 /mbbsd
parent706ea6d5f50b83e382b50f98f3f2f96a1de21572 (diff)
downloadpttbbs-3e14bd7a8e2dc22b2f2e636d5a17c7adb0746958.tar
pttbbs-3e14bd7a8e2dc22b2f2e636d5a17c7adb0746958.tar.gz
pttbbs-3e14bd7a8e2dc22b2f2e636d5a17c7adb0746958.tar.bz2
pttbbs-3e14bd7a8e2dc22b2f2e636d5a17c7adb0746958.tar.lz
pttbbs-3e14bd7a8e2dc22b2f2e636d5a17c7adb0746958.tar.xz
pttbbs-3e14bd7a8e2dc22b2f2e636d5a17c7adb0746958.tar.zst
pttbbs-3e14bd7a8e2dc22b2f2e636d5a17c7adb0746958.zip
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
Diffstat (limited to 'mbbsd')
-rw-r--r--mbbsd/mail.c17
1 files changed, 9 insertions, 8 deletions
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;
}