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 4815 by michael, Sat Nov 1 15:28:42 2014 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-2014 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 51 | Line 51 | report_this_status(struct Client *source
51    if (target_p->status != STAT_CLIENT)
52      return;
53  
54 <  if (ConfigGeneral.hide_spoof_ips)
55 <    sendto_one_numeric(source_p, &me, RPL_ETRACE,
56 <                       HasUMode(target_p, UMODE_OPER) ? "Oper" : "User",
57 <                       get_client_class(&target_p->connection->confs),
58 <                       target_p->name,
59 <                       target_p->username,
60 <                       target_p->host,
61 <                       IsIPSpoof(target_p) ? "255.255.255.255" : target_p->sockhost,
62 <                       target_p->info);
63 <  else
64 <    sendto_one_numeric(source_p, &me, RPL_ETRACE,
65 <                       HasUMode(target_p, UMODE_OPER) ? "Oper" : "User",
66 <                       get_client_class(&target_p->connection->confs),
67 <                       target_p->name,
68 <                       target_p->username,
69 <                       target_p->host,
70 <                       target_p->sockhost,
71 <                       target_p->info);
54 >  sendto_one_numeric(source_p, &me, RPL_ETRACE,
55 >                     HasUMode(target_p, UMODE_OPER) ? "Oper" : "User",
56 >                     get_client_class(&target_p->connection->confs),
57 >                     target_p->name,
58 >                     target_p->username,
59 >                     target_p->host,
60 >                     target_p->sockhost,
61 >                     target_p->info);
62   }
63  
64   /*
# Line 79 | 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)
91    {
92 <    const struct Client *target_p = hash_find_client(tname);
92 >    const struct Client *target_p = find_person(source_p, tname);
93  
94 <    if (target_p && MyClient(target_p))
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 112 | Line 102 | do_etrace(struct Client *source_p, const
102    {
103      const struct Client *target_p = node->data;
104  
105 <    if (wilds)
116 <    {
117 <      if (!match(tname, target_p->name))
118 <        report_this_status(source_p, target_p);
119 <    }
120 <    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 137 | 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
# Line 155 | Line 145 | module_exit(void)
145  
146   struct module module_entry =
147   {
158  .node    = { NULL, NULL, NULL },
159  .name    = NULL,
148    .version = "$Revision$",
161  .handle  = NULL,
149    .modinit = module_init,
150    .modexit = module_exit,
164  .flags   = 0
151   };

Diff Legend

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