diff --git a/modules/m_rehash.c b/modules/m_rehash.c index d8730d7e..dd0d4513 100644 --- a/modules/m_rehash.c +++ b/modules/m_rehash.c @@ -86,13 +86,11 @@ rehash_dns(struct Client *source_p) static void rehash_ssld(struct Client *source_p) { - if (!IsOperAdmin(source_p)) { - sendto_one(source_p, form_str(ERR_NOPRIVS), - me.name, source_p->name, "admin"); - return; - } - sendto_realops_snomask(SNO_GENERAL, L_ALL, "%s is restarting ssld", + sendto_realops_snomask(SNO_GENERAL, L_NETWIDE, + "%s is restarting ssld", get_oper_name(source_p)); + if (!MyConnect(source_p)) + remote_rehash_oper_p = source_p; restart_ssld(); } @@ -100,29 +98,26 @@ rehash_ssld(struct Client *source_p) static void rehash_motd(struct Client *source_p) { - struct stat sb; - struct tm *local_tm; - sendto_realops_snomask(SNO_GENERAL, L_NETWIDE, "%s is forcing re-reading of MOTD file", get_oper_name(source_p)); if (!MyConnect(source_p)) remote_rehash_oper_p = source_p; - free_cachefile(user_motd); - user_motd = cache_file(MPATH, "ircd.motd", 0); - - if(stat(MPATH, &sb) == 0) { - local_tm = localtime(&sb.st_mtime); - - if(local_tm != NULL) { - rb_snprintf(user_motd_changed, sizeof(user_motd_changed), - "%d/%d/%d %d:%d", - local_tm->tm_mday, local_tm->tm_mon + 1, - 1900 + local_tm->tm_year, local_tm->tm_hour, - local_tm->tm_min); - } - } + cache_user_motd(); +} + +static void +rehash_rules(struct Client *source_p) +{ + sendto_realops_snomask(SNO_GENERAL, L_NETWIDE, + "%s is forcing re-reading of RULES file", + get_oper_name(source_p)); + if (!MyConnect(source_p)) + remote_rehash_oper_p = source_p; + + free_cachefile(user_rules); + user_rules = cache_file(RPATH, "ircd.rules", 0); } static void