2 * ircd-ratbox: A slightly useful ircd.
3 * m_kline.c: Bans/unbans a user.
5 * Copyright (C) 1990 Jarkko Oikarinen and University of Oulu, Co Center
6 * Copyright (C) 1996-2002 Hybrid Development Team
7 * Copyright (C) 2002-2005 ircd-ratbox development team
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
37 #include "s_newconf.h"
49 static int mo_kline(struct Client
*, struct Client
*, int, const char **);
50 static int ms_kline(struct Client
*, struct Client
*, int, const char **);
51 static int me_kline(struct Client
*, struct Client
*, int, const char **);
52 static int mo_unkline(struct Client
*, struct Client
*, int, const char **);
53 static int ms_unkline(struct Client
*, struct Client
*, int, const char **);
54 static int me_unkline(struct Client
*, struct Client
*, int, const char **);
56 struct Message kline_msgtab
= {
57 "KLINE", 0, 0, 0, MFLG_SLOW
,
58 {mg_unreg
, mg_not_oper
, {ms_kline
, 5}, {ms_kline
, 5}, {me_kline
, 5}, {mo_kline
, 3}}
61 struct Message unkline_msgtab
= {
62 "UNKLINE", 0, 0, 0, MFLG_SLOW
,
63 {mg_unreg
, mg_not_oper
, {ms_unkline
, 4}, {ms_unkline
, 4}, {me_unkline
, 3}, {mo_unkline
, 2}}
66 mapi_clist_av1 kline_clist
[] = { &kline_msgtab
, &unkline_msgtab
, NULL
};
68 DECLARE_MODULE_AV1(kline
, NULL
, NULL
, kline_clist
, NULL
, NULL
, "$Revision$");
70 /* Local function prototypes */
71 static int find_user_host(struct Client
*source_p
, const char *userhost
, char *user
, char *host
);
72 static int valid_comment(struct Client
*source_p
, char *comment
);
73 static int valid_user_host(struct Client
*source_p
, const char *user
, const char *host
);
75 static void handle_remote_kline(struct Client
*source_p
, int tkline_time
,
76 const char *user
, const char *host
, const char *reason
);
77 static void apply_kline(struct Client
*source_p
, struct ConfItem
*aconf
,
78 const char *reason
, const char *oper_reason
);
79 static void apply_tkline(struct Client
*source_p
, struct ConfItem
*aconf
,
80 const char *, const char *, int);
81 static void apply_prop_kline(struct Client
*source_p
, struct ConfItem
*aconf
,
82 const char *, const char *, int);
83 static int already_placed_kline(struct Client
*, const char *, const char *, int);
85 static void handle_remote_unkline(struct Client
*source_p
, const char *user
, const char *host
);
86 static void remove_permkline_match(struct Client
*, struct ConfItem
*);
87 static int remove_temp_kline(struct Client
*, struct ConfItem
*);
88 static void remove_prop_kline(struct Client
*, struct ConfItem
*);
92 * parv[1] - temp time or user@host
93 * parv[2] - user@host, "ON", or reason
94 * parv[3] - "ON", reason, or server to target
95 * parv[4] - server to target, or reason
99 mo_kline(struct Client
*client_p
, struct Client
*source_p
, int parc
, const char **parv
)
101 char def
[] = "No Reason";
102 char user
[USERLEN
+ 2];
103 char host
[HOSTLEN
+ 2];
106 const char *target_server
= NULL
;
107 struct ConfItem
*aconf
;
110 int propagated
= ConfigFileEntry
.use_propagated_bans
;
112 if(!IsOperK(source_p
))
114 sendto_one(source_p
, form_str(ERR_NOPRIVS
), me
.name
, source_p
->name
, "kline");
118 if((tkline_time
= valid_temp_time(parv
[loc
])) >= 0)
120 /* we just set tkline_time to -1! */
124 if(find_user_host(source_p
, parv
[loc
], user
, host
) == 0)
129 if(parc
>= loc
+ 2 && !irccmp(parv
[loc
], "ON"))
131 if(!IsOperRemoteBan(source_p
))
133 sendto_one(source_p
, form_str(ERR_NOPRIVS
),
134 me
.name
, source_p
->name
, "remoteban");
138 target_server
= parv
[loc
+ 1];
142 if(parc
<= loc
|| EmptyString(parv
[loc
]))
144 sendto_one(source_p
, form_str(ERR_NEEDMOREPARAMS
),
145 me
.name
, source_p
->name
, "KLINE");
149 reason
= LOCAL_COPY(parv
[loc
]);
151 if(target_server
!= NULL
)
153 propagate_generic(source_p
, "KLINE", target_server
, CAP_KLN
,
154 "%d %s %s :%s", tkline_time
, user
, host
, reason
);
156 /* If we are sending it somewhere that doesnt include us, stop */
157 if(!match(target_server
, me
.name
))
160 /* Set as local-only. */
163 /* if we have cluster servers, send it to them.. */
164 else if(!propagated
&& rb_dlink_list_length(&cluster_conf_list
) > 0)
165 cluster_generic(source_p
, "KLINE",
166 (tkline_time
> 0) ? SHARED_TKLINE
: SHARED_PKLINE
, CAP_KLN
,
167 "%lu %s %s :%s", tkline_time
, user
, host
, reason
);
169 if(!valid_user_host(source_p
, user
, host
) ||
170 !valid_comment(source_p
, reason
))
173 if(!valid_wild_card(user
, host
))
175 sendto_one_notice(source_p
,
176 ":Please include at least %d non-wildcard "
177 "characters with the user@host",
178 ConfigFileEntry
.min_nonwildcard
);
182 if(propagated
&& tkline_time
== 0)
184 sendto_one_notice(source_p
, ":Cannot set a permanent global ban");
188 if(already_placed_kline(source_p
, user
, host
, tkline_time
))
193 aconf
->status
= CONF_KILL
;
194 aconf
->created
= rb_current_time();
195 aconf
->host
= rb_strdup(host
);
196 aconf
->user
= rb_strdup(user
);
198 aconf
->info
.oper
= operhash_add(get_oper_name(source_p
));
200 /* Look for an oper reason */
201 if((oper_reason
= strchr(reason
, '|')) != NULL
)
206 if(!EmptyString(oper_reason
))
207 aconf
->spasswd
= rb_strdup(oper_reason
);
209 aconf
->passwd
= rb_strdup(reason
);
212 apply_prop_kline(source_p
, aconf
, reason
, oper_reason
, tkline_time
);
213 else if(tkline_time
> 0)
214 apply_tkline(source_p
, aconf
, reason
, oper_reason
, tkline_time
);
216 apply_kline(source_p
, aconf
, reason
, oper_reason
);
218 if(ConfigFileEntry
.kline_delay
)
220 if(kline_queued
== 0)
222 rb_event_addonce("check_klines", check_klines_event
, NULL
,
223 ConfigFileEntry
.kline_delay
);
235 * parv[1] - server targeted at
236 * parv[2] - tkline time (0 if perm)
242 ms_kline(struct Client
*client_p
, struct Client
*source_p
, int parc
, const char *parv
[])
244 int tkline_time
= atoi(parv
[2]);
246 /* 1.5-3 and earlier contains a bug that allows remote klines to be
247 * sent with an empty reason field. This is a protocol violation,
248 * but its not worth dropping the link over.. --anfl
250 if(parc
< 6 || EmptyString(parv
[5]))
253 propagate_generic(source_p
, "KLINE", parv
[1], CAP_KLN
,
254 "%d %s %s :%s", tkline_time
, parv
[3], parv
[4], parv
[5]);
256 if(!match(parv
[1], me
.name
))
259 if(!IsPerson(source_p
))
262 handle_remote_kline(source_p
, tkline_time
, parv
[3], parv
[4], parv
[5]);
267 me_kline(struct Client
*client_p
, struct Client
*source_p
, int parc
, const char *parv
[])
269 /* <tkline_time> <user> <host> :<reason> */
270 if(!IsPerson(source_p
))
273 handle_remote_kline(source_p
, atoi(parv
[1]), parv
[2], parv
[3], parv
[4]);
278 handle_remote_kline(struct Client
*source_p
, int tkline_time
,
279 const char *user
, const char *host
, const char *kreason
)
281 char *reason
= LOCAL_COPY(kreason
);
282 struct ConfItem
*aconf
= NULL
;
285 if(!find_shared_conf(source_p
->username
, source_p
->host
,
286 source_p
->servptr
->name
,
287 (tkline_time
> 0) ? SHARED_TKLINE
: SHARED_PKLINE
))
290 if(!valid_user_host(source_p
, user
, host
) ||
291 !valid_comment(source_p
, reason
))
294 if(!valid_wild_card(user
, host
))
296 sendto_one_notice(source_p
,
297 ":Please include at least %d non-wildcard "
298 "characters with the user@host",
299 ConfigFileEntry
.min_nonwildcard
);
303 if(already_placed_kline(source_p
, user
, host
, tkline_time
))
308 aconf
->status
= CONF_KILL
;
309 aconf
->created
= rb_current_time();
310 aconf
->user
= rb_strdup(user
);
311 aconf
->host
= rb_strdup(host
);
312 aconf
->info
.oper
= operhash_add(get_oper_name(source_p
));
314 /* Look for an oper reason */
315 if((oper_reason
= strchr(reason
, '|')) != NULL
)
320 if(!EmptyString(oper_reason
))
321 aconf
->spasswd
= rb_strdup(oper_reason
);
323 aconf
->passwd
= rb_strdup(reason
);
326 apply_tkline(source_p
, aconf
, reason
, oper_reason
, tkline_time
);
328 apply_kline(source_p
, aconf
, reason
, oper_reason
);
330 if(ConfigFileEntry
.kline_delay
)
332 if(kline_queued
== 0)
334 rb_event_addonce("check_klines", check_klines_event
, NULL
,
335 ConfigFileEntry
.kline_delay
);
347 * parv[1] - kline to remove
348 * parv[2] - optional "ON"
349 * parv[3] - optional target server
352 mo_unkline(struct Client
*client_p
, struct Client
*source_p
, int parc
, const char *parv
[])
357 char *h
= LOCAL_COPY(parv
[1]);
358 struct ConfItem
*aconf
;
361 if(!IsOperUnkline(source_p
))
363 sendto_one(source_p
, form_str(ERR_NOPRIVS
), me
.name
, source_p
->name
, "unkline");
367 if((host
= strchr(h
, '@')) || *h
== '*' || strchr(h
, '.') || strchr(h
, ':'))
369 /* Explicit user@host mask given */
371 if(host
) /* Found user@host */
375 /* check for @host */
381 /* check for user@ */
387 user
= splat
; /* no @ found, assume its *@somehost */
393 sendto_one_notice(source_p
, ":Invalid parameters");
397 /* possible remote kline.. */
398 if((parc
> 3) && (irccmp(parv
[2], "ON") == 0))
400 if(!IsOperRemoteBan(source_p
))
402 sendto_one(source_p
, form_str(ERR_NOPRIVS
),
403 me
.name
, source_p
->name
, "remoteban");
407 propagate_generic(source_p
, "UNKLINE", parv
[3], CAP_UNKLN
, "%s %s", user
, host
);
409 if(match(parv
[3], me
.name
) == 0)
415 aconf
= find_exact_conf_by_address(host
, CONF_KILL
, user
);
417 /* No clustering for removing a propagated kline */
418 if(propagated
&& (aconf
== NULL
|| !aconf
->lifetime
) &&
419 rb_dlink_list_length(&cluster_conf_list
) > 0)
420 cluster_generic(source_p
, "UNKLINE", SHARED_UNKLINE
, CAP_UNKLN
,
421 "%s %s", user
, host
);
425 sendto_one_notice(source_p
, ":No K-Line for %s@%s", user
, host
);
432 remove_prop_kline(source_p
, aconf
);
434 sendto_one_notice(source_p
, ":Cannot remove global K-Line %s@%s on specific servers", user
, host
);
438 if(remove_temp_kline(source_p
, aconf
))
441 remove_permkline_match(source_p
, aconf
);
448 * parv[1] - target server
449 * parv[2] - user to unkline
450 * parv[3] - host to unkline
453 ms_unkline(struct Client
*client_p
, struct Client
*source_p
, int parc
, const char *parv
[])
455 /* parv[0] parv[1] parv[2] parv[3]
456 * oper target server user host */
457 propagate_generic(source_p
, "UNKLINE", parv
[1], CAP_UNKLN
, "%s %s", parv
[2], parv
[3]);
459 if(!match(parv
[1], me
.name
))
462 if(!IsPerson(source_p
))
465 handle_remote_unkline(source_p
, parv
[2], parv
[3]);
470 me_unkline(struct Client
*client_p
, struct Client
*source_p
, int parc
, const char *parv
[])
473 if(!IsPerson(source_p
))
476 handle_remote_unkline(source_p
, parv
[1], parv
[2]);
481 handle_remote_unkline(struct Client
*source_p
, const char *user
, const char *host
)
483 struct ConfItem
*aconf
;
485 if(!find_shared_conf(source_p
->username
, source_p
->host
,
486 source_p
->servptr
->name
, SHARED_UNKLINE
))
489 aconf
= find_exact_conf_by_address(host
, CONF_KILL
, user
);
492 sendto_one_notice(source_p
, ":No K-Line for %s@%s", user
, host
);
497 sendto_one_notice(source_p
, ":Cannot remove global K-Line %s@%s on specific servers", user
, host
);
501 if(remove_temp_kline(source_p
, aconf
))
504 remove_permkline_match(source_p
, aconf
);
511 * side effects - kline as given, is added to the hashtable
515 apply_kline(struct Client
*source_p
, struct ConfItem
*aconf
,
516 const char *reason
, const char *oper_reason
)
518 add_conf_by_address(aconf
->host
, CONF_KILL
, aconf
->user
, NULL
, aconf
);
519 bandb_add(BANDB_KLINE
, source_p
, aconf
->user
, aconf
->host
,
520 reason
, EmptyString(oper_reason
) ? NULL
: oper_reason
, 0);
522 /* no oper reason.. */
523 if(EmptyString(oper_reason
))
525 sendto_realops_snomask(SNO_GENERAL
, L_ALL
,
526 "%s added K-Line for [%s@%s] [%s]",
527 get_oper_name(source_p
), aconf
->user
, aconf
->host
, reason
);
528 ilog(L_KLINE
, "K %s 0 %s %s %s",
529 get_oper_name(source_p
), aconf
->user
, aconf
->host
, reason
);
533 sendto_realops_snomask(SNO_GENERAL
, L_ALL
,
534 "%s added K-Line for [%s@%s] [%s|%s]",
535 get_oper_name(source_p
), aconf
->user
, aconf
->host
,
536 reason
, oper_reason
);
537 ilog(L_KLINE
, "K %s 0 %s %s %s|%s",
538 get_oper_name(source_p
), aconf
->user
, aconf
->host
, reason
, oper_reason
);
541 sendto_one_notice(source_p
, ":Added K-Line [%s@%s]",
542 aconf
->user
, aconf
->host
);
549 * side effects - tkline as given is placed
552 apply_tkline(struct Client
*source_p
, struct ConfItem
*aconf
,
553 const char *reason
, const char *oper_reason
, int tkline_time
)
555 aconf
->hold
= rb_current_time() + tkline_time
;
556 add_temp_kline(aconf
);
558 /* no oper reason.. */
559 if(EmptyString(oper_reason
))
561 sendto_realops_snomask(SNO_GENERAL
, L_ALL
,
562 "%s added temporary %d min. K-Line for [%s@%s] [%s]",
563 get_oper_name(source_p
), tkline_time
/ 60,
564 aconf
->user
, aconf
->host
, reason
);
565 ilog(L_KLINE
, "K %s %d %s %s %s",
566 get_oper_name(source_p
), tkline_time
/ 60, aconf
->user
, aconf
->host
, reason
);
570 sendto_realops_snomask(SNO_GENERAL
, L_ALL
,
571 "%s added temporary %d min. K-Line for [%s@%s] [%s|%s]",
572 get_oper_name(source_p
), tkline_time
/ 60,
573 aconf
->user
, aconf
->host
, reason
, oper_reason
);
574 ilog(L_KLINE
, "K %s %d %s %s %s|%s",
575 get_oper_name(source_p
), tkline_time
/ 60,
576 aconf
->user
, aconf
->host
, reason
, oper_reason
);
579 sendto_one_notice(source_p
, ":Added temporary %d min. K-Line [%s@%s]",
580 tkline_time
/ 60, aconf
->user
, aconf
->host
);
584 apply_prop_kline(struct Client
*source_p
, struct ConfItem
*aconf
,
585 const char *reason
, const char *oper_reason
, int tkline_time
)
587 aconf
->flags
|= CONF_FLAGS_MYOPER
| CONF_FLAGS_TEMPORARY
;
588 aconf
->hold
= rb_current_time() + tkline_time
;
589 aconf
->lifetime
= aconf
->hold
;
591 replace_old_ban(aconf
);
593 rb_dlinkAddAlloc(aconf
, &prop_bans
);
594 add_conf_by_address(aconf
->host
, CONF_KILL
, aconf
->user
, NULL
, aconf
);
596 /* no oper reason.. */
597 if(EmptyString(oper_reason
))
599 sendto_realops_snomask(SNO_GENERAL
, L_ALL
,
600 "%s added global %d min. K-Line for [%s@%s] [%s]",
601 get_oper_name(source_p
), tkline_time
/ 60,
602 aconf
->user
, aconf
->host
, reason
);
603 ilog(L_KLINE
, "K %s %d %s %s %s",
604 get_oper_name(source_p
), tkline_time
/ 60, aconf
->user
, aconf
->host
, reason
);
608 sendto_realops_snomask(SNO_GENERAL
, L_ALL
,
609 "%s added global %d min. K-Line for [%s@%s] [%s|%s]",
610 get_oper_name(source_p
), tkline_time
/ 60,
611 aconf
->user
, aconf
->host
, reason
, oper_reason
);
612 ilog(L_KLINE
, "K %s %d %s %s %s|%s",
613 get_oper_name(source_p
), tkline_time
/ 60,
614 aconf
->user
, aconf
->host
, reason
, oper_reason
);
617 sendto_one_notice(source_p
, ":Added global %d min. K-Line [%s@%s]",
618 tkline_time
/ 60, aconf
->user
, aconf
->host
);
620 sendto_server(NULL
, NULL
, CAP_BAN
|CAP_TS6
, NOCAPS
,
621 ":%s BAN K %s %s %lu %d %d * :%s%s%s",
622 source_p
->id
, aconf
->user
, aconf
->host
,
623 (unsigned long)aconf
->created
,
624 (int)(aconf
->hold
- aconf
->created
),
625 (int)(aconf
->lifetime
- aconf
->created
),
627 oper_reason
? "|" : "",
628 oper_reason
? oper_reason
: "");
633 * inputs - client placing kline, user@host, user buffer, host buffer
634 * output - 0 if not ok to kline, 1 to kline i.e. if valid user host
638 find_user_host(struct Client
*source_p
, const char *userhost
, char *luser
, char *lhost
)
642 hostp
= strchr(userhost
, '@');
644 if(hostp
!= NULL
) /* I'm a little user@host */
646 *(hostp
++) = '\0'; /* short and squat */
648 rb_strlcpy(luser
, userhost
, USERLEN
+ 1); /* here is my user */
652 rb_strlcpy(lhost
, hostp
, HOSTLEN
+ 1); /* here is my host */
658 /* no '@', no '.', so its not a user@host or host, therefore
659 * its a nick, which support was removed for.
661 if(strchr(userhost
, '.') == NULL
&& strchr(userhost
, ':') == NULL
)
663 sendto_one_notice(source_p
, ":K-Line must be a user@host or host");
667 luser
[0] = '*'; /* no @ found, assume its *@somehost */
669 rb_strlcpy(lhost
, userhost
, HOSTLEN
+ 1);
677 * inputs - user buffer, host buffer
678 * output - 0 if invalid, 1 if valid
682 valid_user_host(struct Client
*source_p
, const char *luser
, const char *lhost
)
684 /* # is invalid, as are '!' (n!u@h kline) and '@' (u@@h kline) */
685 if(strchr(lhost
, '#') || strchr(luser
, '#') || strchr(luser
, '!') || strchr(lhost
, '@'))
687 sendto_one_notice(source_p
, ":Invalid K-Line");
696 * inputs - pointer to client
697 * - pointer to comment
698 * output - 0 if no valid comment, 1 if valid
699 * side effects - NONE
702 valid_comment(struct Client
*source_p
, char *comment
)
704 if(strchr(comment
, '"'))
706 sendto_one_notice(source_p
, ":Invalid character '\"' in comment");
710 if(strlen(comment
) > BANREASONLEN
)
711 comment
[BANREASONLEN
] = '\0';
716 /* already_placed_kline()
718 * inputs - source to notify, user@host to check, tkline time
719 * outputs - 1 if a perm kline or a tkline when a tkline is being
721 * side effects - notifies source_p kline exists
723 /* Note: This currently works if the new K-line is a special case of an
724 * existing K-line, but not the other way round. To do that we would
725 * have to walk the hash and check every existing K-line. -A1kmm.
728 already_placed_kline(struct Client
*source_p
, const char *luser
, const char *lhost
, int tkline
)
730 const char *reason
, *p
;
731 struct rb_sockaddr_storage iphost
, *piphost
;
732 struct ConfItem
*aconf
;
735 aconf
= find_exact_conf_by_address(lhost
, CONF_KILL
, luser
);
736 if(aconf
== NULL
&& ConfigFileEntry
.non_redundant_klines
)
739 if((t
= parse_netmask(lhost
, (struct sockaddr
*) &iphost
, &bits
)) != HM_HOST
)
753 aconf
= find_conf_by_address(lhost
, NULL
, NULL
, (struct sockaddr
*) piphost
,
754 CONF_KILL
, t
, luser
, NULL
);
757 /* The above was really a lookup of a single IP,
758 * so check if the new kline is wider than the
762 p
= strchr(aconf
->host
, '/');
763 if(bits
> 0 && (p
== NULL
|| bits
< atoi(p
+ 1)))
769 /* setting a tkline, or existing one is perm */
770 if(tkline
|| ((aconf
->flags
& CONF_FLAGS_TEMPORARY
) == 0))
772 reason
= aconf
->passwd
? aconf
->passwd
: "<No Reason>";
774 sendto_one_notice(source_p
,
775 ":[%s@%s] already K-Lined by [%s@%s] - %s",
776 luser
, lhost
, aconf
->user
, aconf
->host
, reason
);
784 /* remove_permkline_match()
786 * hunts for a permanent kline, and removes it.
789 remove_permkline_match(struct Client
*source_p
, struct ConfItem
*aconf
)
791 sendto_one_notice(source_p
, ":K-Line for [%s@%s] is removed", aconf
->user
, aconf
->host
);
793 sendto_realops_snomask(SNO_GENERAL
, L_ALL
,
794 "%s has removed the K-Line for: [%s@%s]",
795 get_oper_name(source_p
), aconf
->user
, aconf
->host
);
797 ilog(L_KLINE
, "UK %s %s %s", get_oper_name(source_p
), aconf
->user
, aconf
->host
);
799 remove_reject_mask(aconf
->user
, aconf
->host
);
800 bandb_del(BANDB_KLINE
, aconf
->user
, aconf
->host
);
801 delete_one_address_conf(aconf
->host
, aconf
);
806 /* remove_temp_kline()
808 * inputs - username, hostname to unkline
810 * side effects - tries to unkline anything that matches
813 remove_temp_kline(struct Client
*source_p
, struct ConfItem
*aconf
)
818 for(i
= 0; i
< LAST_TEMP_TYPE
; i
++)
820 RB_DLINK_FOREACH(ptr
, temp_klines
[i
].head
)
822 if(aconf
== ptr
->data
)
824 sendto_one_notice(source_p
,
825 ":Un-klined [%s@%s] from temporary k-lines",
826 aconf
->user
, aconf
->host
);
827 sendto_realops_snomask(SNO_GENERAL
, L_ALL
,
828 "%s has removed the temporary K-Line for: [%s@%s]",
829 get_oper_name(source_p
), aconf
->user
,
832 ilog(L_KLINE
, "UK %s %s %s",
833 get_oper_name(source_p
), aconf
->user
, aconf
->host
);
834 rb_dlinkDestroy(ptr
, &temp_klines
[i
]);
835 remove_reject_mask(aconf
->user
, aconf
->host
);
836 delete_one_address_conf(aconf
->host
, aconf
);
846 remove_prop_kline(struct Client
*source_p
, struct ConfItem
*aconf
)
850 ptr
= rb_dlinkFind(aconf
, &prop_bans
);
853 sendto_one_notice(source_p
,
854 ":Un-klined [%s@%s] from global k-lines",
855 aconf
->user
, aconf
->host
);
856 sendto_realops_snomask(SNO_GENERAL
, L_ALL
,
857 "%s has removed the global K-Line for: [%s@%s]",
858 get_oper_name(source_p
), aconf
->user
,
861 ilog(L_KLINE
, "UK %s %s %s",
862 get_oper_name(source_p
), aconf
->user
, aconf
->host
);
863 if(aconf
->created
< rb_current_time())
864 aconf
->created
= rb_current_time();
867 aconf
->hold
= aconf
->created
;
868 operhash_delete(aconf
->info
.oper
);
869 aconf
->info
.oper
= operhash_add(get_oper_name(source_p
));
870 aconf
->flags
|= CONF_FLAGS_MYOPER
| CONF_FLAGS_TEMPORARY
;
871 sendto_server(NULL
, NULL
, CAP_BAN
|CAP_TS6
, NOCAPS
,
872 ":%s BAN K %s %s %lu %d %d * :*",
873 source_p
->id
, aconf
->user
, aconf
->host
,
874 (unsigned long)aconf
->created
,
876 (int)(aconf
->lifetime
- aconf
->created
));
877 remove_reject_mask(aconf
->user
, aconf
->host
);
878 deactivate_conf(aconf
, ptr
);