| 73 |
|
char buf[IRCD_BUFSIZE]; |
| 74 |
|
char response[NICKLEN*2+USERLEN+HOSTLEN+30]; |
| 75 |
|
char *t; |
| 76 |
< |
int i, n; /* loop counter */ |
| 76 |
> |
int i; /* loop counter */ |
| 77 |
|
int cur_len; |
| 78 |
|
int rl; |
| 79 |
|
|
| 82 |
|
|
| 83 |
|
for (i = 0; i < 5; i++) |
| 84 |
|
{ |
| 85 |
< |
if (parv[i+1] == NULL) |
| 85 |
> |
if (parv[i + 1] == NULL) |
| 86 |
|
break; |
| 87 |
|
|
| 88 |
|
if ((target_p = find_person(client_p, parv[i+1])) != NULL) |
| 89 |
|
{ |
| 90 |
< |
/* |
| 91 |
< |
* Show real IP for USERHOST on yourself. |
| 92 |
< |
* This is needed for things like mIRC, which do a server-based |
| 93 |
< |
* lookup (USERHOST) to figure out what the clients' local IP |
| 94 |
< |
* is. Useful for things like NAT, and dynamic dial-up users. |
| 95 |
< |
*/ |
| 96 |
< |
/* |
| 97 |
< |
* If a lazyleaf relayed us this request, we don't know |
| 98 |
< |
* the clients real IP. |
| 99 |
< |
* So, if you're on a lazyleaf, and you send a userhost |
| 100 |
< |
* including your nick and the nick of someone not known to |
| 101 |
< |
* the leaf, you'll get your spoofed IP. tough. |
| 102 |
< |
*/ |
| 103 |
< |
if (MyClient(target_p) && (target_p == source_p)) |
| 104 |
< |
{ |
| 105 |
< |
rl = ircsprintf(response, "%s%s=%c%s@%s ", |
| 106 |
< |
target_p->name, |
| 107 |
< |
IsOper(target_p) ? "*" : "", |
| 108 |
< |
(target_p->away) ? '-' : '+', |
| 109 |
< |
target_p->username, |
| 110 |
< |
target_p->sockhost); |
| 111 |
< |
} |
| 112 |
< |
else |
| 113 |
< |
{ |
| 114 |
< |
rl = ircsprintf(response, "%s%s=%c%s@%s ", |
| 115 |
< |
target_p->name, |
| 116 |
< |
IsOper(target_p) ? "*" : "", |
| 117 |
< |
(target_p->away) ? '-' : '+', |
| 118 |
< |
target_p->username, |
| 119 |
< |
target_p->host); |
| 120 |
< |
} |
| 90 |
> |
/* |
| 91 |
> |
* Show real IP for USERHOST on yourself. |
| 92 |
> |
* This is needed for things like mIRC, which do a server-based |
| 93 |
> |
* lookup (USERHOST) to figure out what the clients' local IP |
| 94 |
> |
* is. Useful for things like NAT, and dynamic dial-up users. |
| 95 |
> |
*/ |
| 96 |
> |
if (MyClient(target_p) && (target_p == source_p)) |
| 97 |
> |
{ |
| 98 |
> |
rl = ircsprintf(response, "%s%s=%c%s@%s ", |
| 99 |
> |
target_p->name, |
| 100 |
> |
IsOper(target_p) ? "*" : "", |
| 101 |
> |
(target_p->away) ? '-' : '+', |
| 102 |
> |
target_p->username, |
| 103 |
> |
target_p->sockhost); |
| 104 |
> |
} |
| 105 |
> |
else |
| 106 |
> |
{ |
| 107 |
> |
rl = ircsprintf(response, "%s%s=%c%s@%s ", |
| 108 |
> |
target_p->name, |
| 109 |
> |
IsOper(target_p) ? "*" : "", |
| 110 |
> |
(target_p->away) ? '-' : '+', |
| 111 |
> |
target_p->username, |
| 112 |
> |
target_p->host); |
| 113 |
> |
} |
| 114 |
|
|
| 115 |
< |
if ((rl + cur_len) < (IRCD_BUFSIZE-10)) |
| 116 |
< |
{ |
| 117 |
< |
ircsprintf(t,"%s",response); |
| 118 |
< |
t += rl; |
| 119 |
< |
cur_len += rl; |
| 120 |
< |
} |
| 121 |
< |
else |
| 122 |
< |
break; |
| 130 |
< |
} |
| 131 |
< |
else if ( !ServerInfo.hub && uplink && IsCapable(uplink, CAP_LL) ) |
| 132 |
< |
{ |
| 133 |
< |
t = buf; |
| 134 |
< |
for( n = 0; n < 5; n++ ) |
| 135 |
< |
{ |
| 136 |
< |
if( parv[n+1] ) |
| 137 |
< |
{ |
| 138 |
< |
rl = ircsprintf(t, "%s ", parv[n+1]); |
| 139 |
< |
t += rl; |
| 140 |
< |
} |
| 141 |
< |
else |
| 142 |
< |
break; |
| 143 |
< |
} |
| 144 |
< |
/* Relay upstream, and let hub reply */ |
| 145 |
< |
sendto_one(uplink, ":%s USERHOST %s", parv[0], buf ); |
| 146 |
< |
return; |
| 147 |
< |
} |
| 115 |
> |
if ((rl + cur_len) < (IRCD_BUFSIZE - 10)) |
| 116 |
> |
{ |
| 117 |
> |
ircsprintf(t, "%s", response); |
| 118 |
> |
t += rl; |
| 119 |
> |
cur_len += rl; |
| 120 |
> |
} |
| 121 |
> |
else |
| 122 |
> |
break; |
| 123 |
|
} |
| 124 |
+ |
} |
| 125 |
|
|
| 126 |
|
sendto_one(source_p, "%s", buf); |
| 127 |
|
} |