]> jfr.im git - irc/rqf/shadowircd.git/commitdiff
For remote rehashes, send error messages to the requesting oper as well.
authorJilles Tjoelker <redacted>
Thu, 29 Jan 2009 23:11:12 +0000 (00:11 +0100)
committerJilles Tjoelker <redacted>
Thu, 29 Jan 2009 23:11:12 +0000 (00:11 +0100)
include/s_conf.h
modules/m_rehash.c
src/newconf.c
src/s_conf.c

index 815703e5636c5d22cbe56c6c9d350c02b1c6a893..f9b0ef72fbecbe8e34bd2db545449534faf12df3 100644 (file)
@@ -54,6 +54,8 @@ struct ip_value
 extern FILE *conf_fbfile_in;
 extern char conf_line_in[256];
 
+extern struct Client *remote_rehash_oper_p;
+
 struct ConfItem
 {
        struct ConfItem *next;  /* list node pointer */
index 8bddf18ef4a14f716d7521ab9677d7384de89ae7..22848a8c94fd289bc0659d3236a39185efff64bb 100644 (file)
@@ -361,7 +361,9 @@ me_rehash(struct Client *client_p, struct Client *source_p, int parc, const char
                                source_p->servptr->name, SHARED_REHASH))
                return 0;
 
+       remote_rehash_oper_p = source_p;
        do_rehash(source_p, parc > 1 ? parv[1] : NULL);
+       remote_rehash_oper_p = NULL;
 
        return 0;
 }
index 9e929f3c9e6c65b37517ef2c0c1c38bdcd3e74ca..ce954c48efe5fae5120a8c3d4445377415066af3 100644 (file)
@@ -1778,6 +1778,8 @@ conf_report_error(const char *fmt, ...)
 
        ierror("\"%s\", line %d: %s", current_file, lineno + 1, msg);
        sendto_realops_snomask(SNO_GENERAL, L_ALL, "\"%s\", line %d: %s", current_file, lineno + 1, msg);
+       if (remote_rehash_oper_p)
+               sendto_one_notice(remote_rehash_oper_p, ":*** Notice -- \"%s\", line %d: %s", current_file, lineno + 1, msg);
 }
 
 int
index f578ae282451fa955329f12c12e0b6f2964a25b2..13751b51b5f3f34a08ec77f908022906839ec329 100644 (file)
@@ -76,6 +76,7 @@ static void reorganise_temp_kd(void *list);
 
 FILE *conf_fbfile_in;
 extern char yytext[];
+struct Client *remote_rehash_oper_p;
 
 static int verify_access(struct Client *client_p, const char *username);
 static int attach_iline(struct Client *, struct ConfItem *);
@@ -682,6 +683,10 @@ rehash_bans(int sig)
                        sendto_realops_snomask(SNO_GENERAL, L_ALL,
                                        "Can't open %s file bans could be missing!",
                                        *banconfs[i].filename);
+                       if (remote_rehash_oper_p)
+                               sendto_one_notice(remote_rehash_oper_p,
+                                       ":*** Notice -- Can't open %s file bans could be missing!",
+                                       *banconfs[i].filename);
                }
                else
                {
@@ -1154,6 +1159,9 @@ read_conf_files(int cold)
                {
                        sendto_realops_snomask(SNO_GENERAL, L_ALL,
                                             "Can't open file '%s' - aborting rehash!", filename);
+                       if (remote_rehash_oper_p)
+                               sendto_one_notice(remote_rehash_oper_p,
+                                            ":*** Notice -- Can't open file '%s' - aborting rehash!", filename);
                        return;
                }
        }
@@ -1524,6 +1532,9 @@ yyerror(const char *msg)
 
        sendto_realops_snomask(SNO_GENERAL, L_ALL, "\"%s\", line %d: %s at '%s'",
                             conffilebuf, lineno + 1, msg, newlinebuf);
+       if (remote_rehash_oper_p)
+               sendto_one_notice(remote_rehash_oper_p, ":*** Notice -- \"%s\", line %d: %s at '%s'",
+                                    conffilebuf, lineno + 1, msg, newlinebuf);
 
        ilog(L_MAIN, "\"%s\", line %d: %s at '%s'", conffilebuf, lineno + 1, msg, newlinebuf);
 }