diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2016-06-05 14:16:36 +0100 |
---|---|---|
committer | Russell King <rmk+kernel@armlinux.org.uk> | 2019-07-21 20:58:59 +0100 |
commit | 02b2a4ebcbd2eb71f7abaad36da2dc489c7c2d7c (patch) | |
tree | 2a3625f29859be965c7972f6fa131db0f9c9790b /src | |
parent | 7a438c17063b92a23f9ab133a88097861a6f4527 (diff) |
Add global channel operator support
Diffstat (limited to 'src')
-rw-r--r-- | src/channel.c | 2 | ||||
-rw-r--r-- | src/channel_mode.c | 2 | ||||
-rw-r--r-- | src/conf.c | 2 | ||||
-rw-r--r-- | src/conf_lexer.l | 1 | ||||
-rw-r--r-- | src/conf_parser.y | 11 | ||||
-rw-r--r-- | src/s_user.c | 2 |
6 files changed, 16 insertions, 4 deletions
diff --git a/src/channel.c b/src/channel.c index 907a5e9..f96f705 100644 --- a/src/channel.c +++ b/src/channel.c @@ -750,7 +750,7 @@ can_send(struct Channel *chptr, struct Client *source_p, { struct MaskItem *conf = NULL; - if (IsServer(source_p) || HasFlag(source_p, FLAGS_SERVICE)) + if (IsServer(source_p) || HasFlag(source_p, FLAGS_SERVICE) || HasUMode(source_p, UMODE_GCHANOP)) return CAN_SEND_OPV; if (MyClient(source_p) && !IsExemptResv(source_p)) diff --git a/src/channel_mode.c b/src/channel_mode.c index f23bac4..5a11d79 100644 --- a/src/channel_mode.c +++ b/src/channel_mode.c @@ -1578,7 +1578,7 @@ get_channel_access(const struct Client *source_p, const struct Membership *member) { /* Let hacked servers in for now... */ - if (!MyClient(source_p)) + if (!MyClient(source_p) || HasUMode(source_p, UMODE_GCHANOP)) return CHACCESS_CHANOP; if (member == NULL) @@ -1172,7 +1172,7 @@ set_default_conf(void) ConfigFileEntry.true_no_oper_flood = 0; ConfigFileEntry.oper_pass_resv = 1; ConfigFileEntry.max_targets = MAX_TARGETS_DEFAULT; - ConfigFileEntry.oper_only_umodes = UMODE_DEBUG; + ConfigFileEntry.oper_only_umodes = UMODE_GCHANOP | UMODE_DEBUG; ConfigFileEntry.oper_umodes = UMODE_BOTS | UMODE_LOCOPS | UMODE_SERVNOTICE | UMODE_OPERWALL | UMODE_WALLOP; ConfigFileEntry.throttle_time = 1; diff --git a/src/conf_lexer.l b/src/conf_lexer.l index 466e827..88fb7d0 100644 --- a/src/conf_lexer.l +++ b/src/conf_lexer.l @@ -191,6 +191,7 @@ gline_min_cidr { return GLINE_MIN_CIDR; } gline_min_cidr6 { return GLINE_MIN_CIDR6; } gline_request_duration { return GLINE_REQUEST_DURATION; } global_kill { return GLOBAL_KILL; } +globalchops { return T_GCHANOPS; } globops { return T_GLOBOPS; } have_ident { return NEED_IDENT; } havent_read_conf { return HAVENT_READ_CONF; } diff --git a/src/conf_parser.y b/src/conf_parser.y index 303c66d..f77db44 100644 --- a/src/conf_parser.y +++ b/src/conf_parser.y @@ -308,6 +308,7 @@ reset_block_state(void) %token T_FARCONNECT %token T_FILE %token T_FULL +%token T_GCHANOPS %token T_GLOBOPS %token T_INVISIBLE %token T_INVITEONLY @@ -1267,6 +1268,10 @@ oper_umodes_item: T_BOTS { if (conf_parser_ctx.pass == 2) block_state.modes.value |= UMODE_FARCONNECT; +} | T_GCHANOPS +{ + if (conf_parser_ctx.pass == 2) + block_state.modes.value |= UMODE_GCHANOP; }; oper_flags: IRCD_FLAGS @@ -2774,6 +2779,9 @@ umode_oitem: T_BOTS } | T_FARCONNECT { ConfigFileEntry.oper_umodes |= UMODE_FARCONNECT; +} | T_GCHANOPS +{ + ConfigFileEntry.oper_umodes |= UMODE_GCHANOP; }; general_oper_only_umodes: OPER_ONLY_UMODES @@ -2845,6 +2853,9 @@ umode_item: T_BOTS } | T_FARCONNECT { ConfigFileEntry.oper_only_umodes |= UMODE_FARCONNECT; +} | T_GCHANOPS +{ + ConfigFileEntry.oper_only_umodes |= UMODE_GCHANOP; }; general_min_nonwildcard: MIN_NONWILDCARD '=' NUMBER ';' diff --git a/src/s_user.c b/src/s_user.c index 359478b..751684b 100644 --- a/src/s_user.c +++ b/src/s_user.c @@ -97,7 +97,7 @@ const unsigned int user_modes[256] = 0, /* L */ 0, /* M */ 0, /* N */ - 0, /* O */ + UMODE_GCHANOP, /* O */ 0, /* P */ 0, /* Q */ UMODE_REGONLY, /* R */ |