| 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 |
| 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 |
|
/* |
| 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 |
|
|
| 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() |
| 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 |
| 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 |
|
}; |