0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-16 15:00:51 +01:00

Enable remote WHOWAS queries.

On ircd-seven, this will allow remote opers to see certain hidden IPs.
This commit is contained in:
Jilles Tjoelker 2013-09-13 22:29:26 +02:00
parent 7fc09bc4f0
commit 7a9a9000b7
3 changed files with 20 additions and 6 deletions

View file

@ -1058,6 +1058,15 @@ parameters: hunted, target nick
Remote WHOIS request. 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 XLINE
1. 1.
encap only encap only

View file

@ -1,4 +1,4 @@
WHOWAS <nick> [limit] WHOWAS <nick> [limit] [server|nick]
WHOWAS will show you the last known host and whois WHOWAS will show you the last known host and whois
information for the specified nick. Depending on the 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 If a limit is specified, WHOWAS will not show more
than that many listings. than that many listings.
The third parameter allows querying another server.
The WHOWAS data will expire after time. The WHOWAS data will expire after time.

View file

@ -45,7 +45,7 @@ static int m_whowas(struct Client *, struct Client *, int, const char **);
struct Message whowas_msgtab = { struct Message whowas_msgtab = {
"WHOWAS", 0, 0, 0, MFLG_SLOW, "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 }; 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; 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), sendto_one(source_p, form_str(RPL_LOAD2HI),
me.name, source_p->name, "WHOWAS"); 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) if(parc > 2)
max = atoi(parv[2]); max = atoi(parv[2]);
#if 0
if(parc > 3) if(parc > 3)
if(hunt_server(client_p, source_p, ":%s WHOWAS %s %s :%s", 3, parc, parv)) if(hunt_server(client_p, source_p, ":%s WHOWAS %s %s :%s", 3, parc, parv))
return 0; return 0;
#endif
if(!MyClient(source_p) && (max <= 0 || max > 20))
max = 20;
if((p = strchr(parv[1], ','))) if((p = strchr(parv[1], ',')))
*p = '\0'; *p = '\0';