Merge.
This commit is contained in:
commit
4023293674
7
FAQ
7
FAQ
|
@ -28,3 +28,10 @@ A: The ShadowIRCd team highly recommends Atheme IRC Services (www.atheme.net),
|
|||
protocol module and 1.9.x using the ratbox protocol module, but it is not
|
||||
recommended and it has not been tested by the ShadowIRCd developers.
|
||||
|
||||
Q: I've got two servers linked and users on one are getting constant flood notices
|
||||
when trying to send to channels. HELP!!!!
|
||||
A: Has your server's clock gone backwards massively recently? (probably due to it
|
||||
being incorrect). If so, you have two options. You can either wait for the real
|
||||
time to be what the incorrect time was, or you can restart the affected server.
|
||||
If that does not fix the problem, please file a bug at:
|
||||
http://jira.atheme.org/browse/SHAD
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
The ShadowIRCd Mercurial repository can be checked out using the following command:
|
||||
hg clone http://bitbucket.org/uranium/shadowircd/ shadowircd-devel
|
||||
hg clone http://hg.atheme.org/unofficial/shadowircd/ shadowircd-devel
|
||||
|
||||
The stable version can be checked out using the following command:
|
||||
hg clone http://bitbucket.org/uranium/shadowircd-stable/ shadowircd-stable
|
||||
|
||||
ShadowIRCd's Mercurial repository depot can be browsed over the internet at
|
||||
the following address:
|
||||
http://bitbucket.org/uranium/shadowircd/
|
||||
http://hg.atheme.org/unofficial/shadowircd/
|
||||
|
|
11
TODO-SHADOW
11
TODO-SHADOW
|
@ -1,10 +1,7 @@
|
|||
Todo list for ShadowIRCd 6.2
|
||||
----------------------------
|
||||
* channel::disabledmodes
|
||||
* general::disabledumodes
|
||||
* pure TS6 compat mode for linking with charybdis/ratbox/etc.
|
||||
* modesetize umodes
|
||||
* global/remote SET, via shared block flag.
|
||||
* TBAN equivalent (like a extban?) (?)
|
||||
* ELINE - command to make users kline/dline/xline exempt on-the-fly (?)
|
||||
* implementation to change other users' umodes (if you're a oper of course)
|
||||
* evaluate snotes and possibly make a lot more netwide .
|
||||
* on the fly dnsbl exceptions (?)
|
||||
* evaluate snotes and possibly make a lot more netwide.
|
||||
* Update the SGML docs (oper-guide) for all the shadowircd stuff.
|
||||
|
|
|
@ -373,6 +373,7 @@ exempt {
|
|||
|
||||
channel {
|
||||
autochanmodes = "nt";
|
||||
admin_on_channel_create = no;
|
||||
exemptchanops = "NT";
|
||||
use_halfop = yes;
|
||||
use_admin = yes;
|
||||
|
@ -396,6 +397,7 @@ channel {
|
|||
cycle_host_change = yes;
|
||||
host_in_topic = yes;
|
||||
resv_forcepart = yes;
|
||||
channel_target_change = yes;
|
||||
};
|
||||
|
||||
serverhide {
|
||||
|
@ -470,6 +472,10 @@ alias "InfoServ" {
|
|||
target = "InfoServ";
|
||||
};
|
||||
|
||||
alias "GroupServ" {
|
||||
target = "GroupServ";
|
||||
};
|
||||
|
||||
alias "NS" {
|
||||
target = "NickServ";
|
||||
};
|
||||
|
@ -498,6 +504,10 @@ alias "IS" {
|
|||
target = "InfoServ";
|
||||
};
|
||||
|
||||
alias "GS" {
|
||||
target = "GroupServ";
|
||||
};
|
||||
|
||||
general {
|
||||
hide_error_messages = opers;
|
||||
hide_spoof_ips = yes;
|
||||
|
@ -516,6 +526,7 @@ general {
|
|||
#static_quit = "I like turtles!";
|
||||
servicestring = "is a Network Service";
|
||||
disable_fake_channels = no;
|
||||
hide_channel_below_users = 3;
|
||||
tkline_expire_notices = no;
|
||||
default_floodcount = 10;
|
||||
failed_oper_notice = yes;
|
||||
|
|
|
@ -745,6 +745,11 @@ channel {
|
|||
*/
|
||||
autochanmodes = "nt";
|
||||
|
||||
/* admin_on_channel_create: If set to yes, users joining new channels
|
||||
* will be given +ao instead of just +o. Requires use_admin.
|
||||
*/
|
||||
admin_on_channel_create = no;
|
||||
|
||||
/* exemptchanops: Channel modes that any form of channel ops (+aoh)
|
||||
* will be exempt from. Even if the mode is set, it will not apply to the
|
||||
* channel ops if it is listed in this option. Valid modes are cCDTNGK.
|
||||
|
@ -892,6 +897,12 @@ channel {
|
|||
* when a RESV is issued.
|
||||
*/
|
||||
resv_forcepart = yes;
|
||||
|
||||
/* channel target change: restrict how many channels users can
|
||||
* message per unit of time. IRC operators, channel operators and
|
||||
* voiced users are exempt.
|
||||
*/
|
||||
channel_target_change = yes;
|
||||
};
|
||||
|
||||
|
||||
|
@ -996,6 +1007,10 @@ alias "InfoServ" {
|
|||
target = "InfoServ";
|
||||
};
|
||||
|
||||
alias "GroupServ" {
|
||||
target = "GroupServ";
|
||||
};
|
||||
|
||||
alias "NS" {
|
||||
target = "NickServ";
|
||||
};
|
||||
|
@ -1024,6 +1039,10 @@ alias "IS" {
|
|||
target = "InfoServ";
|
||||
};
|
||||
|
||||
alias "GS" {
|
||||
target = "GroupServ";
|
||||
};
|
||||
|
||||
/* The general block contains many of the options that were once compiled
|
||||
* in options in config.h. The general block is read at start time.
|
||||
*/
|
||||
|
@ -1091,6 +1110,12 @@ general {
|
|||
*/
|
||||
disable_fake_channels = no;
|
||||
|
||||
/* hide_channel_below_users: Amount of users a channel must have in it
|
||||
* before it is shown in a standard LIST. This can be overridden by
|
||||
* invoking LIST like: /LIST <3
|
||||
*/
|
||||
hide_channel_below_users = 3;
|
||||
|
||||
/* tkline_expire_notices: give a notice to opers when a tkline
|
||||
* expires
|
||||
*/
|
||||
|
|
|
@ -454,6 +454,24 @@ parameters: server mask, hunted
|
|||
|
||||
Remote LUSERS request. Most servers ignore the server mask, treating it as '*'.
|
||||
|
||||
MLOCK
|
||||
charybdis TS6
|
||||
source: services server
|
||||
parameters: channelTS, channel, mode letters
|
||||
propagation: broadcast (restricted)
|
||||
|
||||
Propagates a channel mode lock change.
|
||||
|
||||
If the channelTS is greater (newer) than the current TS of the channel, drop
|
||||
the message.
|
||||
|
||||
The final parameter is a list of mode letters that may not be changed by local
|
||||
users. This applies to setting or unsetting simple modes, and changing or
|
||||
removing mode parameters.
|
||||
|
||||
An MLOCK message with no modes disables the MLOCK, therefore the MLOCK message
|
||||
always contains the literal MLOCK for simplicity.
|
||||
|
||||
MODE
|
||||
1.
|
||||
source: user
|
||||
|
|
|
@ -3,15 +3,17 @@ Lee H <lee -at- leeh.co.uk>
|
|||
---------------------------
|
||||
|
||||
Reworked by Jilles Tjoelker, February 2010.
|
||||
Channel target change added by Jilles Tjoelker, August 2010.
|
||||
|
||||
If the server you are using uses the target change mechanism, then
|
||||
restrictions are placed on how many different users you can message in a set
|
||||
timeframe. This also applies to invites.
|
||||
restrictions are placed on how many different users and/or channels you can
|
||||
message in a set timeframe. This also applies to invites (for the target
|
||||
user) and topic changes.
|
||||
|
||||
Target change does not apply to channels, ctcp replies, messages to
|
||||
yourself or messages to services.
|
||||
Target change does not apply to ctcp replies, messages to yourself, messages
|
||||
to services and joins.
|
||||
|
||||
You will have a set number of 'slots', each different client you message
|
||||
You will have a set number of 'slots', each different target you message
|
||||
will take up one slot. A client doing a nick change will not use a new slot,
|
||||
however a client disconnecting from the server it is on and reconnecting
|
||||
will. You will receive 1 new slot roughly every minute.
|
||||
|
@ -20,14 +22,14 @@ Additionally, clients that message or invite you are placed in one of a
|
|||
small number of special slots, in many cases allowing replies without using
|
||||
a slot.
|
||||
|
||||
When all slots are filled, messages to new clients will not be accepted.
|
||||
Messages to clients already filling a slot will be accepted. If all slots
|
||||
When all slots are filled, messages to new targets will not be accepted.
|
||||
Messages to targets already filling a slot will be accepted. If all slots
|
||||
are full, you will receive the ERR_TARGCHANGE numeric, number 707 in the
|
||||
form:
|
||||
:<server> 707 <yournick> <targetnick> :Targets changing too fast, message dropped
|
||||
:<server> 707 <yournick> <target> :Targets changing too fast, message dropped
|
||||
|
||||
The slots are operated in an LRU (least recently used), so the person you
|
||||
have talked to least recently will be replaced.
|
||||
The slots are operated in an LRU (least recently used), so the person or
|
||||
channel you have talked to least recently will be replaced.
|
||||
|
||||
The number of slots in use will be kept through a reconnection, though the
|
||||
information in those slots will be dropped. However, you will always
|
||||
|
@ -35,8 +37,9 @@ receive one free slot on a reconnection. Other servers using this mechanism
|
|||
will also be made aware of details about slots.
|
||||
|
||||
Target change does not apply if you are opped or voiced in a channel, and
|
||||
you are messaging a client within that channel. This can be done explicitly
|
||||
using the CNOTICE and CPRIVMSG commands, see /quote help cnotice and /quote
|
||||
help cprivmsg, but is also implicit in a normal /msg, /notice or /invite.
|
||||
you are messaging that channel or a client within that channel. The latter
|
||||
can be done explicitly using the CNOTICE and CPRIVMSG commands, see
|
||||
/quote help cnotice and /quote help cprivmsg, but is also implicit in a
|
||||
normal /msg, /notice or /invite.
|
||||
|
||||
--
|
||||
|
|
|
@ -49,20 +49,13 @@
|
|||
|
||||
static int mo_forcejoin(struct Client *client_p, struct Client *source_p,
|
||||
int parc, const char *parv[]);
|
||||
static int mo_forcepart(struct Client *client_p, struct Client *source_p,
|
||||
int parc, const char *parv[]);
|
||||
|
||||
struct Message forcejoin_msgtab = {
|
||||
"FORCEJOIN", 0, 0, 0, MFLG_SLOW,
|
||||
{mg_unreg, mg_not_oper, mg_ignore, mg_ignore, mg_ignore, {mo_forcejoin, 3}}
|
||||
};
|
||||
|
||||
struct Message forcepart_msgtab = {
|
||||
"FORCEPART", 0, 0, 0, MFLG_SLOW,
|
||||
{mg_unreg, mg_not_oper, mg_ignore, mg_ignore, mg_ignore, {mo_forcepart, 3}}
|
||||
};
|
||||
|
||||
mapi_clist_av1 force_clist[] = { &forcejoin_msgtab, &forcepart_msgtab, NULL };
|
||||
mapi_clist_av1 force_clist[] = { &forcejoin_msgtab, NULL };
|
||||
|
||||
DECLARE_MODULE_AV1(force, NULL, NULL, force_clist, NULL, NULL, "$Revision: 3297 $");
|
||||
|
||||
|
@ -223,68 +216,3 @@ mo_forcejoin(struct Client *client_p, struct Client *source_p, int parc, const c
|
|||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
mo_forcepart(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
|
||||
{
|
||||
struct Client *target_p;
|
||||
struct Channel *chptr;
|
||||
struct membership *msptr;
|
||||
|
||||
if(!IsOperAdmin(source_p))
|
||||
{
|
||||
sendto_one(source_p, form_str(ERR_NOPRIVS), me.name, source_p->name, "admin");
|
||||
return 0;
|
||||
}
|
||||
|
||||
if((hunt_server(client_p, source_p, ":%s FORCEPART %s %s", 1, parc, parv)) != HUNTED_ISME)
|
||||
return 0;
|
||||
|
||||
/* if target_p == NULL then let the oper know */
|
||||
if((target_p = find_client(parv[1])) == NULL)
|
||||
{
|
||||
sendto_one(source_p, form_str(ERR_NOSUCHNICK), me.name, source_p->name, parv[1]);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if(!IsClient(target_p))
|
||||
return 0;
|
||||
|
||||
sendto_wallops_flags(UMODE_WALLOP, &me,
|
||||
"FORCEPART called for %s %s by %s!%s@%s",
|
||||
parv[1], parv[2], source_p->name, source_p->username, source_p->host);
|
||||
ilog(L_MAIN, "FORCEPART called for %s %s by %s!%s@%s",
|
||||
parv[1], parv[2], source_p->name, source_p->username, source_p->host);
|
||||
sendto_server(NULL, NULL, NOCAPS, NOCAPS,
|
||||
":%s WALLOPS :FORCEPART called for %s %s by %s!%s@%s",
|
||||
me.name, parv[1], parv[2],
|
||||
source_p->name, source_p->username, source_p->host);
|
||||
|
||||
if((chptr = find_channel(parv[2])) == NULL)
|
||||
{
|
||||
sendto_one_numeric(source_p, ERR_NOSUCHCHANNEL,
|
||||
form_str(ERR_NOSUCHCHANNEL), parv[1]);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if((msptr = find_channel_membership(chptr, target_p)) == NULL)
|
||||
{
|
||||
sendto_one_numeric(source_p, ERR_USERNOTINCHANNEL,
|
||||
form_str(ERR_USERNOTINCHANNEL),
|
||||
parv[1], parv[2]);
|
||||
return 0;
|
||||
}
|
||||
|
||||
sendto_server(target_p, chptr, NOCAPS, NOCAPS,
|
||||
":%s PART %s :%s", target_p->name, chptr->chname, target_p->name);
|
||||
|
||||
sendto_channel_local(ALL_MEMBERS, chptr, ":%s!%s@%s PART %s :%s",
|
||||
target_p->name, target_p->username,
|
||||
target_p->host, chptr->chname, target_p->name);
|
||||
|
||||
|
||||
remove_user_from_channel(msptr);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -50,6 +50,7 @@ struct Channel
|
|||
{
|
||||
rb_dlink_node node;
|
||||
struct Mode mode;
|
||||
char *mode_lock;
|
||||
char *topic;
|
||||
char *topic_info;
|
||||
time_t topic_time;
|
||||
|
@ -282,6 +283,8 @@ void resv_chan_forcepart(const char *name, const char *reason, int temp_time);
|
|||
|
||||
extern void set_channel_mode(struct Client *client_p, struct Client *source_p,
|
||||
struct Channel *chptr, struct membership *msptr, int parc, const char *parv[]);
|
||||
extern void set_channel_mlock(struct Client *client_p, struct Client *source_p,
|
||||
struct Channel *chptr, const char *newmlock, int propagate);
|
||||
|
||||
extern struct ChannelMode chmode_table[256];
|
||||
|
||||
|
|
|
@ -154,6 +154,7 @@ extern const char *form_str(int);
|
|||
#define RPL_LIST 322
|
||||
#define RPL_LISTEND 323
|
||||
#define RPL_CHANNELMODEIS 324
|
||||
#define RPL_CHANNELMLOCK 325 /* from sorircd 1.3 --nenolod */
|
||||
|
||||
#define RPL_CHANNELURL 328 /* to be sent by services */
|
||||
|
||||
|
@ -308,6 +309,8 @@ extern const char *form_str(int);
|
|||
|
||||
#define ERR_KICKNOREJOIN 495
|
||||
|
||||
#define ERR_OWNMODE 494 /* from bahamut -- jilles */
|
||||
|
||||
#define ERR_UMODEUNKNOWNFLAG 501
|
||||
#define ERR_USERSDONTMATCH 502
|
||||
|
||||
|
@ -377,6 +380,8 @@ extern const char *form_str(int);
|
|||
#define RPL_RSACHALLENGE2 740
|
||||
#define RPL_ENDOFRSACHALLENGE2 741
|
||||
|
||||
#define ERR_MLOCKRESTRICTED 742
|
||||
|
||||
#define RPL_SCANMATCHED 750
|
||||
#define RPL_SCANUMODES 751
|
||||
|
||||
|
|
|
@ -166,6 +166,7 @@ struct config_file_entry
|
|||
|
||||
unsigned char compression_level;
|
||||
int disable_fake_channels;
|
||||
int hide_channel_below_users;
|
||||
int dots_in_ident;
|
||||
int failed_oper_notice;
|
||||
int anti_nick_flood;
|
||||
|
@ -238,6 +239,7 @@ struct config_channel_entry
|
|||
{
|
||||
char * autochanmodes;
|
||||
char * exemptchanops;
|
||||
int admin_on_channel_create;
|
||||
int use_halfop;
|
||||
int use_admin;
|
||||
int use_except;
|
||||
|
@ -260,6 +262,7 @@ struct config_channel_entry
|
|||
int cycle_host_change;
|
||||
int host_in_topic;
|
||||
int resv_forcepart;
|
||||
int channel_target_change;
|
||||
|
||||
int exempt_cmode_c;
|
||||
int exempt_cmode_C;
|
||||
|
|
|
@ -72,13 +72,14 @@ struct Capability
|
|||
#define CAP_EUID 0x80000 /* supports EUID (ext UID + nonencap CHGHOST) */
|
||||
#define CAP_EOPMOD 0x100000 /* supports EOPMOD (ext +z + ext topic) */
|
||||
#define CAP_BAN 0x200000 /* supports propagated bans */
|
||||
#define CAP_MLOCK 0x400000 /* supports MLOCK messages */
|
||||
|
||||
#define CAP_MASK (CAP_QS | CAP_EX | CAP_CHW | \
|
||||
CAP_IE | CAP_KLN | CAP_SERVICE |\
|
||||
CAP_CLUSTER | CAP_ENCAP | \
|
||||
CAP_ZIP | CAP_KNOCK | CAP_UNKLN | \
|
||||
CAP_RSFNC | CAP_SAVE | CAP_EUID | CAP_EOPMOD | \
|
||||
CAP_BAN)
|
||||
CAP_BAN | CAP_MLOCK)
|
||||
|
||||
#ifdef HAVE_LIBZ
|
||||
#define CAP_ZIP_SUPPORTED CAP_ZIP
|
||||
|
|
|
@ -30,6 +30,8 @@
|
|||
struct Channel *find_allowing_channel(struct Client *source_p, struct Client *target_p);
|
||||
/* checks if source_p is allowed to send to target_p */
|
||||
int add_target(struct Client *source_p, struct Client *target_p);
|
||||
/* checks if source_p is allowed to send to chptr */
|
||||
int add_channel_target(struct Client *source_p, struct Channel *chptr);
|
||||
/* allows source_p to send to target_p */
|
||||
void add_reply_target(struct Client *source_p, struct Client *target_p);
|
||||
|
||||
|
|
|
@ -52,8 +52,9 @@ struct Whowas
|
|||
char username[USERLEN + 1];
|
||||
char hostname[HOSTLEN + 1];
|
||||
char sockhost[HOSTIPLEN + 1];
|
||||
const char *servername;
|
||||
char realname[REALLEN + 1];
|
||||
char suser[NICKLEN + 1];
|
||||
const char *servername;
|
||||
time_t logoff;
|
||||
struct Client *online; /* Pointer to new nickname for chasing or NULL */
|
||||
struct Whowas *next; /* for hash table... */
|
||||
|
|
|
@ -45,16 +45,27 @@
|
|||
#include "reject.h"
|
||||
#include "hostmask.h"
|
||||
|
||||
static int m_ban(struct Client *client_p, struct Client *source_p, int parc, const char *parv[]);
|
||||
static int ms_ban(struct Client *client_p, struct Client *source_p, int parc, const char *parv[]);
|
||||
|
||||
struct Message ban_msgtab = {
|
||||
"BAN", 0, 0, 0, MFLG_SLOW,
|
||||
{mg_unreg, mg_ignore, {ms_ban, 9}, {ms_ban, 9}, mg_ignore, mg_ignore}
|
||||
{mg_unreg, {m_ban, 0}, {ms_ban, 9}, {ms_ban, 9}, mg_ignore, {m_ban, 0}}
|
||||
};
|
||||
|
||||
mapi_clist_av1 ban_clist[] = { &ban_msgtab, NULL };
|
||||
DECLARE_MODULE_AV1(ban, NULL, NULL, ban_clist, NULL, NULL, "$Revision: 1349 $");
|
||||
|
||||
static int
|
||||
m_ban(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
|
||||
{
|
||||
sendto_one_notice(source_p, ":The BAN command is not user-accessible.");
|
||||
sendto_one_notice(source_p, ":To ban a user from a channel, see /QUOTE HELP CMODE");
|
||||
if (IsOper(source_p))
|
||||
sendto_one_notice(source_p, ":To ban a user from a server or from the network, see /QUOTE HELP KLINE");
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* ms_ban()
|
||||
*
|
||||
* parv[1] - type
|
||||
|
|
|
@ -111,6 +111,9 @@ me_svsjoin(struct Client *client_p, struct Client *source_p, int parc, const cha
|
|||
if((target_p = find_person(parv[1])) == NULL)
|
||||
return 0;
|
||||
|
||||
if(!MyClient(target_p))
|
||||
return 0;
|
||||
|
||||
user_join(&me, target_p, parv[2], NULL);
|
||||
return 0;
|
||||
}
|
||||
|
@ -227,6 +230,9 @@ ms_join(struct Client *client_p, struct Client *source_p, int parc, const char *
|
|||
source_p->servptr->name,
|
||||
chptr->chname, modebuf, parabuf);
|
||||
*omodebuf = *modebuf = *parabuf = '\0';
|
||||
|
||||
/* since we're dropping our modes, we want to clear the mlock as well. --nenolod */
|
||||
set_channel_mlock(client_p, source_p, chptr, NULL, FALSE);
|
||||
}
|
||||
|
||||
if(!IsMember(source_p, chptr))
|
||||
|
@ -488,6 +494,9 @@ ms_sjoin(struct Client *client_p, struct Client *source_p, int parc, const char
|
|||
/* Update capitalization in channel name, this makes the
|
||||
* capitalization timestamped like modes are -- jilles */
|
||||
strcpy(chptr->chname, parv[2]);
|
||||
|
||||
/* since we're dropping our modes, we want to clear the mlock as well. --nenolod */
|
||||
set_channel_mlock(client_p, source_p, chptr, NULL, FALSE);
|
||||
}
|
||||
|
||||
if(*modebuf != '\0')
|
||||
|
@ -530,7 +539,7 @@ ms_sjoin(struct Client *client_p, struct Client *source_p, int parc, const char
|
|||
{
|
||||
fl = 0;
|
||||
|
||||
for (i = 0; i < 2; i++)
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
if(*s == '!')
|
||||
{
|
||||
|
@ -690,7 +699,7 @@ ms_sjoin(struct Client *client_p, struct Client *source_p, int parc, const char
|
|||
para[pargs++] = target_p->name;
|
||||
}
|
||||
}
|
||||
if(fl & CHFL_CHANOP)
|
||||
else if(fl & CHFL_CHANOP)
|
||||
{
|
||||
*mbuf++ = 'o';
|
||||
para[pargs++] = target_p->name;
|
||||
|
@ -740,7 +749,7 @@ ms_sjoin(struct Client *client_p, struct Client *source_p, int parc, const char
|
|||
para[pargs++] = target_p->name;
|
||||
}
|
||||
}
|
||||
if(fl & CHFL_HALFOP)
|
||||
else if(fl & CHFL_HALFOP)
|
||||
{
|
||||
*mbuf++ = 'h';
|
||||
para[pargs++] = target_p->name;
|
||||
|
|
|
@ -533,6 +533,14 @@ msg_channel(int p_or_n, const char *command,
|
|||
/* chanops and voiced can flood their own channel with impunity */
|
||||
if((result = can_send(chptr, source_p, NULL)))
|
||||
{
|
||||
if(result != CAN_SEND_OPV && MyClient(source_p) &&
|
||||
!IsOper(source_p) &&
|
||||
!add_channel_target(source_p, chptr))
|
||||
{
|
||||
sendto_one(source_p, form_str(ERR_TARGCHANGE),
|
||||
me.name, source_p->name, chptr->chname);
|
||||
return;
|
||||
}
|
||||
if(result == CAN_SEND_OPV ||
|
||||
!flood_attack_channel(p_or_n, source_p, chptr, chptr->chname))
|
||||
{
|
||||
|
@ -583,6 +591,13 @@ msg_channel(int p_or_n, const char *command,
|
|||
(!(chptr->mode.mode & MODE_NOPRIVMSGS) ||
|
||||
IsMember(source_p, chptr)))
|
||||
{
|
||||
if(MyClient(source_p) && !IsOper(source_p) &&
|
||||
!add_channel_target(source_p, chptr))
|
||||
{
|
||||
sendto_one(source_p, form_str(ERR_TARGCHANGE),
|
||||
me.name, source_p->name, chptr->chname);
|
||||
return;
|
||||
}
|
||||
if(!flood_attack_channel(p_or_n, source_p, chptr, chptr->chname))
|
||||
{
|
||||
sendto_channel_opmod(client_p, source_p, chptr,
|
||||
|
@ -736,6 +751,32 @@ msg_client(int p_or_n, const char *command,
|
|||
|
||||
if(MyClient(source_p))
|
||||
{
|
||||
/*
|
||||
* XXX: Controversial? Allow target users to send replies
|
||||
* through a +g. Rationale is that people can presently use +g
|
||||
* as a way to taunt users, e.g. harass them and hide behind +g
|
||||
* as a way of griefing. --nenolod
|
||||
*/
|
||||
if(p_or_n != NOTICE && MyClient(source_p) &&
|
||||
IsSetCallerId(source_p) &&
|
||||
IsSetSCallerId(source_p) &&
|
||||
!accept_message(target_p, source_p))
|
||||
{
|
||||
if(rb_dlink_list_length(&source_p->localClient->allow_list) <
|
||||
ConfigFileEntry.max_accept)
|
||||
{
|
||||
rb_dlinkAddAlloc(target_p, &source_p->localClient->allow_list);
|
||||
rb_dlinkAddAlloc(source_p, &target_p->on_allow_list);
|
||||
}
|
||||
else
|
||||
{
|
||||
sendto_one_numeric(source_p, ERR_OWNMODE,
|
||||
form_str(ERR_OWNMODE),
|
||||
target_p->name, "+g");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/* reset idle time for message only if its not to self
|
||||
* and its not a notice */
|
||||
if(p_or_n != NOTICE)
|
||||
|
|
|
@ -44,6 +44,7 @@
|
|||
static int m_mode(struct Client *, struct Client *, int, const char **);
|
||||
static int ms_mode(struct Client *, struct Client *, int, const char **);
|
||||
static int ms_tmode(struct Client *, struct Client *, int, const char **);
|
||||
static int ms_mlock(struct Client *, struct Client *, int, const char **);
|
||||
static int ms_bmask(struct Client *, struct Client *, int, const char **);
|
||||
|
||||
struct Message mode_msgtab = {
|
||||
|
@ -54,12 +55,16 @@ struct Message tmode_msgtab = {
|
|||
"TMODE", 0, 0, 0, MFLG_SLOW,
|
||||
{mg_ignore, mg_ignore, {ms_tmode, 4}, {ms_tmode, 4}, mg_ignore, mg_ignore}
|
||||
};
|
||||
struct Message mlock_msgtab = {
|
||||
"MLOCK", 0, 0, 0, MFLG_SLOW,
|
||||
{mg_ignore, mg_ignore, {ms_mlock, 3}, {ms_mlock, 3}, mg_ignore, mg_ignore}
|
||||
};
|
||||
struct Message bmask_msgtab = {
|
||||
"BMASK", 0, 0, 0, MFLG_SLOW,
|
||||
{mg_ignore, mg_ignore, mg_ignore, {ms_bmask, 5}, mg_ignore, mg_ignore}
|
||||
};
|
||||
|
||||
mapi_clist_av1 mode_clist[] = { &mode_msgtab, &tmode_msgtab, &bmask_msgtab, NULL };
|
||||
mapi_clist_av1 mode_clist[] = { &mode_msgtab, &tmode_msgtab, &mlock_msgtab, &bmask_msgtab, NULL };
|
||||
|
||||
DECLARE_MODULE_AV1(mode, NULL, NULL, mode_clist, NULL, NULL, "$Revision: 1006 $");
|
||||
|
||||
|
@ -203,6 +208,37 @@ ms_tmode(struct Client *client_p, struct Client *source_p, int parc, const char
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
ms_mlock(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
|
||||
{
|
||||
struct Channel *chptr = NULL;
|
||||
|
||||
/* Now, try to find the channel in question */
|
||||
if(!IsChanPrefix(parv[2][0]) || !check_channel_name(parv[2]))
|
||||
{
|
||||
sendto_one_numeric(source_p, ERR_BADCHANNAME, form_str(ERR_BADCHANNAME), parv[2]);
|
||||
return 0;
|
||||
}
|
||||
|
||||
chptr = find_channel(parv[2]);
|
||||
|
||||
if(chptr == NULL)
|
||||
{
|
||||
sendto_one_numeric(source_p, ERR_NOSUCHCHANNEL,
|
||||
form_str(ERR_NOSUCHCHANNEL), parv[2]);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* TS is higher, drop it. */
|
||||
if(atol(parv[1]) > chptr->channelts)
|
||||
return 0;
|
||||
|
||||
if(IsServer(source_p))
|
||||
set_channel_mlock(client_p, source_p, chptr, parv[3], TRUE);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
ms_bmask(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
|
||||
{
|
||||
|
|
|
@ -150,6 +150,12 @@ static struct InfoStruct info_table[] = {
|
|||
&ConfigFileEntry.default_floodcount,
|
||||
"Startup value of FLOODCOUNT",
|
||||
},
|
||||
{
|
||||
"hide_channel_below_users",
|
||||
OUTPUT_DECIMAL,
|
||||
&ConfigFileEntry.hide_channel_below_users,
|
||||
"Hide channels below this many users in standard /LIST output",
|
||||
},
|
||||
{
|
||||
"default_adminstring",
|
||||
OUTPUT_STRING,
|
||||
|
@ -619,6 +625,12 @@ static struct InfoStruct info_table[] = {
|
|||
&ConfigChannel.host_in_topic,
|
||||
"Defines whether a topicsetters host or just nick is shown on TOPIC",
|
||||
},
|
||||
{
|
||||
"admin_on_channel_create",
|
||||
OUTPUT_BOOLEAN_YN,
|
||||
&ConfigChannel.admin_on_channel_create,
|
||||
"Give users +ao on channel create",
|
||||
},
|
||||
{
|
||||
"use_halfop",
|
||||
OUTPUT_BOOLEAN_YN,
|
||||
|
|
|
@ -152,8 +152,8 @@ static int mo_list(struct Client *client_p, struct Client *source_p, int parc, c
|
|||
return 0;
|
||||
}
|
||||
|
||||
/* XXX rather arbitrary -- jilles */
|
||||
params.users_min = 3;
|
||||
/* Let the user set it */
|
||||
params.users_min = ConfigFileEntry.hide_channel_below_users;
|
||||
params.users_max = INT_MAX;
|
||||
|
||||
if (parc > 1 && parv[1] != NULL && !IsChannelName(parv[1]))
|
||||
|
|
|
@ -301,9 +301,8 @@ h_svc_whois(hook_data_client *data)
|
|||
if(*p == '\0')
|
||||
p = data->target->user->suser;
|
||||
|
||||
sendto_one(data->client, form_str(RPL_WHOISLOGGEDIN),
|
||||
get_id(&me, data->client),
|
||||
get_id(data->client, data->client),
|
||||
sendto_one_numeric(data->client, RPL_WHOISLOGGEDIN,
|
||||
form_str(RPL_WHOISLOGGEDIN),
|
||||
data->target->name, p);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -38,6 +38,7 @@
|
|||
#include "parse.h"
|
||||
#include "modules.h"
|
||||
#include "packet.h"
|
||||
#include "tgchange.h"
|
||||
|
||||
static int m_topic(struct Client *, struct Client *, int, const char **);
|
||||
static int ms_topic(struct Client *, struct Client *, int, const char **);
|
||||
|
@ -115,7 +116,16 @@ m_topic(struct Client *client_p, struct Client *source_p, int parc, const char *
|
|||
return 0;
|
||||
}
|
||||
|
||||
if(MyClient(source_p) && (chptr->mode.mode & MODE_TOPICLIMIT) && !is_any_op(msptr) && !can_send(chptr, source_p, msptr))
|
||||
if(MyClient(source_p) && !is_chanop_voiced(msptr) &&
|
||||
!IsOper(source_p) &&
|
||||
!add_channel_target(source_p, chptr))
|
||||
{
|
||||
sendto_one(source_p, form_str(ERR_TARGCHANGE),
|
||||
me.name, source_p->name, chptr->chname);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if(MyClient(source_p) && (chptr->mode.mode & MODE_TOPICLIMIT) && !is_any_op(msptr))
|
||||
{
|
||||
if(IsOverride(source_p))
|
||||
{
|
||||
|
|
|
@ -114,6 +114,10 @@ m_whowas(struct Client *client_p, struct Client *source_p, int parc, const char
|
|||
form_str(RPL_WHOISACTUALLY),
|
||||
temp->name, temp->sockhost);
|
||||
#endif
|
||||
if (!EmptyString(temp->suser))
|
||||
sendto_one_numeric(source_p, RPL_WHOISLOGGEDIN,
|
||||
"%s %s :was logged in as",
|
||||
temp->name, temp->suser);
|
||||
sendto_one_numeric(source_p, RPL_WHOISSERVER,
|
||||
form_str(RPL_WHOISSERVER),
|
||||
temp->name, temp->servername,
|
||||
|
|
|
@ -106,6 +106,7 @@ free_channel(struct Channel *chptr)
|
|||
{
|
||||
channel_metadata_clear(chptr);
|
||||
rb_free(chptr->chname);
|
||||
rb_free(chptr->mode_lock);
|
||||
rb_bh_free(channel_heap, chptr);
|
||||
}
|
||||
|
||||
|
@ -1829,7 +1830,10 @@ void user_join(struct Client * client_p, struct Client * source_p, const char *
|
|||
continue;
|
||||
}
|
||||
|
||||
flags = CHFL_CHANOP;
|
||||
if(ConfigChannel.admin_on_channel_create && ConfigChannel.use_admin)
|
||||
flags = CHFL_ADMIN | CHFL_CHANOP;
|
||||
else
|
||||
flags = CHFL_CHANOP;
|
||||
}
|
||||
|
||||
if((rb_dlink_list_length(&source_p->user->channel) >=
|
||||
|
|
35
src/chmode.c
35
src/chmode.c
|
@ -56,6 +56,7 @@
|
|||
#define SM_ERR_NOPRIVS 0x00000400
|
||||
#define SM_ERR_RPL_Q 0x00000800
|
||||
#define SM_ERR_RPL_F 0x00001000
|
||||
#define SM_ERR_MLOCK 0x00002000
|
||||
|
||||
#define MAXMODES_SIMPLE 46 /* a-zA-Z except bqeIov */
|
||||
|
||||
|
@ -2086,6 +2087,19 @@ set_channel_mode(struct Client *client_p, struct Client *source_p,
|
|||
dir = MODE_QUERY;
|
||||
break;
|
||||
default:
|
||||
/* If this mode char is locked, don't allow local users to change it. */
|
||||
if (MyClient(source_p) && chptr->mode_lock && strchr(chptr->mode_lock, c))
|
||||
{
|
||||
if (!(errors & SM_ERR_MLOCK))
|
||||
sendto_one_numeric(source_p,
|
||||
ERR_MLOCKRESTRICTED,
|
||||
form_str(ERR_MLOCKRESTRICTED),
|
||||
chptr->chname,
|
||||
c,
|
||||
chptr->mode_lock);
|
||||
errors |= SM_ERR_MLOCK;
|
||||
continue;
|
||||
}
|
||||
chmode_table[(unsigned char) c].set_func(fakesource_p, chptr, alevel,
|
||||
parc, &parn, parv,
|
||||
&errors, dir, c,
|
||||
|
@ -2233,3 +2247,24 @@ set_channel_mode(struct Client *client_p, struct Client *source_p,
|
|||
if(MyClient(source_p) || rb_dlink_list_length(&serv_list) > 1)
|
||||
send_cap_mode_changes(client_p, source_p, chptr, mode_changes, mode_count);
|
||||
}
|
||||
|
||||
/* set_channel_mlock()
|
||||
*
|
||||
* inputs - client, source, channel, params
|
||||
* output -
|
||||
* side effects - channel mlock is changed / MLOCK is propagated
|
||||
*/
|
||||
void
|
||||
set_channel_mlock(struct Client *client_p, struct Client *source_p,
|
||||
struct Channel *chptr, const char *newmlock, int propagate)
|
||||
{
|
||||
rb_free(chptr->mode_lock);
|
||||
chptr->mode_lock = newmlock ? rb_strdup(newmlock) : NULL;
|
||||
|
||||
if (propagate)
|
||||
{
|
||||
sendto_server(client_p, NULL, CAP_TS6 | CAP_MLOCK, NOCAPS, ":%s MLOCK %ld %s :%s",
|
||||
source_p->id, (long) chptr->channelts, chptr->chname,
|
||||
chptr->mode_lock ? chptr->mode_lock : "");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -346,12 +346,12 @@ static const char * replies[] = {
|
|||
/* 322 RPL_LIST, */ ":%s 322 %s %s %d :%s",
|
||||
/* 323 RPL_LISTEND, */ ":%s 323 %s :End of /LIST",
|
||||
/* 324 RPL_CHANNELMODEIS, */ ":%s 324 %s %s %s",
|
||||
/* 325 */ NULL,
|
||||
/* 325 RPL_CHANNELMLOCKIS, */ ":%s 325 %s %s %s :is the current channel mode-lock",
|
||||
/* 326 */ NULL,
|
||||
/* 327 */ NULL,
|
||||
/* 328 RPL_CHANNELURL */ NULL,
|
||||
/* 329 RPL_CREATIONTIME, */ ":%s 329 %s %s %lu",
|
||||
/* 330 RPL_WHOISLOGGEDIN */ ":%s 330 %s %s %s :is logged in as",
|
||||
/* 330 RPL_WHOISLOGGEDIN */ "%s %s :is logged in as",
|
||||
/* 331 RPL_NOTOPIC, */ ":%s 331 %s %s :No topic is set.",
|
||||
/* 332 RPL_TOPIC, */ ":%s 332 %s %s :%s",
|
||||
/* 333 RPL_TOPICWHOTIME, */ ":%s 333 %s %s %s %lu",
|
||||
|
@ -402,7 +402,7 @@ static const char * replies[] = {
|
|||
/* 378 RPL_WHOISHOST, */ "%s :is connecting from *@%s %s",
|
||||
/* 379 RPL_WHOISMODES */ "%s :is using modes %s",
|
||||
/* 380 */ NULL,
|
||||
/* 381 RPL_YOUREOPER, */ ":%s 381 %s :Greetings, Professor Falken. Shall we play a game?",
|
||||
/* 381 RPL_YOUREOPER, */ ":%s 381 %s :Only the jilles can fix your machine god.",
|
||||
/* 382 RPL_REHASHING, */ ":%s 382 %s %s :Rehashing",
|
||||
/* 383 */ NULL,
|
||||
/* 384 RPL_MYPORTIS, */ NULL,
|
||||
|
@ -515,7 +515,7 @@ static const char * replies[] = {
|
|||
/* 491 ERR_NOOPERHOST, */ ":No appropriate operator blocks were found for your host",
|
||||
/* 492 ERR_NOCTCP */ ":Can't send CTCP to %s (+C set)",
|
||||
/* 493 */ NULL,
|
||||
/* 494 */ NULL,
|
||||
/* 494 ERR_OWNMODE, */ "%s :cannot answer you while you are %s, your message was not sent",
|
||||
/* 495 ERR_KICKNOREJOIN */ ":%s 495 %s %s :Cannot rejoin channel so soon after being kicked (+J set)",
|
||||
/* 496 */ NULL,
|
||||
/* 497 */ NULL,
|
||||
|
@ -756,14 +756,14 @@ static const char * replies[] = {
|
|||
/* 732 RPL_MONLIST */ ":%s 732 %s :%s",
|
||||
/* 733 RPL_ENDOFMONLIST */ ":%s 733 %s :End of MONITOR list",
|
||||
/* 734 ERR_MONLISTFULL */ ":%s 734 %s %d %s :Monitor list is full",
|
||||
/* 735 */ NULL,
|
||||
/* 735 */ NULL,
|
||||
/* 736 */ NULL,
|
||||
/* 737 ERR_NOCOMMONCHAN*/ "%s :is in +G mode (server-side ignore) and you do not share a common channel with them.",
|
||||
/* 738 */ NULL,
|
||||
/* 739 */ NULL,
|
||||
/* 740 RPL_RSACHALLENGE2*/ ":%s 740 %s :%s",
|
||||
/* 741 RPL_ENDOFRSACHALLENGE2*/ ":%s 741 %s :End of CHALLENGE",
|
||||
/* 742 */ NULL,
|
||||
/* 742 ERR_MLOCKRESTRICTED */ "%s %c %s :MODE cannot be set due to channel having an active MLOCK restriction policy",
|
||||
/* 743 */ NULL,
|
||||
/* 744 */ NULL,
|
||||
/* 745 */ NULL,
|
||||
|
|
|
@ -2201,6 +2201,7 @@ static struct ConfEntry conf_general_table[] =
|
|||
{ "anti_spam_exit_message_time", CF_TIME, NULL, 0, &ConfigFileEntry.anti_spam_exit_message_time },
|
||||
{ "use_part_messages", CF_YESNO, NULL, 0, &ConfigFileEntry.use_part_messages },
|
||||
{ "disable_fake_channels", CF_YESNO, NULL, 0, &ConfigFileEntry.disable_fake_channels },
|
||||
{ "hide_channel_below_users", CF_INT, NULL, 0, &ConfigFileEntry.hide_channel_below_users },
|
||||
{ "min_nonwildcard_simple", CF_INT, NULL, 0, &ConfigFileEntry.min_nonwildcard_simple },
|
||||
{ "non_redundant_klines", CF_YESNO, NULL, 0, &ConfigFileEntry.non_redundant_klines },
|
||||
{ "tkline_expire_notices", CF_YESNO, NULL, 0, &ConfigFileEntry.tkline_expire_notices },
|
||||
|
@ -2278,6 +2279,7 @@ static struct ConfEntry conf_channel_table[] =
|
|||
{ "only_ascii_channels", CF_YESNO, NULL, 0, &ConfigChannel.only_ascii_channels },
|
||||
{ "cycle_host_change", CF_YESNO, NULL, 0, &ConfigChannel.cycle_host_change },
|
||||
{ "host_in_topic", CF_YESNO, NULL, 0, &ConfigChannel.host_in_topic },
|
||||
{ "admin_on_channel_create", CF_YESNO, NULL, 0, &ConfigChannel.admin_on_channel_create },
|
||||
{ "use_halfop", CF_YESNO, NULL, 0, &ConfigChannel.use_halfop },
|
||||
{ "use_admin", CF_YESNO, NULL, 0, &ConfigChannel.use_admin },
|
||||
{ "use_except", CF_YESNO, NULL, 0, &ConfigChannel.use_except },
|
||||
|
@ -2286,6 +2288,7 @@ static struct ConfEntry conf_channel_table[] =
|
|||
{ "use_forward", CF_YESNO, NULL, 0, &ConfigChannel.use_forward },
|
||||
{ "use_local_channels", CF_YESNO, NULL, 0, &ConfigChannel.use_local_channels },
|
||||
{ "resv_forcepart", CF_YESNO, NULL, 0, &ConfigChannel.resv_forcepart },
|
||||
{ "channel_target_change", CF_YESNO, NULL, 0, &ConfigChannel.channel_target_change },
|
||||
{ "exempt_cmode_c", CF_YESNO, NULL, 0, &ConfigChannel.exempt_cmode_c },
|
||||
{ "exempt_cmode_C", CF_YESNO, NULL, 0, &ConfigChannel.exempt_cmode_C },
|
||||
{ "exempt_cmode_D", CF_YESNO, NULL, 0, &ConfigChannel.exempt_cmode_D },
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
||||
* USA
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* Changes:
|
||||
|
|
|
@ -698,6 +698,7 @@ set_default_conf(void)
|
|||
ConfigFileEntry.failed_oper_notice = YES;
|
||||
ConfigFileEntry.anti_nick_flood = NO;
|
||||
ConfigFileEntry.disable_fake_channels = NO;
|
||||
ConfigFileEntry.hide_channel_below_users = 3;
|
||||
ConfigFileEntry.max_nick_time = 20;
|
||||
ConfigFileEntry.max_nick_changes = 5;
|
||||
ConfigFileEntry.max_accept = 20;
|
||||
|
@ -763,6 +764,7 @@ set_default_conf(void)
|
|||
|
||||
ConfigChannel.autochanmodes = rb_strdup("nt");
|
||||
ConfigChannel.exemptchanops = rb_strdup("");
|
||||
ConfigChannel.admin_on_channel_create = NO;
|
||||
ConfigChannel.use_halfop = YES;
|
||||
ConfigChannel.use_admin = YES;
|
||||
ConfigChannel.use_except = YES;
|
||||
|
@ -786,6 +788,7 @@ set_default_conf(void)
|
|||
ConfigChannel.no_join_on_split = NO;
|
||||
ConfigChannel.no_create_on_split = YES;
|
||||
ConfigChannel.resv_forcepart = YES;
|
||||
ConfigChannel.channel_target_change = YES;
|
||||
|
||||
ConfigChannel.exempt_cmode_c = NO;
|
||||
ConfigChannel.exempt_cmode_C = NO;
|
||||
|
|
|
@ -89,6 +89,7 @@ struct Capability captab[] = {
|
|||
{ "EUID", CAP_EUID },
|
||||
{ "EOPMOD", CAP_EOPMOD },
|
||||
{ "BAN", CAP_BAN },
|
||||
{ "MLOCK", CAP_MLOCK },
|
||||
{0, 0}
|
||||
};
|
||||
|
||||
|
@ -677,6 +678,11 @@ burst_TS6(struct Client *client_p)
|
|||
ConfigChannel.burst_topicwho ? " " : "",
|
||||
chptr->topic);
|
||||
|
||||
if(IsCapable(client_p, CAP_MLOCK))
|
||||
sendto_one(client_p, ":%s MLOCK %ld %s :%s",
|
||||
me.id, (long) chptr->channelts, chptr->chname,
|
||||
EmptyString(chptr->mode_lock) ? "" : chptr->mode_lock);
|
||||
|
||||
hchaninfo.chptr = chptr;
|
||||
call_hook(h_burst_channel, &hchaninfo);
|
||||
}
|
||||
|
|
|
@ -453,8 +453,8 @@ register_local_user(struct Client *client_p, struct Client *source_p, const char
|
|||
source_p->preClient->dnsbl_listed->hits++;
|
||||
|
||||
sendto_realops_snomask(SNO_REJ, L_ALL,
|
||||
"%s [%s] is being disconnected due to being listed in DNS Blacklist %s",
|
||||
source_p->name, source_p->sockhost, source_p->preClient->dnsbl_listed->host);
|
||||
"%s (%s@%s) is being disconnected due to being listed in DNS Blacklist %s",
|
||||
source_p->name, source_p->username, source_p->sockhost, source_p->preClient->dnsbl_listed->host);
|
||||
|
||||
add_reject(source_p, NULL, NULL);
|
||||
exit_client(client_p, source_p, &me, "*** Banned (DNS blacklist)");
|
||||
|
@ -913,7 +913,7 @@ static void
|
|||
expire_umode_p(void *data)
|
||||
{
|
||||
struct Client *source_p = data;
|
||||
char *parv[4] = {source_p->name, source_p->name, "-p", NULL};
|
||||
const char *parv[4] = {source_p->name, source_p->name, "-p", NULL};
|
||||
source_p->localClient->override_timeout_event = NULL;
|
||||
user_mode(source_p, source_p, 3, parv);
|
||||
}
|
||||
|
|
|
@ -30,6 +30,8 @@
|
|||
#include "hash.h"
|
||||
#include "s_newconf.h"
|
||||
|
||||
static int add_hashed_target(struct Client *source_p, uint32_t hashv);
|
||||
|
||||
struct Channel *
|
||||
find_allowing_channel(struct Client *source_p, struct Client *target_p)
|
||||
{
|
||||
|
@ -48,9 +50,7 @@ find_allowing_channel(struct Client *source_p, struct Client *target_p)
|
|||
int
|
||||
add_target(struct Client *source_p, struct Client *target_p)
|
||||
{
|
||||
int i, j;
|
||||
uint32_t hashv;
|
||||
uint32_t *targets;
|
||||
|
||||
/* can msg themselves or services without using any target slots */
|
||||
if(source_p == target_p || IsService(target_p))
|
||||
|
@ -65,6 +65,24 @@ add_target(struct Client *source_p, struct Client *target_p)
|
|||
return 1;
|
||||
|
||||
hashv = fnv_hash_upper((const unsigned char *)use_id(target_p), 32);
|
||||
return add_hashed_target(source_p, hashv);
|
||||
}
|
||||
|
||||
int
|
||||
add_channel_target(struct Client *source_p, struct Channel *chptr)
|
||||
{
|
||||
uint32_t hashv;
|
||||
|
||||
hashv = fnv_hash_upper((const unsigned char *)chptr->chname, 32);
|
||||
return add_hashed_target(source_p, hashv);
|
||||
}
|
||||
|
||||
static int
|
||||
add_hashed_target(struct Client *source_p, uint32_t hashv)
|
||||
{
|
||||
int i, j;
|
||||
uint32_t *targets;
|
||||
|
||||
targets = source_p->localClient->targets;
|
||||
|
||||
/* check for existing target, and move it to the head */
|
||||
|
|
|
@ -80,6 +80,7 @@ void add_history(struct Client *client_p, int online)
|
|||
strcpy(who->username, client_p->username);
|
||||
strcpy(who->hostname, client_p->host);
|
||||
strcpy(who->realname, client_p->info);
|
||||
strcpy(who->suser, client_p->user->suser);
|
||||
if (!EmptyString(client_p->sockhost) && strcmp(client_p->sockhost, "0") && show_ip(NULL, client_p))
|
||||
strcpy(who->sockhost, client_p->sockhost);
|
||||
else
|
||||
|
|
|
@ -189,15 +189,6 @@ main(int argc, char *argv[])
|
|||
else
|
||||
salt = make_sha256_salt(length);
|
||||
}
|
||||
else if(flag & FLAG_SHA512)
|
||||
{
|
||||
if(length == 0)
|
||||
length = 16;
|
||||
if(flag & FLAG_SALT)
|
||||
salt = make_sha512_salt_para(saltpara);
|
||||
else
|
||||
salt = make_sha512_salt(length);
|
||||
}
|
||||
else if(flag & FLAG_EXT)
|
||||
{
|
||||
/* XXX - rounds needs to be done */
|
||||
|
@ -218,7 +209,7 @@ main(int argc, char *argv[])
|
|||
salt = make_ext_salt(rounds);
|
||||
}
|
||||
}
|
||||
else
|
||||
else if (flag & FLAG_DES)
|
||||
{
|
||||
if(flag & FLAG_SALT)
|
||||
{
|
||||
|
@ -237,6 +228,15 @@ main(int argc, char *argv[])
|
|||
salt = make_des_salt();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(length == 0)
|
||||
length = 16;
|
||||
if(flag & FLAG_SALT)
|
||||
salt = make_sha512_salt_para(saltpara);
|
||||
else
|
||||
salt = make_sha512_salt(length);
|
||||
}
|
||||
|
||||
if(flag & FLAG_PASS)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue