View Issue Details

IDProjectCategoryView StatusLast Update
0003899unrealircdpublic2010-05-06 03:09
Reporterdriew Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionduplicate 
PlatformLinuxOSCentosOS Version5.3
Product Version3.2.8 
Summary0003899: PRIVMSG to #<hostmask/wildcardmask> doesn't work.
DescriptionVery similar to the PRIVMSG $servermask :message
PRIVMSG #hostmask :message should be a valid/working form of global notice for opers.

However, an extra elseif in m_message.c prevents it from propagating to the block of code that handles this form of messaging.

I've known about this bug for a long time, but I didn't understand enough C back in the day to really determine if it's a "bug" or not.


I have been able to fix the bug on a test server, but I have not done testing to be sure there aren't any side effects, so I won't provide a patch, just because some users just download patches without reading warnings :/

m_message.c

Line 564:
if ((*nick == '$' || *nick == '#') && (IsAnOper(sptr)
|| IsULine(sptr)))
                {
                           sendto_match_butone(IsServer(cptr) ? cptr : NULL,
                            sptr, nick + 1,
                            (*nick == '#') ? MATCH_HOST :
                            MATCH_SERVER,
                            ":%s %s %s :%s", parv[0], cmd, nick, parv[2]);

Notice that is says if the nick "destination of PRIVMSG" starts with $ or #, to send it on to sendto_match_butone. Allowing globals like:
PRIVMSG #*.badhost.net :You are being klined from all servers except blah. /server now :(

However, this never triggers because up at
Line 550: else if (p2)

keeps it from triggering, because of even before, p2 gets set by
Line 345: p2 = (char *)strchr(nick, '#');

Which basically makes it so anything starting with a # sets p2, and it will never reach the block on line 564.

In testing, I can comment out the elseif block, since it's just a "NOSUCHNICK" message (and there is another one on line 621) and it works as advertised.
Steps To ReproduceSee the bug:
1. /quote PRIVMSG #*.somehost.net :Testing 123
Results: #*.somehost.net: No such nick/channel

See the fix:
1. Comment out the elseif block on line 550 (or change p2 to p2 && 0)
2. recompile
3. /quote PRIVMSG #*.somehost.net :Testing123
Results: All users with the matching mask of *.somehost.net, gets a privmsg of "Testign123"
TagsNo tags attached.
3rd party modules

Relationships

duplicate of 0002915 closedsyzop global /notice #<host> does not work 

Activities

driew

2010-04-15 08:58

reporter   ~0016066

Just found a previously reported bug that is similar: http://bugs.unrealircd.org/view.php?id=2915

Issue History

Date Modified Username Field Change
2010-04-03 09:49 driew New Issue
2010-04-15 08:58 driew Note Added: 0016066
2010-05-06 03:08 ohnobinki Relationship added duplicate of 0002915
2010-05-06 03:09 ohnobinki QA => Not touched yet by developer
2010-05-06 03:09 ohnobinki U4: Need for upstream patch => No need for upstream InspIRCd patch
2010-05-06 03:09 ohnobinki U4: Upstream notification of bug => Not decided
2010-05-06 03:09 ohnobinki U4: Contributor working on this => None
2010-05-06 03:09 ohnobinki Status new => closed
2010-05-06 03:09 ohnobinki Resolution open => duplicate