For remote rehashes, send error messages to the requesting oper as well.

This commit is contained in:
Jilles Tjoelker 2009-01-30 00:11:12 +01:00
parent 12c4f819fa
commit 1ba281712f
4 changed files with 17 additions and 0 deletions

View File

@ -54,6 +54,8 @@ struct ip_value
extern FILE *conf_fbfile_in; extern FILE *conf_fbfile_in;
extern char conf_line_in[256]; extern char conf_line_in[256];
extern struct Client *remote_rehash_oper_p;
struct ConfItem struct ConfItem
{ {
struct ConfItem *next; /* list node pointer */ struct ConfItem *next; /* list node pointer */

View 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)) source_p->servptr->name, SHARED_REHASH))
return 0; return 0;
remote_rehash_oper_p = source_p;
do_rehash(source_p, parc > 1 ? parv[1] : NULL); do_rehash(source_p, parc > 1 ? parv[1] : NULL);
remote_rehash_oper_p = NULL;
return 0; return 0;
} }

View File

@ -1778,6 +1778,8 @@ conf_report_error(const char *fmt, ...)
ierror("\"%s\", line %d: %s", current_file, lineno + 1, msg); 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); 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 int

View File

@ -76,6 +76,7 @@ static void reorganise_temp_kd(void *list);
FILE *conf_fbfile_in; FILE *conf_fbfile_in;
extern char yytext[]; extern char yytext[];
struct Client *remote_rehash_oper_p;
static int verify_access(struct Client *client_p, const char *username); static int verify_access(struct Client *client_p, const char *username);
static int attach_iline(struct Client *, struct ConfItem *); static int attach_iline(struct Client *, struct ConfItem *);
@ -682,6 +683,10 @@ rehash_bans(int sig)
sendto_realops_snomask(SNO_GENERAL, L_ALL, sendto_realops_snomask(SNO_GENERAL, L_ALL,
"Can't open %s file bans could be missing!", "Can't open %s file bans could be missing!",
*banconfs[i].filename); *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 else
{ {
@ -1154,6 +1159,9 @@ read_conf_files(int cold)
{ {
sendto_realops_snomask(SNO_GENERAL, L_ALL, sendto_realops_snomask(SNO_GENERAL, L_ALL,
"Can't open file '%s' - aborting rehash!", filename); "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; return;
} }
} }
@ -1524,6 +1532,9 @@ yyerror(const char *msg)
sendto_realops_snomask(SNO_GENERAL, L_ALL, "\"%s\", line %d: %s at '%s'", sendto_realops_snomask(SNO_GENERAL, L_ALL, "\"%s\", line %d: %s at '%s'",
conffilebuf, lineno + 1, msg, newlinebuf); 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); ilog(L_MAIN, "\"%s\", line %d: %s at '%s'", conffilebuf, lineno + 1, msg, newlinebuf);
} }