~ubuntu-branches/debian/sid/ircd-hybrid/sid

« back to all changes in this revision

Viewing changes to modules/m_module.c

  • Committer: Package Import Robot
  • Author(s): Dominic Hargreaves
  • Date: 2015-04-19 15:53:09 UTC
  • mfrom: (1.2.13)
  • Revision ID: package-import@ubuntu.com-20150419155309-06y59x2at2ax5ou3
Tags: 1:8.2.7+dfsg.1-1
* Remove Suggests: hybserv since it doesn't really work with
  ircd-hybrid 8 and above
* New upstream release
  - update debian/copyright with minor changes
  - update config files from new reference.conf
  - fixes DoS from localhost clients (Closes: #782859)
  - supports SSL certficate chaining (Closes: #769741)
* Debconf configuration script no longer ignores the result of
  upgrade questions (Closes: #779082)
* Don't display upgrade warnings on new installs (Closes: #782883)
* Add NEWS item about updated configuration

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
 *  ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd)
3
3
 *
4
 
 *  Copyright (c) 2000-2014 ircd-hybrid development team
 
4
 *  Copyright (c) 2000-2015 ircd-hybrid development team
5
5
 *
6
6
 *  This program is free software; you can redistribute it and/or modify
7
7
 *  it under the terms of the GNU General Public License as published by
21
21
 
22
22
/*! \file m_module.c
23
23
 * \brief Includes required functions for processing the MODULE command.
24
 
 * \version $Id: m_module.c 4564 2014-08-24 10:24:47Z michael $
 
24
 * \version $Id: m_module.c 5346 2015-01-11 12:41:14Z michael $
25
25
 */
26
26
 
27
27
#include "stdinc.h"
30
30
#include "irc_string.h"
31
31
#include "ircd.h"
32
32
#include "numeric.h"
33
 
#include "conf.h"
34
33
#include "log.h"
35
34
#include "send.h"
36
35
#include "parse.h"
109
108
  if (!strcmp(arg, "*"))
110
109
  {
111
110
    unsigned int modnum = 0;
112
 
    dlink_node *ptr = NULL, *ptr_next = NULL;
 
111
    dlink_node *node = NULL, *node_next = NULL;
113
112
 
114
113
    sendto_one_notice(source_p, &me, ":Reloading all modules");
115
114
 
116
115
    modnum = dlink_list_length(modules_get_list());
117
116
 
118
 
    DLINK_FOREACH_SAFE(ptr, ptr_next, modules_get_list()->head)
 
117
    DLINK_FOREACH_SAFE(node, node_next, modules_get_list()->head)
119
118
    {
120
 
      modp = ptr->data;
 
119
      modp = node->data;
121
120
 
122
121
      if (!(modp->flags & MODULE_FLAG_NOUNLOAD))
123
122
        unload_one_module(modp->name, 0);
174
173
static void
175
174
module_list(struct Client *source_p, const char *arg)
176
175
{
177
 
  const dlink_node *ptr = NULL;
 
176
  const dlink_node *node = NULL;
178
177
 
179
 
  DLINK_FOREACH(ptr, modules_get_list()->head)
 
178
  DLINK_FOREACH(node, modules_get_list()->head)
180
179
  {
181
 
    const struct module *modp = ptr->data;
 
180
    const struct module *modp = node->data;
182
181
 
183
182
    if (!EmptyString(arg) && match(arg, modp->name))
184
183
      continue;
222
221
static int
223
222
mo_module(struct Client *source_p, int parc, char *parv[])
224
223
{
 
224
  const char *const subcmd = parv[1];
 
225
  const char *const module = parv[2];
 
226
 
225
227
  if (!HasOFlag(source_p, OPER_FLAG_MODULE))
226
228
  {
227
229
    sendto_one_numeric(source_p, &me, ERR_NOPRIVS, "module");
228
230
    return 0;
229
231
  }
230
232
 
231
 
  if (EmptyString(parv[1]))
 
233
  if (EmptyString(subcmd))
232
234
  {
233
235
    sendto_one_numeric(source_p, &me, ERR_NEEDMOREPARAMS, "MODULE");
234
236
    return 0;
236
238
 
237
239
  for (const struct ModuleStruct *tab = module_cmd_table; tab->handler; ++tab)
238
240
  {
239
 
    if (irccmp(tab->cmd, parv[1]))
 
241
    if (irccmp(tab->cmd, subcmd))
240
242
      continue;
241
243
 
242
 
    if (tab->arg_required && EmptyString(parv[2]))
 
244
    if (tab->arg_required && EmptyString(module))
243
245
    {
244
246
      sendto_one_numeric(source_p, &me, ERR_NEEDMOREPARAMS, "MODULE");
245
247
      return 0;
246
248
    }
247
249
 
248
 
    tab->handler(source_p, parv[2]);
 
250
    tab->handler(source_p, module);
249
251
    return 0;
250
252
  }
251
253
 
252
254
  sendto_one_notice(source_p, &me, ":%s is not a valid option. "
253
255
                    "Choose from LOAD, UNLOAD, RELOAD, LIST",
254
 
                    parv[1]);
 
256
                    subcmd);
255
257
  return 0;
256
258
}
257
259
 
277
279
{
278
280
  .node    = { NULL, NULL, NULL },
279
281
  .name    = NULL,
280
 
  .version = "$Revision: 4564 $",
 
282
  .version = "$Revision: 5346 $",
281
283
  .handle  = NULL,
282
284
  .modinit = module_init,
283
285
  .modexit = module_exit,