s_user: enhancements to proxy reporting messages

This commit is contained in:
Elizabeth Myers 2016-04-10 09:35:02 -05:00
parent ce58d2dc61
commit 2a104d6641

View file

@ -468,33 +468,52 @@ register_local_user(struct Client *client_p, struct Client *source_p)
} }
break; break;
case 'O': /* OPM */ case 'O': /* OPM */
if(IsExemptKline(source_p) || IsConfExemptProxy(aconf))
{ {
sendto_one_notice(source_p, ":*** Your IP address %s has been detected as an open proxy (ip:port %s), but you are exempt", char *proxy = source_p->preClient->auth.data;
source_p->sockhost, source_p->preClient->auth.data); char *port = strrchr(proxy, ':');
}
else if(port == NULL)
{ {
sendto_realops_snomask(SNO_REJ, L_NETWIDE, ierror("authd sent us a malformed OPM string");
"Open proxy %s: %s (%s@%s) [%s] [%s]", sendto_realops_snomask(SNO_GENERAL, L_ALL,
source_p->preClient->auth.data, "authd sent us a malformed OPM string: %s", proxy);
source_p->name, break;
source_p->username, source_p->host, }
IsIPSpoof(source_p) ? "255.255.255.255" : source_p->sockhost,
source_p->info); /* Terminate the proxy type */
*(port++) = '\0';
ServerStats.is_ref++;
if(IsExemptKline(source_p) || IsConfExemptProxy(aconf))
sendto_one(source_p, form_str(ERR_YOUREBANNEDCREEP), {
me.name, source_p->name, reason); sendto_one_notice(source_p,
":*** Your IP address %s has been detected as an open proxy (type %s, port %s), but you are exempt",
sendto_one_notice(source_p, ":*** Your IP address %s has been detected as an open proxy (ip:port %s)", source_p->sockhost, proxy, port);
source_p->sockhost, source_p->preClient->auth.data); }
add_reject(source_p, NULL, NULL); else
exit_client(client_p, source_p, &me, "*** Banned (Open proxy)"); {
substitution_free(&varlist); sendto_realops_snomask(SNO_REJ, L_NETWIDE,
return CLIENT_EXITED; "Open proxy %s/%s: %s (%s@%s) [%s] [%s]",
proxy, port,
source_p->name,
source_p->username, source_p->host,
IsIPSpoof(source_p) ? "255.255.255.255" : source_p->sockhost,
source_p->info);
ServerStats.is_ref++;
sendto_one(source_p, form_str(ERR_YOUREBANNEDCREEP),
me.name, source_p->name, reason);
sendto_one_notice(source_p,
":*** Your IP address %s has been detected as an open proxy (type %s, port %s)",
source_p->sockhost, proxy, port);
add_reject(source_p, NULL, NULL);
exit_client(client_p, source_p, &me, "*** Banned (Open proxy)");
substitution_free(&varlist);
return CLIENT_EXITED;
}
} }
break;
default: /* Unknown, but handle the case properly */ default: /* Unknown, but handle the case properly */
if (IsExemptKline(source_p)) if (IsExemptKline(source_p))
{ {