#include "modules.h"
#include "hook.h"
#include "s_newconf.h"
-#include "ipv4_from_ipv6.h"
#include "ratelimit.h"
#include "s_assert.h"
int tlen;
hook_data_client hdata;
int extra_space = 0;
-#ifdef RB_IPV6
struct sockaddr_in ip4;
-#endif
if(target_p->user == NULL)
{
sendto_one_numeric(source_p, RPL_AWAY, form_str(RPL_AWAY),
target_p->name, target_p->user->away);
- if(IsOper(target_p) && (!ConfigFileEntry.hide_opers_in_whois || IsOper(source_p)))
+ if((!ConfigFileEntry.hide_opers_in_whois || IsOper(source_p)) && SeesOper(target_p, source_p))
{
sendto_one_numeric(source_p, RPL_WHOISOPERATOR, form_str(RPL_WHOISOPERATOR),
target_p->name,
GlobalSetOptions.operstring));
}
- if(MyClient(target_p) && !EmptyString(target_p->localClient->opername) && IsOper(source_p))
+ if(!EmptyString(target_p->user->opername) && IsOper(target_p) && IsOper(source_p))
{
char buf[512];
+ const char *privset = "(missing)";
+ if (target_p->user->privset != NULL)
+ privset = target_p->user->privset->name;
snprintf(buf, sizeof(buf), "is opered as %s, privset %s",
- target_p->localClient->opername, target_p->localClient->privset->name);
+ target_p->user->opername, privset);
sendto_one_numeric(source_p, RPL_WHOISSPECIAL, form_str(RPL_WHOISSPECIAL),
target_p->name, buf);
}
{
char cbuf[256] = "is using a secure connection";
- if (MyClient(target_p) && target_p->localClient->cipher_string != NULL)
+ if (MyClient(target_p) && target_p->localClient->cipher_string != NULL &&
+ (!ConfigFileEntry.tls_ciphers_oper_only || source_p == target_p || IsOper(source_p)))
rb_snprintf_append(cbuf, sizeof(cbuf), " [%s]", target_p->localClient->cipher_string);
sendto_one_numeric(source_p, RPL_WHOISSECURE, form_str(RPL_WHOISSECURE),
form_str(RPL_WHOISACTUALLY),
target_p->name, target_p->sockhost);
-#ifdef RB_IPV6
if (GET_SS_FAMILY(&target_p->localClient->ip) == AF_INET6 &&
(show_ip(source_p, target_p) ||
(source_p == target_p && !IsIPSpoof(target_p))) &&
- ipv4_from_ipv6((struct sockaddr_in6 *)&target_p->localClient->ip, &ip4))
+ rb_ipv4_from_ipv6((struct sockaddr_in6 *)&target_p->localClient->ip, &ip4))
{
rb_inet_ntop_sock((struct sockaddr *)&ip4,
buf, sizeof buf);
"%s :Underlying IPv4 is %s",
target_p->name, buf);
}
-#endif /* RB_IPV6 */
sendto_one_numeric(source_p, RPL_WHOISIDLE, form_str(RPL_WHOISIDLE),
target_p->name,