예제 #1
0
static void
do_modreload(struct Client *source_p, const char *module)
{
	int modindex;
	int check_core;
	char *m_bn = rb_basename(module);

	if((modindex = findmodule_byname(m_bn)) == -1)
	{
		sendto_one_notice(source_p, ":Module %s is not loaded", m_bn);
		rb_free(m_bn);
		return;
	}

	check_core = modlist[modindex]->core;

	if(unload_one_module(m_bn, true) == false)
	{
		sendto_one_notice(source_p, ":Module %s is not loaded", m_bn);
		rb_free(m_bn);
		return;
	}

	if((load_one_module(m_bn, modlist[modindex]->origin, check_core) == false) && check_core)
	{
		sendto_realops_snomask(SNO_GENERAL, L_NETWIDE,
				     "Error reloading core module: %s: terminating ircd", m_bn);
		ilog(L_MAIN, "Error loading core module %s: terminating ircd", m_bn);
		exit(0);
	}

	rb_free(m_bn);
}
예제 #2
0
/*! \brief LOAD subcommand handler
 *         Attempts to load a module, throwing an error if
 *         the module has already been loaded
 * \param source_p Pointer to client issuing the command
 * \param arg      Additional argument which might be needed by this handler
 */
static void
module_load(struct Client *source_p, const char *arg)
{
  const char *m_bn = NULL;

  if (findmodule_byname((m_bn = libio_basename(arg))))
  {
    sendto_one_notice(source_p, &me, ":Module %s is already loaded", m_bn);
    return;
  }

  load_one_module(arg);
}
예제 #3
0
static void
do_modload(struct Client *source_p, const char *module)
{
	char *m_bn = rb_basename(module);
	int origin;

	if(findmodule_byname(m_bn) != -1)
	{
		sendto_one_notice(source_p, ":Module %s is already loaded", m_bn);
		rb_free(m_bn);
		return;
	}

	origin = strcmp(module, m_bn) == 0 ? MAPI_ORIGIN_CORE : MAPI_ORIGIN_EXTENSION;
	load_one_module(module, origin, false);

	rb_free(m_bn);
}