/** * inject.C: This file contains functionality which implements the OperServ INJECT command. * * Copyright © 2007 Pippijn van Steenhoven / The Ermyth Team * Rights to this code are as documented in COPYING. * * * Portions of this file were derived from sources bearing the following license: * Copyright © 2003-2004 E. Will et al. * Copyright © 2005-2006 Atheme Development Group * Rights to this code are documented in doc/pod/license.pod. * * $Id: inject.C,v 1.8 2007/09/22 14:27:28 pippijn Exp $ */ #include "atheme.h" #include #include "uplink.h" static char const rcsid[] = "$Id: inject.C,v 1.8 2007/09/22 14:27:28 pippijn Exp $"; REGISTER_MODULE ("operserv/inject", false, "The Ermyth Team "); static void os_cmd_inject (sourceinfo_t *si, int parc, char *parv[]); command_t const os_inject = { "INJECT", N_("Fakes data from the uplink (debugging tool)."), PRIV_ADMIN, 1, os_cmd_inject }; E cmdvec os_cmdtree; E helpvec os_helptree; bool _modinit (module *m) { os_cmdtree << os_inject; help_addentry (os_helptree, "INJECT", "help/operserv/inject", NULL); return true; } void _moddeinit () { os_cmdtree >> os_inject; help_delentry (os_helptree, "INJECT"); } static void os_cmd_inject (sourceinfo_t *si, int parc, char *parv[]) { char *inject; static bool injecting = false; inject = parv[0]; if (!config_options.raw) return; if (!inject) { command_fail (si, fault::needmoreparams, STR_INSUFFICIENT_PARAMS, "INJECT"); command_fail (si, fault::needmoreparams, _("Syntax: INJECT ")); return; } logcommand (si, CMDLOG_ADMIN, "INJECT %s", inject); /* looks like someone INJECT'd an INJECT command. * this is probably a bad thing. */ if (injecting == true) { command_fail (si, fault::noprivs, _("You cannot inject an INJECT command.")); return; } injecting = true; irc_parse (inject); injecting = false; } /* vim:cinoptions=>s,e0,n0,f0,{0,}0,^0,=s,ps,t0,c3,+s,(2s,us,)20,*30,gs,hs * vim:ts=8 * vim:sw=8 * vim:noexpandtab */