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-8/modules/m_dline.c (file contents):
Revision 1219 by michael, Sun Sep 18 09:02:38 2011 UTC vs.
Revision 1233 by michael, Thu Sep 22 20:53:07 2011 UTC

# Line 47 | Line 47
47   #include "modules.h"
48  
49  
50 static void mo_dline(struct Client *, struct Client *, int, char *[]);
51 static void mo_undline(struct Client *, struct Client *, int, char *[]);
52
50   static int remove_tdline_match(const char *);
51  
55 struct Message dline_msgtab = {
56  "DLINE", 0, 0, 2, MAXPARA, MFLG_SLOW, 0,
57   {m_unregistered, m_not_oper, rfc1459_command_send_error, m_ignore, mo_dline, m_ignore}
58 };
59
60 struct Message undline_msgtab = {
61  "UNDLINE", 0, 0, 2, MAXPARA, MFLG_SLOW, 0,
62   {m_unregistered, m_not_oper, rfc1459_command_send_error, m_ignore, mo_undline, m_ignore}
63 };
64
65 void
66 _modinit(void)
67 {
68  mod_add_cmd(&dline_msgtab);
69  mod_add_cmd(&undline_msgtab);
70 }
71
72 void
73 _moddeinit(void)
74 {
75  mod_del_cmd(&dline_msgtab);
76  mod_del_cmd(&undline_msgtab);
77 }
78
79 const char *_version = "$Revision$";
80
81 static char buffer[IRCD_BUFSIZE];
82
83
52   /* apply_tdline()
53   *
54   * inputs       -
# Line 138 | Line 106 | mo_dline(struct Client *client_p, struct
106    const char *current_date = NULL;
107    time_t cur_time;
108    char hostip[HOSTIPLEN];
109 +  char buffer[IRCD_BUFSIZE];
110  
111    if (!HasOFlag(source_p, OPER_FLAG_K))
112    {
# Line 226 | Line 195 | mo_dline(struct Client *client_p, struct
195  
196    if (tkline_time != 0)
197    {
198 <    ircsprintf(buffer, "Temporary D-line %d min. - %s (%s)",
199 <               (int)(tkline_time/60), reason, current_date);
198 >    snprintf(buffer, sizeof(buffer), "Temporary D-line %d min. - %s (%s)",
199 >             (int)(tkline_time/60), reason, current_date);
200      DupString(aconf->reason, buffer);
201      if (oper_reason != NULL)
202        DupString(aconf->oper_reason, oper_reason);
# Line 235 | Line 204 | mo_dline(struct Client *client_p, struct
204    }
205    else
206    {
207 <    ircsprintf(buffer, "%s (%s)", reason, current_date);
207 >    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);
# Line 334 | Line 303 | mo_undline(struct Client *client_p, stru
303      sendto_one(source_p, ":%s NOTICE %s :No D-Line for [%s] found",
304                 me.name, source_p->name, cidr);
305   }
306 +
307 + static struct Message dline_msgtab = {
308 +  "DLINE", 0, 0, 2, MAXPARA, MFLG_SLOW, 0,
309 +   {m_unregistered, m_not_oper, rfc1459_command_send_error, m_ignore, mo_dline, m_ignore}
310 + };
311 +
312 + static struct Message undline_msgtab = {
313 +  "UNDLINE", 0, 0, 2, MAXPARA, MFLG_SLOW, 0,
314 +   {m_unregistered, m_not_oper, rfc1459_command_send_error, m_ignore, mo_undline, m_ignore}
315 + };
316 +
317 + static void
318 + module_init(void)
319 + {
320 +  mod_add_cmd(&dline_msgtab);
321 +  mod_add_cmd(&undline_msgtab);
322 + }
323 +
324 + static void
325 + module_exit(void)
326 + {
327 +  mod_del_cmd(&dline_msgtab);
328 +  mod_del_cmd(&undline_msgtab);
329 + }
330 +
331 + struct module module_entry = {
332 +  .node    = { NULL, NULL, NULL },
333 +  .name    = NULL,
334 +  .version = "$Revision$",
335 +  .handle  = NULL,
336 +  .modinit = module_init,
337 +  .modexit = module_exit,
338 +  .flags   = 0
339 + };

Diff Legend

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