Open
Conversation
Contributor
MrIron-no
commented
Sep 20, 2025
- Allow U:lined servers to set umode +x remotely using OPMODE.
- Only permit ACCOUNT messages from U:lined servers.
Ratler
reviewed
Mar 21, 2026
ircd/m_opmode.c
Outdated
|
|
||
| conf = find_conf_byhost(cli_confs(cptr), cli_name(sptr), CONF_UWORLD); | ||
| if (!conf || !(conf->flags & CONF_UWORLD_OPER)) | ||
| if (!conf || ((!strcmp(parv[2], "+o") || !strcmp(parv[2], "-o")) && !(conf->flags & CONF_UWORLD_OPER))) |
Member
There was a problem hiding this comment.
Is this really doing what you intend? If I get this right, your intent is "require CONF_UWORLD_OPER for +o/-o, but allow any U:line for +x."? But in he current form, I think it becomes overly permissive. If conf exists but the mode is not +o/-o (e.g. it's +x, or any arbitrary string like +w, -i, +Z), the CONF_UWORLD_OPER flag check is entirely bypassed. Any U:lined server (even one without the oper flag) can send +x, and any other unrecognized mode string silently falls through to return 0.
I don't think it would technically be an issue, but it might be cleaner to be explicit.
Something like, it also make it a bit less fragile for null check safety since you return immediately if conf is not set:
if (!conf)
return send_reply(sptr, ERR_NOPRIVILEGES, parv[1]);
if ((!strcmp(parv[2], "+o") || !strcmp(parv[2], "-o")) && !(conf->flags & CONF_UWORLD_OPER))
return send_reply(sptr, ERR_NOPRIVILEGES, parv[1]);
…ion instead of send_reply. Fixed bug causing remote deoper not to propagate the mode change.
e590dcd to
2097123
Compare
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.