ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/ircd-hybrid/trunk/src/conf.c
(Generate patch)

Comparing ircd-hybrid/trunk/src/conf.c (file contents):
Revision 3215 by michael, Tue Mar 25 19:23:15 2014 UTC vs.
Revision 3320 by michael, Tue Apr 15 15:58:33 2014 UTC

# Line 33 | Line 33
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"
# Line 44 | Line 43
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"
# Line 131 | Line 129 | conf_dns_callback(void *vptr, const stru
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;
# Line 182 | Line 180 | conf_free(struct MaskItem *conf)
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;
# Line 670 | Line 668 | garbage_collect_ip_entries(void)
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  
# Line 713 | Line 711 | detach_conf(struct Client *client_p, enu
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)
# Line 1033 | Line 1031 | find_exact_name_conf(enum maskitem_type
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  
# Line 1046 | Line 1044 | rehash(int sig)
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();
# Line 1246 | Line 1244 | lookup_confhost(struct MaskItem *conf)
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;
# Line 1272 | Line 1270 | conf_connect_allowed(struct irc_ssaddr *
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);
# Line 1313 | Line 1311 | cleanup_tklines(void *notused)
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  
# Line 1375 | Line 1372 | oper_privs_as_string(const unsigned int
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;
# Line 1570 | Line 1566 | clear_out_old_conf(void)
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;
# Line 2088 | Line 2084 | match_conf_password(const char *password
2084    else
2085      encr = password;
2086  
2087 <  return !strcmp(encr, conf->passwd);
2087 >  return encr && !strcmp(encr, conf->passwd);
2088   }
2089  
2090   /*

Diff Legend

Removed lines
+ Added lines
< Changed lines (old)
> Changed lines (new)