View Issue Details

IDProjectCategoryView StatusLast Update
0006122unrealircdpublic2023-03-18 13:37
Reporterwestor Assigned Tosyzop  
PrioritynormalSeverityminorReproducibilitysometimes
Status resolvedResolutionfixed 
Product Version6.0.4-rc1 
Fixed in Version6.0.7 
Summary0006122: @if module-loaded() @endif doesn't working sometimes when unloading a module
DescriptionHello,

It seems when you have @if module-loaded("module") @endif set under unrealircd.conf and you trying to unload a module after /REHASH ircd gives errors.

Example Errors (line 150 is the following configuration):

config.CONFIG_ERROR_GENERIC [error] /home/westor/unrealircd/conf/unrealircd.conf:150: unknown directive set::antirandom
config.CONFIG_ERROR_GENERIC [error] 1 errors encountered
config.CONFIG_ERROR_GENERIC [error] IRCd configuration failed to pass testing
config.CONFIG_NOT_LOADED [error] IRCd configuration failed to load

Example Configuration:

@if module-loaded("antirandom")
set {
    antirandom {
        threshold 5;

        ban-action zline;

        ban-time 5m;

        ban-reason "You look like a bot. Be sure to fill in your nick/ident/realname properly.";

        convert-to-lowercase yes;

        show-failedconnects yes;

        except {
            ip { 192.168.*; 127.*; }
        }
    }
}
@endif

- Thanks!
Steps To Reproduce1. Load antirandom module
2. Set the above configuration
3. Rehash
4. Unload antirandom
5. Rehash
6. Check that IRCd returns config errors
TagsNo tags attached.
3rd party modules

Activities

syzop

2022-06-01 08:53

administrator   ~0022546

Last edited: 2022-06-01 08:57

Ah ok, you could be right indeed. I will look at it post-6.0.4 release because the config code is generally quite complex and I don't want to accidentally break the entire release for a bug that is probably around for a few years with no reports until now.

syzop

2023-03-18 13:37

administrator   ~0022775

Thanks westor, fixed now.

https://github.com/unrealircd/unrealircd/commit/3329cbcf186402389b7223936ca3df711abada45

commit 3329cbcf186402389b7223936ca3df711abada45 (HEAD -> unreal60_dev, origin/unreal60_dev, origin/HEAD)
Author: Bram Matthys <[email protected]>
Date: Sat Mar 18 13:35:43 2023 +0100

    Fix @if module-loaded() for modules that are about to be unloaded during REHASH.
    Reported by westor in https://bugs.unrealircd.org/view.php?id=6122
    
    This because is_module_loaded() returned the 'current state' rather than
    the 'future state', as mentioned in is_module_loaded() in a comment there.
    Fix was swappping two lines.

Issue History

Date Modified Username Field Change
2022-06-01 04:02 westor New Issue
2022-06-01 08:53 syzop Note Added: 0022546
2022-06-01 08:53 syzop Priority high => normal
2022-06-01 08:53 syzop Severity major => minor
2022-06-01 08:57 syzop Note Edited: 0022546
2023-03-18 13:37 syzop Assigned To => syzop
2023-03-18 13:37 syzop Status new => resolved
2023-03-18 13:37 syzop Resolution open => fixed
2023-03-18 13:37 syzop Fixed in Version => 6.0.7
2023-03-18 13:37 syzop Note Added: 0022775