mirror of
https://github.com/pissnet/pissircd.git
synced 2025-07-30 23:12:25 +01:00
Update extban API to use more consts
This commit is contained in:
parent
d4d4da6a8d
commit
08a32429ff
27 changed files with 125 additions and 123 deletions
30
include/h.h
30
include/h.h
|
@ -175,10 +175,10 @@ extern int valid_server_name(char *name);
|
|||
extern long get_access(Client *, Channel *);
|
||||
extern int ban_check_mask(BanContext *b);
|
||||
extern int extban_is_ok_nuh_extban(BanContext *b);
|
||||
extern char *extban_conv_param_nuh_or_extban(BanContext *b, Extban *extban);
|
||||
extern char *extban_conv_param_nuh(BanContext *b, Extban *extban);
|
||||
extern Ban *is_banned(Client *, Channel *, int, char **, char **);
|
||||
extern Ban *is_banned_with_nick(Client *, Channel *, int, char *, char **, char **);
|
||||
extern const char *extban_conv_param_nuh_or_extban(BanContext *b, Extban *extban);
|
||||
extern const char *extban_conv_param_nuh(BanContext *b, Extban *extban);
|
||||
extern Ban *is_banned(Client *, Channel *, int, const char **, const char **);
|
||||
extern Ban *is_banned_with_nick(Client *, Channel *, int, const char *, const char **, const char **);
|
||||
|
||||
extern Client *find_client(const char *, Client *);
|
||||
extern Client *find_name(const char *, Client *);
|
||||
|
@ -615,7 +615,7 @@ extern time_t unreal_getfilemodtime(const char *filename);
|
|||
extern void unreal_setfilemodtime(const char *filename, time_t mtime);
|
||||
extern void DeleteTempModules(void);
|
||||
extern MODVAR Extban *extbaninfo;
|
||||
extern Extban *findmod_by_bantype(char *str, char **remainder);
|
||||
extern Extban *findmod_by_bantype(const char *str, const char **remainder);
|
||||
extern Extban *ExtbanAdd(Module *reserved, ExtbanInfo req);
|
||||
extern void ExtbanDel(Extban *);
|
||||
extern void extban_init(void);
|
||||
|
@ -742,7 +742,7 @@ extern MODVAR void (*broadcast_moddata_client)(Client *acptr);
|
|||
extern MODVAR int (*check_banned)(Client *cptr, int exitflags);
|
||||
extern MODVAR void (*introduce_user)(Client *to, Client *acptr);
|
||||
extern MODVAR int (*check_deny_version)(Client *cptr, char *software, int protocol, char *flags);
|
||||
extern MODVAR int (*match_user)(char *rmask, Client *acptr, int options);
|
||||
extern MODVAR int (*match_user)(const char *rmask, Client *acptr, int options);
|
||||
extern MODVAR void (*userhost_save_current)(Client *client);
|
||||
extern MODVAR void (*userhost_changed)(Client *client);
|
||||
extern MODVAR void (*send_join_to_local_users)(Client *client, Channel *channel, MessageTag *mtags);
|
||||
|
@ -753,7 +753,7 @@ extern MODVAR void (*broadcast_sinfo)(Client *acptr, Client *to, Client *except)
|
|||
extern MODVAR void (*connect_server)(ConfigItem_link *aconf, Client *by, struct hostent *hp);
|
||||
extern MODVAR void (*parse_message_tags)(Client *cptr, char **str, MessageTag **mtag_list);
|
||||
extern MODVAR char *(*mtags_to_string)(MessageTag *m, Client *acptr);
|
||||
extern MODVAR int (*can_send_to_channel)(Client *cptr, Channel *channel, char **msgtext, char **errmsg, int notice);
|
||||
extern MODVAR int (*can_send_to_channel)(Client *cptr, Channel *channel, const char **msgtext, const char **errmsg, int notice);
|
||||
extern MODVAR void (*broadcast_md_globalvar)(ModDataInfo *mdi, ModData *md);
|
||||
extern MODVAR void (*broadcast_md_globalvar_cmd)(Client *except, Client *sender, char *varname, char *value);
|
||||
extern MODVAR int (*tkl_ip_hash)(char *ip);
|
||||
|
@ -811,11 +811,11 @@ extern void do_unreal_log_remote_deliver_default_handler(LogLevel loglevel, char
|
|||
|
||||
extern MODVAR MOTDFile opermotd, svsmotd, motd, botmotd, smotd, rules;
|
||||
extern MODVAR int max_connection_count;
|
||||
extern int add_listmode(Ban **list, Client *cptr, Channel *channel, char *banid);
|
||||
extern int add_listmode_ex(Ban **list, Client *cptr, Channel *channel, char *banid, char *setby, time_t seton);
|
||||
extern int del_listmode(Ban **list, Channel *channel, char *banid);
|
||||
extern int add_listmode(Ban **list, Client *cptr, Channel *channel, const char *banid);
|
||||
extern int add_listmode_ex(Ban **list, Client *cptr, Channel *channel, const char *banid, const char *setby, time_t seton);
|
||||
extern int del_listmode(Ban **list, Channel *channel, const char *banid);
|
||||
extern int Halfop_mode(long mode);
|
||||
extern char *clean_ban_mask(char *, int, Client *, int);
|
||||
extern const char *clean_ban_mask(const char *, int, Client *, int);
|
||||
extern int find_invex(Channel *channel, Client *client);
|
||||
extern void DoMD5(char *mdout, const char *src, unsigned long n);
|
||||
extern char *md5hash(char *dst, const char *src, unsigned long n);
|
||||
|
@ -1035,12 +1035,12 @@ extern char *sendtype_to_cmd(SendType sendtype);
|
|||
extern MODVAR MessageTagHandler *mtaghandlers;
|
||||
extern int security_group_valid_name(char *name);
|
||||
extern int security_group_exists(char *name);
|
||||
extern SecurityGroup *add_security_group(char *name, int order);
|
||||
extern SecurityGroup *find_security_group(char *name);
|
||||
extern SecurityGroup *add_security_group(const char *name, int order);
|
||||
extern SecurityGroup *find_security_group(const char *name);
|
||||
extern void free_security_group(SecurityGroup *s);
|
||||
extern void set_security_group_defaults(void);
|
||||
extern int user_allowed_by_security_group(Client *client, SecurityGroup *s);
|
||||
extern int user_allowed_by_security_group_name(Client *client, char *secgroupname);
|
||||
extern int user_allowed_by_security_group_name(Client *client, const char *secgroupname);
|
||||
#define nv_find_by_name(stru, name) do_nv_find_by_name(stru, name, ARRAY_SIZEOF((stru)))
|
||||
extern long do_nv_find_by_name(NameValue *table, char *cmd, int numelements);
|
||||
#define nv_find_by_value(stru, value) do_nv_find_by_value(stru, value, ARRAY_SIZEOF((stru)))
|
||||
|
@ -1129,7 +1129,7 @@ extern char *timestamp_iso8601_now(void);
|
|||
extern char *timestamp_iso8601(time_t v);
|
||||
/* end of logging */
|
||||
extern void add_fake_lag(Client *client, long msec);
|
||||
extern char *prefix_with_extban(char *remainder, BanContext *b, Extban *extban, char *buf, size_t buflen);
|
||||
extern char *prefix_with_extban(const char *remainder, BanContext *b, Extban *extban, char *buf, size_t buflen);
|
||||
extern GeoIPResult *geoip_client(Client *client);
|
||||
extern GeoIPResult *geoip_lookup(char *ip);
|
||||
extern void free_geoip_result(GeoIPResult *r);
|
||||
|
|
|
@ -377,10 +377,10 @@ typedef enum ExtbanOptions {
|
|||
typedef struct {
|
||||
Client *client; /**< Client to check, can be a remote client */
|
||||
Channel *channel; /**< Channel to check */
|
||||
char *banstr; /**< Mask string (ban) */
|
||||
const char *banstr; /**< Mask string (ban) */
|
||||
int checktype; /**< Check type, one of BANCHK_* */
|
||||
char *msg; /**< Message, only for some BANCHK_* types (for censoring text) */
|
||||
char *error_msg; /**< Error message, can be NULL */
|
||||
const char *msg; /**< Message, only for some BANCHK_* types (for censoring text) */
|
||||
const char *error_msg; /**< Error message, can be NULL */
|
||||
int no_extbans; /**< Set to 1 to disable extended bans checking - only nick!user@host allowed */
|
||||
int what; /**< MODE_ADD or MODE_DEL (for is_ok) */
|
||||
int what2; /**< EXBTYPE_BAN or EXBTYPE_EXCEPT (for is_ok) */
|
||||
|
@ -412,7 +412,7 @@ struct Extban {
|
|||
* you to limit the length of the ban too.
|
||||
* return value: pointer to output string (temp. storage)
|
||||
*/
|
||||
char *(*conv_param)(BanContext *b, Extban *handler);
|
||||
const char *(*conv_param)(BanContext *b, Extban *handler);
|
||||
|
||||
/** Checks if the user is affected by this ban [required].
|
||||
* XXX FIXME: make this optional, as we have several functions who just return 0 atm (eg textban)
|
||||
|
@ -426,7 +426,7 @@ typedef struct {
|
|||
char *name;
|
||||
ExtbanOptions options;
|
||||
int (*is_ok)(BanContext *b);
|
||||
char *(*conv_param)(BanContext *b, Extban *handler);
|
||||
const char *(*conv_param)(BanContext *b, Extban *handler);
|
||||
int (*is_banned)(BanContext *b);
|
||||
unsigned int is_banned_events;
|
||||
} ExtbanInfo;
|
||||
|
|
|
@ -108,8 +108,8 @@ void cmd_alias(Client *client, MessageTag *mtags, int parc, char *parv[], char *
|
|||
Channel *channel;
|
||||
if ((channel = find_channel(alias->nick)))
|
||||
{
|
||||
char *msg = parv[1];
|
||||
char *errmsg = NULL;
|
||||
const char *msg = parv[1];
|
||||
const char *errmsg = NULL;
|
||||
if (can_send_to_channel(client, channel, &msg, &errmsg, 0))
|
||||
{
|
||||
if (alias->spamfilter && match_spamfilter(client, parv[1], SPAMF_CHANMSG, cmd, channel->name, 0, NULL))
|
||||
|
@ -243,8 +243,8 @@ void cmd_alias(Client *client, MessageTag *mtags, int parc, char *parv[], char *
|
|||
Channel *channel;
|
||||
if ((channel = find_channel(format->nick)))
|
||||
{
|
||||
char *msg = output;
|
||||
char *errmsg = NULL;
|
||||
const char *msg = output;
|
||||
const char *errmsg = NULL;
|
||||
if (!can_send_to_channel(client, channel, &msg, &errmsg, 0))
|
||||
{
|
||||
if (alias->spamfilter && match_spamfilter(client, output, SPAMF_CHANMSG, cmd, channel->name, 0, NULL))
|
||||
|
|
|
@ -95,7 +95,7 @@ void (*send_moddata_client)(Client *srv, Client *client);
|
|||
void (*send_moddata_channel)(Client *srv, Channel *channel);
|
||||
void (*send_moddata_members)(Client *srv);
|
||||
void (*broadcast_moddata_client)(Client *client);
|
||||
int (*match_user)(char *rmask, Client *client, int options);
|
||||
int (*match_user)(const char *rmask, Client *client, int options);
|
||||
void (*userhost_changed)(Client *client);
|
||||
void (*userhost_save_current)(Client *client);
|
||||
void (*send_join_to_local_users)(Client *client, Channel *channel, MessageTag *mtags);
|
||||
|
@ -106,7 +106,7 @@ void (*broadcast_sinfo)(Client *client, Client *to, Client *except);
|
|||
void (*connect_server)(ConfigItem_link *aconf, Client *by, struct hostent *hp);
|
||||
void (*parse_message_tags)(Client *client, char **str, MessageTag **mtag_list);
|
||||
char *(*mtags_to_string)(MessageTag *m, Client *client);
|
||||
int (*can_send_to_channel)(Client *client, Channel *channel, char **msgtext, char **errmsg, int notice);
|
||||
int (*can_send_to_channel)(Client *client, Channel *channel, const char **msgtext, const char **errmsg, int notice);
|
||||
void (*broadcast_md_globalvar)(ModDataInfo *mdi, ModData *md);
|
||||
void (*broadcast_md_globalvar_cmd)(Client *except, Client *sender, char *varname, char *value);
|
||||
int (*tkl_ip_hash)(char *ip);
|
||||
|
|
|
@ -40,11 +40,11 @@ void set_isupport_extban(void)
|
|||
ISupportSetFmt(NULL, "EXTBAN", "~,%s", extbanstr);
|
||||
}
|
||||
|
||||
Extban *findmod_by_bantype(char *str, char **remainder)
|
||||
Extban *findmod_by_bantype(const char *str, const char **remainder)
|
||||
{
|
||||
int i;
|
||||
int ban_name_length;
|
||||
char *p = strchr(str, ':');
|
||||
const char *p = strchr(str, ':');
|
||||
|
||||
if (!p || !p[1])
|
||||
{
|
||||
|
@ -185,7 +185,7 @@ int extban_is_ok_nuh_extban(BanContext *b)
|
|||
/* Mostly copied from clean_ban_mask - but note MyUser checks aren't needed here: extban->is_ok() according to cmd_mode isn't called for nonlocal. */
|
||||
if (is_extended_ban(b->banstr))
|
||||
{
|
||||
char *nextbanstr;
|
||||
const char *nextbanstr;
|
||||
Extban *extban = NULL;
|
||||
|
||||
/* We're dealing with a stacked extended ban.
|
||||
|
@ -242,7 +242,7 @@ int extban_is_ok_nuh_extban(BanContext *b)
|
|||
* to ensure the parameter is nick!user@host.
|
||||
* most of the code is just copied from clean_ban_mask.
|
||||
*/
|
||||
char *extban_conv_param_nuh(BanContext *b, Extban *extban)
|
||||
const char *extban_conv_param_nuh(BanContext *b, Extban *extban)
|
||||
{
|
||||
char *cp, *user, *host, *mask, *ret = NULL;
|
||||
static char retbuf[USERLEN + NICKLEN + HOSTLEN + 32];
|
||||
|
@ -275,7 +275,7 @@ char *extban_conv_param_nuh(BanContext *b, Extban *extban)
|
|||
|
||||
/** conv_param to deal with stacked extbans.
|
||||
*/
|
||||
char *extban_conv_param_nuh_or_extban(BanContext *b, Extban *self_extban)
|
||||
const char *extban_conv_param_nuh_or_extban(BanContext *b, Extban *self_extban)
|
||||
{
|
||||
#if (USERLEN + NICKLEN + HOSTLEN + 32) > 256
|
||||
#error "wtf?"
|
||||
|
@ -284,8 +284,8 @@ char *extban_conv_param_nuh_or_extban(BanContext *b, Extban *self_extban)
|
|||
static char printbuf[256];
|
||||
char *mask;
|
||||
char tmpbuf[USERLEN + NICKLEN + HOSTLEN + 32];
|
||||
char *ret = NULL;
|
||||
char *nextbanstr;
|
||||
const char *ret = NULL;
|
||||
const char *nextbanstr;
|
||||
Extban *extban = NULL;
|
||||
static int extban_recursion = 0;
|
||||
|
||||
|
@ -345,7 +345,7 @@ char *extban_conv_param_nuh_or_extban(BanContext *b, Extban *self_extban)
|
|||
return b->banstr;
|
||||
}
|
||||
|
||||
char *prefix_with_extban(char *remainder, BanContext *b, Extban *extban, char *buf, size_t buflen)
|
||||
char *prefix_with_extban(const char *remainder, BanContext *b, Extban *extban, char *buf, size_t buflen)
|
||||
{
|
||||
/* Yes, we support this because it makes code at the caller cleaner */
|
||||
if (remainder == NULL)
|
||||
|
|
|
@ -230,7 +230,7 @@ Client *find_chasing(Client *client, char *user, int *chasing)
|
|||
}
|
||||
|
||||
/** Return 1 if the bans are identical, taking into account special handling for extbans */
|
||||
int identical_ban(char *one, char *two)
|
||||
int identical_ban(const char *one, const char *two)
|
||||
{
|
||||
#if 0
|
||||
if (is_extended_ban(one) && is_extended_ban(two))
|
||||
|
@ -259,14 +259,14 @@ int identical_ban(char *one, char *two)
|
|||
* the specified channel. (Extended version with
|
||||
* set by nick and set on timestamp)
|
||||
*/
|
||||
int add_listmode_ex(Ban **list, Client *client, Channel *channel, char *banid, char *setby, time_t seton)
|
||||
int add_listmode_ex(Ban **list, Client *client, Channel *channel, const char *banid, const char *setby, time_t seton)
|
||||
{
|
||||
Ban *ban;
|
||||
int cnt = 0, len;
|
||||
int do_not_add = 0;
|
||||
|
||||
if (MyUser(client))
|
||||
collapse(banid);
|
||||
//if (MyUser(client))
|
||||
// collapse(banid);
|
||||
|
||||
len = strlen(banid);
|
||||
if (!*list && ((len > MAXBANLENGTH) || (MAXBANS < 1)))
|
||||
|
@ -330,7 +330,7 @@ int add_listmode_ex(Ban **list, Client *client, Channel *channel, char *banid, c
|
|||
/** Add a listmode (+beI) with the specified banid to
|
||||
* the specified channel. (Simplified version)
|
||||
*/
|
||||
int add_listmode(Ban **list, Client *client, Channel *channel, char *banid)
|
||||
int add_listmode(Ban **list, Client *client, Channel *channel, const char *banid)
|
||||
{
|
||||
char *setby = client->name;
|
||||
char nuhbuf[NICKLEN+USERLEN+HOSTLEN+4];
|
||||
|
@ -343,7 +343,7 @@ int add_listmode(Ban **list, Client *client, Channel *channel, char *banid)
|
|||
|
||||
/** Delete a listmode (+beI) from a channel that matches the specified banid.
|
||||
*/
|
||||
int del_listmode(Ban **list, Channel *channel, char *banid)
|
||||
int del_listmode(Ban **list, Channel *channel, const char *banid)
|
||||
{
|
||||
Ban **ban;
|
||||
Ban *tmp;
|
||||
|
@ -375,7 +375,7 @@ int del_listmode(Ban **list, Channel *channel, char *banid)
|
|||
* @returns A pointer to the ban struct if banned, otherwise NULL.
|
||||
* @comments Simple wrapper for is_banned_with_nick()
|
||||
*/
|
||||
inline Ban *is_banned(Client *client, Channel *channel, int type, char **msg, char **errmsg)
|
||||
inline Ban *is_banned(Client *client, Channel *channel, int type, const char **msg, const char **errmsg)
|
||||
{
|
||||
return is_banned_with_nick(client, channel, type, NULL, msg, errmsg);
|
||||
}
|
||||
|
@ -392,7 +392,7 @@ inline int ban_check_mask(BanContext *b)
|
|||
if (!b->no_extbans && is_extended_ban(b->banstr))
|
||||
{
|
||||
/* Is an extended ban. */
|
||||
char *nextbanstr;
|
||||
const char *nextbanstr;
|
||||
Extban *extban = findmod_by_bantype(b->banstr, &nextbanstr);
|
||||
if (!extban || !(extban->is_banned_events & b->checktype))
|
||||
{
|
||||
|
@ -417,7 +417,7 @@ inline int ban_check_mask(BanContext *b)
|
|||
* @param msg Message, only for some BANCHK_* types, otherwise NULL
|
||||
* @returns A pointer to the ban struct if banned, otherwise NULL.
|
||||
*/
|
||||
Ban *is_banned_with_nick(Client *client, Channel *channel, int type, char *nick, char **msg, char **errmsg)
|
||||
Ban *is_banned_with_nick(Client *client, Channel *channel, int type, const char *nick, const char **msg, const char **errmsg)
|
||||
{
|
||||
Ban *ban, *ex;
|
||||
char savednick[NICKLEN+1];
|
||||
|
@ -724,26 +724,25 @@ char *trim_str(char *str, int len)
|
|||
* @note A pointer is returned to a static buffer, which is overwritten
|
||||
* on next clean_ban_mask or make_nick_user_host call.
|
||||
*/
|
||||
char *clean_ban_mask(char *mask, int what, Client *client, int conv_options)
|
||||
const char *clean_ban_mask(const char *mask_in, int what, Client *client, int conv_options)
|
||||
{
|
||||
char *cp, *x;
|
||||
char *user;
|
||||
char *host;
|
||||
static char maskbuf[512];
|
||||
static char mask[512];
|
||||
|
||||
/* Strip any ':' at beginning since that would cause a desync */
|
||||
for (; (*mask_in && (*mask_in == ':')); mask_in++);
|
||||
if (!*mask_in)
|
||||
return NULL;
|
||||
|
||||
/* Work on a copy */
|
||||
strlcpy(maskbuf, mask, sizeof(maskbuf));
|
||||
mask = maskbuf;
|
||||
strlcpy(mask, mask_in, sizeof(mask));
|
||||
|
||||
cp = strchr(mask, ' ');
|
||||
if (cp)
|
||||
*cp = '\0';
|
||||
|
||||
/* Strip any ':' at beginning since that would cause a desync */
|
||||
for (; (*mask && (*mask == ':')); mask++);
|
||||
if (!*mask)
|
||||
return NULL;
|
||||
|
||||
/* Forbid ASCII <= 32 in all bans */
|
||||
for (x = mask; *x; x++)
|
||||
if (*x <= ' ')
|
||||
|
@ -752,7 +751,7 @@ char *clean_ban_mask(char *mask, int what, Client *client, int conv_options)
|
|||
/* Extended ban? */
|
||||
if (is_extended_ban(mask))
|
||||
{
|
||||
char *nextbanstr;
|
||||
const char *nextbanstr;
|
||||
Extban *extban;
|
||||
|
||||
if (RESTRICT_EXTENDEDBANS && MyUser(client) && !ValidatePermissionsForPath("immune:restrict-extendedbans",client,NULL,NULL,NULL))
|
||||
|
@ -787,7 +786,7 @@ char *clean_ban_mask(char *mask, int what, Client *client, int conv_options)
|
|||
|
||||
if (extban->conv_param)
|
||||
{
|
||||
char *ret;
|
||||
const char *ret;
|
||||
static char retbuf[512];
|
||||
BanContext *b = safe_alloc(sizeof(BanContext));
|
||||
b->client = client;
|
||||
|
|
|
@ -55,7 +55,7 @@ int cmodeL_sjoin_check(Channel *channel, void *ourx, void *theirx);
|
|||
|
||||
int extban_link_syntax(Client *client, int checkt, char *reason);
|
||||
int extban_link_is_ok(BanContext *b);
|
||||
char *extban_link_conv_param(BanContext *b, Extban *extban);
|
||||
const char *extban_link_conv_param(BanContext *b, Extban *extban);
|
||||
int link_doforward(Client *client, Channel *channel, char *linked, linkType linktype);
|
||||
int link_pre_localjoin_cb(Client *client, Channel *channel, char *parv[]);
|
||||
|
||||
|
@ -255,13 +255,13 @@ int extban_link_is_ok(BanContext *b)
|
|||
return 1; // Is ok
|
||||
}
|
||||
|
||||
char *extban_link_conv_param(BanContext *b, Extban *extban)
|
||||
const char *extban_link_conv_param(BanContext *b, Extban *extban)
|
||||
{
|
||||
static char retbuf[MAX_EB_LEN + 1];
|
||||
char paramtmp[MAX_EB_LEN + 1];
|
||||
char tmpmask[MAX_EB_LEN + 1];
|
||||
char *matchby; // Matching method, such as 'n!u@h'
|
||||
char *newmask; // Cleaned matching method, such as 'n!u@h'
|
||||
const char *newmask; // Cleaned matching method, such as 'n!u@h'
|
||||
char *chan;
|
||||
|
||||
strlcpy(paramtmp, b->banstr, sizeof(paramtmp)); // Work on a size-truncated copy
|
||||
|
|
|
@ -28,7 +28,7 @@ ModuleHeader MOD_HEADER
|
|||
};
|
||||
|
||||
/* Forward declarations */
|
||||
char *extban_account_conv_param(BanContext *b, Extban *extban);
|
||||
const char *extban_account_conv_param(BanContext *b, Extban *extban);
|
||||
int extban_account_is_banned(BanContext *b);
|
||||
|
||||
/** Called upon module init */
|
||||
|
@ -68,7 +68,7 @@ MOD_UNLOAD()
|
|||
}
|
||||
|
||||
/** Account bans */
|
||||
char *extban_account_conv_param(BanContext *b, Extban *extban)
|
||||
const char *extban_account_conv_param(BanContext *b, Extban *extban)
|
||||
{
|
||||
char *mask, *acc;
|
||||
static char retbuf[NICKLEN + 4];
|
||||
|
|
|
@ -29,7 +29,7 @@ ModuleHeader MOD_HEADER
|
|||
|
||||
/* Forward declarations */
|
||||
int extban_certfp_is_ok(BanContext *b);
|
||||
char *extban_certfp_conv_param(BanContext *b, Extban *extban);
|
||||
const char *extban_certfp_conv_param(BanContext *b, Extban *extban);
|
||||
int extban_certfp_is_banned(BanContext *b);
|
||||
|
||||
/* Called upon module init */
|
||||
|
@ -81,7 +81,7 @@ int extban_certfp_is_ok(BanContext *b)
|
|||
{
|
||||
if (b->is_ok_checktype == EXCHK_PARAM)
|
||||
{
|
||||
char *p;
|
||||
const char *p;
|
||||
|
||||
if (strlen(b->banstr) != CERT_FP_LEN)
|
||||
return extban_certfp_usage(b->client);
|
||||
|
@ -96,7 +96,7 @@ int extban_certfp_is_ok(BanContext *b)
|
|||
}
|
||||
|
||||
/* Obtain targeted certfp from the ban string */
|
||||
char *extban_certfp_conv_param(BanContext *b, Extban *extban)
|
||||
const char *extban_certfp_conv_param(BanContext *b, Extban *extban)
|
||||
{
|
||||
static char retbuf[EVP_MAX_MD_SIZE * 2 + 1];
|
||||
char *p;
|
||||
|
|
|
@ -29,7 +29,7 @@ ModuleHeader MOD_HEADER
|
|||
|
||||
/* Forward declarations */
|
||||
int extban_country_is_ok(BanContext *b);
|
||||
char *extban_country_conv_param(BanContext *b, Extban *extban);
|
||||
const char *extban_country_conv_param(BanContext *b, Extban *extban);
|
||||
int extban_country_is_banned(BanContext *b);
|
||||
|
||||
/* Called upon module init */
|
||||
|
@ -79,7 +79,7 @@ int extban_country_is_ok(BanContext *b)
|
|||
{
|
||||
if (b->is_ok_checktype == EXCHK_PARAM)
|
||||
{
|
||||
char *p;
|
||||
const char *p;
|
||||
|
||||
if (!strcmp(b->banstr, "*"))
|
||||
return EX_ALLOW;
|
||||
|
@ -97,7 +97,7 @@ int extban_country_is_ok(BanContext *b)
|
|||
}
|
||||
|
||||
/* Obtain targeted country from the ban string */
|
||||
char *extban_country_conv_param(BanContext *b, Extban *extban)
|
||||
const char *extban_country_conv_param(BanContext *b, Extban *extban)
|
||||
{
|
||||
static char retbuf[EVP_MAX_MD_SIZE * 2 + 1];
|
||||
char *p;
|
||||
|
|
|
@ -29,7 +29,7 @@ ModuleHeader MOD_HEADER
|
|||
|
||||
/* Forward declarations */
|
||||
int extban_inchannel_is_ok(BanContext *b);
|
||||
char *extban_inchannel_conv_param(BanContext *b, Extban *extban);
|
||||
const char *extban_inchannel_conv_param(BanContext *b, Extban *extban);
|
||||
int extban_inchannel_is_banned(BanContext *b);
|
||||
|
||||
/** Called upon module init */
|
||||
|
@ -68,7 +68,7 @@ MOD_UNLOAD()
|
|||
return MOD_SUCCESS;
|
||||
}
|
||||
|
||||
char *extban_inchannel_conv_param(BanContext *b, Extban *extban)
|
||||
const char *extban_inchannel_conv_param(BanContext *b, Extban *extban)
|
||||
{
|
||||
static char retbuf[CHANNELLEN+6];
|
||||
char *chan, *p, symbol='\0';
|
||||
|
@ -97,7 +97,7 @@ char *extban_inchannel_conv_param(BanContext *b, Extban *extban)
|
|||
/* The only purpose of this function is a temporary workaround to prevent a desync.. pfff */
|
||||
int extban_inchannel_is_ok(BanContext *b)
|
||||
{
|
||||
char *p = b->banstr;
|
||||
const char *p = b->banstr;
|
||||
|
||||
if ((b->is_ok_checktype == EXBCHK_PARAM) && MyUser(b->client) && (b->what == MODE_ADD) && (strlen(b->banstr) > 3))
|
||||
{
|
||||
|
@ -138,7 +138,7 @@ static int extban_inchannel_compareflags(char symbol, int flags)
|
|||
int extban_inchannel_is_banned(BanContext *b)
|
||||
{
|
||||
Membership *lp;
|
||||
char *p = b->banstr;
|
||||
const char *p = b->banstr;
|
||||
char symbol = '\0';
|
||||
|
||||
if (*p != '#')
|
||||
|
|
|
@ -30,7 +30,7 @@ ModuleHeader MOD_HEADER
|
|||
/* Forward declarations */
|
||||
int msgbypass_can_bypass(Client *client, Channel *channel, BypassChannelMessageRestrictionType bypass_type);
|
||||
int msgbypass_extban_is_ok(BanContext *b);
|
||||
char *msgbypass_extban_conv_param(BanContext *b, Extban *extban);
|
||||
const char *msgbypass_extban_conv_param(BanContext *b, Extban *extban);
|
||||
|
||||
/** Called upon module init */
|
||||
MOD_INIT()
|
||||
|
@ -129,14 +129,14 @@ int msgbypass_extban_type_ok(char *type)
|
|||
}
|
||||
|
||||
#define MAX_LENGTH 128
|
||||
char *msgbypass_extban_conv_param(BanContext *b, Extban *extban)
|
||||
const char *msgbypass_extban_conv_param(BanContext *b, Extban *extban)
|
||||
{
|
||||
static char retbuf[MAX_LENGTH+1];
|
||||
char para[MAX_LENGTH+1];
|
||||
char tmpmask[MAX_LENGTH+1];
|
||||
char *type; /**< Type, such as 'external' */
|
||||
char *matchby; /**< Matching method, such as 'n!u@h' */
|
||||
char *newmask; /**< Cleaned matching method, such as 'n!u@h' */
|
||||
const char *newmask; /**< Cleaned matching method, such as 'n!u@h' */
|
||||
|
||||
strlcpy(para, b->banstr, sizeof(para)); /* work on a copy (and truncate it) */
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ ModuleHeader MOD_HEADER
|
|||
};
|
||||
|
||||
/* Forward declarations */
|
||||
char *extban_operclass_conv_param(BanContext *b, Extban *extban);
|
||||
const char *extban_operclass_conv_param(BanContext *b, Extban *extban);
|
||||
int extban_operclass_is_banned(BanContext *b);
|
||||
|
||||
/** Called upon module init */
|
||||
|
@ -70,7 +70,7 @@ MOD_UNLOAD()
|
|||
|
||||
#define OPERCLASSLEN 64
|
||||
|
||||
char *extban_operclass_conv_param(BanContext *b, Extban *extban)
|
||||
const char *extban_operclass_conv_param(BanContext *b, Extban *extban)
|
||||
{
|
||||
static char retbuf[OPERCLASSLEN + 4];
|
||||
char *p;
|
||||
|
|
|
@ -28,7 +28,7 @@ ModuleHeader MOD_HEADER
|
|||
};
|
||||
|
||||
/* Forward declarations */
|
||||
char *extban_realname_conv_param(BanContext *b, Extban *extban);
|
||||
const char *extban_realname_conv_param(BanContext *b, Extban *extban);
|
||||
int extban_realname_is_banned(BanContext *b);
|
||||
|
||||
/** Called upon module init */
|
||||
|
@ -68,7 +68,7 @@ MOD_UNLOAD()
|
|||
}
|
||||
|
||||
/** Realname bans - conv_param */
|
||||
char *extban_realname_conv_param(BanContext *b, Extban *extban)
|
||||
const char *extban_realname_conv_param(BanContext *b, Extban *extban)
|
||||
{
|
||||
static char retbuf[REALLEN + 8];
|
||||
char *mask;
|
||||
|
|
|
@ -28,7 +28,7 @@ ModuleHeader MOD_HEADER
|
|||
};
|
||||
|
||||
/* Forward declarations */
|
||||
char *extban_securitygroup_conv_param(BanContext *b, Extban *extban);
|
||||
const char *extban_securitygroup_conv_param(BanContext *b, Extban *extban);
|
||||
int extban_securitygroup_is_ok(BanContext *b);
|
||||
int extban_securitygroup_is_banned(BanContext *b);
|
||||
|
||||
|
@ -90,9 +90,6 @@ int extban_securitygroup_generic(char *mask, int strict)
|
|||
if (!*mask)
|
||||
return 0; /* don't allow "~G:" nor "~G:!" */
|
||||
|
||||
if (strlen(mask) > SECURITYGROUPLEN)
|
||||
mask[SECURITYGROUPLEN] = '\0';
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -118,7 +115,7 @@ int extban_securitygroup_is_ok(BanContext *b)
|
|||
}
|
||||
|
||||
/** Security group extban - conv_param */
|
||||
char *extban_securitygroup_conv_param(BanContext *b, Extban *extban)
|
||||
const char *extban_securitygroup_conv_param(BanContext *b, Extban *extban)
|
||||
{
|
||||
static char retbuf[SECURITYGROUPLEN + 8];
|
||||
|
||||
|
|
|
@ -71,7 +71,7 @@ ModuleHeader MOD_HEADER
|
|||
};
|
||||
|
||||
/* Forward declarations */
|
||||
char *extban_modeT_conv_param(BanContext *b, Extban *extban);
|
||||
const char *extban_modeT_conv_param(BanContext *b, Extban *extban);
|
||||
int textban_check_ban(Client *client, Channel *channel, const char *ban, const char **msg, const char **errmsg);
|
||||
int textban_can_send_to_channel(Client *client, Channel *channel, Membership *lp, const char **msg, const char **errmsg, SendType sendtype);
|
||||
int extban_modeT_is_ok(BanContext *b);
|
||||
|
@ -288,7 +288,7 @@ char *conv_pattern_asterisks(const char *pattern)
|
|||
}
|
||||
|
||||
/** Ban callbacks */
|
||||
char *extban_modeT_conv_param(BanContext *b, Extban *extban)
|
||||
const char *extban_modeT_conv_param(BanContext *b, Extban *extban)
|
||||
{
|
||||
static char retbuf[MAX_LENGTH+1];
|
||||
char para[MAX_LENGTH+1], *action, *text, *p;
|
||||
|
|
|
@ -55,7 +55,7 @@ ModuleHeader MOD_HEADER
|
|||
};
|
||||
|
||||
/* Forward declarations */
|
||||
char *timedban_extban_conv_param(BanContext *b, Extban *extban);
|
||||
const char *timedban_extban_conv_param(BanContext *b, Extban *extban);
|
||||
int timedban_extban_is_ok(BanContext *b);
|
||||
int timedban_is_banned(BanContext *b);
|
||||
void add_send_mode_param(Channel *channel, Client *from, char what, char mode, char *param);
|
||||
|
@ -110,7 +110,7 @@ MOD_UNLOAD()
|
|||
* Mostly copied from clean_ban_mask()
|
||||
* FIXME: Figure out why we have this one at all and not use conv_param? ;)
|
||||
*/
|
||||
char *generic_clean_ban_mask(BanContext *b, Extban *extban)
|
||||
const char *generic_clean_ban_mask(BanContext *b, Extban *extban)
|
||||
{
|
||||
char *cp, *x;
|
||||
char *user;
|
||||
|
@ -139,13 +139,13 @@ char *generic_clean_ban_mask(BanContext *b, Extban *extban)
|
|||
/* Extended ban? */
|
||||
if (is_extended_ban(mask))
|
||||
{
|
||||
char *nextbanstr;
|
||||
const char *nextbanstr;
|
||||
Extban *extban = findmod_by_bantype(mask, &nextbanstr);
|
||||
if (!extban)
|
||||
return NULL; /* reject unknown extban */
|
||||
if (extban->conv_param)
|
||||
{
|
||||
char *ret;
|
||||
const char *ret;
|
||||
static char retbuf[512];
|
||||
BanContext *b = safe_alloc(sizeof(BanContext));
|
||||
b->banstr = nextbanstr;
|
||||
|
@ -182,7 +182,7 @@ char *generic_clean_ban_mask(BanContext *b, Extban *extban)
|
|||
}
|
||||
|
||||
/** Convert ban to an acceptable format (or return NULL to fully reject it) */
|
||||
char *timedban_extban_conv_param(BanContext *b, Extban *extban)
|
||||
const char *timedban_extban_conv_param(BanContext *b, Extban *extban)
|
||||
{
|
||||
static char retbuf[MAX_LENGTH+1];
|
||||
char para[MAX_LENGTH+1];
|
||||
|
@ -190,7 +190,7 @@ char *timedban_extban_conv_param(BanContext *b, Extban *extban)
|
|||
char *durationstr; /**< Duration, such as '5' */
|
||||
int duration;
|
||||
char *matchby; /**< Matching method, such as 'n!u@h' */
|
||||
char *newmask; /**< Cleaned matching method, such as 'n!u@h' */
|
||||
const char *newmask; /**< Cleaned matching method, such as 'n!u@h' */
|
||||
static int timedban_extban_conv_param_recursion = 0;
|
||||
|
||||
if (timedban_extban_conv_param_recursion)
|
||||
|
@ -246,7 +246,7 @@ int generic_ban_is_ok(BanContext *b)
|
|||
if ((b->banstr[0] == '~') && MyUser(b->client))
|
||||
{
|
||||
Extban *extban;
|
||||
char *nextbanstr;
|
||||
const char *nextbanstr;
|
||||
|
||||
/* This portion is copied from clean_ban_mask() */
|
||||
if (is_extended_ban(b->banstr) && MyUser(b->client))
|
||||
|
|
|
@ -28,8 +28,8 @@ CMD_FUNC(cmd_private);
|
|||
CMD_FUNC(cmd_notice);
|
||||
CMD_FUNC(cmd_tagmsg);
|
||||
void cmd_message(Client *client, MessageTag *recv_mtags, int parc, char *parv[], SendType sendtype);
|
||||
int _can_send_to_channel(Client *client, Channel *channel, char **msgtext, char **errmsg, SendType sendtype);
|
||||
int can_send_to_user(Client *client, Client *target, char **msgtext, char **errmsg, SendType sendtype);
|
||||
int _can_send_to_channel(Client *client, Channel *channel, const char **msgtext, const char **errmsg, SendType sendtype);
|
||||
int can_send_to_user(Client *client, Client *target, const char **msgtext, const char **errmsg, SendType sendtype);
|
||||
|
||||
/* Variables */
|
||||
long CAP_MESSAGE_TAGS = 0; /**< Looked up at MOD_LOAD, may stay 0 if message-tags support is absent */
|
||||
|
@ -85,7 +85,7 @@ MOD_UNLOAD()
|
|||
* text: Pointer to a pointer to a text [in, out]
|
||||
* cmd: Pointer to a pointer which contains the command to use [in, out]
|
||||
*/
|
||||
int can_send_to_user(Client *client, Client *target, char **msgtext, char **errmsg, SendType sendtype)
|
||||
int can_send_to_user(Client *client, Client *target, const char **msgtext, const char **errmsg, SendType sendtype)
|
||||
{
|
||||
int ret;
|
||||
Hook *h;
|
||||
|
@ -276,7 +276,8 @@ void cmd_message(Client *client, MessageTag *recv_mtags, int parc, char *parv[],
|
|||
{
|
||||
Client *target;
|
||||
Channel *channel;
|
||||
char *targetstr, *p, *p2, *pc, *text, *errmsg;
|
||||
char *targetstr, *p, *p2, *pc;
|
||||
const char *text, *errmsg;
|
||||
int prefix = 0;
|
||||
char pfixchan[CHANNELLEN + 4];
|
||||
int ret;
|
||||
|
@ -471,7 +472,7 @@ void cmd_message(Client *client, MessageTag *recv_mtags, int parc, char *parv[],
|
|||
target = hash_find_nickatserver(targetstr, NULL);
|
||||
if (target)
|
||||
{
|
||||
char *errmsg = NULL;
|
||||
const char *errmsg = NULL;
|
||||
text = parv[2];
|
||||
if (!can_send_to_user(client, target, &text, &errmsg, sendtype))
|
||||
{
|
||||
|
@ -784,7 +785,7 @@ int ban_version(Client *client, char *text)
|
|||
* @returns Returns 1 if the user is allowed to send, otherwise 0.
|
||||
* (note that this behavior was reversed in UnrealIRCd versions <5.x.
|
||||
*/
|
||||
int _can_send_to_channel(Client *client, Channel *channel, char **msgtext, char **errmsg, SendType sendtype)
|
||||
int _can_send_to_channel(Client *client, Channel *channel, const char **msgtext, const char **errmsg, SendType sendtype)
|
||||
{
|
||||
Membership *lp;
|
||||
int member, i = 0;
|
||||
|
|
|
@ -525,9 +525,9 @@ void make_mode_str(Channel *channel, Cmode_t oldem, int pcount,
|
|||
return;
|
||||
}
|
||||
|
||||
char *mode_ban_handler(Client *client, Channel *channel, char *param, int what, int extbtype, Ban **banlist)
|
||||
const char *mode_ban_handler(Client *client, Channel *channel, char *param, int what, int extbtype, Ban **banlist)
|
||||
{
|
||||
char *tmpstr;
|
||||
const char *tmpstr;
|
||||
BanContext *b;
|
||||
|
||||
tmpstr = clean_ban_mask(param, what, client, 0);
|
||||
|
@ -536,7 +536,7 @@ char *mode_ban_handler(Client *client, Channel *channel, char *param, int what,
|
|||
/* Invalid ban. See if we can send an error about that (only for extbans) */
|
||||
if (MyUser(client) && is_extended_ban(param))
|
||||
{
|
||||
char *nextbanstr;
|
||||
const char *nextbanstr;
|
||||
Extban *extban = findmod_by_bantype(param, &nextbanstr);
|
||||
BanContext *b;
|
||||
|
||||
|
@ -557,7 +557,7 @@ char *mode_ban_handler(Client *client, Channel *channel, char *param, int what,
|
|||
if (MyUser(client) && is_extended_ban(param))
|
||||
{
|
||||
/* extban: check access if needed */
|
||||
char *nextbanstr;
|
||||
const char *nextbanstr;
|
||||
Extban *extban = findmod_by_bantype(tmpstr, &nextbanstr);
|
||||
if (extban)
|
||||
{
|
||||
|
@ -613,7 +613,7 @@ char *mode_ban_handler(Client *client, Channel *channel, char *param, int what,
|
|||
* The result is later used by make_mode_str() to create the
|
||||
* actual MODE line to be broadcasted to the channel and other servers.
|
||||
*/
|
||||
void do_mode_char_write(char pvar[MAXMODEPARAMS][MODEBUFLEN + 3], u_int *pcount, u_int what, char modeletter, char *str)
|
||||
void do_mode_char_write(char pvar[MAXMODEPARAMS][MODEBUFLEN + 3], u_int *pcount, u_int what, char modeletter, const char *str)
|
||||
{
|
||||
/* Caller should have made sure there was room! */
|
||||
if (*pcount >= MAXMODEPARAMS)
|
||||
|
@ -642,7 +642,7 @@ int do_mode_char_list_mode(Channel *channel, long modetype, char modechar, char
|
|||
u_int *pcount, char pvar[MAXMODEPARAMS][MODEBUFLEN + 3],
|
||||
long my_access)
|
||||
{
|
||||
char *tmpstr;
|
||||
const char *tmpstr;
|
||||
|
||||
switch (modetype)
|
||||
{
|
||||
|
|
|
@ -63,7 +63,7 @@ CMD_FUNC(cmd_part)
|
|||
Membership *lp;
|
||||
char *p = NULL, *name;
|
||||
char *commentx = (parc > 2 && parv[2]) ? parv[2] : NULL;
|
||||
char *comment;
|
||||
const char *comment;
|
||||
int n;
|
||||
int ntargets = 0;
|
||||
int maxtargets = max_targets_for_command("PART");
|
||||
|
|
|
@ -98,7 +98,7 @@ CMD_FUNC(cmd_quit)
|
|||
if (iConf.part_instead_of_quit_on_comment_change && MyUser(client))
|
||||
{
|
||||
Membership *lp, *lp_next;
|
||||
char *newcomment;
|
||||
const char *newcomment;
|
||||
Channel *channel;
|
||||
|
||||
for (lp = client->user->channel; lp; lp = lp_next)
|
||||
|
@ -121,11 +121,14 @@ CMD_FUNC(cmd_quit)
|
|||
if (comment != newcomment)
|
||||
{
|
||||
char *parx[4];
|
||||
char tmp[512];
|
||||
int ret;
|
||||
|
||||
strlcpy(tmp, newcomment, sizeof(tmp));
|
||||
|
||||
parx[0] = NULL;
|
||||
parx[1] = channel->name;
|
||||
parx[2] = newcomment;
|
||||
parx[2] = tmp;
|
||||
parx[3] = NULL;
|
||||
|
||||
do_cmd(client, recv_mtags, "PART", newcomment ? 3 : 2, parx);
|
||||
|
|
|
@ -564,7 +564,7 @@ getnick:
|
|||
/* For list modes (beI): validate the syntax */
|
||||
if (modeflags & (CHFL_BAN|CHFL_EXCEPT|CHFL_INVEX))
|
||||
{
|
||||
char *str;
|
||||
const char *str;
|
||||
|
||||
/* non-extbans: prevent bans without ! or @. a good case of "should never happen". */
|
||||
if ((nick[0] != '~') && (!strchr(nick, '!') || !strchr(nick, '@') || (nick[0] == '!')))
|
||||
|
|
|
@ -63,7 +63,7 @@ MOD_UNLOAD()
|
|||
void unban_user(Client *client, Channel *channel, Client *acptr, char chmode)
|
||||
{
|
||||
Extban *extban;
|
||||
char *nextbanstr;
|
||||
const char *nextbanstr;
|
||||
Ban *ban, *bnext;
|
||||
Ban **banlist;
|
||||
BanContext *b;
|
||||
|
|
|
@ -89,8 +89,8 @@ int _match_spamfilter_mtags(Client *client, MessageTag *mtags, char *cmd);
|
|||
int check_mtag_spamfilters_present(void);
|
||||
int _join_viruschan(Client *client, TKL *tk, int type);
|
||||
void _spamfilter_build_user_string(char *buf, char *nick, Client *client);
|
||||
int _match_user(char *rmask, Client *client, int options);
|
||||
int _match_user_extended_server_ban(char *banstr, Client *client);
|
||||
int _match_user(const char *rmask, Client *client, int options);
|
||||
int _match_user_extended_server_ban(const char *banstr, Client *client);
|
||||
void ban_target_to_tkl_layer(BanTarget ban_target, BanAction action, Client *client, char **tkl_username, char **tkl_hostname);
|
||||
int _tkl_ip_hash(char *ip);
|
||||
int _tkl_ip_hash_type(int type);
|
||||
|
@ -1279,9 +1279,10 @@ static int xline_exists(char *type, char *usermask, char *hostmask)
|
|||
*/
|
||||
int parse_extended_server_ban(char *mask_in, Client *client, char **error, int skip_checking, char *buf1, size_t buf1len, char *buf2, size_t buf2len)
|
||||
{
|
||||
char *nextbanstr = NULL;
|
||||
const char *nextbanstr = NULL;
|
||||
Extban *extban;
|
||||
char *str, *p;
|
||||
const char *str;
|
||||
char *p;
|
||||
BanContext *b = NULL;
|
||||
char mask[USERLEN + NICKLEN + HOSTLEN + 32]; // same as extban_conv_param_nuh_or_extban()
|
||||
char newmask[USERLEN + NICKLEN + HOSTLEN + 32];
|
||||
|
@ -4988,7 +4989,7 @@ static int comp_with_mask(void *addr, void *dest, u_int mask)
|
|||
* CIDR support is available so 'host' may be like '1.2.0.0/16'.
|
||||
* @returns 1 on match, 0 on no match.
|
||||
*/
|
||||
int _match_user(char *rmask, Client *client, int options)
|
||||
int _match_user(const char *rmask, Client *client, int options)
|
||||
{
|
||||
char mask[NICKLEN+USERLEN+HOSTLEN+8];
|
||||
char clientip[IPSZ], maskip[IPSZ];
|
||||
|
@ -5142,9 +5143,9 @@ int _match_user(char *rmask, Client *client, int options)
|
|||
return 0; /* NOMATCH: nothing of the above matched */
|
||||
}
|
||||
|
||||
int _match_user_extended_server_ban(char *banstr, Client *client)
|
||||
int _match_user_extended_server_ban(const char *banstr, Client *client)
|
||||
{
|
||||
char *nextbanstr;
|
||||
const char *nextbanstr;
|
||||
Extban *extban;
|
||||
BanContext *b;
|
||||
int ret;
|
||||
|
|
|
@ -52,7 +52,7 @@ MOD_UNLOAD()
|
|||
return MOD_SUCCESS;
|
||||
}
|
||||
|
||||
void topic_operoverride_msg(Client *client, Channel *channel, char *topic)
|
||||
void topic_operoverride_msg(Client *client, Channel *channel, const char *topic)
|
||||
{
|
||||
unreal_log(ULOG_INFO, "operoverride", "OPEROVERRIDE_TOPIC", client,
|
||||
"OperOverride: $client.details changed the topic of $channel to '$topic'",
|
||||
|
@ -76,8 +76,9 @@ void topic_operoverride_msg(Client *client, Channel *channel, char *topic)
|
|||
CMD_FUNC(cmd_topic)
|
||||
{
|
||||
Channel *channel = NULL;
|
||||
char *topic = NULL, *name, *tnick = client->name;
|
||||
char *errmsg = NULL;
|
||||
const char *topic = NULL;
|
||||
char *name, *tnick = client->name;
|
||||
const char *errmsg = NULL;
|
||||
time_t ttime = 0;
|
||||
int i = 0;
|
||||
Hook *h;
|
||||
|
@ -184,7 +185,7 @@ CMD_FUNC(cmd_topic)
|
|||
/* Topic change. Either locally (check permissions!) or remote, check permissions: */
|
||||
if (IsUser(client))
|
||||
{
|
||||
char *newtopic = NULL;
|
||||
const char *newtopic = NULL;
|
||||
|
||||
// FIXME/TODO: all these checks must be moved to chanmodes/topiclimit
|
||||
// and to chanmodes/noexternalmsgs, so use some kind of hook !!
|
||||
|
|
|
@ -169,7 +169,7 @@ int usc_reparse_mode(char **msg, char *p, int *length)
|
|||
|
||||
if ((pm.modechar == 'b') || (pm.modechar == 'e') || (pm.modechar == 'I'))
|
||||
{
|
||||
char *result = clean_ban_mask(pm.param, pm.what, &me, 1);
|
||||
const char *result = clean_ban_mask(pm.param, pm.what, &me, 1);
|
||||
strlcat(obuf, result?result:"<invalid>", sizeof(obuf));
|
||||
strlcat(obuf, " ", sizeof(obuf));
|
||||
} else
|
||||
|
@ -233,7 +233,7 @@ int usc_reparse_sjoin(char **msg, char *p, int *length)
|
|||
if (strchr("&\"\\", *s))
|
||||
{
|
||||
/* +b / +e / +I */
|
||||
char *result = clean_ban_mask(s+1, MODE_ADD, &me, 1);
|
||||
const char *result = clean_ban_mask(s+1, MODE_ADD, &me, 1);
|
||||
if (!result)
|
||||
{
|
||||
unreal_log(ULOG_WARNING, "unreal_server_compat", "USC_REPARSE_SJOIN_FAILURE", NULL,
|
||||
|
|
|
@ -768,7 +768,7 @@ int security_group_valid_name(char *name)
|
|||
* @param name The name of the security group
|
||||
* @returns A SecurityGroup struct, or NULL if not found.
|
||||
*/
|
||||
SecurityGroup *find_security_group(char *name)
|
||||
SecurityGroup *find_security_group(const char *name)
|
||||
{
|
||||
SecurityGroup *s;
|
||||
for (s = securitygroups; s; s = s->next)
|
||||
|
@ -793,7 +793,7 @@ int security_group_exists(char *name)
|
|||
* @param name The name of the security group
|
||||
* @returns A SecurityGroup struct (already added to the 'securitygroups' linked list)
|
||||
*/
|
||||
SecurityGroup *add_security_group(char *name, int priority)
|
||||
SecurityGroup *add_security_group(const char *name, int priority)
|
||||
{
|
||||
SecurityGroup *s = find_security_group(name);
|
||||
|
||||
|
@ -876,7 +876,7 @@ int user_allowed_by_security_group(Client *client, SecurityGroup *s)
|
|||
* @param secgroupname The name of the security-group to check against
|
||||
* @retval 1 if user is allowed by security-group, 0 if not.
|
||||
*/
|
||||
int user_allowed_by_security_group_name(Client *client, char *secgroupname)
|
||||
int user_allowed_by_security_group_name(Client *client, const char *secgroupname)
|
||||
{
|
||||
SecurityGroup *s;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue