Skip to content

Fix LUSERSLOCK RPL_LUSERME client count - #274

Open
Jazzzzz-hub wants to merge 1 commit into
DALnet:masterfrom
Jazzzzz-hub:fix-luserslock-rpl-luserme
Open

Jazzzzz-hub wants to merge 1 commit into
DALnet:masterfrom
Jazzzzz-hub:fix-luserslock-rpl-luserme

Conversation

@Jazzzzz-hub

Copy link
Copy Markdown
Contributor

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.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants