to restrict channel names to printable ascii only.
Like disable_fake_channels this only applies to joins
by local users; unlike disable_fake_channels it applies
to opers as well.
no_join_on_split = no;
burst_topicwho = yes;
kick_on_split_riding = no;
+ only_ascii_channels = no;
};
serverhide {
* ratbox-services does.
*/
kick_on_split_riding = no;
+
+ /* only ascii channels: disable local users joining channels
+ * containing characters outside the range 33-126 (non-printable
+ * or non-ASCII).
+ */
+ only_ascii_channels = no;
};
int default_split_user_count;
int burst_topicwho;
int kick_on_split_riding;
+ int only_ascii_channels;
};
struct config_server_hide
static int
check_channel_name_loc(struct Client *source_p, const char *name)
{
+ const char *p;
+
s_assert(name != NULL);
if(EmptyString(name))
return 0;
if(ConfigFileEntry.disable_fake_channels && !IsOper(source_p))
{
- for(; *name; ++name)
+ for(p = name; *p; ++p)
{
- if(!IsChanChar(*name) || IsFakeChanChar(*name))
+ if(!IsChanChar(*p) || IsFakeChanChar(*p))
return 0;
}
}
else
{
- for(; *name; ++name)
+ for(p = name; *p; ++p)
{
- if(!IsChanChar(*name))
+ if(!IsChanChar(*p))
return 0;
}
}
+ if(ConfigChannel.only_ascii_channels)
+ {
+ for(p = name; *p; ++p)
+ if(*p < 33 || *p > 126)
+ return 0;
+ }
+
return 1;
}
&ConfigChannel.no_join_on_split,
"Disallow joining channels when split",
},
+ {
+ "only_ascii_channels",
+ OUTPUT_BOOLEAN_YN,
+ &ConfigChannel.only_ascii_channels,
+ "Controls whether non-ASCII is disabled for JOIN"
+ },
{
"use_except",
OUTPUT_BOOLEAN_YN,
{ "max_chans_per_user", CF_INT, NULL, 0, &ConfigChannel.max_chans_per_user },
{ "no_create_on_split", CF_YESNO, NULL, 0, &ConfigChannel.no_create_on_split },
{ "no_join_on_split", CF_YESNO, NULL, 0, &ConfigChannel.no_join_on_split },
+ { "only_ascii_channels", CF_YESNO, NULL, 0, &ConfigChannel.only_ascii_channels },
{ "use_except", CF_YESNO, NULL, 0, &ConfigChannel.use_except },
{ "use_invex", CF_YESNO, NULL, 0, &ConfigChannel.use_invex },
{ "use_knock", CF_YESNO, NULL, 0, &ConfigChannel.use_knock },
ConfigChannel.max_chans_per_user = 15;
ConfigChannel.max_bans = 25;
ConfigChannel.max_bans_large = 500;
+ ConfigChannel.only_ascii_channels = NO;
ConfigChannel.burst_topicwho = NO;
ConfigChannel.kick_on_split_riding = NO;