| 154 |
|
struct MaskItem * |
| 155 |
|
conf_make(enum maskitem_type type) |
| 156 |
|
{ |
| 157 |
< |
struct MaskItem *conf = MyMalloc(sizeof(*conf)); |
| 157 |
> |
struct MaskItem *conf = MyCalloc(sizeof(*conf)); |
| 158 |
|
dlink_list *list = NULL; |
| 159 |
|
|
| 160 |
|
conf->type = type; |
| 403 |
|
* setting a_limit_reached if any limit is reached. |
| 404 |
|
* - Dianora |
| 405 |
|
*/ |
| 406 |
< |
if (class->max_total != 0 && class->ref_count >= class->max_total) |
| 406 |
> |
if (class->max_total && class->ref_count >= class->max_total) |
| 407 |
|
a_limit_reached = 1; |
| 408 |
< |
else if (class->max_perip != 0 && ip_found->count > class->max_perip) |
| 408 |
> |
else if (class->max_perip && ip_found->count > class->max_perip) |
| 409 |
|
a_limit_reached = 1; |
| 410 |
< |
else if (class->max_local != 0 && local >= class->max_local) |
| 410 |
> |
else if (class->max_local && local >= class->max_local) |
| 411 |
|
a_limit_reached = 1; |
| 412 |
< |
else if (class->max_global != 0 && global >= class->max_global) |
| 412 |
> |
else if (class->max_global && global >= class->max_global) |
| 413 |
|
a_limit_reached = 1; |
| 414 |
< |
else if (class->max_ident != 0 && ident >= class->max_ident && |
| 414 |
> |
else if (class->max_ident && ident >= class->max_ident && |
| 415 |
|
client_p->username[0] != '~') |
| 416 |
|
a_limit_reached = 1; |
| 417 |
|
|
| 604 |
|
count_ip_hash(unsigned int *number_ips_stored, uint64_t *mem_ips_stored) |
| 605 |
|
{ |
| 606 |
|
struct ip_entry *ptr; |
| 607 |
– |
int i; |
| 607 |
|
|
| 608 |
|
*number_ips_stored = 0; |
| 609 |
|
*mem_ips_stored = 0; |
| 610 |
|
|
| 611 |
< |
for (i = 0; i < IP_HASH_SIZE; i++) |
| 611 |
> |
for (unsigned int i = 0; i < IP_HASH_SIZE; ++i) |
| 612 |
|
{ |
| 613 |
|
for (ptr = ip_hash_table[i]; ptr; ptr = ptr->next) |
| 614 |
|
{ |
| 630 |
|
struct ip_entry *ptr; |
| 631 |
|
struct ip_entry *last_ptr; |
| 632 |
|
struct ip_entry *next_ptr; |
| 634 |
– |
int i; |
| 633 |
|
|
| 634 |
< |
for (i = 0; i < IP_HASH_SIZE; i++) |
| 634 |
> |
for (unsigned int i = 0; i < IP_HASH_SIZE; ++i) |
| 635 |
|
{ |
| 636 |
|
last_ptr = NULL; |
| 637 |
|
|
| 781 |
|
|
| 782 |
|
if (conf->type == type) |
| 783 |
|
{ |
| 784 |
< |
if (conf->name && (irccmp(conf->name, name) == 0 || |
| 784 |
> |
if (conf->name && (!irccmp(conf->name, name) || |
| 785 |
|
!match(conf->name, name))) |
| 786 |
|
return conf; |
| 787 |
|
} |
| 1101 |
|
ConfigLoggingEntry.use_logging = 1; |
| 1102 |
|
|
| 1103 |
|
ConfigChannel.disable_fake_channels = 0; |
| 1104 |
+ |
|
| 1105 |
+ |
ConfigChannel.invite_delay = 300; |
| 1106 |
+ |
ConfigChannel.invite_delay_channel = 60; |
| 1107 |
|
ConfigChannel.knock_delay = 300; |
| 1108 |
|
ConfigChannel.knock_delay_channel = 60; |
| 1109 |
|
ConfigChannel.max_chans_per_user = 25; |
| 1149 |
|
ConfigFileEntry.anti_spam_exit_message_time = 0; |
| 1150 |
|
ConfigFileEntry.ts_warn_delta = TS_WARN_DELTA_DEFAULT; |
| 1151 |
|
ConfigFileEntry.ts_max_delta = TS_MAX_DELTA_DEFAULT; |
| 1152 |
< |
ConfigFileEntry.warn_no_nline = 1; |
| 1152 |
> |
ConfigFileEntry.warn_no_connect_block = 1; |
| 1153 |
> |
ConfigFileEntry.stats_e_disabled = 0; |
| 1154 |
|
ConfigFileEntry.stats_o_oper_only = 0; |
| 1155 |
< |
ConfigFileEntry.stats_k_oper_only = 1; /* masked */ |
| 1156 |
< |
ConfigFileEntry.stats_i_oper_only = 1; /* masked */ |
| 1155 |
> |
ConfigFileEntry.stats_k_oper_only = 1; /* 1 = masked */ |
| 1156 |
> |
ConfigFileEntry.stats_i_oper_only = 1; /* 1 = masked */ |
| 1157 |
|
ConfigFileEntry.stats_P_oper_only = 0; |
| 1158 |
|
ConfigFileEntry.stats_u_oper_only = 0; |
| 1159 |
|
ConfigFileEntry.caller_id_wait = 60; |
| 1206 |
|
{ |
| 1207 |
|
lineno = 0; |
| 1208 |
|
|
| 1209 |
< |
set_default_conf(); /* Set default values prior to conf parsing */ |
| 1209 |
> |
set_default_conf(); /* Set default values prior to conf parsing */ |
| 1210 |
|
conf_parser_ctx.pass = 1; |
| 1211 |
< |
yyparse(); /* pick up the classes first */ |
| 1211 |
> |
yyparse(); /* Pick up the classes first */ |
| 1212 |
|
|
| 1213 |
|
rewind(file); |
| 1214 |
|
|
| 1215 |
|
conf_parser_ctx.pass = 2; |
| 1216 |
< |
yyparse(); /* Load the values from the conf */ |
| 1217 |
< |
validate_conf(); /* Check to make sure some values are still okay. */ |
| 1218 |
< |
/* Some global values are also loaded here. */ |
| 1219 |
< |
class_delete_marked(); /* Make sure classes are valid */ |
| 1216 |
> |
yyparse(); /* Load the values from the conf */ |
| 1217 |
> |
validate_conf(); /* Check to make sure some values are still okay. */ |
| 1218 |
> |
/* Some global values are also loaded here. */ |
| 1219 |
> |
class_delete_marked(); /* Delete unused classes that are marked for deletion */ |
| 1220 |
|
} |
| 1221 |
|
|
| 1222 |
|
/* lookup_confhost() |
| 1229 |
|
{ |
| 1230 |
|
struct addrinfo hints, *res; |
| 1231 |
|
|
| 1232 |
< |
/* Do name lookup now on hostnames given and store the |
| 1232 |
> |
/* |
| 1233 |
> |
* Do name lookup now on hostnames given and store the |
| 1234 |
|
* ip numbers in conf structure. |
| 1235 |
|
*/ |
| 1236 |
|
memset(&hints, 0, sizeof(hints)); |
| 1436 |
|
void |
| 1437 |
|
read_conf_files(int cold) |
| 1438 |
|
{ |
| 1439 |
< |
const char *filename; |
| 1440 |
< |
char chanmodes[IRCD_BUFSIZE]; |
| 1441 |
< |
char chanlimit[IRCD_BUFSIZE]; |
| 1439 |
> |
const char *filename = NULL; |
| 1440 |
> |
char chanmodes[IRCD_BUFSIZE] = ""; |
| 1441 |
> |
char chanlimit[IRCD_BUFSIZE] = ""; |
| 1442 |
|
|
| 1443 |
|
conf_parser_ctx.boot = cold; |
| 1444 |
|
filename = ConfigFileEntry.configfile; |
| 1488 |
|
ConfigChannel.max_chans_per_user); |
| 1489 |
|
add_isupport("CHANLIMIT", chanlimit, -1); |
| 1490 |
|
snprintf(chanmodes, sizeof(chanmodes), "%s", "beI,k,l,imnprstORS"); |
| 1491 |
< |
add_isupport("CHANNELLEN", NULL, LOCAL_CHANNELLEN); |
| 1491 |
> |
add_isupport("CHANNELLEN", NULL, CHANNELLEN); |
| 1492 |
|
add_isupport("TOPICLEN", NULL, ServerInfo.max_topic_length); |
| 1493 |
|
add_isupport("CHANMODES", chanmodes, -1); |
| 1494 |
|
|
| 1855 |
|
char **target_server, char **reason) |
| 1856 |
|
{ |
| 1857 |
|
int found_tkline_time=0; |
| 1858 |
< |
static char def_reason[] = "No Reason"; |
| 1858 |
> |
static char def_reason[] = CONF_NOREASON; |
| 1859 |
|
static char user[USERLEN*4+1]; |
| 1860 |
|
static char host[HOSTLEN*4+1]; |
| 1861 |
|
|
| 2021 |
|
/* Okay to use source_p as the first param, because source_p == client_p */ |
| 2022 |
|
if ((target_p = |
| 2023 |
|
find_chasing(source_p, user_host_or_nick)) == NULL) |
| 2024 |
< |
return 0; |
| 2024 |
> |
return 0; /* find_chasing sends ERR_NOSUCHNICK */ |
| 2025 |
|
|
| 2026 |
|
if (IsExemptKline(target_p)) |
| 2027 |
|
{ |
| 2107 |
|
int capab, int cluster_type, const char *pattern, ...) |
| 2108 |
|
{ |
| 2109 |
|
va_list args; |
| 2110 |
< |
char buffer[IRCD_BUFSIZE]; |
| 2110 |
> |
char buffer[IRCD_BUFSIZE] = ""; |
| 2111 |
|
const dlink_node *ptr = NULL; |
| 2112 |
|
|
| 2113 |
|
va_start(args, pattern); |
| 2168 |
|
{ |
| 2169 |
|
*p = '\0'; |
| 2170 |
|
|
| 2171 |
< |
if (iptr->nickptr && *iptr->nuhmask != '\0') |
| 2171 |
> |
if (iptr->nickptr && *iptr->nuhmask) |
| 2172 |
|
strlcpy(iptr->nickptr, iptr->nuhmask, iptr->nicksize); |
| 2173 |
|
|
| 2174 |
|
if ((q = strchr(++p, '@'))) |
| 2175 |
|
{ |
| 2176 |
|
*q++ = '\0'; |
| 2177 |
|
|
| 2178 |
< |
if (*p != '\0') |
| 2178 |
> |
if (*p) |
| 2179 |
|
strlcpy(iptr->userptr, p, iptr->usersize); |
| 2180 |
|
|
| 2181 |
< |
if (*q != '\0') |
| 2181 |
> |
if (*q) |
| 2182 |
|
strlcpy(iptr->hostptr, q, iptr->hostsize); |
| 2183 |
|
} |
| 2184 |
|
else |
| 2185 |
|
{ |
| 2186 |
< |
if (*p != '\0') |
| 2186 |
> |
if (*p) |
| 2187 |
|
strlcpy(iptr->userptr, p, iptr->usersize); |
| 2188 |
|
} |
| 2189 |
|
} |
| 2195 |
|
/* if found a @ */ |
| 2196 |
|
*p++ = '\0'; |
| 2197 |
|
|
| 2198 |
< |
if (*iptr->nuhmask != '\0') |
| 2198 |
> |
if (*iptr->nuhmask) |
| 2199 |
|
strlcpy(iptr->userptr, iptr->nuhmask, iptr->usersize); |
| 2200 |
|
|
| 2201 |
< |
if (*p != '\0') |
| 2201 |
> |
if (*p) |
| 2202 |
|
strlcpy(iptr->hostptr, p, iptr->hostsize); |
| 2203 |
|
} |
| 2204 |
|
else |