Repository navigation
Fix LUSERSLOCK RPL_LUSERME client count - #274
Open
Jazzzzz-hub wants to merge 1 commit into
Open
Jazzzzz-hub wants to merge 1 commit into
Jazzzzz-hub wants to merge 1 commit into
Conversation
send_fake_lusers() omitted the frozen local client count required by RPL_LUSERME, causing the server-count conversion to consume an undefined vararg while LUSERSLOCK was active. Pass fakelusers.m_client before the server count. Backport of the src/hide.c portion of e8166a2.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fix send_fake_lusers() to pass the frozen local client count required by RPL_LUSERME.
When LUSERSLOCK is active, the current master branch omits the client-count argument:
sendto_one(sptr, rpl_str(RPL_LUSERME), me.name, sptr->name,
#ifdef HIDEULINEDSERVS
fakelusers.m_server - fakelusers.m_ulined);
#else
fakelusers.m_server);
#endif
RPL_LUSERME expects both a client count and a server count:
I have %d clients and %d servers
Because the client count is missing, the server-count conversion consumes an undefined vararg and can produce incorrect output.
Fix
Pass the already-snapshotted fakelusers.m_client before the server count:
sendto_one(sptr, rpl_str(RPL_LUSERME), me.name, sptr->name,
fakelusers.m_client,
#ifdef HIDEULINEDSERVS
fakelusers.m_server - fakelusers.m_ulined);
#else
fakelusers.m_server);
#endif
This is the src/hide.c portion of existing commit e8166a2 (Fix err_str/rpl_str format argument mismatches) from the bahamut-mods-gossip branch, backported independently to current master.
Reproduction
With LUSERSLOCK active, an unprivileged client's /LUSERS returned:
I have 1 clients and 100 servers
After cancelling the lock, the same server returned:
I have 1 clients and 1 servers
The incorrect 100 servers value came from the missing vararg.
Testing
Tested from current master (fc3d398).
Clean build completed successfully.
Baseline behavior reproduced.
Patched LUSERSLOCK output correctly preserved the frozen snapshot:
I have 0 clients and 1 servers
/USERS continued to return frozen local/global counts while locked.
IRC operators continued to bypass the lock and receive live counts.
Cancelling LUSERSLOCK restored live counts.
No garbage server count was observed after the fix.
Final patched runtime regression matrix passed.
git diff --check passed.
The branch contains one file change with one insertion and no deletions.