summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2009-05-26 01:28:29 +0800
committerkcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2009-05-26 01:28:29 +0800
commit47e1682c7ad6d559f46b49d525423479d7d78316 (patch)
tree6d6756306f1e7a3315215c4f0e261c8a4de735b0
parent90e35e137daa94c9b448c5a8b243a2f434e557d6 (diff)
downloadpttbbs-47e1682c7ad6d559f46b49d525423479d7d78316.tar
pttbbs-47e1682c7ad6d559f46b49d525423479d7d78316.tar.gz
pttbbs-47e1682c7ad6d559f46b49d525423479d7d78316.tar.bz2
pttbbs-47e1682c7ad6d559f46b49d525423479d7d78316.tar.lz
pttbbs-47e1682c7ad6d559f46b49d525423479d7d78316.tar.xz
pttbbs-47e1682c7ad6d559f46b49d525423479d7d78316.tar.zst
pttbbs-47e1682c7ad6d559f46b49d525423479d7d78316.zip
- more sleep. try to prevent bad user to try password or multi-login
- add debug log git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@4486 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r--mbbsd/mbbsd.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/mbbsd/mbbsd.c b/mbbsd/mbbsd.c
index 1e9a9ea7..4dca1e80 100644
--- a/mbbsd/mbbsd.c
+++ b/mbbsd/mbbsd.c
@@ -294,6 +294,7 @@ abort_bbs_debug(int sig)
sigaddset(&sigset, SIGXCPU);
sigprocmask(SIG_UNBLOCK, &sigset, NULL);
+ fprintf(stderr, "%d %d %d %.12s\n", (int)time4(NULL), getpid(), sig, cuser.userid);
#define CRASH_MSG ANSI_COLOR(0) \
"\r\n程式異常, 立刻斷線. \r\n" \
"請洽 " BN_BUGREPORT " 板詳述問題發生經過。\r\n"
@@ -308,6 +309,8 @@ abort_bbs_debug(int sig)
else
write(1, CRASH_MSG, sizeof(CRASH_MSG));
+ sleep(5);
+
/* close all file descriptors (including the network connection) */
for (i = 0; i < 256; ++i)
close(i);
@@ -619,7 +622,7 @@ multi_user_check(void)
getdata(b_lines - 1, 0, "您想刪除其他重複登入的連線嗎?[Y/n] ",
genbuf, 3, LCECHO);
- usleep(random()%1000000); // 0~1s
+ usleep(random()%5000000); // 0~5s
if (genbuf[0] != 'n') {
do {
// scan again, old ui may be invalid
@@ -639,12 +642,15 @@ multi_user_check(void)
} while(getotherlogin(3) != NULL);
} else {
/* deny login if still have 3 */
- if (getotherlogin(3) != NULL)
+ if (getotherlogin(3) != NULL) {
+ sleep(1);
abort_bbs(0); /* Goodbye(); */
+ }
}
} else {
/* allow multiple guest user */
if (search_ulistn(usernum, MAX_GUEST) != NULL) {
+ sleep(1);
vmsg("抱歉,目前已有太多 guest 在站上, 請用new註冊。");
exit(1);
}
@@ -718,6 +724,7 @@ login_query(void)
if (attempts++ >= LOGINATTEMPTS) {
more("etc/goodbye", NA);
pressanykey();
+ sleep(3);
exit(1);
}
bzero(&cuser, sizeof(cuser));
@@ -798,6 +805,7 @@ login_query(void)
if(is_validuserid(cuser.userid))
logattempt(cuser.userid , '-');
+ sleep(1);
outs(ERR_PASSWD);
} else {