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

« back to all changes in this revision

Viewing changes to modules/core/m_kill.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) 1997-2014 ircd-hybrid development team
 
4
 *  Copyright (c) 1997-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_kill.c
23
23
 * \brief Includes required functions for processing the KILL command.
24
 
 * \version $Id: m_kill.c 4564 2014-08-24 10:24:47Z michael $
 
24
 * \version $Id: m_kill.c 5346 2015-01-11 12:41:14Z michael $
25
25
 */
26
26
 
27
27
#include "stdinc.h"
40
40
#include "modules.h"
41
41
 
42
42
 
43
 
/* mo_kill()
44
 
 *  parv[0] = command
45
 
 *  parv[1] = kill victim
46
 
 *  parv[2] = kill path
 
43
/*! \brief KILL command handler
 
44
 *
 
45
 * \param source_p Pointer to allocated Client struct from which the message
 
46
 *                 originally comes from.  This can be a local or remote client.
 
47
 * \param parc     Integer holding the number of supplied arguments.
 
48
 * \param parv     Argument vector where parv[0] .. parv[parc-1] are non-NULL
 
49
 *                 pointers.
 
50
 * \note Valid arguments for this command are:
 
51
 *      - parv[0] = command
 
52
 *      - parv[1] = kill victim
 
53
 *      - parv[2] = reason
47
54
 */
48
55
static int
49
56
mo_kill(struct Client *source_p, int parc, char *parv[])
76
83
     * rewrite the KILL for this new nickname--this keeps
77
84
     * servers in synch when nick change and kill collide
78
85
     */
79
 
    if ((target_p = whowas_get_history(parv[1],
80
 
                                (time_t)ConfigGeneral.kill_chase_time_limit))
81
 
                                == NULL)
 
86
    target_p = whowas_get_history(parv[1], (time_t)ConfigGeneral.kill_chase_time_limit);
 
87
 
 
88
    if (!target_p)
82
89
    {
83
90
      sendto_one_numeric(source_p, &me, ERR_NOSUCHNICK, parv[1]);
84
91
      return 0;
133
140
   */
134
141
  if (!MyConnect(target_p))
135
142
  {
136
 
    sendto_server(source_p, NOCAPS, NOCAPS, ":%s KILL %s :%s!%s!%s!%s (%s)",
 
143
    sendto_server(source_p, 0, 0, ":%s KILL %s :%s!%s!%s!%s (%s)",
137
144
                  source_p->id, target_p->id, me.name, source_p->host,
138
145
                  source_p->username, source_p->name, reason);
139
146
 
140
147
    /*
141
 
     * Set FLAGS_KILLED. This prevents exit_one_client from sending
 
148
     * Set FLAGS_KILLED. This prevents exit_client() from sending
142
149
     * the unnecessary QUIT for this. (This flag should never be
143
150
     * set in any other place)
144
151
     */
150
157
  return 0;
151
158
}
152
159
 
153
 
/* ms_kill()
154
 
 *  parv[0] = command
155
 
 *  parv[1] = kill victim
156
 
 *  parv[2] = kill path and reason
 
160
/*! \brief KILL command handler
 
161
 *
 
162
 * \param source_p Pointer to allocated Client struct from which the message
 
163
 *                 originally comes from.  This can be a local or remote client.
 
164
 * \param parc     Integer holding the number of supplied arguments.
 
165
 * \param parv     Argument vector where parv[0] .. parv[parc-1] are non-NULL
 
166
 *                 pointers.
 
167
 * \note Valid arguments for this command are:
 
168
 *      - parv[0] = command
 
169
 *      - parv[1] = kill victim
 
170
 *      - parv[2] = kill path and reason
157
171
 */
158
172
static int
159
173
ms_kill(struct Client *source_p, int parc, char *parv[])
209
223
   * Path must contain at least 2 !'s, or bitchx falsely declares it
210
224
   * local --fl
211
225
   */
212
 
  if (HasUMode(source_p, UMODE_OPER)) /* send it normally */
 
226
  if (IsClient(source_p))  /* Send it normally */
213
227
    sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE,
214
228
                         "Received KILL message for %s!%s@%s[%s/%s]. From %s Path: %s!%s!%s!%s %s",
215
229
                         target_p->name, target_p->username, target_p->host,
228
242
  ilog(LOG_TYPE_KILL, "KILL From %s For %s Path %s %s",
229
243
       source_p->name, target_p->name, source_p->name, reason);
230
244
 
231
 
  sendto_server(source_p, NOCAPS, NOCAPS, ":%s KILL %s :%s %s",
 
245
  sendto_server(source_p, 0, 0, ":%s KILL %s :%s %s",
232
246
                source_p->id, target_p->id, parv[2], reason);
233
247
  AddFlag(target_p, FLAGS_KILLED);
234
248
 
265
279
{
266
280
  .node    = { NULL, NULL, NULL },
267
281
  .name    = NULL,
268
 
  .version = "$Revision: 4564 $",
 
282
  .version = "$Revision: 5346 $",
269
283
  .handle  = NULL,
270
284
  .modinit = module_init,
271
285
  .modexit = module_exit,