]> jfr.im git - irc/charybdis-ircd/charybdis.git/commitdiff
Add oper:testline
authorEd Kellett <redacted>
Sun, 7 Jul 2019 22:15:43 +0000 (23:15 +0100)
committerEd Kellett <redacted>
Tue, 4 Aug 2020 21:58:30 +0000 (22:58 +0100)
doc/ircd.conf.example
doc/reference.conf
modules/m_testline.c

index 705a0d6dccc6f928048dca2a5dc8c099b215e4bf..45f45367e6eb68e173514341bdf2eef4b4dde5e4 100644 (file)
@@ -236,7 +236,7 @@ auth {
  * means they must be defined before operator {}.
  */
 privset "local_op" {
-       privs = oper:general, auspex:oper, oper:privs, oper:local_kill, oper:operwall;
+       privs = oper:general, auspex:oper, oper:privs, oper:testline, oper:local_kill, oper:operwall;
 };
 
 privset "server_bot" {
index 6a268613cbbc99798325aa211d6fc5dcb9d7280f..946732d8eaa305a8d4b4c55c3aa80d22a409d55d 100644 (file)
@@ -434,6 +434,7 @@ privset "local_op" {
         *                       with +o in older releases
         * auspex:oper:       allows the oper to see through oper hiding
         * oper:privs:      allows /stats o/O and seeing privset in /whois
+        * oper:testline:        allows /testline and /testgecos
         * oper:local_kill:      allows local users to be /KILL'd
         * oper:global_kill:     allows local and remote users to be /KILL'd
         * oper:routing:         allows remote SQUIT and CONNECT
@@ -459,7 +460,7 @@ privset "local_op" {
         * oper:mass_notice:     allows sending wallops and mass notices
         * oper:grant:           allows using the GRANT command
         */
-       privs = oper:general, auspex:oper, oper:privs, oper:local_kill, oper:operwall;
+       privs = oper:general, auspex:oper, oper:privs, oper:testline, oper:local_kill, oper:operwall;
 };
 
 privset "server_bot" {
index 7aa27a8862e0ed0ccaa7fc2c5c4a751f847c00a5..1f78d5d4a0003d40c4f3a91744cc2ff0a4fe0d65 100644 (file)
@@ -75,6 +75,13 @@ mo_testline(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *sou
        char *puser, *phost, *reason, *operreason;
        char reasonbuf[BUFSIZE];
 
+       if (!HasPrivilege(source_p, "oper:testline"))
+       {
+               sendto_one(source_p, form_str(ERR_NOPRIVS),
+                          me.name, source_p->name, "testline");
+               return;
+       }
+
        mask = LOCAL_COPY(parv[1]);
 
        if (IsChannelName(mask))
@@ -231,6 +238,13 @@ mo_testgecos(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *so
 {
        struct ConfItem *aconf;
 
+       if (!HasPrivilege(source_p, "oper:testline"))
+       {
+               sendto_one(source_p, form_str(ERR_NOPRIVS),
+                          me.name, source_p->name, "testline");
+               return;
+       }
+
        if(!(aconf = find_xline(parv[1], 0)))
        {
                sendto_one(source_p, form_str(RPL_NOTESTLINE),