| 1 |
|
/* |
| 2 |
< |
* ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). |
| 3 |
< |
* m_dline.c: Bans a user. |
| 2 |
> |
* ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) |
| 3 |
|
* |
| 4 |
< |
* Copyright (C) 2002 by the past and present ircd coders, and others. |
| 4 |
> |
* Copyright (c) 2002-2014 ircd-hybrid development team |
| 5 |
|
* |
| 6 |
|
* This program is free software; you can redistribute it and/or modify |
| 7 |
|
* it under the terms of the GNU General Public License as published by |
| 17 |
|
* along with this program; if not, write to the Free Software |
| 18 |
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 |
| 19 |
|
* USA |
| 20 |
< |
* |
| 21 |
< |
* $Id$ |
| 20 |
> |
*/ |
| 21 |
> |
|
| 22 |
> |
/*! \file m_dline.c |
| 23 |
> |
* \brief Includes required functions for processing the DLINE/UNDLINE command. |
| 24 |
> |
* \version $Id$ |
| 25 |
|
*/ |
| 26 |
|
|
| 27 |
|
#include "stdinc.h" |
| 156 |
|
|
| 157 |
|
if (!HasOFlag(source_p, OPER_FLAG_DLINE)) |
| 158 |
|
{ |
| 159 |
< |
sendto_one(source_p, form_str(ERR_NOPRIVS), |
| 160 |
< |
me.name, source_p->name, "dline"); |
| 159 |
> |
sendto_one(source_p, form_str(ERR_NOPRIVS), me.name, |
| 160 |
> |
source_p->name, "dline"); |
| 161 |
|
return; |
| 162 |
|
} |
| 163 |
|
|
| 194 |
|
|
| 195 |
|
if (IsExemptKline(target_p)) |
| 196 |
|
{ |
| 197 |
< |
sendto_one(source_p, |
| 198 |
< |
":%s NOTICE %s :%s is E-lined", me.name, |
| 197 |
< |
source_p->name, target_p->name); |
| 197 |
> |
sendto_one(source_p, ":%s NOTICE %s :%s is E-lined", |
| 198 |
> |
me.name, source_p->name, target_p->name); |
| 199 |
|
return; |
| 200 |
|
} |
| 201 |
|
|
| 227 |
|
if ((conf = find_dline_conf(&daddr, aftype)) != NULL) |
| 228 |
|
{ |
| 229 |
|
creason = conf->reason ? conf->reason : def_reason; |
| 230 |
+ |
|
| 231 |
|
if (IsConfExemptKline(conf)) |
| 232 |
< |
sendto_one(source_p, |
| 233 |
< |
":%s NOTICE %s :[%s] is (E)d-lined by [%s] - %s", |
| 232 |
< |
me.name, source_p->name, dlhost, conf->host, creason); |
| 232 |
> |
sendto_one(source_p, ":%s NOTICE %s :[%s] is (E)d-lined by [%s] - %s", |
| 233 |
> |
me.name, source_p->name, dlhost, conf->host, creason); |
| 234 |
|
else |
| 235 |
< |
sendto_one(source_p, |
| 236 |
< |
":%s NOTICE %s :[%s] already D-lined by [%s] - %s", |
| 236 |
< |
me.name, source_p->name, dlhost, conf->host, creason); |
| 235 |
> |
sendto_one(source_p, ":%s NOTICE %s :[%s] already D-lined by [%s] - %s", |
| 236 |
> |
me.name, source_p->name, dlhost, conf->host, creason); |
| 237 |
|
return; |
| 238 |
|
} |
| 239 |
|
|
| 290 |
|
dlhost = parv[3]; |
| 291 |
|
reason = parv[4]; |
| 292 |
|
|
| 293 |
< |
if (HasFlag(source_p, FLAGS_SERVICE) || find_matching_name_conf(CONF_ULINE, source_p->servptr->name, |
| 293 |
> |
if (HasFlag(source_p, FLAGS_SERVICE) || |
| 294 |
> |
find_matching_name_conf(CONF_ULINE, source_p->servptr->name, |
| 295 |
|
source_p->username, source_p->host, |
| 296 |
|
SHARED_DLINE)) |
| 297 |
|
{ |
| 396 |
|
|
| 397 |
|
if (!HasOFlag(source_p, OPER_FLAG_UNDLINE)) |
| 398 |
|
{ |
| 399 |
< |
sendto_one(source_p, form_str(ERR_NOPRIVS), |
| 400 |
< |
me.name, source_p->name, "undline"); |
| 399 |
> |
sendto_one(source_p, form_str(ERR_NOPRIVS), me.name, |
| 400 |
> |
source_p->name, "undline"); |
| 401 |
|
return; |
| 402 |
|
} |
| 403 |
|
|
| 427 |
|
|
| 428 |
|
if (remove_dline_match(addr)) |
| 429 |
|
{ |
| 430 |
< |
sendto_one(source_p, |
| 430 |
< |
":%s NOTICE %s :D-Line for [%s] is removed", |
| 430 |
> |
sendto_one(source_p, ":%s NOTICE %s :D-Line for [%s] is removed", |
| 431 |
|
me.name, source_p->name, addr); |
| 432 |
|
sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE, |
| 433 |
|
"%s has removed the D-Line for: [%s]", |
| 454 |
|
if (!IsClient(source_p) || match(parv[1], me.name)) |
| 455 |
|
return; |
| 456 |
|
|
| 457 |
< |
if (HasFlag(source_p, FLAGS_SERVICE) || find_matching_name_conf(CONF_ULINE, |
| 458 |
< |
source_p->servptr->name, |
| 459 |
< |
source_p->username, source_p->host, |
| 460 |
< |
SHARED_UNDLINE)) |
| 457 |
> |
if (HasFlag(source_p, FLAGS_SERVICE) || |
| 458 |
> |
find_matching_name_conf(CONF_ULINE, source_p->servptr->name, |
| 459 |
> |
source_p->username, source_p->host, |
| 460 |
> |
SHARED_UNDLINE)) |
| 461 |
|
{ |
| 462 |
|
if (remove_dline_match(addr)) |
| 463 |
|
{ |
| 464 |
< |
sendto_one(source_p, |
| 465 |
< |
":%s NOTICE %s :D-Line for [%s] is removed", |
| 464 |
> |
sendto_one(source_p, ":%s NOTICE %s :D-Line for [%s] is removed", |
| 465 |
|
me.name, source_p->name, addr); |
| 466 |
|
sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE, |
| 467 |
|
"%s has removed the D-Line for: [%s]", |
| 489 |
|
me_undline(client_p, source_p, parc, parv); |
| 490 |
|
} |
| 491 |
|
|
| 492 |
< |
static struct Message dline_msgtab = { |
| 492 |
> |
static struct Message dline_msgtab = |
| 493 |
> |
{ |
| 494 |
|
"DLINE", 0, 0, 2, MAXPARA, MFLG_SLOW, 0, |
| 495 |
< |
{m_unregistered, m_not_oper, ms_dline, m_ignore, mo_dline, m_ignore} |
| 495 |
> |
{ m_unregistered, m_not_oper, ms_dline, m_ignore, mo_dline, m_ignore } |
| 496 |
|
}; |
| 497 |
|
|
| 498 |
< |
static struct Message undline_msgtab = { |
| 498 |
> |
static struct Message undline_msgtab = |
| 499 |
> |
{ |
| 500 |
|
"UNDLINE", 0, 0, 2, MAXPARA, MFLG_SLOW, 0, |
| 501 |
< |
{m_unregistered, m_not_oper, ms_undline, m_ignore, mo_undline, m_ignore} |
| 501 |
> |
{ m_unregistered, m_not_oper, ms_undline, m_ignore, mo_undline, m_ignore } |
| 502 |
|
}; |
| 503 |
|
|
| 504 |
|
static void |
| 519 |
|
delete_capability("DLN"); |
| 520 |
|
} |
| 521 |
|
|
| 522 |
< |
struct module module_entry = { |
| 522 |
> |
struct module module_entry = |
| 523 |
> |
{ |
| 524 |
|
.node = { NULL, NULL, NULL }, |
| 525 |
|
.name = NULL, |
| 526 |
|
.version = "$Revision$", |