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
35 #include "s_newconf.h"
47 static const char kline_desc
[] = "Provides the KLINE facility to ban users via hostmask";
49 static void mo_kline(struct MsgBuf
*, struct Client
*, struct Client
*, int, const char **);
50 static void ms_kline(struct MsgBuf
*, struct Client
*, struct Client
*, int, const char **);
51 static void me_kline(struct MsgBuf
*, struct Client
*, struct Client
*, int, const char **);
52 static void mo_unkline(struct MsgBuf
*, struct Client
*, struct Client
*, int, const char **);
53 static void ms_unkline(struct MsgBuf
*, struct Client
*, struct Client
*, int, const char **);
54 static void me_unkline(struct MsgBuf
*, struct Client
*, struct Client
*, int, const char **);
56 struct Message kline_msgtab
= {
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, 0,
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_AV2(kline
, NULL
, NULL
, kline_clist
, NULL
, NULL
, NULL
, NULL
, kline_desc
);
70 /* Local function prototypes */
71 static bool find_user_host(struct Client
*source_p
, const char *userhost
, char *user
, char *host
);
72 static bool valid_user_host(struct Client
*source_p
, const char *user
, const char *host
);
74 static void handle_remote_kline(struct Client
*source_p
, int tkline_time
,
75 const char *user
, const char *host
, const char *reason
);
76 static void apply_kline(struct Client
*source_p
, struct ConfItem
*aconf
,
77 const char *reason
, const char *oper_reason
);
78 static void apply_tkline(struct Client
*source_p
, struct ConfItem
*aconf
,
79 const char *, const char *, int);
80 static void apply_prop_kline(struct Client
*source_p
, struct ConfItem
*aconf
,
81 const char *, const char *, int);
82 static bool already_placed_kline(struct Client
*, const char *, const char *, int);
84 static void handle_remote_unkline(struct Client
*source_p
, const char *user
, const char *host
);
85 static void remove_permkline_match(struct Client
*, struct ConfItem
*);
86 static bool remove_temp_kline(struct Client
*, struct ConfItem
*);
87 static void remove_prop_kline(struct Client
*, struct ConfItem
*);
91 * parv[1] - temp time or user@host
92 * parv[2] - user@host, "ON", or reason
93 * parv[3] - "ON", reason, or server to target
94 * parv[4] - server to target, or reason
98 mo_kline(struct MsgBuf
*msgbuf_p
, struct Client
*client_p
, struct Client
*source_p
, int parc
, const char **parv
)
100 char def
[] = "No Reason";
101 char user
[USERLEN
+ 2];
102 char host
[HOSTLEN
+ 2];
105 const char *target_server
= NULL
;
106 struct ConfItem
*aconf
;
109 bool propagated
= ConfigFileEntry
.use_propagated_bans
;
111 if(!IsOperK(source_p
))
113 sendto_one(source_p
, form_str(ERR_NOPRIVS
), me
.name
, source_p
->name
, "kline");
117 if((tkline_time
= valid_temp_time(parv
[loc
])) >= 0)
119 /* we just set tkline_time to -1! */
123 if(find_user_host(source_p
, parv
[loc
], user
, host
) == 0)
128 if(parc
>= loc
+ 2 && !irccmp(parv
[loc
], "ON"))
130 if(!IsOperRemoteBan(source_p
))
132 sendto_one(source_p
, form_str(ERR_NOPRIVS
),
133 me
.name
, source_p
->name
, "remoteban");
137 target_server
= parv
[loc
+ 1];
141 if(parc
<= loc
|| EmptyString(parv
[loc
]))
143 sendto_one(source_p
, form_str(ERR_NEEDMOREPARAMS
),
144 me
.name
, source_p
->name
, "KLINE");
148 reason
= LOCAL_COPY(parv
[loc
]);
150 if(target_server
!= NULL
)
152 propagate_generic(source_p
, "KLINE", target_server
, CAP_KLN
,
153 "%d %s %s :%s", tkline_time
, user
, host
, reason
);
155 /* If we are sending it somewhere that doesnt include us, stop */
156 if(!match(target_server
, me
.name
))
159 /* Set as local-only. */
162 /* if we have cluster servers, send it to them.. */
163 else if(!propagated
&& rb_dlink_list_length(&cluster_conf_list
) > 0)
164 cluster_generic(source_p
, "KLINE",
165 (tkline_time
> 0) ? SHARED_TKLINE
: SHARED_PKLINE
, CAP_KLN
,
166 "%lu %s %s :%s", tkline_time
, user
, host
, reason
);
168 if(!valid_user_host(source_p
, user
, host
))
171 if(!valid_wild_card(user
, host
))
173 sendto_one_notice(source_p
,
174 ":Please include at least %d non-wildcard "
175 "characters with the user@host",
176 ConfigFileEntry
.min_nonwildcard
);
180 if(propagated
&& tkline_time
== 0)
182 sendto_one_notice(source_p
, ":Cannot set a permanent global ban");
186 if(already_placed_kline(source_p
, user
, host
, tkline_time
))
191 aconf
->status
= CONF_KILL
;
192 aconf
->created
= rb_current_time();
193 aconf
->host
= rb_strdup(host
);
194 aconf
->user
= rb_strdup(user
);
196 aconf
->info
.oper
= operhash_add(get_oper_name(source_p
));
198 if(strlen(reason
) > BANREASONLEN
)
199 reason
[BANREASONLEN
] = '\0';
201 /* Look for an oper reason */
202 if((oper_reason
= strchr(reason
, '|')) != NULL
)
207 if(!EmptyString(oper_reason
))
208 aconf
->spasswd
= rb_strdup(oper_reason
);
210 aconf
->passwd
= rb_strdup(reason
);
213 apply_prop_kline(source_p
, aconf
, reason
, oper_reason
, tkline_time
);
214 else if(tkline_time
> 0)
215 apply_tkline(source_p
, aconf
, reason
, oper_reason
, tkline_time
);
217 apply_kline(source_p
, aconf
, reason
, oper_reason
);
219 if(ConfigFileEntry
.kline_delay
)
223 rb_event_addonce("check_klines", check_klines_event
, NULL
,
224 ConfigFileEntry
.kline_delay
);
234 * parv[1] - server targeted at
235 * parv[2] - tkline time (0 if perm)
241 ms_kline(struct MsgBuf
*msgbuf_p
, struct Client
*client_p
, struct Client
*source_p
, int parc
, const char *parv
[])
243 int tkline_time
= atoi(parv
[2]);
245 /* 1.5-3 and earlier contains a bug that allows remote klines to be
246 * sent with an empty reason field. This is a protocol violation,
247 * but its not worth dropping the link over.. --anfl
249 if(parc
< 6 || EmptyString(parv
[5]))
252 propagate_generic(source_p
, "KLINE", parv
[1], CAP_KLN
,
253 "%d %s %s :%s", tkline_time
, parv
[3], parv
[4], parv
[5]);
255 if(!match(parv
[1], me
.name
))
258 if(!IsPerson(source_p
))
261 handle_remote_kline(source_p
, tkline_time
, parv
[3], parv
[4], parv
[5]);
265 me_kline(struct MsgBuf
*msgbuf_p
, struct Client
*client_p
, struct Client
*source_p
, int parc
, const char *parv
[])
267 /* <tkline_time> <user> <host> :<reason> */
268 if(!IsPerson(source_p
))
271 handle_remote_kline(source_p
, atoi(parv
[1]), parv
[2], parv
[3], parv
[4]);
275 handle_remote_kline(struct Client
*source_p
, int tkline_time
,
276 const char *user
, const char *host
, const char *kreason
)
278 char *reason
= LOCAL_COPY(kreason
);
279 struct ConfItem
*aconf
= NULL
;
282 if(!find_shared_conf(source_p
->username
, source_p
->host
,
283 source_p
->servptr
->name
,
284 (tkline_time
> 0) ? SHARED_TKLINE
: SHARED_PKLINE
))
287 if(!valid_user_host(source_p
, user
, host
))
290 if(!valid_wild_card(user
, host
))
292 sendto_one_notice(source_p
,
293 ":Please include at least %d non-wildcard "
294 "characters with the user@host",
295 ConfigFileEntry
.min_nonwildcard
);
299 if(already_placed_kline(source_p
, user
, host
, tkline_time
))
304 aconf
->status
= CONF_KILL
;
305 aconf
->created
= rb_current_time();
306 aconf
->user
= rb_strdup(user
);
307 aconf
->host
= rb_strdup(host
);
308 aconf
->info
.oper
= operhash_add(get_oper_name(source_p
));
310 if(strlen(reason
) > BANREASONLEN
)
311 reason
[BANREASONLEN
] = '\0';
313 /* Look for an oper reason */
314 if((oper_reason
= strchr(reason
, '|')) != NULL
)
319 if(!EmptyString(oper_reason
))
320 aconf
->spasswd
= rb_strdup(oper_reason
);
322 aconf
->passwd
= rb_strdup(reason
);
325 apply_tkline(source_p
, aconf
, reason
, oper_reason
, tkline_time
);
327 apply_kline(source_p
, aconf
, reason
, oper_reason
);
329 if(ConfigFileEntry
.kline_delay
)
333 rb_event_addonce("check_klines", check_klines_event
, NULL
,
334 ConfigFileEntry
.kline_delay
);
344 * parv[1] - kline to remove
345 * parv[2] - optional "ON"
346 * parv[3] - optional target server
349 mo_unkline(struct MsgBuf
*msgbuf_p
, struct Client
*client_p
, struct Client
*source_p
, int parc
, const char *parv
[])
354 char *h
= LOCAL_COPY(parv
[1]);
355 struct ConfItem
*aconf
;
356 bool propagated
= true;
358 if(!IsOperUnkline(source_p
))
360 sendto_one(source_p
, form_str(ERR_NOPRIVS
), me
.name
, source_p
->name
, "unkline");
364 if((host
= strchr(h
, '@')) || *h
== '*' || strchr(h
, '.') || strchr(h
, ':'))
366 /* Explicit user@host mask given */
368 if(host
) /* Found user@host */
372 /* check for @host */
378 /* check for user@ */
384 user
= splat
; /* no @ found, assume its *@somehost */
390 sendto_one_notice(source_p
, ":Invalid parameters");
394 /* possible remote kline.. */
395 if((parc
> 3) && (irccmp(parv
[2], "ON") == 0))
397 if(!IsOperRemoteBan(source_p
))
399 sendto_one(source_p
, form_str(ERR_NOPRIVS
),
400 me
.name
, source_p
->name
, "remoteban");
404 propagate_generic(source_p
, "UNKLINE", parv
[3], CAP_UNKLN
, "%s %s", user
, host
);
406 if(match(parv
[3], me
.name
) == 0)
412 aconf
= find_exact_conf_by_address(host
, CONF_KILL
, user
);
414 /* No clustering for removing a propagated kline */
415 if(propagated
&& (aconf
== NULL
|| !aconf
->lifetime
) &&
416 rb_dlink_list_length(&cluster_conf_list
) > 0)
417 cluster_generic(source_p
, "UNKLINE", SHARED_UNKLINE
, CAP_UNKLN
,
418 "%s %s", user
, host
);
422 sendto_one_notice(source_p
, ":No K-Line for %s@%s", user
, host
);
429 remove_prop_kline(source_p
, aconf
);
431 sendto_one_notice(source_p
, ":Cannot remove global K-Line %s@%s on specific servers", user
, host
);
435 if(remove_temp_kline(source_p
, aconf
))
438 remove_permkline_match(source_p
, aconf
);
443 * parv[1] - target server
444 * parv[2] - user to unkline
445 * parv[3] - host to unkline
448 ms_unkline(struct MsgBuf
*msgbuf_p
, struct Client
*client_p
, struct Client
*source_p
, int parc
, const char *parv
[])
450 /* parv[0] parv[1] parv[2] parv[3]
451 * oper target server user host */
452 propagate_generic(source_p
, "UNKLINE", parv
[1], CAP_UNKLN
, "%s %s", parv
[2], parv
[3]);
454 if(!match(parv
[1], me
.name
))
457 if(!IsPerson(source_p
))
460 handle_remote_unkline(source_p
, parv
[2], parv
[3]);
464 me_unkline(struct MsgBuf
*msgbuf_p
, struct Client
*client_p
, struct Client
*source_p
, int parc
, const char *parv
[])
467 if(!IsPerson(source_p
))
470 handle_remote_unkline(source_p
, parv
[1], parv
[2]);
474 handle_remote_unkline(struct Client
*source_p
, const char *user
, const char *host
)
476 struct ConfItem
*aconf
;
478 if(!find_shared_conf(source_p
->username
, source_p
->host
,
479 source_p
->servptr
->name
, SHARED_UNKLINE
))
482 aconf
= find_exact_conf_by_address(host
, CONF_KILL
, user
);
485 sendto_one_notice(source_p
, ":No K-Line for %s@%s", user
, host
);
490 sendto_one_notice(source_p
, ":Cannot remove global K-Line %s@%s on specific servers", user
, host
);
494 if(remove_temp_kline(source_p
, aconf
))
497 remove_permkline_match(source_p
, aconf
);
504 * side effects - kline as given, is added to the hashtable
508 apply_kline(struct Client
*source_p
, struct ConfItem
*aconf
,
509 const char *reason
, const char *oper_reason
)
511 add_conf_by_address(aconf
->host
, CONF_KILL
, aconf
->user
, NULL
, aconf
);
512 bandb_add(BANDB_KLINE
, source_p
, aconf
->user
, aconf
->host
,
513 reason
, EmptyString(oper_reason
) ? NULL
: oper_reason
, 0);
515 /* no oper reason.. */
516 if(EmptyString(oper_reason
))
518 sendto_realops_snomask(SNO_GENERAL
, L_ALL
,
519 "%s added K-Line for [%s@%s] [%s]",
520 get_oper_name(source_p
), aconf
->user
, aconf
->host
, reason
);
521 ilog(L_KLINE
, "K %s 0 %s %s %s",
522 get_oper_name(source_p
), aconf
->user
, aconf
->host
, reason
);
526 sendto_realops_snomask(SNO_GENERAL
, L_ALL
,
527 "%s added K-Line for [%s@%s] [%s|%s]",
528 get_oper_name(source_p
), aconf
->user
, aconf
->host
,
529 reason
, oper_reason
);
530 ilog(L_KLINE
, "K %s 0 %s %s %s|%s",
531 get_oper_name(source_p
), aconf
->user
, aconf
->host
, reason
, oper_reason
);
534 sendto_one_notice(source_p
, ":Added K-Line [%s@%s]",
535 aconf
->user
, aconf
->host
);
542 * side effects - tkline as given is placed
545 apply_tkline(struct Client
*source_p
, struct ConfItem
*aconf
,
546 const char *reason
, const char *oper_reason
, int tkline_time
)
548 aconf
->hold
= rb_current_time() + tkline_time
;
549 add_temp_kline(aconf
);
551 /* no oper reason.. */
552 if(EmptyString(oper_reason
))
554 sendto_realops_snomask(SNO_GENERAL
, L_ALL
,
555 "%s added temporary %d min. K-Line for [%s@%s] [%s]",
556 get_oper_name(source_p
), tkline_time
/ 60,
557 aconf
->user
, aconf
->host
, reason
);
558 ilog(L_KLINE
, "K %s %d %s %s %s",
559 get_oper_name(source_p
), tkline_time
/ 60, aconf
->user
, aconf
->host
, reason
);
563 sendto_realops_snomask(SNO_GENERAL
, L_ALL
,
564 "%s added temporary %d min. K-Line for [%s@%s] [%s|%s]",
565 get_oper_name(source_p
), tkline_time
/ 60,
566 aconf
->user
, aconf
->host
, reason
, oper_reason
);
567 ilog(L_KLINE
, "K %s %d %s %s %s|%s",
568 get_oper_name(source_p
), tkline_time
/ 60,
569 aconf
->user
, aconf
->host
, reason
, oper_reason
);
572 sendto_one_notice(source_p
, ":Added temporary %d min. K-Line [%s@%s]",
573 tkline_time
/ 60, aconf
->user
, aconf
->host
);
577 apply_prop_kline(struct Client
*source_p
, struct ConfItem
*aconf
,
578 const char *reason
, const char *oper_reason
, int tkline_time
)
580 aconf
->flags
|= CONF_FLAGS_MYOPER
| CONF_FLAGS_TEMPORARY
;
581 aconf
->hold
= rb_current_time() + tkline_time
;
582 aconf
->lifetime
= aconf
->hold
;
584 replace_old_ban(aconf
);
586 rb_dlinkAddAlloc(aconf
, &prop_bans
);
587 add_conf_by_address(aconf
->host
, CONF_KILL
, aconf
->user
, NULL
, aconf
);
589 /* no oper reason.. */
590 if(EmptyString(oper_reason
))
592 sendto_realops_snomask(SNO_GENERAL
, L_ALL
,
593 "%s added global %d min. K-Line for [%s@%s] [%s]",
594 get_oper_name(source_p
), tkline_time
/ 60,
595 aconf
->user
, aconf
->host
, reason
);
596 ilog(L_KLINE
, "K %s %d %s %s %s",
597 get_oper_name(source_p
), tkline_time
/ 60, aconf
->user
, aconf
->host
, reason
);
601 sendto_realops_snomask(SNO_GENERAL
, L_ALL
,
602 "%s added global %d min. K-Line for [%s@%s] [%s|%s]",
603 get_oper_name(source_p
), tkline_time
/ 60,
604 aconf
->user
, aconf
->host
, reason
, oper_reason
);
605 ilog(L_KLINE
, "K %s %d %s %s %s|%s",
606 get_oper_name(source_p
), tkline_time
/ 60,
607 aconf
->user
, aconf
->host
, reason
, oper_reason
);
610 sendto_one_notice(source_p
, ":Added global %d min. K-Line [%s@%s]",
611 tkline_time
/ 60, aconf
->user
, aconf
->host
);
613 sendto_server(NULL
, NULL
, CAP_BAN
|CAP_TS6
, NOCAPS
,
614 ":%s BAN K %s %s %lu %d %d * :%s%s%s",
615 source_p
->id
, aconf
->user
, aconf
->host
,
616 (unsigned long)aconf
->created
,
617 (int)(aconf
->hold
- aconf
->created
),
618 (int)(aconf
->lifetime
- aconf
->created
),
620 oper_reason
? "|" : "",
621 oper_reason
? oper_reason
: "");
626 * inputs - client placing kline, user@host, user buffer, host buffer
627 * output - false if not ok to kline, true to kline i.e. if valid user host
631 find_user_host(struct Client
*source_p
, const char *userhost
, char *luser
, char *lhost
)
635 hostp
= strchr(userhost
, '@');
637 if(hostp
!= NULL
) /* I'm a little user@host */
639 *(hostp
++) = '\0'; /* short and squat */
641 rb_strlcpy(luser
, userhost
, USERLEN
+ 1); /* here is my user */
645 rb_strlcpy(lhost
, hostp
, HOSTLEN
+ 1); /* here is my host */
651 /* no '@', no '.', so its not a user@host or host, therefore
652 * its a nick, which support was removed for.
654 if(strchr(userhost
, '.') == NULL
&& strchr(userhost
, ':') == NULL
)
656 sendto_one_notice(source_p
, ":K-Line must be a user@host or host");
660 luser
[0] = '*'; /* no @ found, assume its *@somehost */
662 rb_strlcpy(lhost
, userhost
, HOSTLEN
+ 1);
665 /* would break the protocol */
666 if (*luser
== ':' || *lhost
== ':')
668 sendto_one_notice(source_p
, ":Invalid K-Line");
677 * inputs - user buffer, host buffer
678 * output - false if invalid, true 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");
694 /* already_placed_kline()
696 * inputs - source to notify, user@host to check, tkline time
697 * outputs - true if a perm kline or a tkline when a tkline is being
698 * set exists, else false
699 * side effects - notifies source_p kline exists
701 /* Note: This currently works if the new K-line is a special case of an
702 * existing K-line, but not the other way round. To do that we would
703 * have to walk the hash and check every existing K-line. -A1kmm.
706 already_placed_kline(struct Client
*source_p
, const char *luser
, const char *lhost
, int tkline
)
708 const char *reason
, *p
;
709 struct rb_sockaddr_storage iphost
, *piphost
;
710 struct ConfItem
*aconf
;
713 aconf
= find_exact_conf_by_address(lhost
, CONF_KILL
, luser
);
714 if(aconf
== NULL
&& ConfigFileEntry
.non_redundant_klines
)
717 if((t
= parse_netmask(lhost
, &iphost
, &bits
)) != HM_HOST
)
731 aconf
= find_conf_by_address(lhost
, NULL
, NULL
, (struct sockaddr
*) piphost
,
732 CONF_KILL
, t
, luser
, NULL
);
735 /* The above was really a lookup of a single IP,
736 * so check if the new kline is wider than the
740 p
= strchr(aconf
->host
, '/');
741 if(bits
> 0 && (p
== NULL
|| bits
< atoi(p
+ 1)))
747 /* setting a tkline, or existing one is perm */
748 if(tkline
|| ((aconf
->flags
& CONF_FLAGS_TEMPORARY
) == 0))
750 reason
= aconf
->passwd
? aconf
->passwd
: "<No Reason>";
752 sendto_one_notice(source_p
,
753 ":[%s@%s] already K-Lined by [%s@%s] - %s",
754 luser
, lhost
, aconf
->user
, aconf
->host
, reason
);
762 /* remove_permkline_match()
764 * hunts for a permanent kline, and removes it.
767 remove_permkline_match(struct Client
*source_p
, struct ConfItem
*aconf
)
769 sendto_one_notice(source_p
, ":K-Line for [%s@%s] is removed", aconf
->user
, aconf
->host
);
771 sendto_realops_snomask(SNO_GENERAL
, L_ALL
,
772 "%s has removed the K-Line for: [%s@%s]",
773 get_oper_name(source_p
), aconf
->user
, aconf
->host
);
775 ilog(L_KLINE
, "UK %s %s %s", get_oper_name(source_p
), aconf
->user
, aconf
->host
);
777 remove_reject_mask(aconf
->user
, aconf
->host
);
778 bandb_del(BANDB_KLINE
, aconf
->user
, aconf
->host
);
779 delete_one_address_conf(aconf
->host
, aconf
);
782 /* remove_temp_kline()
784 * inputs - username, hostname to unkline
786 * side effects - tries to unkline anything that matches
789 remove_temp_kline(struct Client
*source_p
, struct ConfItem
*aconf
)
794 for(i
= 0; i
< LAST_TEMP_TYPE
; i
++)
796 RB_DLINK_FOREACH(ptr
, temp_klines
[i
].head
)
798 if(aconf
== ptr
->data
)
800 sendto_one_notice(source_p
,
801 ":Un-klined [%s@%s] from temporary k-lines",
802 aconf
->user
, aconf
->host
);
803 sendto_realops_snomask(SNO_GENERAL
, L_ALL
,
804 "%s has removed the temporary K-Line for: [%s@%s]",
805 get_oper_name(source_p
), aconf
->user
,
808 ilog(L_KLINE
, "UK %s %s %s",
809 get_oper_name(source_p
), aconf
->user
, aconf
->host
);
810 rb_dlinkDestroy(ptr
, &temp_klines
[i
]);
811 remove_reject_mask(aconf
->user
, aconf
->host
);
812 delete_one_address_conf(aconf
->host
, aconf
);
822 remove_prop_kline(struct Client
*source_p
, struct ConfItem
*aconf
)
827 ptr
= rb_dlinkFind(aconf
, &prop_bans
);
830 sendto_one_notice(source_p
,
831 ":Un-klined [%s@%s] from global k-lines",
832 aconf
->user
, aconf
->host
);
833 sendto_realops_snomask(SNO_GENERAL
, L_ALL
,
834 "%s has removed the global K-Line for: [%s@%s]",
835 get_oper_name(source_p
), aconf
->user
,
838 ilog(L_KLINE
, "UK %s %s %s",
839 get_oper_name(source_p
), aconf
->user
, aconf
->host
);
840 now
= rb_current_time();
841 if(aconf
->created
< now
)
842 aconf
->created
= now
;
845 aconf
->hold
= aconf
->created
;
846 operhash_delete(aconf
->info
.oper
);
847 aconf
->info
.oper
= operhash_add(get_oper_name(source_p
));
848 aconf
->flags
|= CONF_FLAGS_MYOPER
| CONF_FLAGS_TEMPORARY
;
849 sendto_server(NULL
, NULL
, CAP_BAN
|CAP_TS6
, NOCAPS
,
850 ":%s BAN K %s %s %lu %d %d * :*",
851 source_p
->id
, aconf
->user
, aconf
->host
,
852 (unsigned long)aconf
->created
,
854 (int)(aconf
->lifetime
- aconf
->created
));
855 remove_reject_mask(aconf
->user
, aconf
->host
);
856 deactivate_conf(aconf
, ptr
, now
);