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

Comparing ircd-hybrid/trunk/modules/m_etrace.c (file contents):
Revision 5864 by michael, Tue Apr 28 12:23:30 2015 UTC vs.
Revision 7910 by michael, Sun Nov 27 16:59:35 2016 UTC

# Line 1 | Line 1
1   /*
2   *  ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd)
3   *
4 < *  Copyright (c) 2004-2015 ircd-hybrid development team
4 > *  Copyright (c) 2004-2016 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 69 | Line 69 | do_etrace(struct Client *source_p, const
69   {
70    const char *tname = NULL;
71    unsigned int wilds = 0, do_all = 0;
72 <  const dlink_node *node = NULL;
72 >  dlink_node *node;
73  
74    sendto_realops_flags(UMODE_SPY, L_ALL, SEND_NOTICE,
75                         "ETRACE requested by %s (%s@%s) [%s]",
76                         source_p->name, source_p->username,
77                         source_p->host, source_p->servptr->name);
78  
79 <  if (!EmptyString(arg))
79 >  if (EmptyString(arg))
80    {
81 <    tname = arg;
82 <    wilds = has_wildcards(tname);
81 >    do_all = 1;
82 >    tname = "*";
83    }
84    else
85    {
86 <    do_all = 1;
87 <    tname = "*";
86 >    tname = arg;
87 >    wilds = has_wildcards(tname);
88    }
89  
90    if (!wilds && !do_all)
# Line 94 | Line 94 | do_etrace(struct Client *source_p, const
94      if (target_p && MyConnect(target_p))
95        report_this_status(source_p, target_p);
96  
97 <    sendto_one_numeric(source_p, &me, RPL_ENDOFTRACE, tname);
97 >    sendto_one_numeric(source_p, &me, RPL_TRACEEND, tname);
98      return;
99    }
100  
# Line 102 | Line 102 | do_etrace(struct Client *source_p, const
102    {
103      const struct Client *target_p = node->data;
104  
105 <    if (wilds)
106 <    {
107 <      if (!match(tname, target_p->name))
108 <        report_this_status(source_p, target_p);
109 <    }
110 <    else
105 >    if (!wilds || !match(tname, target_p->name))
106        report_this_status(source_p, target_p);
107    }
108  
109 <  sendto_one_numeric(source_p, &me, RPL_ENDOFTRACE, tname);
109 >  sendto_one_numeric(source_p, &me, RPL_TRACEEND, tname);
110   }
111  
112   /* mo_etrace()
# Line 127 | Line 122 | mo_etrace(struct Client *source_p, int p
122  
123   static struct Message etrace_msgtab =
124   {
125 <  "ETRACE", NULL, 0, 0, 0, MAXPARA, MFLG_SLOW, 0,
126 <  { m_unregistered, m_not_oper, m_ignore, m_ignore, mo_etrace, m_ignore }
125 >  .cmd = "ETRACE",
126 >  .args_max = MAXPARA,
127 >  .handlers[UNREGISTERED_HANDLER] = m_unregistered,
128 >  .handlers[CLIENT_HANDLER] = m_not_oper,
129 >  .handlers[SERVER_HANDLER] = m_ignore,
130 >  .handlers[ENCAP_HANDLER] = m_ignore,
131 >  .handlers[OPER_HANDLER] = mo_etrace
132   };
133  
134   static void

Diff Legend

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