[srvx-commits] CVS: services/src opserv.c,1.235.2.2,1.235.2.3
Brought to you by:
entrope
|
From: Zoot <zo...@us...> - 2002-07-12 19:39:01
|
Update of /cvsroot/srvx/services/src
In directory usw-pr-cvs1:/tmp/cvs-serv23165/src
Modified Files:
Tag: rel-1_1-branch
opserv.c
Log Message:
Improve the flooding countermeasures slightly.
Index: opserv.c
===================================================================
RCS file: /cvsroot/srvx/services/src/opserv.c,v
retrieving revision 1.235.2.2
retrieving revision 1.235.2.3
diff -C2 -r1.235.2.2 -r1.235.2.3
*** opserv.c 12 Jul 2002 19:21:12 -0000 1.235.2.2
--- opserv.c 12 Jul 2002 19:38:56 -0000 1.235.2.3
***************
*** 208,214 ****
#define OSMSG_ILLEGAL_KILL_REASON "Joined an illegal modeless channel - do not repeat."
#define OSMSG_ILLEGAL_CHANNEL "$b%s$b is an ILLEGAL channel. Do not re-join it."
! #define OSMSG_JOIN_FLOOD "Warning: Possible join flood in %s (currently %d users)."
#define OSMSG_NEW_USER_FLOOD "Warning: Possible new-user flood."
! #define OSMSG_FLOOD_MODERATE "This channel has been temporarily moderated as a result of a join flood attack in this channel; network staff have been notified."
#define OSMSG_CLONE_WARNING "WARNING: You have connected the maximum permitted number of clients from one IP address (clones). If you connect any more, your host will be temporarily banned from the network."
#define OSMSG_TOO_MANY_CLONES "Excessive connections from a single host."
--- 208,214 ----
#define OSMSG_ILLEGAL_KILL_REASON "Joined an illegal modeless channel - do not repeat."
#define OSMSG_ILLEGAL_CHANNEL "$b%s$b is an ILLEGAL channel. Do not re-join it."
! #define OSMSG_JOIN_FLOOD "Warning: Possible join flood in %s (currently %d users%s)."
#define OSMSG_NEW_USER_FLOOD "Warning: Possible new-user flood."
! #define OSMSG_FLOOD_MODERATE "This channel has been temporarily moderated due to a possible join flood attack detected in this channel; network staff have been notified and will investigate."
#define OSMSG_CLONE_WARNING "WARNING: You have connected the maximum permitted number of clients from one IP address (clones). If you connect any more, your host will be temporarily banned from the network."
#define OSMSG_TOO_MANY_CLONES "Excessive connections from a single host."
***************
*** 2296,2300 ****
opserv_join_check(struct userNode *user, struct chanNode *channel)
{
! if (channel->bad_channel && !IsService(user)) {
if (channel->name[0] == '#') {
if (!GetUserMode(channel, opserv)) {
--- 2296,2304 ----
opserv_join_check(struct userNode *user, struct chanNode *channel)
{
! if(IsService(user)) {
! return;
! }
!
! if (channel->bad_channel) {
if (channel->name[0] == '#') {
if (!GetUserMode(channel, opserv)) {
***************
*** 2312,2320 ****
if (!channel->join_flooded) {
channel->join_flooded = 1;
! opserv_alert(OSMSG_JOIN_FLOOD, channel->name, channel->members.used);
! if(opserv_conf.join_flood_moderate)
! {
! AddChannelUser(opserv, channel);
! AddChannelOp(1, &opserv, channel, opserv, 1);
channel->modes |= MODE_MODERATED;
irc_mode(opserv, channel, "+m");
--- 2316,2324 ----
if (!channel->join_flooded) {
channel->join_flooded = 1;
! if(opserv_conf.join_flood_moderate) {
! if(!GetUserMode(channel, opserv)) {
! AddChannelUser(opserv, channel);
! AddChannelOp(1, &opserv, channel, opserv, 1);
! }
channel->modes |= MODE_MODERATED;
irc_mode(opserv, channel, "+m");
***************
*** 2322,2325 ****
--- 2326,2330 ----
send_channel_notice(channel, opserv, OSMSG_FLOOD_MODERATE);
}
+ opserv_alert(OSMSG_JOIN_FLOOD, channel->name, channel->members.used, opserv_conf.join_flood_moderate ? "; channel moderated" : "");
}
log(OS_LOG, LOG_INFO, "Join to %s during flood: "IDENT_FORMAT"\n", channel->name, IDENT_DATA(user));
|