33 |
|
#include "channel.h" |
34 |
|
#include "client.h" |
35 |
|
#include "event.h" |
36 |
– |
#include "hook.h" |
36 |
|
#include "irc_string.h" |
37 |
|
#include "s_bsd.h" |
38 |
|
#include "ircd.h" |
43 |
|
#include "fdlist.h" |
44 |
|
#include "log.h" |
45 |
|
#include "send.h" |
47 |
– |
#include "s_gline.h" |
46 |
|
#include "memory.h" |
47 |
|
#include "mempool.h" |
48 |
|
#include "irc_res.h" |
129 |
|
|
130 |
|
conf->dns_pending = 0; |
131 |
|
|
132 |
< |
if (addr != NULL) |
132 |
> |
if (addr) |
133 |
|
memcpy(&conf->addr, addr, sizeof(conf->addr)); |
134 |
|
else |
135 |
|
conf->dns_failed = 1; |
180 |
|
|
181 |
|
if (conf->dns_pending) |
182 |
|
delete_resolver_queries(conf); |
183 |
< |
if (conf->passwd != NULL) |
183 |
> |
if (conf->passwd) |
184 |
|
memset(conf->passwd, 0, strlen(conf->passwd)); |
185 |
< |
if (conf->spasswd != NULL) |
185 |
> |
if (conf->spasswd) |
186 |
|
memset(conf->spasswd, 0, strlen(conf->spasswd)); |
187 |
|
|
188 |
|
conf->class = NULL; |
668 |
|
void |
669 |
|
detach_conf(struct Client *client_p, enum maskitem_type type) |
670 |
|
{ |
671 |
< |
dlink_node *ptr = NULL, *next_ptr = NULL; |
671 |
> |
dlink_node *ptr = NULL, *ptr_next = NULL; |
672 |
|
|
673 |
< |
DLINK_FOREACH_SAFE(ptr, next_ptr, client_p->localClient->confs.head) |
673 |
> |
DLINK_FOREACH_SAFE(ptr, ptr_next, client_p->localClient->confs.head) |
674 |
|
{ |
675 |
|
struct MaskItem *conf = ptr->data; |
676 |
|
|
711 |
|
int |
712 |
|
attach_conf(struct Client *client_p, struct MaskItem *conf) |
713 |
|
{ |
714 |
< |
if (dlinkFind(&client_p->localClient->confs, conf) != NULL) |
714 |
> |
if (dlinkFind(&client_p->localClient->confs, conf)) |
715 |
|
return 1; |
716 |
|
|
717 |
|
if (conf->type == CONF_CLIENT) |
1031 |
|
int |
1032 |
|
rehash(int sig) |
1033 |
|
{ |
1034 |
< |
if (sig != 0) |
1034 |
> |
if (sig) |
1035 |
|
sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE, |
1036 |
|
"Got signal SIGHUP, reloading configuration file(s)"); |
1037 |
|
|
1044 |
|
|
1045 |
|
read_conf_files(0); |
1046 |
|
|
1047 |
< |
if (ServerInfo.description != NULL) |
1047 |
> |
if (ServerInfo.description) |
1048 |
|
strlcpy(me.info, ServerInfo.description, sizeof(me.info)); |
1049 |
|
|
1050 |
|
load_conf_modules(); |
1244 |
|
return; |
1245 |
|
} |
1246 |
|
|
1247 |
< |
assert(res != NULL); |
1247 |
> |
assert(res); |
1248 |
|
|
1249 |
|
memcpy(&conf->addr, res->ai_addr, res->ai_addrlen); |
1250 |
|
conf->addr.ss_len = res->ai_addrlen; |
1270 |
|
if (conf && (conf->type == CONF_EXEMPT)) |
1271 |
|
return 0; |
1272 |
|
|
1273 |
< |
if (conf != NULL) |
1273 |
> |
if (conf) |
1274 |
|
return BANNED_CLIENT; |
1275 |
|
|
1276 |
|
ip_found = find_or_add_ip(addr); |
1311 |
|
static void |
1312 |
|
expire_tklines(dlink_list *tklist) |
1313 |
|
{ |
1314 |
< |
dlink_node *ptr; |
1315 |
< |
dlink_node *next_ptr; |
1318 |
< |
struct MaskItem *conf; |
1314 |
> |
dlink_node *ptr = NULL, *ptr_next = NULL; |
1315 |
> |
struct MaskItem *conf = NULL; |
1316 |
|
|
1317 |
< |
DLINK_FOREACH_SAFE(ptr, next_ptr, tklist->head) |
1317 |
> |
DLINK_FOREACH_SAFE(ptr, ptr_next, tklist->head) |
1318 |
|
{ |
1319 |
|
conf = ptr->data; |
1320 |
|
|
1372 |
|
{ |
1373 |
|
static char privs_out[IRCD_BUFSIZE]; |
1374 |
|
char *privs_ptr = privs_out; |
1378 |
– |
const struct oper_privs *opriv = flag_list; |
1375 |
|
|
1376 |
< |
for (; opriv->flag; ++opriv) |
1376 |
> |
for (const struct oper_privs *opriv = flag_list; opriv->flag; ++opriv) |
1377 |
|
{ |
1378 |
|
if (port & opriv->flag) |
1379 |
|
*privs_ptr++ = opriv->c; |
1566 |
|
MyFree(ConfigFileEntry.egdpool_path); |
1567 |
|
ConfigFileEntry.egdpool_path = NULL; |
1568 |
|
#ifdef HAVE_LIBCRYPTO |
1569 |
< |
if (ServerInfo.rsa_private_key != NULL) |
1569 |
> |
if (ServerInfo.rsa_private_key) |
1570 |
|
{ |
1571 |
|
RSA_free(ServerInfo.rsa_private_key); |
1572 |
|
ServerInfo.rsa_private_key = NULL; |
2084 |
|
else |
2085 |
|
encr = password; |
2086 |
|
|
2087 |
< |
return !strcmp(encr, conf->passwd); |
2087 |
> |
return encr && !strcmp(encr, conf->passwd); |
2088 |
|
} |
2089 |
|
|
2090 |
|
/* |