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 2269 by michael, Tue Jun 18 15:07:26 2013 UTC vs.
Revision 2525 by michael, Sat Nov 2 17:07:38 2013 UTC

# Line 383 | Line 383 | attach_iline(struct Client *client_p, st
383    int a_limit_reached = 0;
384    unsigned int local = 0, global = 0, ident = 0;
385  
386 +  assert(conf->class);
387 +
388    ip_found = find_or_add_ip(&client_p->localClient->ip);
389    ip_found->count++;
390    SetIpHash(client_p);
391  
390  if (conf->class == NULL)
391    return NOT_AUTHORIZED;  /* If class is missing, this is best */
392
392    class = conf->class;
393  
394    count_user_host(client_p->username, client_p->host,
# Line 1122 | Line 1121 | set_default_conf(void)
1121    
1122    ConfigFileEntry.service_name = xstrdup(SERVICE_NAME_DEFAULT);
1123    ConfigFileEntry.max_watch = WATCHSIZE_DEFAULT;
1124 +  ConfigFileEntry.cycle_on_host_change = 1;
1125    ConfigFileEntry.glines = 0;
1126    ConfigFileEntry.gline_time = 12 * 3600;
1127    ConfigFileEntry.gline_request_time = GLINE_REQUEST_EXPIRE_DEFAULT;
# Line 1283 | Line 1283 | conf_connect_allowed(struct irc_ssaddr *
1283    return 0;
1284   }
1285  
1286 /* find_kill()
1287 *
1288 * inputs       - pointer to client structure
1289 * output       - pointer to struct MaskItem if found
1290 * side effects - See if this user is klined already,
1291 *                and if so, return struct MaskItem pointer
1292 */
1293 struct MaskItem *
1294 find_kill(struct Client *client_p)
1295 {
1296  struct MaskItem *conf = NULL;
1297
1298  assert(client_p != NULL);
1299
1300  conf = find_conf_by_address(client_p->host, &client_p->localClient->ip,
1301                              CONF_KLINE, client_p->localClient->aftype,
1302                              client_p->username, NULL, 1);
1303  return conf;
1304 }
1305
1306 struct MaskItem *
1307 find_gline(struct Client *client_p)
1308 {
1309  struct MaskItem *conf;
1310
1311  assert(client_p != NULL);
1312
1313  conf = find_conf_by_address(client_p->host, &client_p->localClient->ip,
1314                              CONF_GLINE, client_p->localClient->aftype,
1315                              client_p->username, NULL, 1);
1316  return conf;
1317 }
1318
1286   /* cleanup_tklines()
1287   *
1288   * inputs       - NONE
# Line 1718 | Line 1685 | conf_error_report(const char *msg)
1685   * Originally written by Dianora (Diane, db@db.net)
1686   */
1687   time_t
1688 < valid_tkline(const char *p, int minutes)
1688 > valid_tkline(const char *data, const int minutes)
1689   {
1690 +  const unsigned char *p = (const unsigned char *)data;
1691 +  unsigned char tmpch = '\0';
1692    time_t result = 0;
1693  
1694 <  for (; *p; ++p)
1694 >  while ((tmpch = *p++))
1695    {
1696 <    if (!IsDigit(*p))
1696 >    if (!IsDigit(tmpch))
1697        return 0;
1698  
1699      result *= 10;
1700 <    result += (*p & 0xF);
1700 >    result += (tmpch & 0xF);
1701    }
1702  
1703    /*
# Line 1744 | Line 1713 | valid_tkline(const char *p, int minutes)
1713     * of this calculation
1714     */
1715    if (!minutes)
1716 <    result = result / (time_t)60;
1716 >    result = result / 60;
1717  
1718    if (result > MAX_TDKLINE_TIME)
1719      result = MAX_TDKLINE_TIME;
1720  
1721 <  result = result * (time_t)60;  /* turn it into seconds */
1721 >  result = result * 60;  /* turn it into seconds */
1722  
1723    return result;
1724   }
# Line 2048 | Line 2017 | find_user_host(struct Client *source_p,
2017      /* Try to find user@host mask from nick */
2018      /* Okay to use source_p as the first param, because source_p == client_p */
2019      if ((target_p =
2020 <        find_chasing(source_p, source_p, user_host_or_nick, NULL)) == NULL)
2020 >        find_chasing(source_p, user_host_or_nick, NULL)) == NULL)
2021        return 0;
2022  
2023      if (IsExemptKline(target_p))
# Line 2201 | Line 2170 | split_nuh(struct split_nuh_item *const i
2170      if (iptr->nickptr && *iptr->nuhmask != '\0')
2171        strlcpy(iptr->nickptr, iptr->nuhmask, iptr->nicksize);
2172  
2173 <    if ((q = strchr(++p, '@'))) {
2173 >    if ((q = strchr(++p, '@')))
2174 >    {
2175        *q++ = '\0';
2176  
2177        if (*p != '\0')

Diff Legend

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