bmybbs / bmybbs Goto Github PK
View Code? Open in Web Editor NEWThe project for bmybbs, which is the official Bulletin Board System of Xi'an Jiaotong University.
Home Page: http://bbs.xjtu.edu.cn
License: GNU General Public License v2.0
The project for bmybbs, which is the official Bulletin Board System of Xi'an Jiaotong University.
Home Page: http://bbs.xjtu.edu.cn
License: GNU General Public License v2.0
相关代码 95b041b
例如 job、newlife。
能将转储的文件独立存放,最好能重命名为形如 core-<prog_name>-<pid>-<datetime>
的形式。
例如十大,链接指向的似乎是原帖的时间戳,而非合集产生的新文章。
C区显示了8区的热门话题。
从系统文件 ~/etc/Area_Dir/C
中看,文件内容是正确的。需要检查 bbsboa.c 读取讨论区热门话题的过程。
由 hasreadperm_ext
函数引起,相关代码依次为:
while(i!=MAX_MENTION_ID && mention_ids[i][0]!=0) {
if(strcasecmp(currentuser.userid, mention_ids[i])!=0) {
if(hasreadperm_ext(mention_ids[i], currboard)) { // 该函数内调用了 getuser() 函数,因此可以直接使用 lookupuser 全局变量
// 用户存在的情况下,且不为当前用户的情况下,且拥有该版面阅读权限的情况下,且不在黑名单里的时候
if(!inoverride(currentuser.userid, lookupuser.userid, "rejects"))
add_mention_notification(lookupuser.userid, (header.chk_anony) ? "Anonymous" : currentuser.userid,
currboard, postfile.filetime, postfile.title);
}
}
++i;
}
int hasreadperm_ext(char *username, char *boardname)
{
// ...
struct user_info *ui = query_uindex(tuid, 0); // 调用 ui 前先检查 ui 是否不在线(主要为俱乐部、封闭版面)
// ..
if(!(ui->userlevel & PERM_BASIC))
return 0;
// ..
}
原因:统计方法不对
if ((data = ght_get(p_table, sizeof (int), &(ptr->thread))) == NULL) {
if(ptr->thread != ptr->filetime) // 主题不存在,并且该篇帖子 id 和主题不相同,视为回帖
continue;
让用户有效的查看到各项提醒。提醒项可以忽略。提醒项查看后会从提醒列表中删除。
查看提醒的功能主要针对www用户。telnet/www下回帖等等操作都可以触发提醒通知。
位于用户个人文件夹,例如 /home/bbs/home/S/SYSOP/Notification,数据格式如下:
<?xml version="1.0" encoding="gbk"?>
<Notify>
<Item type="0" board="sysop" aid="1375224754" uid="IronBlood" title="[公告]本站开放回复提醒" />
</Notify>
title
字符转义有可能 Perl 版本升级之后,API 发生了变化,有些函数和原本的预期产生了出入,例如 readdir
,需要更新。
此期间进站画面的管理可能得手动修改 loginpics
、loginlinks
文件。
尚未使用 63ade3d 版本编译
term 下精化区 (0)Digest
入口没有权限检查。
这样 nju09/api 无需等待第一个 telnet 登录
当前的 @ 提醒功能中,位于引言中的 @id
字符串也会被处理。现在要求仅处理文章正文。
打开版面最新的帖子会返回 500 的错误。检查对应的 dump 文件,显示在 iconv 某处调用出错。
如果新发表一篇文章,则当前无法阅读的文章可以正常显示内容,并且无 dump 文件产生。
未正确处理没有拿到锁时候的阻塞逻辑。
尚未使用 63ade3d 版本编译
做一个空白的网页,当文件拖入浏览器页面内并释放后,要求在页面上显示文件路径。
原先的 .PASSWDS 是 i386 架构下程序生成的。
如果在64位系统下编译不使用 -m32
选项,能否直接使用原先的 .PASSWDS 文件?
提示:对比 struct userec
的长度,并分别注册用户,使用 od 来对比
不管是回复还是at,在 Notification
中 type 均为空。
www下预定讨论区时显示错误!你已预定本版
预定后左边栏不现实预订讨论区
以上是在www未退出下,显示无变化
尚未使用 63ade3d 版本编译
原因在于主贴删除,搜索的时候返回一个负数,导致指针错误。
目前从老机器上恢复的数据已经拿到。
猜测是文件索引的信息大多数已经损坏,所以绝大部分的目录名、文件名是以 group
、node
、obj
加编号来命名的。完整的文件树参见 data.to.be.fixed.tar.gz。
粗鲁查看了部分数据内容,文件的分布尚未发现规律。以 unknown 目录为例:
粗略统计有 1000w 的文本文件需要重命名(并移动到正确的路径)。考虑使用如下的流程来判断并做处理,请评审。
消除 SQL 注入的风险。
nju09 下发送的提醒情况没有测试。
例如夕草。其他的ID、版面情况未知。
参考 bbsfall.c 实现
导致版面阅读状态下某些键功能错乱。
目前 smth_sshbbsd
还包含有一些 GNU 配置命令。目前的编译已不考虑平台的兼容性,因此不再适用,需要被精简掉。
可能是空文,可能前几名没有显示,例如
发信人: XJTU-XANET (自动发信系统), 信区:
标 题: [Sun Oct 12] 本站各讨论区人气榜
发信站: 兵马俑BBS自动发信系统 (Sun Oct 12 09:28:52 2014)
【此篇文章是由自动发信系统所张贴】
名次 讨论区名称 中文叙述 人气值
3 dance [体育] 青春舞步 118
4 XJTUnews [本校] 说说咱交大 84
5 sysop [本站] 站长工作室 63
7 Single [感性] 单身贵族 50
8 SecondHand [信息] 二手货市场 46
10 Jiangxi [乡谊] 江南西道 34
12 bbslists [本站] 本站的各类统计列表 26
又一处运行时错误,关联 #30
重现方法:
输入有效的邮箱及验证密码后 core dump。
调试信息:
Program received signal SIGSEGV, Segmentation fault.
__strcpy_sse2_unaligned () at ../sysdeps/x86_64/multiarch/strcpy-sse2-unaligned.S:296
296 ../sysdeps/x86_64/multiarch/strcpy-sse2-unaligned.S: No such file or directory.
(gdb) where
#0 __strcpy_sse2_unaligned () at ../sysdeps/x86_64/multiarch/strcpy-sse2-unaligned.S:296
#1 0x00007f1313b7f11b in x_fillform () at userinfo.c:864
#2 0x00007f1313b3f4c0 in main (argc=3, argv=0x7fffc40a8fb8) at main.c:1176
(gdb) frame 1
#1 0x00007f1313b7f11b in x_fillform () at userinfo.c:864
864 strcpy(email, str_to_lowercase(user));
(gdb) where
#0 0x00007fa7a2921bb9 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#1 0x00007fa7a2924fc8 in __GI_abort () at abort.c:89
#2 0x00007fa7a295ee14 in __libc_message (do_abort=do_abort@entry=1,
fmt=fmt@entry=0x7fa7a2a6b06b "*** %s ***: %s terminated\n") at ../sysdeps/posix/libc_fatal.c:175
#3 0x00007fa7a29f67dc in __GI___fortify_fail (msg=<optimized out>,
msg@entry=0x7fa7a2a6b053 "stack smashing detected") at fortify_fail.c:37
#4 0x00007fa7a29f6780 in __stack_chk_fail () at stack_chk_fail.c:28
#5 0x0000000000408e20 in bbscon_main () at bbscon.c:801
#6 0x3e72742f3c3e6474 in ?? ()
#7 0x3e656c6261742f3c in ?? ()
#8 0x742f3c3e64742f3c in ?? ()
#9 0x00000000000a3e72 in ?? ()
#10 0x0000000000684638 in applets ()
#11 0x0000000001400000 in ?? ()
#12 0x0000000002800000 in ?? ()
#13 0x0000000000000000 in ?? ()
(gdb) frame 5
#5 0x0000000000408e20 in bbscon_main () at bbscon.c:801
801 }
堆栈信息:
(gdb) where
#0 0x00007fa172f0f2c5 in malloc_consolidate (av=av@entry=0x7fa17324f760 <main_arena>) at malloc.c:4165
#1 0x00007fa172f10878 in _int_malloc (av=0x7fa17324f760 <main_arena>, bytes=32640) at malloc.c:3423
#2 0x00007fa172f13230 in __GI___libc_malloc (bytes=32640) at malloc.c:2891
#3 0x00007fa172eb2e31 in __gconv_open (toset=<optimized out>, toset@entry=0x7fff363753b0 "GB2312//", fromset=<optimized out>,
fromset@entry=0x7fff36375390 "UTF-8//", handle=handle@entry=0x7fff363753d0, flags=flags@entry=0) at gconv_open.c:282
#4 0x00007fa172eb27d2 in iconv_open (tocode=0x7fff363753b0 "GB2312//", fromcode=0x7fff36375390 "UTF-8//") at iconv_open.c:71
#5 0x0000000000444f6d in code_convert (from_charset=0x4774e1 "utf-8", to_charset=0x4774da "gb2312",
inbuf=0x140d5d0 "Re: term下没法注册和绑定认证新id。。。", inlen=52, outbuf=0x14163e0 "", outlen=52) at misc.c:102
#6 0x0000000000445013 in u2g (inbuf=0x140d5d0 "Re: term下没法注册和绑定认证新id。。。", inlen=52, outbuf=0x14163e0 "", outlen=52)
at misc.c:113
#7 0x000000000044f294 in parse_to_item (xmlItem=0x1419940) at notification.c:291
#8 0x000000000044ecab in parse_notification (userid=0x6aa440 <currentuser> "ironb") at notification.c:175
#9 0x0000000000438f5f in bbsnotify_main () at bbsnotify.c:10
#10 0x0000000000404003 in main (argc=1, argv=0x7fff36375758) at bbsmain.c:417
现状:
.PASSWDS
文件大约从 (37046*452) 字节开始全部为零,也就是此后的用户信息丢失userec
结构体因 time_t
发生长度变化,因此 .PASSWDS
文件不再通用任务:
.PASSWDS
文件到 amd64 架构预计结果:
关联 Issue:
#22 ,更新 .PASSWDS
文件后需要进一步校验用户文件夹。
另外term下进入收藏夹,若收藏夹内版面均为已读状态,默认会停留在第6个版面。
telnet 下回复另一个 ID 的帖子,在 add_notification.c
函数中执行到 free
的时候出错。
Debug 显示:
glibc detected free(): invalid next size (fast)
如果此处 title_utf8
换成声明为字符数组,而非通过 malloc()
获取,则提示有关什么 stack smashing detected 的错误。最终指向的是:
in __GI_raise at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
初步检查如 stackoverflow 上的这个 QA 显示:
#include <stdlib.h>
void foo() { abort(); }
int main() { foo(); return 0; }
该代码在调试的时候同样会返回有关 __GI_raise
的错误。
term下进入收藏夹,若收藏夹内版面均为已读状态,默认会停留在第6个版面。
更新 menu.ini 后在主菜单下 ~
按键时 segmentation fault,堆栈信息
(gdb) where
#0 0x00007f76ecbd5095 in f_prep (pat_index=1, Pattern=0x7f76ee588174 "13186147158", patt_img=0x7f76ee583d40)
at mgrep.c:466
#1 0x00007f76ecbd44a9 in prepf (fp=1, ppatt_img=0x7fffa286f260, patt_image_len=0x7fffa286f258) at mgrep.c:161
#2 0x00007f76ecbd3d6a in reload_badwords (wordlistf=0x7f76ecbdda3a "etc/badwords",
imgf=0x7f76ecbdda28 "etc/.badwords_new") at smth_filter.c:30
#3 0x00007f76ecb53537 in domenu (menu_name=0x7f76ecbd8b14 "TOPMENU") at comm_lists.c:747
#4 0x00007f76ecb3953d in main (argc=3, argv=0x7fffa286f448) at main.c:1189
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.