| 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 |
|
} |
| 1148 |
|
ConfigFileEntry.ts_max_delta = TS_MAX_DELTA_DEFAULT; |
| 1149 |
|
ConfigFileEntry.warn_no_nline = 1; |
| 1150 |
|
ConfigFileEntry.stats_o_oper_only = 0; |
| 1151 |
< |
ConfigFileEntry.stats_k_oper_only = 1; /* masked */ |
| 1152 |
< |
ConfigFileEntry.stats_i_oper_only = 1; /* masked */ |
| 1151 |
> |
ConfigFileEntry.stats_k_oper_only = 1; /* 1 = masked */ |
| 1152 |
> |
ConfigFileEntry.stats_i_oper_only = 1; /* 1 = masked */ |
| 1153 |
|
ConfigFileEntry.stats_P_oper_only = 0; |
| 1154 |
|
ConfigFileEntry.stats_u_oper_only = 0; |
| 1155 |
|
ConfigFileEntry.caller_id_wait = 60; |
| 1202 |
|
{ |
| 1203 |
|
lineno = 0; |
| 1204 |
|
|
| 1205 |
< |
set_default_conf(); /* Set default values prior to conf parsing */ |
| 1205 |
> |
set_default_conf(); /* Set default values prior to conf parsing */ |
| 1206 |
|
conf_parser_ctx.pass = 1; |
| 1207 |
< |
yyparse(); /* pick up the classes first */ |
| 1207 |
> |
yyparse(); /* Pick up the classes first */ |
| 1208 |
|
|
| 1209 |
|
rewind(file); |
| 1210 |
|
|
| 1211 |
|
conf_parser_ctx.pass = 2; |
| 1212 |
< |
yyparse(); /* Load the values from the conf */ |
| 1213 |
< |
validate_conf(); /* Check to make sure some values are still okay. */ |
| 1214 |
< |
/* Some global values are also loaded here. */ |
| 1215 |
< |
class_delete_marked(); /* Make sure classes are valid */ |
| 1212 |
> |
yyparse(); /* Load the values from the conf */ |
| 1213 |
> |
validate_conf(); /* Check to make sure some values are still okay. */ |
| 1214 |
> |
/* Some global values are also loaded here. */ |
| 1215 |
> |
class_delete_marked(); /* Delete unused classes that are marked for deletion */ |
| 1216 |
|
} |
| 1217 |
|
|
| 1218 |
|
/* lookup_confhost() |
| 1225 |
|
{ |
| 1226 |
|
struct addrinfo hints, *res; |
| 1227 |
|
|
| 1228 |
< |
/* Do name lookup now on hostnames given and store the |
| 1228 |
> |
/* |
| 1229 |
> |
* Do name lookup now on hostnames given and store the |
| 1230 |
|
* ip numbers in conf structure. |
| 1231 |
|
*/ |
| 1232 |
|
memset(&hints, 0, sizeof(hints)); |
| 1432 |
|
void |
| 1433 |
|
read_conf_files(int cold) |
| 1434 |
|
{ |
| 1435 |
< |
const char *filename; |
| 1436 |
< |
char chanmodes[IRCD_BUFSIZE]; |
| 1437 |
< |
char chanlimit[IRCD_BUFSIZE]; |
| 1435 |
> |
const char *filename = NULL; |
| 1436 |
> |
char chanmodes[IRCD_BUFSIZE] = ""; |
| 1437 |
> |
char chanlimit[IRCD_BUFSIZE] = ""; |
| 1438 |
|
|
| 1439 |
|
conf_parser_ctx.boot = cold; |
| 1440 |
|
filename = ConfigFileEntry.configfile; |
| 2103 |
|
int capab, int cluster_type, const char *pattern, ...) |
| 2104 |
|
{ |
| 2105 |
|
va_list args; |
| 2106 |
< |
char buffer[IRCD_BUFSIZE]; |
| 2106 |
> |
char buffer[IRCD_BUFSIZE] = ""; |
| 2107 |
|
const dlink_node *ptr = NULL; |
| 2108 |
|
|
| 2109 |
|
va_start(args, pattern); |
| 2164 |
|
{ |
| 2165 |
|
*p = '\0'; |
| 2166 |
|
|
| 2167 |
< |
if (iptr->nickptr && *iptr->nuhmask != '\0') |
| 2167 |
> |
if (iptr->nickptr && *iptr->nuhmask) |
| 2168 |
|
strlcpy(iptr->nickptr, iptr->nuhmask, iptr->nicksize); |
| 2169 |
|
|
| 2170 |
|
if ((q = strchr(++p, '@'))) |
| 2171 |
|
{ |
| 2172 |
|
*q++ = '\0'; |
| 2173 |
|
|
| 2174 |
< |
if (*p != '\0') |
| 2174 |
> |
if (*p) |
| 2175 |
|
strlcpy(iptr->userptr, p, iptr->usersize); |
| 2176 |
|
|
| 2177 |
< |
if (*q != '\0') |
| 2177 |
> |
if (*q) |
| 2178 |
|
strlcpy(iptr->hostptr, q, iptr->hostsize); |
| 2179 |
|
} |
| 2180 |
|
else |
| 2181 |
|
{ |
| 2182 |
< |
if (*p != '\0') |
| 2182 |
> |
if (*p) |
| 2183 |
|
strlcpy(iptr->userptr, p, iptr->usersize); |
| 2184 |
|
} |
| 2185 |
|
} |
| 2191 |
|
/* if found a @ */ |
| 2192 |
|
*p++ = '\0'; |
| 2193 |
|
|
| 2194 |
< |
if (*iptr->nuhmask != '\0') |
| 2194 |
> |
if (*iptr->nuhmask) |
| 2195 |
|
strlcpy(iptr->userptr, iptr->nuhmask, iptr->usersize); |
| 2196 |
|
|
| 2197 |
< |
if (*p != '\0') |
| 2197 |
> |
if (*p) |
| 2198 |
|
strlcpy(iptr->hostptr, p, iptr->hostsize); |
| 2199 |
|
} |
| 2200 |
|
else |