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

« back to all changes in this revision

Viewing changes to modules/m_unresv.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) 2001-2014 ircd-hybrid development team
 
4
 *  Copyright (c) 2001-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_unresv.c
23
23
 * \brief Includes required functions for processing the UNRESV command.
24
 
 * \version $Id: m_unresv.c 4564 2014-08-24 10:24:47Z michael $
 
24
 * \version $Id: m_unresv.c 5775 2015-04-04 17:31:06Z michael $
25
25
 */
26
26
 
27
27
#include "stdinc.h"
36
36
#include "conf.h"
37
37
#include "log.h"
38
38
#include "resv.h"
39
 
#include "hash.h"
40
39
 
41
40
 
42
41
static void
48
47
  {
49
48
    if ((conf = find_exact_name_conf(CONF_CRESV, NULL, name, NULL, NULL)) == NULL)
50
49
    {
51
 
      sendto_one_notice(source_p, &me, ":A RESV does not exist for channel: %s", name);
 
50
      if (IsClient(source_p))
 
51
       sendto_one_notice(source_p, &me, ":A RESV does not exist for channel: %s", name);
 
52
 
52
53
      return;
53
54
    }
54
55
 
55
56
    if (!IsConfDatabase(conf))
56
57
    {
57
 
      sendto_one_notice(source_p, &me, ":The RESV for channel: %s is in ircd.conf and must be removed by hand.",
58
 
                        name);
 
58
      if (IsClient(source_p))
 
59
        sendto_one_notice(source_p, &me, ":The RESV for channel: %s is in ircd.conf and must be removed by hand.",
 
60
                          name);
 
61
 
59
62
      return;
60
63
    }
61
64
 
62
65
    conf_free(conf);
63
 
    sendto_one_notice(source_p, &me, ":The RESV has been removed on channel: %s", name);
 
66
 
 
67
    if (IsClient(source_p))
 
68
      sendto_one_notice(source_p, &me, ":The RESV has been removed on channel: %s", name);
 
69
 
64
70
    sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE,
65
71
                         "%s has removed the RESV for channel: %s",
66
72
                         get_oper_name(source_p), name);
71
77
  {
72
78
    if ((conf = find_exact_name_conf(CONF_NRESV, NULL, name, NULL, NULL)) == NULL)
73
79
    {
74
 
      sendto_one_notice(source_p, &me, ":A RESV does not exist for nick: %s", name);
 
80
      if (IsClient(source_p))
 
81
        sendto_one_notice(source_p, &me, ":A RESV does not exist for nick: %s", name);
 
82
 
75
83
      return;
76
84
    }
77
85
 
78
86
    if (!IsConfDatabase(conf))
79
87
    {
80
 
      sendto_one_notice(source_p, &me, ":The RESV for nick: %s is in ircd.conf and must be removed by hand.",
81
 
                        name);
 
88
      if (IsClient(source_p))
 
89
        sendto_one_notice(source_p, &me, ":The RESV for nick: %s is in ircd.conf and must be removed by hand.",
 
90
                          name);
 
91
 
82
92
      return;
83
93
    }
84
94
 
85
95
    conf_free(conf);
86
 
    sendto_one_notice(source_p, &me, ":The RESV has been removed on nick: %s", name);
 
96
 
 
97
    if (IsClient(source_p))
 
98
      sendto_one_notice(source_p, &me, ":The RESV has been removed on nick: %s", name);
 
99
 
87
100
    sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE,
88
101
                         "%s has removed the RESV for nick: %s",
89
102
                         get_oper_name(source_p), name);
114
127
 
115
128
  /* UNRESV #channel ON irc.server.com */
116
129
  /* UNRESV kiddie ON irc.server.com */
117
 
  if (parse_aline("UNRESV", source_p, parc, parv, 0, &resv, NULL,
118
 
                  NULL, &target_server, &reason) < 0)
 
130
  if (!parse_aline("UNRESV", source_p, parc, parv, 0, &resv, NULL,
 
131
                   NULL, &target_server, &reason))
119
132
    return 0;
120
133
 
121
134
  if (target_server)
122
135
  {
123
 
    sendto_match_servs(source_p, target_server, CAP_CLUSTER,
124
 
                       "UNRESV %s %s",
 
136
    sendto_match_servs(source_p, target_server, CAP_CLUSTER, "UNRESV %s %s",
125
137
                       target_server, resv);
126
138
 
127
139
    /* Allow ON to apply local unresv as well if it matches */
153
165
  if (parc != 3 || EmptyString(parv[2]))
154
166
    return 0;
155
167
 
156
 
  sendto_match_servs(source_p, parv[1], CAP_CLUSTER,
157
 
                     "UNRESV %s %s",
 
168
  sendto_match_servs(source_p, parv[1], CAP_CLUSTER, "UNRESV %s %s",
158
169
                     parv[1], parv[2]);
159
170
 
160
 
  if (!IsClient(source_p) || match(parv[1], me.name))
 
171
  if (match(parv[1], me.name))
161
172
    return 0;
162
173
 
163
174
  if (HasFlag(source_p, FLAGS_SERVICE) ||
190
201
{
191
202
  .node    = { NULL, NULL, NULL },
192
203
  .name    = NULL,
193
 
  .version = "$Revision: 4564 $",
 
204
  .version = "$Revision: 5775 $",
194
205
  .handle  = NULL,
195
206
  .modinit = module_init,
196
207
  .modexit = module_exit,