View Issue Details

IDProjectCategoryView StatusLast Update
0005023unrealmodule apipublic2017-10-23 10:09
ReporterGottemAssigned Tosyzop 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Platformx86_64OSDebianOS Version7 (wheezy)
Product Version4.0.15 
Target VersionFixed in Version4.0.16 
Summary0005023: Denying HOOKTYPE_PRE_INVITE results in incorrect error string
DescriptionWhen you return HOOK_DENY from a hook function for HOOKTYPE_PRE_INVITE, you get the following message after an invite attempt:
    Message(518): Cannot invite (+V) at channel #test

Even though the channel is not actually +V. :D
Steps To ReproduceUse a hook function like this:

int hook_preinvite(aClient *sptr, aChannel *chptr)
    return HOOK_DENY;

Join a channel, set +i and invite someone else. Then check the server console/tab.
Additional InformationI noticed src/modules/m_invite.c returns ERR_NOINVITE always when HOOK_DENY is returned (and OperOverride is not applicable). I guess the noinvite module should return the error itself and let m_invite return -1 silently?
TagsNo tags attached.
3rd party modulesN/A

Activities

syzop

2017-10-23 10:09

administrator   ~0019930

Ah, indeed. And /KNOCK with a +V channel resulted in two confusing messages because the same hook was used :D

Thanks for the report. Had to change the API though to fix this, see below.

commit 77234b2b8df225f8cf1defa5fc5406e4fdd8f92f
Author: Bram Matthys <syzop@vulnscan.org>
Date: Mon Oct 23 10:07:33 2017 +0200

    API change for HOOKTYPE_PRE_INVITE and fix 0005023:
    * API change for HOOKTYPE_PRE_INVITE:
      (aClient *sptr, aClient *target, aChannel *chptr, int *override)
      Modules must now send the error message instead of only returning
      HOOK_DENY. Also check for operoverride and set *override=1.
    
    This so modules can send their own error messages instead of the
    default message being sent ("channel is +V" - which is not true).
    
    Reported by Gottem (0005023).

Issue History

Date Modified Username Field Change
2017-10-21 13:09 Gottem New Issue
2017-10-23 10:09 syzop Assigned To => syzop
2017-10-23 10:09 syzop Status new => resolved
2017-10-23 10:09 syzop Resolution open => fixed
2017-10-23 10:09 syzop Fixed in Version => 4.0.16
2017-10-23 10:09 syzop Note Added: 0019930