From eac35d8428e8c4bdf19be7e89618827dbce80657 Mon Sep 17 00:00:00 2001 From: MrIron Date: Sat, 20 Sep 2025 08:20:00 +0200 Subject: [PATCH 1/2] Added support for remote +x from U:lined servers. --- ircd/m_opmode.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/ircd/m_opmode.c b/ircd/m_opmode.c index 7f3d8caf..33c64ee0 100644 --- a/ircd/m_opmode.c +++ b/ircd/m_opmode.c @@ -182,16 +182,22 @@ int ms_opmode(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) } 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))) return send_reply(sptr, ERR_NOPRIVILEGES, parv[1]); - /* At the moment, we only support +o and -o. set_user_mode() does + /* At the moment, we only support +o, -o and +x. set_user_mode() does * not support remote mode setting or setting +o. */ if (!strcmp(parv[2], "+o") && !IsOper(dptr)) make_oper(sptr, dptr); else if (!strcmp(parv[2], "-o") && IsOper(dptr)) de_oper(dptr); + else if (!strcmp(parv[2], "+x") && IsAccount(dptr) && !HasHiddenHost(dptr)) { + struct Flags old_mode = cli_flags(dptr); + SetHiddenHost(dptr); + send_umode_out(dptr, dptr, &old_mode, HasPriv(dptr, PRIV_PROPAGATE)); + hide_hostmask(dptr, FLAG_HIDDENHOST); + } return 0; } From c1f35dacde19060c5cde14a4d48822d33d9a51f7 Mon Sep 17 00:00:00 2001 From: MrIron Date: Sat, 20 Sep 2025 09:22:07 +0200 Subject: [PATCH 2/2] Only permit ACCOUNT messages from U:lined servers. --- ircd/m_account.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ircd/m_account.c b/ircd/m_account.c index a55f6944..cca18f16 100644 --- a/ircd/m_account.c +++ b/ircd/m_account.c @@ -87,9 +87,11 @@ #include "ircd_string.h" #include "msg.h" #include "numnicks.h" +#include "s_conf.h" #include "s_debug.h" #include "s_user.h" #include "send.h" +#include "numeric.h" /* #include -- Now using assert in ircd_log.h */ #include @@ -108,6 +110,7 @@ int ms_account(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) { struct Client *acptr; + struct ConfItem *conf; uint64_t acc_id = 0, acc_flags = 0; if (parc < 3) @@ -117,6 +120,9 @@ int ms_account(struct Client* cptr, struct Client* sptr, int parc, return protocol_violation(cptr, "ACCOUNT from non-server %s", cli_name(sptr)); + if (!(conf = find_conf_byhost(cli_confs(cptr), cli_name(sptr), CONF_UWORLD))) + return send_reply(sptr, ERR_NOPRIVILEGES, parv[1]); /* Ignore ACCOUNT from non U:lined servers. */ + if (!(acptr = findNUser(parv[1]))) return 0; /* Ignore ACCOUNT for a user that QUIT; probably crossed */