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

Comparing:
ircd-hybrid/modules/m_whois.c (file contents), Revision 30 by adx, Sun Oct 2 20:03:27 2005 UTC vs.
ircd-hybrid-7.2/modules/m_whois.c (file contents), Revision 1011 by michael, Fri Sep 18 10:14:09 2009 UTC

# Line 19 | Line 19
19   *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
20   *  USA
21   *
22 < *  $Id: m_whois.c,v 1.145 2005/09/27 12:43:33 adx Exp $
22 > *  $Id$
23   */
24  
25   #include "stdinc.h"
26 < #include "fdlist.h"
27 < #include "tools.h"
26 > #include "list.h"
27   #include "common.h"  
28   #include "handlers.h"
29   #include "client.h"
# Line 37 | Line 36
36   #include "s_misc.h"
37   #include "s_serv.h"
38   #include "send.h"
40 #include "list.h"
39   #include "irc_string.h"
40   #include "sprintf_irc.h"
41   #include "msg.h"
# Line 59 | Line 57 | struct Message whois_msgtab = {
57   };
58  
59   #ifndef STATIC_MODULES
60 < const char *_version = "$Revision: 1.145 $";
60 > const char *_version = "$Revision$";
61   static struct Callback *whois_cb;
62  
63   static void *
# Line 106 | Line 104 | m_whois(struct Client *client_p, struct
104      return;
105    }
106  
107 <  if (parc > 2)
107 >  if (parc > 2 && !EmptyString(parv[2]))
108    {
109      /* seeing as this is going across servers, we should limit it */
110      if ((last_used + ConfigFileEntry.pace_wait_simple) > CurrentTime)
# Line 155 | Line 153 | mo_whois(struct Client *client_p, struct
153      return;
154    }
155  
156 <  if (parc > 2)
156 >  if (parc > 2 && !EmptyString(parv[2]))
157    {
158      if (hunt_server(client_p, source_p, ":%s WHOIS %s :%s", 1,
159                      parc, parv) != HUNTED_ISME)
# Line 182 | Line 180 | mo_whois(struct Client *client_p, struct
180   static void
181   do_whois(struct Client *source_p, int parc, char **parv)
182   {
183 +  static time_t last_used = 0;
184    struct Client *target_p;
185    char *nick;
186    char *p = NULL;
# Line 202 | Line 201 | do_whois(struct Client *source_p, int pa
201    {
202      if ((target_p = find_client(nick)) != NULL)
203      {
205      if (IsServer(source_p->from))
206        client_burst_if_needed(source_p->from, target_p);
207
204        if (IsClient(target_p))
205        {
206 <        whois_person(source_p, target_p);
207 <        found = 1;
206 >        whois_person(source_p, target_p);
207 >        found = 1;
208        }
209      }
214    else if (!ServerInfo.hub && uplink && IsCapable(uplink, CAP_LL))
215    {
216      if (parc > 2)
217        sendto_one(uplink,":%s WHOIS %s :%s",
218                   source_p->name, nick, nick);
219      else
220        sendto_one(uplink,":%s WHOIS %s",
221                   source_p->name, nick);
222      return;
223    }
210    }
211    else /* wilds is true */
212    {
213 <    /* disallow wild card whois on lazylink leafs for now */
214 <    if (!ServerInfo.hub && uplink && IsCapable(uplink, CAP_LL))
215 <      return;
213 >    if (!IsOper(source_p))
214 >    {
215 >      if ((last_used + ConfigFileEntry.pace_wait_simple) > CurrentTime)
216 >      {
217 >        sendto_one(source_p, form_str(RPL_LOAD2HI),
218 >                   me.name, source_p->name);
219 >        return;
220 >      }
221 >      else
222 >        last_used = CurrentTime;
223 >  }
224  
225      /* Oh-oh wilds is true so have to do it the hard expensive way */
226      if (MyClient(source_p))
# Line 286 | Line 280 | global_whois(struct Client *source_p, co
280      found |= single_whois(source_p, target_p);
281    }
282  
283 <  return (found);
283 >  return found;
284   }
285  
286   /* single_whois()
# Line 402 | Line 396 | whois_person(struct Client *source_p, st
396                 me.name, source_p->name, target_p->name,
397                 target_p->away);
398  
399 +  if (IsSetCallerId(target_p) && !IsSoftCallerId(target_p))
400 +    sendto_one(source_p, form_str(RPL_TARGUMODEG),
401 +               me.name, source_p->name, target_p->name);
402 +
403    if (IsOper(target_p))
404      sendto_one(source_p, form_str((IsAdmin(target_p) &&
405                 !IsOperHiddenAdmin(target_p)) ? RPL_WHOISADMIN :
# Line 411 | Line 409 | whois_person(struct Client *source_p, st
409      sendto_one(source_p, form_str(RPL_ISCAPTURED),
410                 me.name, source_p->name, target_p->name);
411  
412 <  if (ConfigFileEntry.use_whois_actually && (target_p->sockhost[0] != '\0') &&
415 <      !(ConfigFileEntry.hide_spoof_ips && IsIPSpoof(target_p)) &&
416 <      !(target_p->sockhost[0] == '0' && target_p->sockhost[1] == '\0'))
412 >  if (ConfigFileEntry.use_whois_actually)
413    {
414 <    if (IsAdmin(source_p) || source_p == target_p)
415 <      sendto_one(source_p, form_str(RPL_WHOISACTUALLY),
416 <                 me.name, source_p->name, target_p->name, target_p->sockhost);
417 <    else
414 >    int show_ip = 0;
415 >
416 >    if ((target_p->sockhost[0] != '\0') && irccmp(target_p->sockhost, "0"))
417 >    {
418 >      if ((IsAdmin(source_p) || source_p == target_p))
419 >        show_ip = 1;
420 >      else if (IsIPSpoof(target_p))
421 >        show_ip = (IsOper(source_p) && !ConfigFileEntry.hide_spoof_ips);
422 >      else
423 >        show_ip = 1;
424 >
425        sendto_one(source_p, form_str(RPL_WHOISACTUALLY),
426                   me.name, source_p->name, target_p->name,
427 <                 IsIPSpoof(target_p) || IsOper(target_p) ?
428 <                 "255.255.255.255" : target_p->sockhost);
427 >                 show_ip ? target_p->sockhost : "255.255.255.255");
428 >    }
429    }
430  
431    if (MyConnect(target_p)) /* Can't do any of this if not local! db */

Comparing:
ircd-hybrid/modules/m_whois.c (property svn:keywords), Revision 30 by adx, Sun Oct 2 20:03:27 2005 UTC vs.
ircd-hybrid-7.2/modules/m_whois.c (property svn:keywords), Revision 1011 by michael, Fri Sep 18 10:14:09 2009 UTC

# Line 1 | Line 1
1 < "Id Revision"
1 > Id Revision

Diff Legend

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