From 89456a6324f6b596e93879d4decf5a6110688632 Mon Sep 17 00:00:00 2001 From: piaip Date: Sat, 23 May 2009 01:27:40 +0000 Subject: - add reserved id to prevent malicious registration git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@4461 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- include/common.h | 1 + mbbsd/register.c | 3 +++ 2 files changed, 4 insertions(+) diff --git a/include/common.h b/include/common.h index c842a330..655c06b9 100644 --- a/include/common.h +++ b/include/common.h @@ -33,6 +33,7 @@ #define FN_TICKET_BRDLIST "boardlist" #define FN_BRDLISTHELP "etc/boardlist.help" #define FN_BOARDHELP "etc/board.help" +#define FN_RESERVED_ID "etc/reserved.id" // 保留系統用無法註冊的 ID #define FN_USERMEMO "memo.txt" // 使用者個人記事本 diff --git a/mbbsd/register.c b/mbbsd/register.c index b26107c0..c5bda783 100644 --- a/mbbsd/register.c +++ b/mbbsd/register.c @@ -124,6 +124,9 @@ bad_user_id(const char *userid) return 1; #endif + if (file_exist_record(FN_RESERVED_ID, userid)) + return 1; + /* in2: 原本是用strcasestr, 不過有些人中間剛剛好出現這個字應該還算合理吧? */ if( strncasecmp(userid, "fuck", 4) == 0 || -- cgit v1.2.3