From d610dfbe9f3a6103ff73ba47dafd0191ed4f77e4 Mon Sep 17 00:00:00 2001 From: Bram Matthys Date: Sun, 9 Sep 2018 18:03:54 +0200 Subject: [PATCH] Duplicate error messages when trying to set channel modes +O/+P. Reported by FwdInTime in https://bugs.unrealircd.org/view.php?id=4840 --- src/modules/chanmodes/operonly.c | 5 +++-- src/modules/chanmodes/permanent.c | 4 +++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/modules/chanmodes/operonly.c b/src/modules/chanmodes/operonly.c index 286a3e0ef..1c0fb672c 100644 --- a/src/modules/chanmodes/operonly.c +++ b/src/modules/chanmodes/operonly.c @@ -100,9 +100,10 @@ DLLFUNC int operonly_require_oper(aClient *cptr, aChannel *chptr, char mode, cha if (!MyClient(cptr) || ValidatePermissionsForPath("channel:operonly",cptr,NULL,chptr,NULL)) return EX_ALLOW; + if (checkt == EXCHK_ACCESS_ERR) + sendto_one(cptr, err_str(ERR_CANNOTCHANGECHANMODE), + me.name, cptr->name, 'O', "You are not an IRC operator"); - sendto_one(cptr, err_str(ERR_CANNOTCHANGECHANMODE), - me.name, cptr->name, 'O', "You are not an IRC operator"); return EX_DENY; } diff --git a/src/modules/chanmodes/permanent.c b/src/modules/chanmodes/permanent.c index 5cb45126a..3e9d3e9a5 100644 --- a/src/modules/chanmodes/permanent.c +++ b/src/modules/chanmodes/permanent.c @@ -42,7 +42,9 @@ static int permanent_is_ok(aClient *cptr, aChannel *chptr, char mode, char *para { if (!IsOper(cptr)) { - sendto_one(cptr, err_str(ERR_NOPRIVILEGES), me.name, cptr->name); + if (checkt == EXCHK_ACCESS_ERR) + sendto_one(cptr, err_str(ERR_NOPRIVILEGES), me.name, cptr->name); + return EX_DENY; }