Skip to content

Remote +x#62

Open
MrIron-no wants to merge 3 commits intoUndernetIRC:mainfrom
MrIron-no:feature/remotex
Open

Remote +x#62
MrIron-no wants to merge 3 commits intoUndernetIRC:mainfrom
MrIron-no:feature/remotex

Conversation

@MrIron-no
Copy link
Contributor

  • Allow U:lined servers to set umode +x remotely using OPMODE.
  • Only permit ACCOUNT messages from U:lined servers.

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)))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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]);

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