| 33 |
|
#include "numeric.h" |
| 34 |
|
#include "fdlist.h" |
| 35 |
|
#include "s_bsd.h" |
| 36 |
< |
#include "s_conf.h" |
| 37 |
< |
#include "s_log.h" |
| 36 |
> |
#include "conf.h" |
| 37 |
> |
#include "log.h" |
| 38 |
|
#include "s_misc.h" |
| 39 |
|
#include "send.h" |
| 40 |
|
#include "hash.h" |
| 243 |
|
{ |
| 244 |
|
struct AccessItem *aconf = map_to_conf(conf); |
| 245 |
|
|
| 246 |
< |
add_conf_by_address(CONF_KILL, aconf); |
| 246 |
> |
add_conf_by_address(CONF_KLINE, aconf); |
| 247 |
|
write_conf_line(source_p, conf, current_date, cur_time); |
| 248 |
|
/* Now, activate kline against current online clients */ |
| 249 |
|
rehashed_klines = 1; |
| 263 |
|
|
| 264 |
|
aconf = (struct AccessItem *)map_to_conf(conf); |
| 265 |
|
aconf->hold = CurrentTime + tkline_time; |
| 266 |
< |
add_temp_line(conf); |
| 266 |
> |
SetConfTemporary(aconf); |
| 267 |
> |
add_conf_by_address(CONF_KLINE, aconf); |
| 268 |
> |
|
| 269 |
|
sendto_realops_flags(UMODE_ALL, L_ALL, |
| 270 |
|
"%s added temporary %d min. K-Line for [%s@%s] [%s]", |
| 271 |
|
get_oper_name(source_p), tkline_time/60, |
| 315 |
|
piphost = NULL; |
| 316 |
|
} |
| 317 |
|
|
| 318 |
< |
if ((aconf = find_conf_by_address(lhost, piphost, CONF_KILL, t, luser, NULL))) |
| 318 |
> |
if ((aconf = find_conf_by_address(lhost, piphost, CONF_KLINE, t, luser, NULL))) |
| 319 |
|
{ |
| 320 |
|
if (warn) |
| 321 |
|
{ |
| 492 |
|
static int |
| 493 |
|
remove_tkline_match(const char *host, const char *user) |
| 494 |
|
{ |
| 495 |
< |
struct AccessItem *tk_c; |
| 496 |
< |
dlink_node *tk_n; |
| 497 |
< |
struct irc_ssaddr addr, caddr; |
| 496 |
< |
int nm_t, cnm_t, bits, cbits; |
| 497 |
< |
|
| 498 |
< |
nm_t = parse_netmask(host, &addr, &bits); |
| 495 |
> |
struct irc_ssaddr iphost, *piphost; |
| 496 |
> |
struct AccessItem *aconf; |
| 497 |
> |
int t; |
| 498 |
|
|
| 499 |
< |
DLINK_FOREACH(tk_n, temporary_klines.head) |
| 499 |
> |
if ((t = parse_netmask(host, &iphost, NULL)) != HM_HOST) |
| 500 |
|
{ |
| 502 |
– |
tk_c = map_to_conf(tk_n->data); |
| 503 |
– |
cnm_t = parse_netmask(tk_c->host, &caddr, &cbits); |
| 504 |
– |
|
| 505 |
– |
if (cnm_t != nm_t || irccmp(user, tk_c->user)) |
| 506 |
– |
continue; |
| 507 |
– |
|
| 508 |
– |
if ((nm_t == HM_HOST && !irccmp(tk_c->host, host)) || |
| 509 |
– |
(nm_t == HM_IPV4 && bits == cbits && match_ipv4(&addr, &caddr, bits)) |
| 501 |
|
#ifdef IPV6 |
| 502 |
< |
|| (nm_t == HM_IPV6 && bits == cbits && match_ipv6(&addr, &caddr, bits)) |
| 502 |
> |
if (t == HM_IPV6) |
| 503 |
> |
t = AF_INET6; |
| 504 |
> |
else |
| 505 |
|
#endif |
| 506 |
< |
) |
| 507 |
< |
{ |
| 508 |
< |
dlinkDelete(tk_n, &temporary_klines); |
| 509 |
< |
delete_one_address_conf(tk_c->host, tk_c); |
| 510 |
< |
return 1; |
| 511 |
< |
} |
| 506 |
> |
t = AF_INET; |
| 507 |
> |
piphost = &iphost; |
| 508 |
> |
} |
| 509 |
> |
else |
| 510 |
> |
{ |
| 511 |
> |
t = 0; |
| 512 |
> |
piphost = NULL; |
| 513 |
> |
} |
| 514 |
> |
|
| 515 |
> |
if ((aconf = find_conf_by_address(host, piphost, CONF_KLINE, t, user, NULL))) |
| 516 |
> |
{ |
| 517 |
> |
if (IsConfTemporary(aconf)) |
| 518 |
> |
{ |
| 519 |
> |
delete_one_address_conf(host, aconf); |
| 520 |
> |
return 1; |
| 521 |
> |
} |
| 522 |
|
} |
| 523 |
|
|
| 524 |
|
return 0; |