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

Comparing ircd-hybrid-7.2/modules/m_trace.c (file contents):
Revision 890 by michael, Thu Nov 1 12:59:05 2007 UTC vs.
Revision 891 by michael, Thu Nov 1 13:44:50 2007 UTC

# Line 40 | Line 40
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 *[]);
# Line 234 | Line 233 | do_actual_trace(struct Client *source_p,
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        }
# Line 260 | Line 253 | do_actual_trace(struct Client *source_p,
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        }
# Line 355 | Line 348 | report_this_status(struct Client *source
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    {
# Line 368 | Line 360 | report_this_status(struct Client *source
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  
# Line 394 | Line 382 | report_this_status(struct Client *source
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) &&
# Line 408 | Line 397 | report_this_status(struct Client *source
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                        
# Line 417 | Line 406 | report_this_status(struct Client *source
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            }                    
# Line 439 | Line 428 | report_this_status(struct Client *source
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            }

Diff Legend

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