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

Comparing ircd-hybrid/trunk/modules/m_dline.c (file contents):
Revision 1632 by michael, Sun Nov 4 15:37:10 2012 UTC vs.
Revision 1649 by michael, Sat Nov 10 19:27:13 2012 UTC

# Line 56 | Line 56 | apply_dline(struct Client *source_p, str
56   {
57    if (tkline_time)
58    {
59 <    conf->hold = CurrentTime + tkline_time;
59 >    conf->until = CurrentTime + tkline_time;
60      sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE,
61                           "%s added temporary %d min. D-Line for [%s] [%s]",
62                           get_oper_name(source_p), tkline_time/60,
# Line 96 | Line 96 | remove_dline_match(const char *host)
96   {
97    struct irc_ssaddr iphost, *piphost;
98    struct MaskItem *conf;
99 <  int t;
99 >  int t = 0;
100 >  int aftype = 0;
101  
102    if ((t = parse_netmask(host, &iphost, NULL)) != HM_HOST)
103    {
104   #ifdef IPV6
105      if (t == HM_IPV6)
106 <      t = AF_INET6;
106 >      aftype = AF_INET6;
107      else
108   #endif
109 <      t = AF_INET;
109 >      aftype = AF_INET;
110      piphost = &iphost;
111    }
112    else
112 –  {
113 –    t = 0;
113      piphost = NULL;
115 –  }
114  
115 <  if ((conf = find_conf_by_address(host, piphost, CONF_DLINE, t, NULL, NULL, 0)))
115 >  if ((conf = find_conf_by_address(host, piphost, CONF_DLINE, aftype, NULL, NULL, 0)))
116    {
117      if (IsConfDatabase(conf))
118      {
# Line 148 | Line 146 | mo_dline(struct Client *client_p, struct
146    struct irc_ssaddr daddr;
147    struct MaskItem *conf=NULL;
148    time_t tkline_time=0;
149 <  int bits, t;
149 >  int bits = 0, aftype = 0, t = 0;
150    const char *current_date = NULL;
151    time_t cur_time;
152    char hostip[HOSTIPLEN + 1];
# Line 231 | Line 229 | mo_dline(struct Client *client_p, struct
229  
230   #ifdef IPV6
231    if (t == HM_IPV6)
232 <    t = AF_INET6;
232 >    aftype = AF_INET6;
233    else
234   #endif
235 <    t = AF_INET;
235 >    aftype = AF_INET;
236  
237    parse_netmask(dlhost, &daddr, NULL);
238  
239 <  if ((conf = find_dline_conf(&daddr, t)) != NULL)
239 >  if ((conf = find_dline_conf(&daddr, aftype)) != NULL)
240    {
241      creason = conf->reason ? conf->reason : def_reason;
242      if (IsConfExemptKline(conf))
# Line 259 | Line 257 | mo_dline(struct Client *client_p, struct
257      return;
258  
259    conf = conf_make(CONF_DLINE);
260 <  DupString(conf->host, dlhost);
260 >  conf->host = xstrdup(dlhost);
261  
262    if (tkline_time != 0)
263      snprintf(buffer, sizeof(buffer), "Temporary D-line %d min. - %s (%s)",
# Line 267 | Line 265 | mo_dline(struct Client *client_p, struct
265    else
266      snprintf(buffer, sizeof(buffer), "%s (%s)", reason, current_date);
267  
268 <  DupString(conf->reason, buffer);
268 >  conf->reason = xstrdup(buffer);
269    apply_dline(source_p, conf, tkline_time);
270    rehashed_klines = 1;
271   }
# Line 283 | Line 281 | ms_dline(struct Client *client_p, struct
281    struct irc_ssaddr daddr;
282    struct MaskItem *conf=NULL;
283    time_t tkline_time=0;
284 <  int bits, t;
284 >  int bits = 0, aftype = 0, t = 0;
285    const char *current_date = NULL;
286    time_t cur_time;
287    char hostip[HOSTIPLEN + 1];
# Line 350 | Line 348 | ms_dline(struct Client *client_p, struct
348  
349   #ifdef IPV6
350      if (t == HM_IPV6)
351 <      t = AF_INET6;
351 >      aftype= AF_INET6;
352      else
353   #endif
354 <      t = AF_INET;
354 >      aftype = AF_INET;
355  
356      parse_netmask(dlhost, &daddr, NULL);
357  
358 <    if ((conf = find_dline_conf(&daddr, t)) != NULL)
358 >    if ((conf = find_dline_conf(&daddr, aftype)) != NULL)
359      {
360        creason = conf->reason ? conf->reason : def_reason;
361        if (IsConfExemptKline(conf))
# Line 378 | Line 376 | ms_dline(struct Client *client_p, struct
376        return;
377  
378      conf = conf_make(CONF_DLINE);
379 <    DupString(conf->host, dlhost);
379 >    conf->host = xstrdup(dlhost);
380  
381      if (tkline_time != 0)
382        snprintf(buffer, sizeof(buffer), "Temporary D-line %d min. - %s (%s)",
# Line 386 | Line 384 | ms_dline(struct Client *client_p, struct
384      else
385        snprintf(buffer, sizeof(buffer), "%s (%s)", reason, current_date);
386  
387 <    DupString(conf->reason, buffer);
387 >    conf->reason = xstrdup(buffer);
388      apply_dline(source_p, conf, tkline_time);
389      rehashed_klines = 1;
390    }

Diff Legend

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