| 40 |
|
#include "parse.h" |
| 41 |
|
#include "modules.h" |
| 42 |
|
#include "s_conf.h" |
| 43 |
– |
#include "irc_getnameinfo.h" |
| 43 |
|
|
| 44 |
|
static void m_trace(struct Client *, struct Client *, int, char *[]); |
| 45 |
|
static void ms_trace(struct Client *, struct Client *, int, char *[]); |
| 233 |
|
{ |
| 234 |
|
const char *name; |
| 235 |
|
const char *class_name; |
| 237 |
– |
char ipaddr[HOSTIPLEN]; |
| 236 |
|
|
| 237 |
|
target_p = find_client(tname); |
| 238 |
|
|
| 239 |
|
if (target_p && IsClient(target_p)) |
| 240 |
|
{ |
| 241 |
|
name = get_client_name(target_p, HIDE_IP); |
| 244 |
– |
/* should we not use sockhost here? - stu */ |
| 245 |
– |
irc_getnameinfo((struct sockaddr*)&target_p->localClient->ip, |
| 246 |
– |
target_p->localClient->ip.ss_len, ipaddr, HOSTIPLEN, NULL, 0, |
| 247 |
– |
NI_NUMERICHOST); |
| 248 |
– |
|
| 242 |
|
class_name = get_client_class(target_p); |
| 243 |
|
|
| 244 |
|
if (IsOper(target_p)) |
| 245 |
|
{ |
| 246 |
|
sendto_one(source_p, form_str(RPL_TRACEOPERATOR), |
| 247 |
|
from, to, class_name, name, |
| 248 |
< |
IsIPSpoof(target_p) ? "255.255.255.255" : ipaddr, |
| 248 |
> |
IsIPSpoof(target_p) ? "255.255.255.255" : target_p->sockhost, |
| 249 |
|
CurrentTime - target_p->lasttime, |
| 250 |
|
CurrentTime - target_p->localClient->last); |
| 251 |
|
} |
| 253 |
|
{ |
| 254 |
|
sendto_one(source_p,form_str(RPL_TRACEUSER), |
| 255 |
|
from, to, class_name, name, |
| 256 |
< |
IsIPSpoof(target_p) ? "255.255.255.255" : ipaddr, |
| 256 |
> |
IsIPSpoof(target_p) ? "255.255.255.255" : target_p->sockhost, |
| 257 |
|
CurrentTime - target_p->lasttime, |
| 258 |
|
CurrentTime - target_p->localClient->last); |
| 259 |
|
} |
| 348 |
|
const char *name; |
| 349 |
|
const char *class_name; |
| 350 |
|
const char *from, *to; |
| 358 |
– |
char ip[HOSTIPLEN]; |
| 351 |
|
|
| 352 |
|
if (!MyConnect(source_p) && IsCapable(source_p->from, CAP_TS6) && HasID(source_p)) |
| 353 |
|
{ |
| 360 |
|
to = source_p->name; |
| 361 |
|
} |
| 362 |
|
|
| 371 |
– |
/* Should this be sockhost? - stu */ |
| 372 |
– |
irc_getnameinfo((struct sockaddr*)&target_p->localClient->ip, |
| 373 |
– |
target_p->localClient->ip.ss_len, ip, HOSTIPLEN, NULL, 0, |
| 374 |
– |
NI_NUMERICHOST); |
| 363 |
|
name = get_client_name(target_p, HIDE_IP); |
| 364 |
|
class_name = get_client_class(target_p); |
| 365 |
|
|
| 382 |
|
case STAT_UNKNOWN: |
| 383 |
|
/* added time -Taner */ |
| 384 |
|
sendto_one(source_p, form_str(RPL_TRACEUNKNOWN), |
| 385 |
< |
from, to, class_name, name, ip, |
| 385 |
> |
from, to, class_name, name, target_p->sockhost, |
| 386 |
|
target_p->firsttime ? CurrentTime - target_p->firsttime : -1); |
| 387 |
|
break; |
| 388 |
|
case STAT_CLIENT: |
| 389 |
< |
/* Only opers see users if there is a wildcard |
| 389 |
> |
/* |
| 390 |
> |
* Only opers see users if there is a wildcard |
| 391 |
|
* but anyone can see all the opers. |
| 392 |
|
*/ |
| 393 |
|
if ((IsOper(source_p) && |
| 397 |
|
if (IsAdmin(target_p) && !ConfigFileEntry.hide_spoof_ips) |
| 398 |
|
sendto_one(source_p, form_str(RPL_TRACEOPERATOR), |
| 399 |
|
from, to, class_name, name, |
| 400 |
< |
IsOperAdmin(source_p) ? ip : "255.255.255.255", |
| 400 |
> |
IsOperAdmin(source_p) ? target_p->sockhost : "255.255.255.255", |
| 401 |
|
CurrentTime - target_p->lasttime, |
| 402 |
|
CurrentTime - target_p->localClient->last); |
| 403 |
|
|
| 406 |
|
if (ConfigFileEntry.hide_spoof_ips) |
| 407 |
|
sendto_one(source_p, form_str(RPL_TRACEOPERATOR), |
| 408 |
|
from, to, class_name, name, |
| 409 |
< |
IsIPSpoof(target_p) ? "255.255.255.255" : ip, |
| 409 |
> |
IsIPSpoof(target_p) ? "255.255.255.255" : target_p->sockhost, |
| 410 |
|
CurrentTime - target_p->lasttime, |
| 411 |
|
CurrentTime - target_p->localClient->last); |
| 412 |
|
else |
| 413 |
|
sendto_one(source_p, form_str(RPL_TRACEOPERATOR), |
| 414 |
|
from, to, class_name, name, |
| 415 |
< |
MyOper(source_p) ? ip : |
| 416 |
< |
(IsIPSpoof(target_p) ? "255.255.255.255" : ip), |
| 415 |
> |
MyOper(source_p) ? target_p->sockhost : |
| 416 |
> |
(IsIPSpoof(target_p) ? "255.255.255.255" : target_p->sockhost), |
| 417 |
|
CurrentTime - target_p->lasttime, |
| 418 |
|
CurrentTime - target_p->localClient->last); |
| 419 |
|
} |
| 428 |
|
if (ConfigFileEntry.hide_spoof_ips) |
| 429 |
|
sendto_one(source_p, format_str, |
| 430 |
|
from, to, class_name, name, |
| 431 |
< |
IsIPSpoof(target_p) ? "255.255.255.255" : ip, |
| 431 |
> |
IsIPSpoof(target_p) ? "255.255.255.255" : target_p->sockhost, |
| 432 |
|
CurrentTime - target_p->lasttime, |
| 433 |
|
CurrentTime - target_p->localClient->last); |
| 434 |
|
else |
| 435 |
|
sendto_one(source_p, format_str, |
| 436 |
|
from, to, class_name, name, |
| 437 |
< |
MyOper(source_p) ? ip : |
| 438 |
< |
(IsIPSpoof(target_p) ? "255.255.255.255" : ip), |
| 437 |
> |
MyOper(source_p) ? target_p->sockhost : |
| 438 |
> |
(IsIPSpoof(target_p) ? "255.255.255.255" : target_p->sockhost), |
| 439 |
|
CurrentTime - target_p->lasttime, |
| 440 |
|
CurrentTime - target_p->localClient->last); |
| 441 |
|
} |