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

Comparing:
ircd-hybrid-8/modules/m_dline.c (file contents), Revision 1233 by michael, Thu Sep 22 20:53:07 2011 UTC vs.
ircd-hybrid/trunk/modules/m_dline.c (file contents), Revision 3192 by michael, Sun Mar 23 19:46:39 2014 UTC

# Line 1 | Line 1
1   /*
2 < *  ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd).
3 < *  m_dline.c: Bans a user.
2 > *  ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd)
3   *
4 < *  Copyright (C) 2002 by the past and present ircd coders, and others.
4 > *  Copyright (c) 1997-2014 ircd-hybrid development team
5   *
6   *  This program is free software; you can redistribute it and/or modify
7   *  it under the terms of the GNU General Public License as published by
# Line 18 | Line 17
17   *  along with this program; if not, write to the Free Software
18   *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
19   *  USA
20 < *
21 < *  $Id$
20 > */
21 >
22 > /*! \file m_dline.c
23 > * \brief Includes required functions for processing the DLINE/UNDLINE command.
24 > * \version $Id$
25   */
26  
27   #include "stdinc.h"
28   #include "list.h"
27 #include "channel.h"
29   #include "client.h"
29 #include "common.h"
30   #include "irc_string.h"
31 < #include "sprintf_irc.h"
31 > #include "conf.h"
32   #include "ircd.h"
33   #include "hostmask.h"
34   #include "numeric.h"
35 < #include "fdlist.h"
36 < #include "s_bsd.h"
37 < #include "s_conf.h"
38 < #include "s_log.h"
35 > #include "log.h"
36   #include "s_misc.h"
37   #include "send.h"
38   #include "hash.h"
42 #include "handlers.h"
39   #include "s_serv.h"
44 #include "msg.h"
45 #include "s_gline.h"
40   #include "parse.h"
41   #include "modules.h"
42 + #include "conf_db.h"
43 + #include "memory.h"
44  
45  
50 static int remove_tdline_match(const char *);
51
46   /* apply_tdline()
47   *
48   * inputs       -
# Line 56 | Line 50 | static int remove_tdline_match(const cha
50   * side effects - tkline as given is placed
51   */
52   static void
53 < apply_tdline(struct Client *source_p, struct ConfItem *conf,
54 <             const char *current_date, int tkline_time)
53 > apply_dline(struct Client *source_p, struct MaskItem *conf,
54 >            time_t tkline_time)
55   {
56 <  struct AccessItem *aconf;
56 >  if (tkline_time)
57 >  {
58 >    conf->until = CurrentTime + tkline_time;
59 >    sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE,
60 >                         "%s added temporary %d min. D-Line for [%s] [%s]",
61 >                         get_oper_name(source_p), tkline_time/60,
62 >                         conf->host, conf->reason);
63 >    sendto_one_notice(source_p, &me, ":Added temporary %d min. D-Line [%s]",
64 >                      tkline_time/60, conf->host);
65 >    ilog(LOG_TYPE_DLINE, "%s added temporary %d min. D-Line for [%s] [%s]",
66 >         get_oper_name(source_p), tkline_time/60, conf->host, conf->reason);
67 >  }
68 >  else
69 >  {
70 >    sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE,
71 >                         "%s added D-Line for [%s] [%s]",
72 >                         get_oper_name(source_p), conf->host, conf->reason);
73 >    sendto_one_notice(source_p, &me, ":Added D-Line [%s]", conf->host);
74 >    ilog(LOG_TYPE_DLINE, "%s added D-Line for [%s] [%s]",
75 >         get_oper_name(source_p), conf->host, conf->reason);
76  
77 <  aconf = map_to_conf(conf);
65 <  aconf->hold = CurrentTime + tkline_time;
77 >  }
78  
79 <  add_temp_line(conf);
80 <  sendto_realops_flags(UMODE_ALL, L_ALL,
81 <                       "%s added temporary %d min. D-Line for [%s] [%s]",
70 <                       get_oper_name(source_p), tkline_time/60,
71 <                       aconf->host, aconf->reason);
72 <
73 <  sendto_one(source_p, ":%s NOTICE %s :Added temporary %d min. D-Line [%s]",
74 <             MyConnect(source_p) ? me.name : ID_or_name(&me, source_p->from),
75 <             source_p->name, tkline_time/60, aconf->host);
76 <  ilog(L_TRACE, "%s added temporary %d min. D-Line for [%s] [%s]",
77 <       source_p->name, tkline_time/60, aconf->host, aconf->reason);
78 <  log_oper_action(LOG_TEMP_DLINE_TYPE, source_p, "[%s@%s] [%s]\n",
79 <                  aconf->user, aconf->host, aconf->reason);
79 >  SetConfDatabase(conf);
80 >  conf->setat = CurrentTime;
81 >  add_conf_by_address(CONF_DLINE, conf);
82    rehashed_klines = 1;
83   }
84  
85 + /* static int remove_tdline_match(const char *host, const char *user)
86 + * Input: An ip to undline.
87 + * Output: returns YES on success, NO if no tdline removed.
88 + * Side effects: Any matching tdlines are removed.
89 + */
90 + static int
91 + remove_dline_match(const char *host)
92 + {
93 +  struct irc_ssaddr iphost, *piphost;
94 +  struct MaskItem *conf;
95 +  int t = 0;
96 +  int aftype = 0;
97 +
98 +  if ((t = parse_netmask(host, &iphost, NULL)) != HM_HOST)
99 +  {
100 + #ifdef IPV6
101 +    if (t == HM_IPV6)
102 +      aftype = AF_INET6;
103 +    else
104 + #endif
105 +      aftype = AF_INET;
106 +    piphost = &iphost;
107 +  }
108 +  else
109 +    piphost = NULL;
110 +
111 +  if ((conf = find_conf_by_address(host, piphost, CONF_DLINE, aftype, NULL, NULL, 0)))
112 +  {
113 +    if (IsConfDatabase(conf))
114 +    {
115 +      delete_one_address_conf(host, conf);
116 +      return 1;
117 +    }
118 +  }
119 +
120 +  return 0;
121 + }
122 +
123   /* mo_dline()
124   *
125   * inputs       - pointer to server
# Line 90 | Line 130 | apply_tdline(struct Client *source_p, st
130   * side effects - D line is added
131   *
132   */
133 < static void
134 < mo_dline(struct Client *client_p, struct Client *source_p,
95 <         int parc, char *parv[])
133 > static int
134 > mo_dline(struct Client *source_p, int parc, char *parv[])
135   {
136 <  char def_reason[] = "No reason";
137 <  char *dlhost, *oper_reason, *reason;
136 >  char def_reason[] = CONF_NOREASON;
137 >  char *dlhost = NULL, *reason = NULL;
138 >  char *target_server = NULL;
139    const char *creason;
140    const struct Client *target_p = NULL;
141    struct irc_ssaddr daddr;
142 <  struct ConfItem *conf=NULL;
103 <  struct AccessItem *aconf=NULL;
142 >  struct MaskItem *conf=NULL;
143    time_t tkline_time=0;
144 <  int bits, t;
144 >  int bits = 0, aftype = 0, t = 0;
145    const char *current_date = NULL;
146    time_t cur_time;
147 <  char hostip[HOSTIPLEN];
147 >  char hostip[HOSTIPLEN + 1];
148    char buffer[IRCD_BUFSIZE];
149  
150 <  if (!HasOFlag(source_p, OPER_FLAG_K))
150 >  if (!HasOFlag(source_p, OPER_FLAG_DLINE))
151    {
152 <    sendto_one(source_p, form_str(ERR_NOPRIVS),
153 <               me.name, source_p->name, "kline");
115 <    return;
152 >    sendto_one_numeric(source_p, &me, ERR_NOPRIVS, "dline");
153 >    return 0;
154    }
155  
156    if (parse_aline("DLINE", source_p,  parc, parv, AWILD, &dlhost,
157 <                  NULL, &tkline_time, NULL, &reason) < 0)
158 <    return;
157 >                  NULL, &tkline_time, &target_server, &reason) < 0)
158 >    return 0;
159 >
160 >  if (target_server != NULL)
161 >  {
162 >    sendto_match_servs(source_p, target_server, CAP_DLN, "DLINE %s %lu %s :%s",
163 >                       target_server, (unsigned long)tkline_time,
164 >                       dlhost, reason);
165 >
166 >    /* Allow ON to apply local kline as well if it matches */
167 >    if (match(target_server, me.name))
168 >      return 0;
169 >  }
170 >  else
171 >    cluster_a_line(source_p, "DLINE", CAP_DLN, SHARED_DLINE,
172 >                   "%d %s :%s", tkline_time, dlhost, reason);
173  
174    if ((t = parse_netmask(dlhost, NULL, &bits)) == HM_HOST)
175    {
176 <    if ((target_p = find_chasing(client_p, source_p, dlhost, NULL)) == NULL)
177 <      return;
176 >    if ((target_p = find_chasing(source_p, dlhost)) == NULL)
177 >      return 0;
178  
179      if (!MyConnect(target_p))
180      {
181 <      sendto_one(source_p,
182 <                 ":%s NOTICE %s :Can't DLINE nick on another server",
131 <                 me.name, source_p->name);
132 <      return;
181 >      sendto_one_notice(source_p, &me, ":Cannot DLINE nick on another server");
182 >      return 0;
183      }
184  
185      if (IsExemptKline(target_p))
186      {
187 <      sendto_one(source_p,
188 <                 ":%s NOTICE %s :%s is E-lined", me.name,
189 <                 source_p->name, target_p->name);
140 <      return;
187 >      sendto_one_notice(source_p, &me, ":%s is E-lined",
188 >                        target_p->name);
189 >      return 0;
190      }
191  
192      getnameinfo((struct sockaddr *)&target_p->localClient->ip,
# Line 150 | Line 199 | mo_dline(struct Client *client_p, struct
199  
200    if (bits < 8)
201    {
202 <    sendto_one(source_p,
203 <               ":%s NOTICE %s :For safety, bitmasks less than 8 require conf access.",
155 <               me.name, source_p->name);
156 <    return;
202 >    sendto_one_notice(source_p, &me, ":For safety, bitmasks less than 8 require conf access.");
203 >    return 0;
204    }
205  
206   #ifdef IPV6
207    if (t == HM_IPV6)
208 <    t = AF_INET6;
208 >    aftype = AF_INET6;
209    else
210   #endif
211 <    t = AF_INET;
211 >    aftype = AF_INET;
212  
213    parse_netmask(dlhost, &daddr, NULL);
214  
215 <  if ((aconf = find_dline_conf(&daddr, t)) != NULL)
215 >  if ((conf = find_dline_conf(&daddr, aftype)) != NULL)
216    {
217 <    creason = aconf->reason ? aconf->reason : def_reason;
218 <    if (IsConfExemptKline(aconf))
219 <      sendto_one(source_p,
220 <                 ":%s NOTICE %s :[%s] is (E)d-lined by [%s] - %s",
221 <                 me.name, source_p->name, dlhost, aconf->host, creason);
217 >    creason = conf->reason ? conf->reason : def_reason;
218 >
219 >    if (IsConfExemptKline(conf))
220 >      sendto_one_notice(source_p, &me, ":[%s] is (E)d-lined by [%s] - %s",
221 >                        dlhost, conf->host, creason);
222      else
223 <      sendto_one(source_p,
224 <                 ":%s NOTICE %s :[%s] already D-lined by [%s] - %s",
225 <                 me.name, source_p->name, dlhost, aconf->host, creason);
179 <    return;
223 >      sendto_one_notice(source_p, &me, ":[%s] already D-lined by [%s] - %s",
224 >                        dlhost, conf->host, creason);
225 >    return 0;
226    }
227  
228    cur_time = CurrentTime;
229    current_date = smalldate(cur_time);
230  
231 <  /* Look for an oper reason */
232 <  if ((oper_reason = strchr(reason, '|')) != NULL)
233 <    *oper_reason++ = '\0';
234 <
235 <  if (!valid_comment(source_p, reason, YES))
190 <    return;
191 <
192 <  conf = make_conf_item(DLINE_TYPE);
193 <  aconf = map_to_conf(conf);
194 <  DupString(aconf->host, dlhost);
231 >  if (!valid_comment(source_p, reason, 1))
232 >    return 0;
233 >
234 >  conf = conf_make(CONF_DLINE);
235 >  conf->host = xstrdup(dlhost);
236  
237    if (tkline_time != 0)
197  {
238      snprintf(buffer, sizeof(buffer), "Temporary D-line %d min. - %s (%s)",
239               (int)(tkline_time/60), reason, current_date);
200    DupString(aconf->reason, buffer);
201    if (oper_reason != NULL)
202      DupString(aconf->oper_reason, oper_reason);
203    apply_tdline(source_p, conf, current_date, tkline_time);
204  }
240    else
206  {
241      snprintf(buffer, sizeof(buffer), "%s (%s)", reason, current_date);
208    DupString(aconf->reason, buffer);
209    if (oper_reason != NULL)
210      DupString(aconf->oper_reason, oper_reason);
211    add_conf_by_address(CONF_DLINE, aconf);
212    write_conf_line(source_p, conf, current_date, cur_time);
213  }
242  
243 +  conf->reason = xstrdup(buffer);
244 +  apply_dline(source_p, conf, tkline_time);
245    rehashed_klines = 1;
246 +  return 0;
247   }
248  
218 /* static int remove_tdline_match(const char *host, const char *user)
219 * Input: An ip to undline.
220 * Output: returns YES on success, NO if no tdline removed.
221 * Side effects: Any matching tdlines are removed.
222 */
249   static int
250 < remove_tdline_match(const char *cidr)
250 > ms_dline(struct Client *source_p, int parc, char *parv[])
251   {
252 <  struct AccessItem *td_conf;
253 <  dlink_node *td_node;
254 <  struct irc_ssaddr addr, caddr;
255 <  int nm_t, cnm_t, bits, cbits;
256 <  nm_t = parse_netmask(cidr, &addr, &bits);
252 >  char def_reason[] = CONF_NOREASON;
253 >  char *dlhost, *reason;
254 >  const char *creason;
255 >  const struct Client *target_p = NULL;
256 >  struct irc_ssaddr daddr;
257 >  struct MaskItem *conf=NULL;
258 >  time_t tkline_time=0;
259 >  int bits = 0, aftype = 0, t = 0;
260 >  const char *current_date = NULL;
261 >  time_t cur_time;
262 >  char hostip[HOSTIPLEN + 1];
263 >  char buffer[IRCD_BUFSIZE];
264 >
265 >  if (parc != 5 || EmptyString(parv[4]))
266 >    return 0;
267  
268 <  DLINK_FOREACH(td_node, temporary_dlines.head)
268 >  /* parv[0]  parv[1]        parv[2]      parv[3]  parv[4] */
269 >  /* oper     target_server  tkline_time  host     reason  */
270 >  sendto_match_servs(source_p, parv[1], CAP_DLN,
271 >                     "DLINE %s %s %s :%s",
272 >                     parv[1], parv[2], parv[3], parv[4]);
273 >
274 >  if (match(parv[1], me.name))
275 >    return 0;
276 >
277 >  tkline_time = valid_tkline(parv[2], TK_SECONDS);
278 >  dlhost = parv[3];
279 >  reason = parv[4];
280 >
281 >  if (HasFlag(source_p, FLAGS_SERVICE) ||
282 >      find_matching_name_conf(CONF_ULINE, source_p->servptr->name,
283 >                              source_p->username, source_p->host,
284 >                              SHARED_DLINE))
285    {
286 <    td_conf = map_to_conf(td_node->data);
287 <    cnm_t   = parse_netmask(td_conf->host, &caddr, &cbits);
286 >    if (!IsClient(source_p))
287 >      return 0;
288 >
289 >    if ((t = parse_netmask(dlhost, NULL, &bits)) == HM_HOST)
290 >    {
291 >      if ((target_p = find_chasing(source_p, dlhost)) == NULL)
292 >        return 0;
293  
294 <    if (cnm_t != nm_t)
295 <      continue;
294 >      if (!MyConnect(target_p))
295 >      {
296 >        sendto_one_notice(source_p, &me, ":Cannot DLINE nick on another server");
297 >        return 0;
298 >      }
299 >
300 >      if (IsExemptKline(target_p))
301 >      {
302 >        sendto_one_notice(source_p, &me, ":%s is E-lined", target_p->name);
303 >        return 0;
304 >      }
305 >
306 >      getnameinfo((struct sockaddr *)&target_p->localClient->ip,
307 >                  target_p->localClient->ip.ss_len, hostip,
308 >                  sizeof(hostip), NULL, 0, NI_NUMERICHOST);
309 >      dlhost = hostip;
310 >      t = parse_netmask(dlhost, NULL, &bits);
311 >      assert(t == HM_IPV4 || t == HM_IPV6);
312 >    }
313 >
314 >    if (bits < 8)
315 >    {
316 >      sendto_one_notice(source_p, &me, ":For safety, bitmasks less than 8 require conf access.");
317 >      return 0;
318 >    }
319  
240    if((nm_t==HM_HOST && !irccmp(td_conf->host, cidr)) ||
241       (nm_t==HM_IPV4 && bits==cbits && match_ipv4(&addr, &caddr, bits))
320   #ifdef IPV6
321 <       || (nm_t==HM_IPV6 && bits==cbits && match_ipv6(&addr, &caddr, bits))
321 >    if (t == HM_IPV6)
322 >      aftype= AF_INET6;
323 >    else
324   #endif
325 <      )
325 >      aftype = AF_INET;
326 >
327 >    parse_netmask(dlhost, &daddr, NULL);
328 >
329 >    if ((conf = find_dline_conf(&daddr, aftype)) != NULL)
330      {
331 <      dlinkDelete(td_node, &temporary_dlines);
332 <      delete_one_address_conf(td_conf->host, td_conf);
333 <      return 1;
331 >      creason = conf->reason ? conf->reason : def_reason;
332 >      if (IsConfExemptKline(conf))
333 >        sendto_one_notice(source_p, &me, ":[%s] is (E)d-lined by [%s] - %s",
334 >                          dlhost, conf->host, creason);
335 >      else
336 >        sendto_one_notice(source_p, &me, ":[%s] already D-lined by [%s] - %s",
337 >                          dlhost, conf->host, creason);
338 >      return 0;
339      }
340 +
341 +    cur_time = CurrentTime;
342 +    current_date = smalldate(cur_time);
343 +
344 +    if (!valid_comment(source_p, reason, 1))
345 +      return 0;
346 +
347 +    conf = conf_make(CONF_DLINE);
348 +    conf->host = xstrdup(dlhost);
349 +
350 +    if (tkline_time != 0)
351 +      snprintf(buffer, sizeof(buffer), "Temporary D-line %d min. - %s (%s)",
352 +               (int)(tkline_time/60), reason, current_date);
353 +    else
354 +      snprintf(buffer, sizeof(buffer), "%s (%s)", reason, current_date);
355 +
356 +    conf->reason = xstrdup(buffer);
357 +    apply_dline(source_p, conf, tkline_time);
358 +    rehashed_klines = 1;
359    }
360  
361    return 0;
# Line 259 | Line 367 | remove_tdline_match(const char *cidr)
367   ** based totally on m_unkline
368   ** added to hybrid-7 7/11/2000 --is
369   **
370 < **      parv[0] = sender nick
370 > **      parv[0] = command
371   **      parv[1] = dline to remove
372   */
373 < static void
374 < mo_undline(struct Client *client_p, struct Client *source_p,
267 <           int parc, char *parv[])
373 > static int
374 > mo_undline(struct Client *source_p, int parc, char *parv[])
375   {
376 <  const char *cidr = NULL;
376 >  char *addr = NULL, *user = NULL;
377 >  char *target_server = NULL;
378 >
379 >  if (!HasOFlag(source_p, OPER_FLAG_UNDLINE))
380 >  {
381 >    sendto_one_numeric(source_p, &me, ERR_NOPRIVS, "undline");
382 >    return 0;
383 >  }
384  
385 <  if (!HasOFlag(source_p, OPER_FLAG_UNKLINE))
385 >  if (parc < 2 || EmptyString(parv[1]))
386    {
387 <    sendto_one(source_p, form_str(ERR_NOPRIVS),
388 <               me.name, source_p->name, "undline");
275 <    return;
387 >    sendto_one_numeric(source_p, &me, ERR_NEEDMOREPARAMS, "UNDLINE");
388 >    return 0;
389    }
390  
391 <  cidr = parv[1];
391 >  if (parse_aline("UNDLINE", source_p, parc, parv, 0, &user,
392 >                  &addr, NULL, &target_server, NULL) < 0)
393 >    return 0;
394  
395 <  if (remove_tdline_match(cidr))
395 >  if (target_server != NULL)
396    {
397 <    sendto_one(source_p,
398 <              ":%s NOTICE %s :Un-Dlined [%s] from temporary D-Lines",
399 <              me.name, source_p->name, cidr);
400 <    sendto_realops_flags(UMODE_ALL, L_ALL,
401 <                         "%s has removed the temporary D-Line for: [%s]",
402 <                         get_oper_name(source_p), cidr);
288 <    ilog(L_NOTICE, "%s removed temporary D-Line for [%s]", source_p->name, cidr);
289 <    return;
397 >    sendto_match_servs(source_p, target_server, CAP_UNDLN,
398 >                       "UNDLINE %s %s", target_server, addr);
399 >
400 >    /* Allow ON to apply local unkline as well if it matches */
401 >    if (match(target_server, me.name))
402 >      return 0;
403    }
404 +  else
405 +    cluster_a_line(source_p, "UNDLINE", CAP_UNDLN, SHARED_UNDLINE,
406 +                   "%s", addr);
407  
408 <  if (remove_conf_line(DLINE_TYPE, source_p, cidr, NULL) > 0)
408 >  if (remove_dline_match(addr))
409    {
410 <    sendto_one(source_p, ":%s NOTICE %s :D-Line for [%s] is removed",
411 <               me.name, source_p->name, cidr);
412 <    sendto_realops_flags(UMODE_ALL, L_ALL,
413 <                         "%s has removed the D-Line for: [%s]",
414 <                         get_oper_name(source_p), cidr);
415 <    ilog(L_NOTICE, "%s removed D-Line for [%s]",
300 <         get_oper_name(source_p), cidr);
410 >    sendto_one_notice(source_p, &me, ":D-Line for [%s] is removed", addr);
411 >    sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE,
412 >                         "%s has removed the D-Line for: [%s]",
413 >                         get_oper_name(source_p), addr);
414 >    ilog(LOG_TYPE_DLINE, "%s removed D-Line for [%s]",
415 >         get_oper_name(source_p), addr);
416    }
417    else
418 <    sendto_one(source_p, ":%s NOTICE %s :No D-Line for [%s] found",
419 <               me.name, source_p->name, cidr);
418 >    sendto_one_notice(source_p, &me, ":No D-Line for [%s] found", addr);
419 >  return 0;
420 > }
421 >
422 > static int
423 > ms_undline(struct Client *source_p, int parc, char *parv[])
424 > {
425 >  const char *addr = parv[1];
426 >
427 >  if (parc != 3 || EmptyString(parv[2]))
428 >    return 0;
429 >
430 >  sendto_match_servs(source_p, parv[1], CAP_UNDLN,
431 >                     "UNDLINE %s %s",
432 >                     parv[1], parv[2]);
433 >
434 >  if (!IsClient(source_p) || match(parv[1], me.name))
435 >    return 0;
436 >
437 >  if (HasFlag(source_p, FLAGS_SERVICE) ||
438 >      find_matching_name_conf(CONF_ULINE, source_p->servptr->name,
439 >                              source_p->username, source_p->host,
440 >                              SHARED_UNDLINE))
441 >  {
442 >    if (remove_dline_match(addr))
443 >    {
444 >      sendto_one_notice(source_p, &me, ":D-Line for [%s] is removed", addr);
445 >      sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE,
446 >                           "%s has removed the D-Line for: [%s]",
447 >                           get_oper_name(source_p), addr);
448 >      ilog(LOG_TYPE_DLINE, "%s removed D-Line for [%s]",
449 >           get_oper_name(source_p), addr);
450 >    }
451 >    else
452 >      sendto_one_notice(source_p, &me, ":No D-Line for [%s] found", addr);
453 >  }
454 >
455 >  return 0;
456   }
457  
458 < static struct Message dline_msgtab = {
458 > static struct Message dline_msgtab =
459 > {
460    "DLINE", 0, 0, 2, MAXPARA, MFLG_SLOW, 0,
461 <   {m_unregistered, m_not_oper, rfc1459_command_send_error, m_ignore, mo_dline, m_ignore}
461 >  { m_unregistered, m_not_oper, ms_dline, m_ignore, mo_dline, m_ignore }
462   };
463  
464 < static struct Message undline_msgtab = {
464 > static struct Message undline_msgtab =
465 > {
466    "UNDLINE", 0, 0, 2, MAXPARA, MFLG_SLOW, 0,
467 <   {m_unregistered, m_not_oper, rfc1459_command_send_error, m_ignore, mo_undline, m_ignore}
467 >  { m_unregistered, m_not_oper, ms_undline, m_ignore, mo_undline, m_ignore }
468   };
469  
470   static void
# Line 319 | Line 472 | module_init(void)
472   {
473    mod_add_cmd(&dline_msgtab);
474    mod_add_cmd(&undline_msgtab);
475 +  add_capability("DLN", CAP_DLN, 1);
476 +  add_capability("UNDLN", CAP_UNDLN, 1);
477   }
478  
479   static void
# Line 326 | Line 481 | module_exit(void)
481   {
482    mod_del_cmd(&dline_msgtab);
483    mod_del_cmd(&undline_msgtab);
484 +  delete_capability("UNDLN");
485 +  delete_capability("DLN");
486   }
487  
488 < struct module module_entry = {
488 > struct module module_entry =
489 > {
490    .node    = { NULL, NULL, NULL },
491    .name    = NULL,
492    .version = "$Revision$",

Diff Legend

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