]> jfr.im git - irc/DALnet/bahamut.git/commitdiff
Don't accept OPER commands from servers
authorKobi Shmueli <redacted>
Mon, 22 Oct 2018 04:25:16 +0000 (07:25 +0300)
committerKobi Shmueli <redacted>
Wed, 24 Oct 2018 05:07:00 +0000 (08:07 +0300)
An OPER command should never be sent by a server, only by local clients.

src/s_user.c

index 026fd9d96faa48faf0097b70b833b0969bec4608..be18ff9b19f647a6ab52bc6971619dd8868ace5e 100644 (file)
@@ -2907,37 +2907,12 @@ int m_oper(aClient *cptr, aClient *sptr, int parc, char *parv[])
         return 0;
     }
 
-    /* if message arrived from server, trust it, and set to oper */
     /* an OPER message should never come from a server. complain */
 
-    if ((IsServer(cptr) || IsMe(cptr)) && !IsOper(sptr))
+    if (IsServer(cptr) || IsMe(cptr))
     {
         sendto_realops("Why is %s sending me an OPER? Contact Coders",
                         cptr->name);
-
-        /* sanity */
-        if (!IsPerson(sptr))
-            return 0;
-
-#ifdef DEFAULT_HELP_MODE
-        sptr->umode |= UMODE_o;
-        sptr->umode |= UMODE_h;
-        sendto_serv_butone(cptr, ":%s MODE %s :+oh", parv[0], parv[0]);
-#else
-        sptr->umode |= UMODE_o;
-        sendto_serv_butone(cptr, ":%s MODE %s :+o", parv[0], parv[0]);
-#endif
-#ifdef ALL_OPERS_HIDDEN
-        sptr->umode |= UMODE_I;
-        sendto_serv_butone(cptr, ":%s MODE %s :+I", parv[0], parv[0]);
-#endif
-#if defined(SPAMFILTER) && defined(DEFAULT_OPER_SPAMFILTER_DISABLED)
-        sptr->umode |= UMODE_P;
-        sendto_serv_butone(cptr, ":%s MODE %s :+P", parv[0], parv[0]);
-#endif
-        Count.oper++;
-        if (IsMe(cptr))
-            sendto_one(sptr, rpl_str(RPL_YOUREOPER), me.name, parv[0]);
         return 0;
     }
     else if (IsAnOper(sptr) && MyConnect(sptr))