From 8a6cbfaaf06b5921e7ab0fb280f83954bd2518d8 Mon Sep 17 00:00:00 2001 From: Bram Matthys Date: Thu, 2 May 2019 09:30:15 +0200 Subject: [PATCH] Show linking error messages if these happen during the handshake and we have already fully authenticated the server (but when it technically is not fully linked as a server yet, eg post-EAUTH but pre-SERVER). Also, send ERRORs to junk snomask from untrusted sources. After all, the junk snomask is precisely there to enable briefly to debug issues. In case of link errors we always advice to check BOTH sides of the link as an IRCOp, and this advice still stands. This may just help a little for people who do not follow our advice. --- src/s_serv.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/s_serv.c b/src/s_serv.c index 1121ec042..8f3a73e8d 100644 --- a/src/s_serv.c +++ b/src/s_serv.c @@ -503,17 +503,22 @@ CMD_FUNC(m_error) Debug((DEBUG_ERROR, "Received ERROR message from %s: %s", sptr->name, para)); - /* - ** Ignore error messages generated by normal user clients - ** (because ill-behaving user clients would flood opers - ** screen otherwise). Pass ERROR's from other sources to - ** the local operator... + + /* Errors from untrusted sources only go to the junk snomask + * (which is only for debugging issues and such). + * This to prevent flooding and confusing IRCOps by + * malicious users. */ - if (IsPerson(cptr) || IsUnknown(cptr)) + if (!IsServer(cptr) && !cptr->serv) + { + sendto_snomask(SNO_JUNK, "ERROR from %s -- %s", + get_client_name(cptr, FALSE), para); return 0; + } + if (cptr == sptr) { - sendto_umode_global(UMODE_OPER, "ERROR :from %s -- %s", + sendto_umode_global(UMODE_OPER, "ERROR from %s -- %s", get_client_name(cptr, FALSE), para); } else