1
0
mirror of https://github.com/unrealircd/unrealircd.git synced 2026-07-10 12:43:12 +02:00

Remove /REHASH -motd and -opermotd and get rid of some rehash quirks.

This commit is contained in:
Bram Matthys
2021-08-05 13:57:43 +02:00
parent 5e94b1cddb
commit 53fa3c44f5
11 changed files with 4 additions and 44 deletions
+1 -2
View File
@@ -10795,8 +10795,7 @@ int rehash_internal(Client *client, int sig)
loop.ircd_rehashing = 1; /* double checking.. */
if (init_conf(configfile, 1) == 0)
run_configuration();
if (sig == 1)
reread_motdsandrules();
reread_motdsandrules();
unload_all_unused_snomasks();
unload_all_unused_umodes();
unload_all_unused_extcmodes();
+2 -24
View File
@@ -572,10 +572,7 @@ CMD_FUNC(cmd_rehash)
}
unreal_log(ULOG_INFO, "config", "CONFIG_RELOAD", client, "Rehashing server configuration file [by: $client.nuh]");
remote_rehash_client = client;
reread_motdsandrules();
// TODO: clean this next line up, wtf man.
rehash(client, (parc > 1) ? ((*parv[1] == 'q') ? 2 : 0) : 0);
return;
/* fallthrough... so we deal with this the same way as local rehashes */
}
parv[1] = parv[2];
} else {
@@ -591,16 +588,6 @@ CMD_FUNC(cmd_rehash)
parv[1] = parv[2];
parv[2] = NULL;
parc--;
/* Only netadmins may use /REHASH -global, which is because:
* a) it makes sense
* b) remote servers don't support remote rehashes by non-netadmins
*/
if (!ValidatePermissionsForPath("server:rehash",client,NULL,NULL,NULL))
{
sendnumeric(client, ERR_NOPRIVILEGES);
sendnotice(client, "'/REHASH -global' requires you to have server::rehash permissions");
return;
}
if (parv[1] && *parv[1] != '-')
{
sendnotice(client, "You cannot specify a server name after /REHASH -global, for obvious reasons");
@@ -622,13 +609,6 @@ CMD_FUNC(cmd_rehash)
if (!BadPtr(parv[1]) && strcasecmp(parv[1], "-all"))
{
if (!ValidatePermissionsForPath("server:rehash",client,NULL,NULL,NULL))
{
sendnumeric(client, ERR_NOPRIVILEGES);
return;
}
if (*parv[1] == '-')
{
if (!strncasecmp("-gar", parv[1], 4))
@@ -664,9 +644,7 @@ CMD_FUNC(cmd_rehash)
/* Normal rehash, rehash motds&rules too, just like the on in the tld block will :p */
sendnumeric(client, RPL_REHASHING, configfile);
// TODO: fix next line - occurence #2
x = rehash(client, (parc > 1) ? ((*parv[1] == 'q') ? 2 : 0) : 0);
reread_motdsandrules();
x = rehash(client, 0);
}
/** RESTART command - restart the server (discouraged command)