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

Comparing ircd-hybrid/trunk/modules/m_kline.c (file contents):
Revision 1644 by michael, Tue Nov 6 22:20:16 2012 UTC vs.
Revision 1666 by michael, Sun Nov 18 17:03:18 2012 UTC

# Line 43 | Line 43
43   #include "parse.h"
44   #include "modules.h"
45   #include "conf_db.h"
46 <
46 > #include "memory.h"
47  
48   static int already_placed_kline(struct Client *, const char *, const char *, int);
49   static void m_kline_add_kline(struct Client *, struct MaskItem *, time_t);
# Line 105 | Line 105 | mo_kline(struct Client *client_p, struct
105                      user, host, reason);
106  
107      /* Allow ON to apply local kline as well if it matches */
108 <    if (!match(target_server, me.name))
108 >    if (match(target_server, me.name))
109        return;
110    }
111    else
# Line 119 | Line 119 | mo_kline(struct Client *client_p, struct
119    current_date = smalldate(cur_time);
120    conf = conf_make(CONF_KLINE);
121  
122 <  DupString(conf->host, host);
123 <  DupString(conf->user, user);
122 >  conf->host = xstrdup(host);
123 >  conf->user = xstrdup(user);
124  
125    if (tkline_time != 0)
126      snprintf(buffer, sizeof(buffer), "Temporary K-line %d min. - %s (%s)",
# Line 128 | Line 128 | mo_kline(struct Client *client_p, struct
128    else
129      snprintf(buffer, sizeof(buffer), "%s (%s)", reason, current_date);
130  
131 <  DupString(conf->reason, buffer);
131 >  conf->reason = xstrdup(buffer);
132    m_kline_add_kline(source_p, conf, tkline_time);
133   }
134  
# Line 146 | Line 146 | me_kline(struct Client *client_p, struct
146    if (parc != 6 || EmptyString(parv[5]))
147      return;
148  
149 <  if (!match(parv[1], me.name))
149 >  if (match(parv[1], me.name))
150      return;
151  
152    tkline_time = valid_tkline(parv[2], TK_SECONDS);
# Line 166 | Line 166 | me_kline(struct Client *client_p, struct
166        return;
167  
168      conf = conf_make(CONF_KLINE);
169 <    DupString(conf->host, khost);
170 <    DupString(conf->user, kuser);
169 >    conf->host = xstrdup(khost);
170 >    conf->user = xstrdup(kuser);
171  
172      if (tkline_time != 0)
173        snprintf(buffer, sizeof(buffer), "Temporary K-line %d min. - %s (%s)",
# Line 175 | Line 175 | me_kline(struct Client *client_p, struct
175      else
176        snprintf(buffer, sizeof(buffer), "%s (%s)", kreason, current_date);
177  
178 <    DupString(conf->reason, buffer);
178 >    conf->reason = xstrdup(buffer);
179      m_kline_add_kline(source_p, conf, tkline_time);
180    }
181   }
# Line 208 | Line 208 | m_kline_add_kline(struct Client *source_
208   {
209    if (tkline_time)
210    {
211 <    conf->hold = CurrentTime + tkline_time;
211 >    conf->until = CurrentTime + tkline_time;
212      sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE,
213                           "%s added temporary %d min. K-Line for [%s@%s] [%s]",
214                           get_oper_name(source_p), tkline_time/60,
# Line 332 | Line 332 | mo_unkline(struct Client *client_p,struc
332                          target_server, user, host);
333  
334      /* Allow ON to apply local unkline as well if it matches */
335 <    if (!match(target_server, me.name))
335 >    if (match(target_server, me.name))
336        return;
337    }
338    else
# Line 377 | Line 377 | me_unkline(struct Client *client_p, stru
377    kuser = parv[2];
378    khost = parv[3];
379  
380 <  if (!IsClient(source_p) || !match(parv[1], me.name))
380 >  if (!IsClient(source_p) || match(parv[1], me.name))
381      return;
382  
383    if (HasFlag(source_p, FLAGS_SERVICE) || find_matching_name_conf(CONF_ULINE,

Diff Legend

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