diff options
author | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2011-08-22 19:04:44 +0800 |
---|---|---|
committer | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2011-08-22 19:04:44 +0800 |
commit | 00957455004e061b1e05eafd21975f0b111fa433 (patch) | |
tree | a33dfdc2c99de096f24f726a9df2c07252455e50 | |
parent | 77f3f4c2444fa79707b851fd17f9f1a1cd95a7ce (diff) | |
download | pttbbs-00957455004e061b1e05eafd21975f0b111fa433.tar pttbbs-00957455004e061b1e05eafd21975f0b111fa433.tar.gz pttbbs-00957455004e061b1e05eafd21975f0b111fa433.tar.bz2 pttbbs-00957455004e061b1e05eafd21975f0b111fa433.tar.lz pttbbs-00957455004e061b1e05eafd21975f0b111fa433.tar.xz pttbbs-00957455004e061b1e05eafd21975f0b111fa433.tar.zst pttbbs-00957455004e061b1e05eafd21975f0b111fa433.zip |
allow reporting banned message for ban_ip.
git-svn-id: http://opensvn.csie.org/pttbbs/trunk@5388 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r-- | pttbbs/daemon/logind/logind.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/pttbbs/daemon/logind/logind.c b/pttbbs/daemon/logind/logind.c index c5882cf5..99d207de 100644 --- a/pttbbs/daemon/logind/logind.c +++ b/pttbbs/daemon/logind/logind.c @@ -705,9 +705,10 @@ _set_bind_opt(int sock) #define FN_WELCOME BBSHOME "/etc/Welcome" #define FN_GOODBYE BBSHOME "/etc/goodbye" +#define FN_BANIP BBSHOME "/etc/banip.scr" #define FN_BAN BBSHOME "/" BAN_FILE -static char *welcome_screen, *goodbye_screen, *ban_screen; +static char *welcome_screen, *goodbye_screen, *ban_screen, *banip_screen; static void load_text_screen_file(const char *filename, char **pptr) @@ -786,6 +787,7 @@ reload_data() g_welcome_mtime = dasht(FN_WELCOME); load_text_screen_file(FN_WELCOME, &welcome_screen); load_text_screen_file(FN_GOODBYE, &goodbye_screen); + load_text_screen_file(FN_BANIP, &banip_screen); load_text_screen_file(FN_BAN, &ban_screen); } @@ -1788,15 +1790,20 @@ listen_cb(int lfd, short event, void *arg) event_set(&conn->ev, fd, EV_READ|EV_PERSIST, client_cb, conn); event_add(&conn->ev, &idle_tv); - // check ban here? XXX can we directly use xsin.sin_addr instead of ASCII form? - if (g_banned || check_banip(conn->ctx.hostip) ) - { - // draw ban screen, if available. (for banip, this is empty). + if (g_banned) { draw_text_screen (conn, ban_screen); login_conn_remove(conn, fd, BAN_SLEEP_SEC); return; } + // TODO can we directly use xsin.sin_addr instead of ASCII form? + if (check_banip(conn->ctx.hostip)) + { + draw_text_screen (conn, banip_screen); + login_conn_remove(conn, fd, BAN_SLEEP_SEC); + return; + } + // XXX check system load here. if (g_overload) { |