summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2010-11-12 19:43:55 +0800
committerpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2010-11-12 19:43:55 +0800
commit2dcbc3bf7bc802a83dd7b3529c03ecbd309451b3 (patch)
tree9da37f0526a8551a72cdfd4447732811e49fdc35
parentc1f7d8129f3ba65ba046790569dd13e6ff3c68d1 (diff)
downloadpttbbs-2dcbc3bf7bc802a83dd7b3529c03ecbd309451b3.tar
pttbbs-2dcbc3bf7bc802a83dd7b3529c03ecbd309451b3.tar.gz
pttbbs-2dcbc3bf7bc802a83dd7b3529c03ecbd309451b3.tar.bz2
pttbbs-2dcbc3bf7bc802a83dd7b3529c03ecbd309451b3.tar.lz
pttbbs-2dcbc3bf7bc802a83dd7b3529c03ecbd309451b3.tar.xz
pttbbs-2dcbc3bf7bc802a83dd7b3529c03ecbd309451b3.tar.zst
pttbbs-2dcbc3bf7bc802a83dd7b3529c03ecbd309451b3.zip
comment for the bug that deleting file does not always cancel the entry in
BN_ALLPOST correctly. known bug, but fixing that is not easy. git-svn-id: http://opensvn.csie.org/pttbbs/trunk@5254 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r--pttbbs/mbbsd/bbs.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/pttbbs/mbbsd/bbs.c b/pttbbs/mbbsd/bbs.c
index 4534b562..40c9e74d 100644
--- a/pttbbs/mbbsd/bbs.c
+++ b/pttbbs/mbbsd/bbs.c
@@ -878,13 +878,19 @@ do_deleteCrossPost(const fileheader_t *fh, char bname[])
setbdir(bdir, bname);
setbfile(file, bname, fh->filename);
memcpy(&newfh, fh, sizeof(fileheader_t));
+
+ // XXX TODO FIXME This (finding file by getindex) sucks. getindex checks
+ // only timestamp by binary search, and we know that BN_ALLPOST has plenty
+ // of files sharing same timestamp, so deleting cross post has a very big
+ // chance to delete wrong file, or failed to find the target.
+ // (there's no promise that entries in BN_ALLPOST are sequential)
+
// Ptt: protect original fh
// because getindex safe_article_delete will change fh in some case
if( (i=getindex(bdir, &newfh, 0))>0)
{
#ifdef SAFE_ARTICLE_DELETE
- if(bp && !(currmode & MODE_DIGEST) &&
- bp->nuser >= SAFE_ARTICLE_DELETE_NUSER)
+ if(bp && bp->nuser >= SAFE_ARTICLE_DELETE_NUSER)
safe_article_delete(i, &newfh, bdir, NULL);
else
#endif