1
0
mirror of https://github.com/unrealircd/unrealircd.git synced 2026-07-06 16:33:13 +02:00

Set set::modes-on-join to +nt by default and also put it in the

example.conf. Leaving it empty by default is strange and contrasts
with our "secure by default" principle.
This commit is contained in:
Bram Matthys
2019-08-26 18:22:12 +02:00
parent d331f22dbc
commit 890e4c9acd
3 changed files with 22 additions and 13 deletions
+1
View File
@@ -161,6 +161,7 @@ Changed
in case of a bug and also more control for admins at runtime.
Only <5 modules out of 173 are permanent now.
* User mode +T now blocks channel CTCPs as well.
* set::modes-on-join is now +nt by default.
* The authprompt module is now loaded by default. This means that if
you do a soft kline on someone (eg: KLINE %*@*.badisp) then the user
has a chance to authenticate to services, even without SASL, and
+3 -5
View File
@@ -452,7 +452,8 @@ set {
set {
kline-address "set.this.to.email.address"; /* e-mail or URL shown when a user is banned */
modes-on-connect "+ixw"; /* when users connect, they will get these user modes */
modes-on-oper "+xwgs"; /* when someone becomes IRCOp they'll get these modes */
modes-on-oper "+xwgs"; /* when someone becomes IRCOp they'll get these modes */
modes-on-join "+nt"; /* default channel modes when a new channel is created */
oper-auto-join "#opers"; /* IRCOps are auto-joined to this channel */
options {
hide-ulines; /* hide U-lines in /MAP and /LINKS */
@@ -472,13 +473,10 @@ set {
/* static-part does the same for /PART */
/* static-part yes; */
/* how fast the server must reply to PING before sending a warning to opers. */
ping-warning 15;
/* Which /STATS to restrict to opers only. We suggest to leave it to * (ALL) */
oper-only-stats "*";
/* Anti flood protection */
/* Flood protection */
anti-flood {
nick-flood 3:60; /* 3 nick changes per 60 seconds (the default) */
connect-flood 3:60; /* 3 connection attempts per 60 seconds (the default) */
+18 -8
View File
@@ -474,7 +474,17 @@ long config_checkval(char *orig, unsigned short flags) {
return ret;
}
void set_channelmodes(char *modes, struct ChMode *store, int warn)
/** Free configuration setting for set::modes-on-join */
void free_conf_channelmodes(struct ChMode *store)
{
int i;
for (i = 0; i < EXTCMODETABLESZ; i++)
safefree(iConf.modes_on_join.extparams[i]);
}
/* Set configuration, used for set::modes-on-join */
void conf_channelmodes(char *modes, struct ChMode *store, int warn)
{
aCtab *tab;
char *params = strchr(modes, ' ');
@@ -484,6 +494,9 @@ void set_channelmodes(char *modes, struct ChMode *store, int warn)
warn = 0; // warn is broken
/* Free existing parameters first (no inheritance) */
free_conf_channelmodes(store);
if (params)
{
params++;
@@ -1487,6 +1500,7 @@ void config_setdefaultsettings(aConfiguration *i)
i->maxchannelsperuser = 10;
i->maxdccallow = 10;
i->channel_command_prefix = strdup("`!.");
conf_channelmodes("+nt", &i->modes_on_join, 0);
i->check_target_nick_bans = 1;
i->maxbans = 60;
i->maxbanlength = 2048;
@@ -2425,11 +2439,7 @@ void config_rehash()
}
conf_sni = NULL;
for (i = 0; i < EXTCMODETABLESZ; i++)
{
if (iConf.modes_on_join.extparams[i])
free(iConf.modes_on_join.extparams[i]);
}
free_conf_channelmodes(&iConf.modes_on_join);
/*
reset conf_files -- should this be in its own function? no, because
@@ -7345,7 +7355,7 @@ int _conf_set(ConfigFile *conf, ConfigEntry *ce)
tempiConf.oper_modes = (long) set_usermode(cep->ce_vardata);
}
else if (!strcmp(cep->ce_varname, "modes-on-join")) {
set_channelmodes(cep->ce_vardata, &tempiConf.modes_on_join, 0);
conf_channelmodes(cep->ce_vardata, &tempiConf.modes_on_join, 0);
}
else if (!strcmp(cep->ce_varname, "snomask-on-oper")) {
safestrdup(tempiConf.oper_snomask, cep->ce_vardata);
@@ -7945,7 +7955,7 @@ int _test_set(ConfigFile *conf, ConfigEntry *ce)
break;
}
}
set_channelmodes(cep->ce_vardata, &temp, 1);
conf_channelmodes(cep->ce_vardata, &temp, 1);
if (temp.mode & MODE_SECRET && temp.mode & MODE_PRIVATE)
{
config_error("%s:%i: set::modes-on-join has both +s and +p",