From: Michael Poole Date: Tue, 3 Mar 2015 02:48:14 +0000 (-0500) Subject: m_cap.c: Do not allow CAP ACK to set prohibited caps, or clear sticky ones. X-Git-Url: http://git.pk910.de/?p=ircu2.10.12-pk.git;a=commitdiff_plain;h=be7c44e61bdc795a72b4c7478ea302b791223927 m_cap.c: Do not allow CAP ACK to set prohibited caps, or clear sticky ones. Thanks to Michael Wobst from the ircd-hybrid team for reporting this. --- diff --git a/ircd/m_cap.c b/ircd/m_cap.c index 2443c42..a2cc799 100644 --- a/ircd/m_cap.c +++ b/ircd/m_cap.c @@ -260,10 +260,15 @@ cap_ack(struct Client *sptr, const char *caplist) (neg ? HasCap(sptr, cap->cap) : !HasCap(sptr, cap->cap))) /* uh... */ continue; - if (neg) /* set or clear the active capability... */ + if (neg) { /* set or clear the active capability... */ + if (cap->flags & CAPFL_STICKY) + continue; /* but don't clear sticky capabilities */ CapClr(cli_active(sptr), cap->cap); - else + } else { + if (cap->flags & CAPFL_PROHIBIT) + continue; /* and don't set prohibited ones */ CapSet(cli_active(sptr), cap->cap); + } } return 0;