Page 1 of 1

Module textshun, mode +T & oper are not compatible (fix needed)

Posted: Wed May 17, 2017 8:54 am
by HeXiLeD
Setup details:

UnrealIrcd 4.0.12
Module textshun (m_textshun (Drop messages based on nick and body) [3RD])
Oper block:
oper hotshot {
class clients;
operclass netadmin-textshun;
mask { *@127.0.0.1; };
password "whatever";
require-modes z;
modes HIipqTtWwxcFfksq;
vhost oh.i.am.so.amazing;
swhois "because i am special ";
snomask cDFfkejvGnNqsSo;
maxlogins 1;
};
Set block

Code: Select all

        # https://www.unrealircd.org/docs/Set_block#set::modes-on-connect
        # For everyone connecting https://unrealircd.org/docs/User_modes
        set { modes-on-connect                "T"; };
Or if the client sets usermode +T on connection

Reproduction is easy.

Once logged in /oper nick pass and then /mode nick -T

Result is always:

Code: Select all

  
        User mode [-osHIqWT] by nick
        Server notice mask for nick: Server notice mask (+)
Problem:
Removing mode -T also deopers the oper when the oper is using operclass netadmin-textshun and such should not happen.
If the operblock only loads the normal operclass netadmin, the problem does not happen.

Re: Module textshun, mode +T & oper are not compatible (fix needed)

Posted: Thu May 18, 2017 11:39 am
by Gottem
Well, it's not due to m_textshun but because the operclass netadmin-textshun doesn't exist. I simply copypasted your snippets first and the same happened to me, then I created the operclass, rehashed and it worked properly. Weird that Unreal doesn't tell you that though, maybe I should whip up a module for that. =]

(I also added a note to the mod repo README regarding config blocks shown there)

EDIT:
The module I mentioned is finished. All further info is on that page.

I also reported 2 bugs (1 here and 2 there) that are relevant to this topic.

Re: Module textshun, mode +T & oper are not compatible (fix needed)

Posted: Wed May 31, 2017 11:08 pm
by HeXiLeD
A new problem...

Created and loaded:

Config block:

Code: Select all

operclass netadmin-textshun {
    parent netadmin;
    privileges {
        textshun;
    };
};
Loaded:
m_extwarn - $Id: v1.0 2017/05/18 Gottem$ (Enables additional configuration error checking) [3RD]

On rehash:

Code: Select all

error: A critical error occurred when registering ModData for m_textshun: No space available
error: Error loading m_textshun: Mod_Init returned -1
Configuration loaded without any problems.
Starting or restarting unrealircd also fails as it aborts the startup.

I also removed all other extra modules and tried to start the ircd and got:

Code: Select all


== UNREALIRCD CRASH REPORT ==

SYSTEM INFORMATION:
UnrealIRCd version: 4.0.12
          Compiler: 4.9.2
  Operating System: Linux PI3B-Testing_Unit 4.9.24-v7+ #993 SMP Wed Apr 26 18:01:23 BST 2017 armv7l
Using core file: /home/ircd/unrealircd/tmp/core
Crash date/time: Wed May 31 18:51:08 2017
 Crash secs ago: 243

START OF BACKTRACE
 [New LWP 3669]
 [Thread debugging using libthread_db enabled]
 Using host libthread_db library "/lib/arm-linux-gnueabihf/libthread_db.so.1".
 Core was generated by `/home/ircd/unrealircd/bin/unrealircd'.
 Program terminated with signal SIGABRT, Aborted.
 #0  0x76ae0f70 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
 56     ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
 #0  0x76ae0f70 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
 56     in ../nptl/sysdeps/unix/sysv/linux/raise.c
 
 51     in ../nptl/sysdeps/unix/sysv/linux/raise.c
 
 0x54c1d4a8 <our_mod_version>:  "UnrealIRCd-4.0.12/SSL/NOCHF"
 
 0x54ccc140 <backupbuf>:        ""
 
 #0  0x76ae0f70 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
 #1  0x76ae2324 in __GI_abort () at abort.c:89
 #2  0x7617dfcc in Mod_Init (modinfo=0x0) at certfp.c:50
 #3  0x54bb7c3c in Init_all_testing_modules () at modules.c:575
 #4  0x54bd60e8 in init_conf (rootconf=<optimized out>, rehash=0) at s_conf.c:1700
 #5  0x54ba3504 in main (argc=<optimized out>, argv=<optimized out>) at ircd.c:1331
 
 #0  0x76ae0f70 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
         _sys_result = <optimized out>
         pd = 0x76f18000
         pid = <optimized out>
         selftid = 3669
 #1  0x76ae2324 in __GI_abort () at abort.c:89
         save_stage = 2
         act = {__sigaction_handler = {sa_handler = 0x0, sa_sigaction = 0x0}, sa_mask = {__val = {1993510684, 1995551448, 3, 0, 0, 0, 1995599632, 1981275140, 0, 0, 0, 1981276768, 0, 1, 0, 0, 1981275372, 1981275140, 1981275468, 1, 1421846652, 3508578816, 1995543008, 0, 1981342696, 1435844172, 1435844144, 1995599632, 1, 1981275468, 1421846652, 1981275928}}, sa_flags = 1981202088, sa_restorer = 0x0}
         sigs = {__val = {32, 0 <repeats 31 times>}}
 #2  0x7617dfcc in Mod_Init (modinfo=0x0) at certfp.c:50
         mreq = {prev = 0x0, next = 0x0, name = 0x7617e260 "certfp", owner = 0x0, type = MODDATATYPE_CLIENT, slot = 0, unloaded = 0 '\000', free = 0x7617dcec <certfp_free>, serialize = 0x7617dc04 <certfp_serialize>, unserialize = 0x7617dd4c <certfp_unserialize>, sync = 1}
 #3  0x54bb7c3c in Init_all_testing_modules () at modules.c:575
         mi = 0x55953e30
         next = 0x55953a30
         ret = <optimized out>
         Mod_Init = <optimized out>
 #4  0x54bd60e8 in init_conf (rootconf=<optimized out>, rehash=0) at s_conf.c:1700
         old_pid_file = 0x0
 #5  0x54ba3504 in main (argc=<optimized out>, argv=<optimized out>) at ircd.c:1331
         uid = <optimized out>
         euid = <optimized out>
         gid = 1995599632
         egid = 1992232448
         portarg = <optimized out>
         corelim = {rlim_cur = 4294967295, rlim_max = 4294967295}
The rest I was not able to test. Something is crashing the ircd and only happens when I load this module last revision.

Re: Module textshun, mode +T & oper are not compatible (fix needed)

Posted: Thu Jun 01, 2017 10:31 am
by Gottem
Well, there was a bug that causes an IRCd crash when you unload a module using ModData. Syzop fixed it but I'm not sure if it made its way to a release yet.

As for the "no space available", there's a readme file about troubleshooting in my repo and a link to it in the sticky about 3rd party mods in this board. There's a section about that specific error you're getting. ;]