]> jfr.im git - irc/quakenet/snircd-patchqueue.git/blame - minoplevel.patch
rename patch files
[irc/quakenet/snircd-patchqueue.git] / minoplevel.patch
CommitLineData
92c15a5f 1Fix for enforcing the min oplevel we added to snircd.
2
3Previously, only oplevels between 0 and MINOPLEVEL (value 100) were accepted from
4services server (+s flag) or from a service client (umode +k) on them.
5
61. Servers bouncing modes with such an oplevel would be set back to MINOPLEVEL,
7instead of the original level, leading to desynch. Locally the server that bounces the mode
8would keep the original oplevel, and bounce it back upstream, were the servers would correct
9it with MINOPLEVEL.
10
112. If we would ever dicide to change this hardcoded value for MINOPLEVEL, there would be
12desynchs for the oplevels chanops would have between old and new servers.
13
143. The original oplevel received (either by client or over a server link)
15was propagated (further) and not the oplevel the ircd set locally
16(and which may have been changed for the MINOPLEVEL value).
17
18All of these issues are fixed in this patch.
19
201. MINOPLEVEL is only enforced on local clients, that is, local clients
21using /MODE (for more detail, see comment in code).
222. if we ever change the value, there would be no desynch, just different local
23enforcement of the value between old and new servers.
243. in case the oplevel is corrected for MINOPLEVEL, the correct oplevel goes upstream.
25
26NOTE: previously MINOPLEVEL was also enforced on /OPMODE - it is no longer in this patch (should it?)
27
1fff196b 28diff -r 041543097dfa ircd/channel.c
29--- a/ircd/channel.c Sun Feb 15 16:28:56 2009 +0100
30+++ b/ircd/channel.c Sun Feb 15 16:36:34 2009 +0100
31@@ -3355,18 +3355,34 @@
92c15a5f 32 * Otherwise, get state->member's oplevel+1.
33 */
34 if (state->cli_change[i].oplevel <= MAXOPLEVEL) {
35- if ((IsChannelService(state->sptr) && IsService(cli_user(state->sptr)->server)) || (IsService(state->sptr))) {
36- SetOpLevel(member, state->cli_change[i].oplevel);
37- } else {
38- SetOpLevel(member, state->cli_change[i].oplevel > MINOPLEVEL ? state->cli_change[i].oplevel : MINOPLEVEL);
39- }
40+ /* MINOPLEVEL - snircd
41+ * accept oplevels as given when forced - modes are forced when:
42+ * MODE &chan by oper with MODE_LCHAN PRIV
43+ * OPMODE, MODE with server as source, MODE from remote user
44+ *
45+ * we need to change state->cli_change[i].oplevel so that
46+ * the oplevel we set goes upstream (including any change we make to it),
47+ * and not the oplevel specified by the client
48+ * we do not want to set one thing locally, and send upstream another
49+ */
50+ if (!(state->flags & MODE_PARSE_FORCE) && state->cli_change[i].oplevel < MINOPLEVEL)
51+ state->cli_change[i].oplevel = MINOPLEVEL;
52+ SetOpLevel(member, state->cli_change[i].oplevel);
53 }
54 else if (!state->member)
55 SetOpLevel(member, MAXOPLEVEL);
56 else if (OpLevel(state->member) >= MAXOPLEVEL)
57 SetOpLevel(member, OpLevel(state->member));
58- else
59- SetOpLevel(member, OpLevel(state->member) >= MINOPLEVEL ? OpLevel(state->member) + 1 : MINOPLEVEL);
60+ else {
61+ /* MINOPLEVEL - snircd
62+ * change state->cli_change[i].oplevel - see above.
63+ */
1fff196b 64+ if (!(state->flags & MODE_PARSE_FORCE) && OpLevel(state->member) < MINOPLEVEL)
92c15a5f 65+ state->cli_change[i].oplevel = MINOPLEVEL;
66+ else
67+ state->cli_change[i].oplevel = OpLevel(state->member) + 1;
68+ SetOpLevel(member, state->cli_change[i].oplevel);
69+ }
70 }
71
72 /* actually effect the change */