2000-03-31 Kevin L. Mitchell <klmitch@mit.edu>
+ * ircd/m_clearmode.c (do_clearmode): Log the CLEARMODE to OPATH
+
+ * ircd/m_opmode.c: Log the mode changes to OPATH
+
+ * ircd/channel.c (modebuf_flush_int): Log the mode changes to
+ OPATH
+
+ * include/channel.h (MODEBUF_DEST_LOG): Log the mode changes to
+ OPATH
+
+ * doc/Configure.help: help text for CONFIG_LOG_OPMODE / OPATH
+
+ * config/config-sh.in: added OPATH for opmode log file
+
* ircd/m_clearmode.c (do_clearmode): updated uses of
modebuf_mode_string() for the new usage
#
# ChangeLog for ircu2.10.11
#
-# $Id: ChangeLog,v 1.48 2000-03-31 18:19:09 kev Exp $
+# $Id: ChangeLog,v 1.49 2000-03-31 19:42:03 kev Exp $
#
# Insert new changes at beginning of the change list.
#
if [ "$CONFIG_LOG_JUPES" = "y" ]; then
string ' Give the path and(or) filename of this log file' JPATH 'jupe.log'
fi
+ bool 'Do you want to log OPMODEs and CLEARMODEs to a separate file' CONFIG_LOG_OPMODES y
+ if [ "$CONFIG_LOG_OPMODES" = "y" ]; then
+ string ' Give the path and(or) filename of this log file' OPATH 'opmode.log'
+ fi
bool 'Do you want to log connecting users to a separate file' CONFIG_LOG_USERS
if [ "$CONFIG_LOG_USERS" = "y" ]; then
string ' Give the path and(or) filename of this log file' FNAME_USERLOG $DPATH/users
endmenu
mainmenu_option next_comment
-comment 'Experimental options (Do you know what you'\''re doing?'
+comment 'Experimental options (Do you know what you'\''re doing?)'
bool 'Use new MODE implementation' CONFIG_NEW_MODE
endmenu
log file where the logs of JUPEs will be stored; it is usually called
"jupe.log". Note that you should not include quotes here.
+Do you want to log OPMODEs and CLEARMODEs to a separate file
+CONFIG_LOG_OPMODES
+ Specify 'y' here if you want to log OPMODEs and CLEARMODEs to a local
+ file.
+
+Give the path and(or) filename of this log file
+OPATH
+ OPATH is the filename, relative to DPATH, or the full path, of the
+ log file where the logs of OPMODEs and CLEARMODEs will be stored; it
+ is usually called "opmode.log". Note that you should not include
+ quote here.
+
Do you want to log connecting users to a separate file
CONFIG_LOG_USERS
Specify 'y' here if you want to log who is connecting to your server.
#define MODEBUF_DEST_OPMODE 0x0100 /* Send server mode as OPMODE */
#define MODEBUF_DEST_DEOP 0x0200 /* Deop the offender */
#define MODEBUF_DEST_BOUNCE 0x0400 /* Bounce the modes */
+#define MODEBUF_DEST_LOG 0x0800 /* Log the mode changes to OPATH */
#define MODEBUF_DEST_HACK2 0x2000 /* Send a HACK(2) notice, reverse */
#define MODEBUF_DEST_HACK3 0x4000 /* Send a HACK(3) notice, TS == 0 */
../include/numnicks.h ../include/querycmds.h ../include/s_bsd.h \
../include/s_conf.h ../include/s_debug.h ../include/s_misc.h \
../include/s_user.h ../include/send.h ../include/sprintf_irc.h \
- ../include/support.h ../include/whowas.h
+ ../include/support.h ../include/sys.h ../include/whowas.h
class.o: class.c ../include/class.h ../include/client.h \
../include/dbuf.h ../include/ircd_defs.h ../include/ircd_handler.h \
../include/ircd.h ../config/config.h ../config/setup.h \
../include/hash.h ../include/ircd.h ../include/struct.h \
../include/ircd_reply.h ../include/ircd_string.h \
../include/ircd_chattr.h ../include/msg.h ../include/numeric.h \
- ../include/numnicks.h ../include/s_debug.h ../include/s_user.h \
- ../include/send.h
+ ../include/numnicks.h ../include/s_conf.h ../include/s_debug.h \
+ ../include/s_user.h ../include/send.h
m_motd.o: m_motd.c ../include/client.h ../include/dbuf.h \
../include/ircd_defs.h ../include/ircd_handler.h ../include/ircd.h \
../config/config.h ../config/setup.h ../include/struct.h \
/* If we're building a user visible MODE or HACK... */
if (mbuf->mb_dest & (MODEBUF_DEST_CHANNEL | MODEBUF_DEST_HACK2 |
- MODEBUF_DEST_HACK3 | MODEBUF_DEST_HACK4)) {
+ MODEBUF_DEST_HACK3 | MODEBUF_DEST_HACK4 |
+ MODEBUF_DEST_LOG)) {
/* Set up the parameter strings */
addstr[0] = '\0';
addstr_i = 0;
rembuf_i ? "-" : "", rembuf, addbuf_i ? "+" : "", addbuf,
remstr, addstr, mbuf->mb_channel->creationtime);
+#ifdef OPATH
+ if (mbuf->mb_dest & MODEBUF_DEST_LOG) {
+ if (IsServer(mbuf->mb_source))
+ write_log(OPATH, TIME_T_FMT " %s OPMODE %s %s%s%s%s%s%s\n", TStime(),
+ mbuf->mb_source->name, mbuf->mb_channel->chname,
+ rembuf_i ? "-" : "", rembuf, addbuf_i ? "+" : "", addbuf,
+ remstr, addstr);
+ else
+ write_log(OPATH, TIME_T_FMT " %s!%s@%s OPMODE %s %s%s%s%s%s%s\n",
+ TStime(), mbuf->mb_source->name,
+ mbuf->mb_source->user->username, mbuf->mb_source->user->host,
+ mbuf->mb_channel->chname, rembuf_i ? "-" : "", rembuf,
+ addbuf_i ? "+" : "", addbuf, remstr, addstr);
+ }
+#endif
+
if (mbuf->mb_dest & MODEBUF_DEST_CHANNEL)
sendto_channel_butserv(mbuf->mb_channel, app_source,
":%s MODE %s %s%s%s%s%s%s", app_source->name,
if (del_mode & MODE_KEY)
chptr->mode.key[0] = '\0';
+#ifndef OPATH
/* Don't propagate CLEARMODE if it's a local channel */
if (IsLocalChannel(chptr->chname))
return 0;
+#endif
/* Ok, build control string again */
for (flag_p = flags; flag_p[0]; flag_p += 2)
control_buf[control_buf_i] = '\0';
- /* Then send it */
+#ifdef OPATH
if (IsServer(sptr))
- sendto_serv_butone(cptr, "%s " TOK_CLEARMODE " %s %s", NumServ(sptr),
- chptr->chname, control_buf);
+ write_log(OPATH, TIME_T_FMT " %s CLEARMODE %s %s\n", TStime(), sptr->name,
+ chptr->chname, control_buf);
else
- sendto_serv_butone(cptr, "%s%s " TOK_CLEARMODE " %s %s", NumNick(sptr),
- chptr->chname, control_buf);
+ write_log(OPATH, TIME_T_FMT " %s!%s@%s CLEARMODE %s %s\n", TStime(),
+ sptr->name, sptr->user->username, sptr->user->host,
+ chptr->chname, control_buf);
+#endif
+
+ /* Then send it */
+ if (!IsLocalChannel(chptr->chname)) {
+ if (IsServer(sptr))
+ sendto_serv_butone(cptr, "%s " TOK_CLEARMODE " %s %s", NumServ(sptr),
+ chptr->chname, control_buf);
+ else
+ sendto_serv_butone(cptr, "%s%s " TOK_CLEARMODE " %s %s", NumNick(sptr),
+ chptr->chname, control_buf);
+ }
return 0;
}
(MODEBUF_DEST_CHANNEL | /* Send MODE to channel */
MODEBUF_DEST_SERVER | /* And to server */
MODEBUF_DEST_OPMODE | /* Use OPMODE */
- MODEBUF_DEST_HACK4)); /* Generate a HACK(4) notice */
+ MODEBUF_DEST_HACK4 | /* Generate a HACK(4) notice */
+ MODEBUF_DEST_LOG)); /* Log the mode changes to OPATH */
mode_parse(&mbuf, cptr, sptr, chptr, parc - 2, parv + 2,
(MODE_PARSE_SET | /* Set the modes on the channel */
(MODEBUF_DEST_CHANNEL | /* Send MODE to channel */
MODEBUF_DEST_SERVER | /* And to server */
MODEBUF_DEST_OPMODE | /* Use OPMODE */
- MODEBUF_DEST_HACK4)); /* Generate a HACK(4) notice */
+ MODEBUF_DEST_HACK4 | /* Generate a HACK(4) notice */
+ MODEBUF_DEST_LOG)); /* Log the mode changes to OPATH */
mode_parse(&mbuf, cptr, sptr, chptr, parc - 2, parv + 2,
(MODE_PARSE_SET | /* set the modes on the channel */