]> jfr.im git - irc/freenode/solanum.git/commitdiff
Enable remote WHOWAS queries.
authorJilles Tjoelker <redacted>
Fri, 13 Sep 2013 20:29:26 +0000 (22:29 +0200)
committerJilles Tjoelker <redacted>
Fri, 13 Sep 2013 20:29:26 +0000 (22:29 +0200)
On ircd-seven, this will allow remote opers to see certain hidden IPs.

doc/technical/ts6-protocol.txt
help/opers/whowas
modules/m_whowas.c

index 8c90e182c30f501052ee87e8ec6efdce8e4a0890..df253420c63fcc2125472aa17687af8b092ccf5b 100644 (file)
@@ -1058,6 +1058,15 @@ parameters: hunted, target nick
 
 Remote WHOIS request.
 
+WHOWAS
+source: user
+parameters: nickname, limit, hunted
+
+Remote WHOWAS request. Not implemented in all servers.
+
+Different from a local WHOWAS request, the limit is mandatory and servers should
+apply a maximum to it.
+
 XLINE
 1.
 encap only
index 0f3023c04f292af8a370710b7e57ed4ad1b96fc7..b277942fa54aa342a84fdf24a89416435025b464 100644 (file)
@@ -1,4 +1,4 @@
-WHOWAS <nick> [limit]
+WHOWAS <nick> [limit] [server|nick]
 
 WHOWAS will show you the last known host and whois
 information for the specified nick.  Depending on the
@@ -8,4 +8,6 @@ may be more than one listing for a specific user.
 If a limit is specified, WHOWAS will not show more
 than that many listings.
 
+The third parameter allows querying another server.
+
 The WHOWAS data will expire after time.
index eb32ede286908426cdfdd5a26bb785c8c9b1b68b..c0f10b66a708801a099fe49322868bc2013fb33c 100644 (file)
@@ -45,7 +45,7 @@ static int m_whowas(struct Client *, struct Client *, int, const char **);
 
 struct Message whowas_msgtab = {
        "WHOWAS", 0, 0, 0, MFLG_SLOW,
-       {mg_unreg, {m_whowas, 2}, mg_ignore, mg_ignore, mg_ignore, {m_whowas, 2}}
+       {mg_unreg, {m_whowas, 2}, {m_whowas, 4}, mg_ignore, mg_ignore, {m_whowas, 2}}
 };
 
 mapi_clist_av1 whowas_clist[] = { &whowas_msgtab, NULL };
@@ -68,9 +68,11 @@ m_whowas(struct Client *client_p, struct Client *source_p, int parc, const char
 
        static time_t last_used = 0L;
 
-       if(!IsOper(source_p))
+       if(MyClient(source_p) && !IsOper(source_p))
        {
-               if((last_used + ConfigFileEntry.pace_wait_simple) > rb_current_time())
+               if(last_used + (parc > 3 ? ConfigFileEntry.pace_wait :
+                                               ConfigFileEntry.pace_wait_simple
+                               ) > rb_current_time())
                {
                        sendto_one(source_p, form_str(RPL_LOAD2HI),
                                   me.name, source_p->name, "WHOWAS");
@@ -86,11 +88,12 @@ m_whowas(struct Client *client_p, struct Client *source_p, int parc, const char
        if(parc > 2)
                max = atoi(parv[2]);
 
-#if 0
        if(parc > 3)
                if(hunt_server(client_p, source_p, ":%s WHOWAS %s %s :%s", 3, parc, parv))
                        return 0;
-#endif
+
+       if(!MyClient(source_p) && (max <= 0 || max > 20))
+               max = 20;
 
        if((p = strchr(parv[1], ',')))
                *p = '\0';