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
34 #include "s_newconf.h"
46 static const char kline_desc
[] = "Provides the KLINE facility to ban users via hostmask";
48 static void mo_kline(struct MsgBuf
*, struct Client
*, struct Client
*, int, const char **);
49 static void ms_kline(struct MsgBuf
*, struct Client
*, struct Client
*, int, const char **);
50 static void me_kline(struct MsgBuf
*, struct Client
*, struct Client
*, int, const char **);
51 static void mo_unkline(struct MsgBuf
*, struct Client
*, struct Client
*, int, const char **);
52 static void ms_unkline(struct MsgBuf
*, struct Client
*, struct Client
*, int, const char **);
53 static void me_unkline(struct MsgBuf
*, struct Client
*, struct Client
*, int, const char **);
55 struct Message kline_msgtab
= {
57 {mg_unreg
, mg_not_oper
, {ms_kline
, 5}, {ms_kline
, 5}, {me_kline
, 5}, {mo_kline
, 3}}
60 struct Message unkline_msgtab
= {
61 "UNKLINE", 0, 0, 0, 0,
62 {mg_unreg
, mg_not_oper
, {ms_unkline
, 4}, {ms_unkline
, 4}, {me_unkline
, 3}, {mo_unkline
, 2}}
65 mapi_clist_av1 kline_clist
[] = { &kline_msgtab
, &unkline_msgtab
, NULL
};
67 DECLARE_MODULE_AV2(kline
, NULL
, NULL
, kline_clist
, NULL
, NULL
, NULL
, NULL
, kline_desc
);
69 /* Local function prototypes */
70 static bool find_user_host(struct Client
*source_p
, const char *userhost
, char *user
, char *host
);
71 static bool valid_user_host(struct Client
*source_p
, const char *user
, const char *host
);
73 static void handle_remote_kline(struct Client
*source_p
, int tkline_time
,
74 const char *user
, const char *host
, const char *reason
);
75 static void apply_kline(struct Client
*source_p
, struct ConfItem
*aconf
,
76 const char *reason
, const char *oper_reason
);
77 static void apply_tkline(struct Client
*source_p
, struct ConfItem
*aconf
,
78 const char *, const char *, int);
79 static void apply_prop_kline(struct Client
*source_p
, struct ConfItem
*aconf
,
80 const char *, const char *, int);
81 static bool already_placed_kline(struct Client
*, const char *, const char *, int);
83 static void handle_remote_unkline(struct Client
*source_p
, const char *user
, const char *host
);
84 static void remove_permkline_match(struct Client
*, struct ConfItem
*);
85 static bool remove_temp_kline(struct Client
*, struct ConfItem
*);
86 static void remove_prop_kline(struct Client
*, struct ConfItem
*);
90 * parv[1] - temp time or user@host
91 * parv[2] - user@host, "ON", or reason
92 * parv[3] - "ON", reason, or server to target
93 * parv[4] - server to target, or reason
97 mo_kline(struct MsgBuf
*msgbuf_p
, struct Client
*client_p
, struct Client
*source_p
, int parc
, const char **parv
)
99 char def
[] = "No Reason";
100 char user
[USERLEN
+ 2];
101 char host
[HOSTLEN
+ 2];
104 const char *target_server
= NULL
;
105 struct ConfItem
*aconf
;
108 bool propagated
= ConfigFileEntry
.use_propagated_bans
;
110 if(!IsOperK(source_p
))
112 sendto_one(source_p
, form_str(ERR_NOPRIVS
), me
.name
, source_p
->name
, "kline");
116 if((tkline_time
= valid_temp_time(parv
[loc
])) >= 0)
118 /* we just set tkline_time to -1! */
122 if(find_user_host(source_p
, parv
[loc
], user
, host
) == 0)
127 if(parc
>= loc
+ 2 && !irccmp(parv
[loc
], "ON"))
129 if(!IsOperRemoteBan(source_p
))
131 sendto_one(source_p
, form_str(ERR_NOPRIVS
),
132 me
.name
, source_p
->name
, "remoteban");
136 target_server
= parv
[loc
+ 1];
140 if(parc
<= loc
|| EmptyString(parv
[loc
]))
142 sendto_one(source_p
, form_str(ERR_NEEDMOREPARAMS
),
143 me
.name
, source_p
->name
, "KLINE");
147 reason
= LOCAL_COPY(parv
[loc
]);
149 if(target_server
!= NULL
)
151 propagate_generic(source_p
, "KLINE", target_server
, CAP_KLN
,
152 "%d %s %s :%s", tkline_time
, user
, host
, reason
);
154 /* If we are sending it somewhere that doesnt include us, stop */
155 if(!match(target_server
, me
.name
))
158 /* Set as local-only. */
161 /* if we have cluster servers, send it to them.. */
162 else if(!propagated
&& rb_dlink_list_length(&cluster_conf_list
) > 0)
163 cluster_generic(source_p
, "KLINE",
164 (tkline_time
> 0) ? SHARED_TKLINE
: SHARED_PKLINE
, CAP_KLN
,
165 "%lu %s %s :%s", tkline_time
, user
, host
, reason
);
167 if(!valid_user_host(source_p
, user
, host
))
170 if(!valid_wild_card(user
, host
))
172 sendto_one_notice(source_p
,
173 ":Please include at least %d non-wildcard "
174 "characters with the user@host",
175 ConfigFileEntry
.min_nonwildcard
);
179 if(propagated
&& tkline_time
== 0)
181 sendto_one_notice(source_p
, ":Cannot set a permanent global ban");
185 if(already_placed_kline(source_p
, user
, host
, tkline_time
))
190 aconf
->status
= CONF_KILL
;
191 aconf
->created
= rb_current_time();
192 aconf
->host
= rb_strdup(host
);
193 aconf
->user
= rb_strdup(user
);
195 aconf
->info
.oper
= operhash_add(get_oper_name(source_p
));
197 if(strlen(reason
) > BANREASONLEN
)
198 reason
[BANREASONLEN
] = '\0';
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
)
222 rb_event_addonce("check_klines", check_klines_event
, NULL
,
223 ConfigFileEntry
.kline_delay
);
233 * parv[1] - server targeted at
234 * parv[2] - tkline time (0 if perm)
240 ms_kline(struct MsgBuf
*msgbuf_p
, struct Client
*client_p
, struct Client
*source_p
, int parc
, const char *parv
[])
242 int tkline_time
= atoi(parv
[2]);
244 /* 1.5-3 and earlier contains a bug that allows remote klines to be
245 * sent with an empty reason field. This is a protocol violation,
246 * but its not worth dropping the link over.. --anfl
248 if(parc
< 6 || EmptyString(parv
[5]))
251 propagate_generic(source_p
, "KLINE", parv
[1], CAP_KLN
,
252 "%d %s %s :%s", tkline_time
, parv
[3], parv
[4], parv
[5]);
254 if(!match(parv
[1], me
.name
))
257 if(!IsPerson(source_p
))
260 handle_remote_kline(source_p
, tkline_time
, parv
[3], parv
[4], parv
[5]);
264 me_kline(struct MsgBuf
*msgbuf_p
, struct Client
*client_p
, struct Client
*source_p
, int parc
, const char *parv
[])
266 /* <tkline_time> <user> <host> :<reason> */
267 if(!IsPerson(source_p
))
270 handle_remote_kline(source_p
, atoi(parv
[1]), parv
[2], parv
[3], parv
[4]);
274 handle_remote_kline(struct Client
*source_p
, int tkline_time
,
275 const char *user
, const char *host
, const char *kreason
)
277 char *reason
= LOCAL_COPY(kreason
);
278 struct ConfItem
*aconf
= NULL
;
281 if(!find_shared_conf(source_p
->username
, source_p
->host
,
282 source_p
->servptr
->name
,
283 (tkline_time
> 0) ? SHARED_TKLINE
: SHARED_PKLINE
))
286 if(!valid_user_host(source_p
, user
, host
))
289 if(!valid_wild_card(user
, host
))
291 sendto_one_notice(source_p
,
292 ":Please include at least %d non-wildcard "
293 "characters with the user@host",
294 ConfigFileEntry
.min_nonwildcard
);
298 if(already_placed_kline(source_p
, user
, host
, tkline_time
))
303 aconf
->status
= CONF_KILL
;
304 aconf
->created
= rb_current_time();
305 aconf
->user
= rb_strdup(user
);
306 aconf
->host
= rb_strdup(host
);
307 aconf
->info
.oper
= operhash_add(get_oper_name(source_p
));
309 if(strlen(reason
) > BANREASONLEN
)
310 reason
[BANREASONLEN
] = '\0';
312 /* Look for an oper reason */
313 if((oper_reason
= strchr(reason
, '|')) != NULL
)
318 if(!EmptyString(oper_reason
))
319 aconf
->spasswd
= rb_strdup(oper_reason
);
321 aconf
->passwd
= rb_strdup(reason
);
324 apply_tkline(source_p
, aconf
, reason
, oper_reason
, tkline_time
);
326 apply_kline(source_p
, aconf
, reason
, oper_reason
);
328 if(ConfigFileEntry
.kline_delay
)
332 rb_event_addonce("check_klines", check_klines_event
, NULL
,
333 ConfigFileEntry
.kline_delay
);
343 * parv[1] - kline to remove
344 * parv[2] - optional "ON"
345 * parv[3] - optional target server
348 mo_unkline(struct MsgBuf
*msgbuf_p
, struct Client
*client_p
, struct Client
*source_p
, int parc
, const char *parv
[])
353 char *h
= LOCAL_COPY(parv
[1]);
354 struct ConfItem
*aconf
;
355 bool propagated
= true;
357 if(!IsOperUnkline(source_p
))
359 sendto_one(source_p
, form_str(ERR_NOPRIVS
), me
.name
, source_p
->name
, "unkline");
363 if((host
= strchr(h
, '@')) || *h
== '*' || strchr(h
, '.') || strchr(h
, ':'))
365 /* Explicit user@host mask given */
367 if(host
) /* Found user@host */
371 /* check for @host */
377 /* check for user@ */
383 user
= splat
; /* no @ found, assume its *@somehost */
389 sendto_one_notice(source_p
, ":Invalid parameters");
393 /* possible remote kline.. */
394 if((parc
> 3) && (irccmp(parv
[2], "ON") == 0))
396 if(!IsOperRemoteBan(source_p
))
398 sendto_one(source_p
, form_str(ERR_NOPRIVS
),
399 me
.name
, source_p
->name
, "remoteban");
403 propagate_generic(source_p
, "UNKLINE", parv
[3], CAP_UNKLN
, "%s %s", user
, host
);
405 if(match(parv
[3], me
.name
) == 0)
411 aconf
= find_exact_conf_by_address(host
, CONF_KILL
, user
);
413 /* No clustering for removing a propagated kline */
414 if(propagated
&& (aconf
== NULL
|| !aconf
->lifetime
) &&
415 rb_dlink_list_length(&cluster_conf_list
) > 0)
416 cluster_generic(source_p
, "UNKLINE", SHARED_UNKLINE
, CAP_UNKLN
,
417 "%s %s", user
, host
);
421 sendto_one_notice(source_p
, ":No K-Line for %s@%s", user
, host
);
428 remove_prop_kline(source_p
, aconf
);
430 sendto_one_notice(source_p
, ":Cannot remove global K-Line %s@%s on specific servers", user
, host
);
434 if(remove_temp_kline(source_p
, aconf
))
437 remove_permkline_match(source_p
, aconf
);
442 * parv[1] - target server
443 * parv[2] - user to unkline
444 * parv[3] - host to unkline
447 ms_unkline(struct MsgBuf
*msgbuf_p
, struct Client
*client_p
, struct Client
*source_p
, int parc
, const char *parv
[])
449 /* parv[0] parv[1] parv[2] parv[3]
450 * oper target server user host */
451 propagate_generic(source_p
, "UNKLINE", parv
[1], CAP_UNKLN
, "%s %s", parv
[2], parv
[3]);
453 if(!match(parv
[1], me
.name
))
456 if(!IsPerson(source_p
))
459 handle_remote_unkline(source_p
, parv
[2], parv
[3]);
463 me_unkline(struct MsgBuf
*msgbuf_p
, struct Client
*client_p
, struct Client
*source_p
, int parc
, const char *parv
[])
466 if(!IsPerson(source_p
))
469 handle_remote_unkline(source_p
, parv
[1], parv
[2]);
473 handle_remote_unkline(struct Client
*source_p
, const char *user
, const char *host
)
475 struct ConfItem
*aconf
;
477 if(!find_shared_conf(source_p
->username
, source_p
->host
,
478 source_p
->servptr
->name
, SHARED_UNKLINE
))
481 aconf
= find_exact_conf_by_address(host
, CONF_KILL
, user
);
484 sendto_one_notice(source_p
, ":No K-Line for %s@%s", user
, host
);
489 sendto_one_notice(source_p
, ":Cannot remove global K-Line %s@%s on specific servers", user
, host
);
493 if(remove_temp_kline(source_p
, aconf
))
496 remove_permkline_match(source_p
, aconf
);
503 * side effects - kline as given, is added to the hashtable
507 apply_kline(struct Client
*source_p
, struct ConfItem
*aconf
,
508 const char *reason
, const char *oper_reason
)
510 add_conf_by_address(aconf
->host
, CONF_KILL
, aconf
->user
, NULL
, aconf
);
511 bandb_add(BANDB_KLINE
, source_p
, aconf
->user
, aconf
->host
,
512 reason
, EmptyString(oper_reason
) ? NULL
: oper_reason
, 0);
514 /* no oper reason.. */
515 if(EmptyString(oper_reason
))
517 sendto_realops_snomask(SNO_GENERAL
, L_ALL
,
518 "%s added K-Line for [%s@%s] [%s]",
519 get_oper_name(source_p
), aconf
->user
, aconf
->host
, reason
);
520 ilog(L_KLINE
, "K %s 0 %s %s %s",
521 get_oper_name(source_p
), aconf
->user
, aconf
->host
, reason
);
525 sendto_realops_snomask(SNO_GENERAL
, L_ALL
,
526 "%s added K-Line for [%s@%s] [%s|%s]",
527 get_oper_name(source_p
), aconf
->user
, aconf
->host
,
528 reason
, oper_reason
);
529 ilog(L_KLINE
, "K %s 0 %s %s %s|%s",
530 get_oper_name(source_p
), aconf
->user
, aconf
->host
, reason
, oper_reason
);
533 sendto_one_notice(source_p
, ":Added K-Line [%s@%s]",
534 aconf
->user
, aconf
->host
);
541 * side effects - tkline as given is placed
544 apply_tkline(struct Client
*source_p
, struct ConfItem
*aconf
,
545 const char *reason
, const char *oper_reason
, int tkline_time
)
547 aconf
->hold
= rb_current_time() + tkline_time
;
548 add_temp_kline(aconf
);
550 /* no oper reason.. */
551 if(EmptyString(oper_reason
))
553 sendto_realops_snomask(SNO_GENERAL
, L_ALL
,
554 "%s added temporary %d min. K-Line for [%s@%s] [%s]",
555 get_oper_name(source_p
), tkline_time
/ 60,
556 aconf
->user
, aconf
->host
, reason
);
557 ilog(L_KLINE
, "K %s %d %s %s %s",
558 get_oper_name(source_p
), tkline_time
/ 60, aconf
->user
, aconf
->host
, reason
);
562 sendto_realops_snomask(SNO_GENERAL
, L_ALL
,
563 "%s added temporary %d min. K-Line for [%s@%s] [%s|%s]",
564 get_oper_name(source_p
), tkline_time
/ 60,
565 aconf
->user
, aconf
->host
, reason
, oper_reason
);
566 ilog(L_KLINE
, "K %s %d %s %s %s|%s",
567 get_oper_name(source_p
), tkline_time
/ 60,
568 aconf
->user
, aconf
->host
, reason
, oper_reason
);
571 sendto_one_notice(source_p
, ":Added temporary %d min. K-Line [%s@%s]",
572 tkline_time
/ 60, aconf
->user
, aconf
->host
);
576 apply_prop_kline(struct Client
*source_p
, struct ConfItem
*aconf
,
577 const char *reason
, const char *oper_reason
, int tkline_time
)
579 aconf
->flags
|= CONF_FLAGS_MYOPER
| CONF_FLAGS_TEMPORARY
;
580 aconf
->hold
= rb_current_time() + tkline_time
;
581 aconf
->lifetime
= aconf
->hold
;
583 replace_old_ban(aconf
);
585 rb_dlinkAddAlloc(aconf
, &prop_bans
);
586 add_conf_by_address(aconf
->host
, CONF_KILL
, aconf
->user
, NULL
, aconf
);
588 /* no oper reason.. */
589 if(EmptyString(oper_reason
))
591 sendto_realops_snomask(SNO_GENERAL
, L_ALL
,
592 "%s added global %d min. K-Line for [%s@%s] [%s]",
593 get_oper_name(source_p
), tkline_time
/ 60,
594 aconf
->user
, aconf
->host
, reason
);
595 ilog(L_KLINE
, "K %s %d %s %s %s",
596 get_oper_name(source_p
), tkline_time
/ 60, aconf
->user
, aconf
->host
, reason
);
600 sendto_realops_snomask(SNO_GENERAL
, L_ALL
,
601 "%s added global %d min. K-Line for [%s@%s] [%s|%s]",
602 get_oper_name(source_p
), tkline_time
/ 60,
603 aconf
->user
, aconf
->host
, reason
, oper_reason
);
604 ilog(L_KLINE
, "K %s %d %s %s %s|%s",
605 get_oper_name(source_p
), tkline_time
/ 60,
606 aconf
->user
, aconf
->host
, reason
, oper_reason
);
609 sendto_one_notice(source_p
, ":Added global %d min. K-Line [%s@%s]",
610 tkline_time
/ 60, aconf
->user
, aconf
->host
);
612 sendto_server(NULL
, NULL
, CAP_BAN
|CAP_TS6
, NOCAPS
,
613 ":%s BAN K %s %s %lu %d %d * :%s%s%s",
614 source_p
->id
, aconf
->user
, aconf
->host
,
615 (unsigned long)aconf
->created
,
616 (int)(aconf
->hold
- aconf
->created
),
617 (int)(aconf
->lifetime
- aconf
->created
),
619 oper_reason
? "|" : "",
620 oper_reason
? oper_reason
: "");
625 * inputs - client placing kline, user@host, user buffer, host buffer
626 * output - false if not ok to kline, true to kline i.e. if valid user host
630 find_user_host(struct Client
*source_p
, const char *userhost
, char *luser
, char *lhost
)
634 hostp
= strchr(userhost
, '@');
636 if(hostp
!= NULL
) /* I'm a little user@host */
638 *(hostp
++) = '\0'; /* short and squat */
640 rb_strlcpy(luser
, userhost
, USERLEN
+ 1); /* here is my user */
644 rb_strlcpy(lhost
, hostp
, HOSTLEN
+ 1); /* here is my host */
650 /* no '@', no '.', so its not a user@host or host, therefore
651 * its a nick, which support was removed for.
653 if(strchr(userhost
, '.') == NULL
&& strchr(userhost
, ':') == NULL
)
655 sendto_one_notice(source_p
, ":K-Line must be a user@host or host");
659 luser
[0] = '*'; /* no @ found, assume its *@somehost */
661 rb_strlcpy(lhost
, userhost
, HOSTLEN
+ 1);
664 /* would break the protocol */
665 if (*luser
== ':' || *lhost
== ':')
667 sendto_one_notice(source_p
, ":Invalid K-Line");
676 * inputs - user buffer, host buffer
677 * output - false if invalid, true if valid
681 valid_user_host(struct Client
*source_p
, const char *luser
, const char *lhost
)
683 /* # is invalid, as are '!' (n!u@h kline) and '@' (u@@h kline) */
684 if(strchr(lhost
, '#') || strchr(luser
, '#') || strchr(luser
, '!') || strchr(lhost
, '@'))
686 sendto_one_notice(source_p
, ":Invalid K-Line");
693 /* already_placed_kline()
695 * inputs - source to notify, user@host to check, tkline time
696 * outputs - true if a perm kline or a tkline when a tkline is being
697 * set exists, else false
698 * side effects - notifies source_p kline exists
700 /* Note: This currently works if the new K-line is a special case of an
701 * existing K-line, but not the other way round. To do that we would
702 * have to walk the hash and check every existing K-line. -A1kmm.
705 already_placed_kline(struct Client
*source_p
, const char *luser
, const char *lhost
, int tkline
)
707 const char *reason
, *p
;
708 struct rb_sockaddr_storage iphost
, *piphost
;
709 struct ConfItem
*aconf
;
712 aconf
= find_exact_conf_by_address(lhost
, CONF_KILL
, luser
);
713 if(aconf
== NULL
&& ConfigFileEntry
.non_redundant_klines
)
716 if((t
= parse_netmask(lhost
, &iphost
, &bits
)) != HM_HOST
)
730 aconf
= find_conf_by_address(lhost
, NULL
, NULL
, (struct sockaddr
*) piphost
,
731 CONF_KILL
, t
, luser
, NULL
);
734 /* The above was really a lookup of a single IP,
735 * so check if the new kline is wider than the
739 p
= strchr(aconf
->host
, '/');
740 if(bits
> 0 && (p
== NULL
|| bits
< atoi(p
+ 1)))
746 /* setting a tkline, or existing one is perm */
747 if(tkline
|| ((aconf
->flags
& CONF_FLAGS_TEMPORARY
) == 0))
749 reason
= aconf
->passwd
? aconf
->passwd
: "<No Reason>";
751 sendto_one_notice(source_p
,
752 ":[%s@%s] already K-Lined by [%s@%s] - %s",
753 luser
, lhost
, aconf
->user
, aconf
->host
, reason
);
761 /* remove_permkline_match()
763 * hunts for a permanent kline, and removes it.
766 remove_permkline_match(struct Client
*source_p
, struct ConfItem
*aconf
)
768 sendto_one_notice(source_p
, ":K-Line for [%s@%s] is removed", aconf
->user
, aconf
->host
);
770 sendto_realops_snomask(SNO_GENERAL
, L_ALL
,
771 "%s has removed the K-Line for: [%s@%s]",
772 get_oper_name(source_p
), aconf
->user
, aconf
->host
);
774 ilog(L_KLINE
, "UK %s %s %s", get_oper_name(source_p
), aconf
->user
, aconf
->host
);
776 remove_reject_mask(aconf
->user
, aconf
->host
);
777 bandb_del(BANDB_KLINE
, aconf
->user
, aconf
->host
);
778 delete_one_address_conf(aconf
->host
, aconf
);
781 /* remove_temp_kline()
783 * inputs - username, hostname to unkline
785 * side effects - tries to unkline anything that matches
788 remove_temp_kline(struct Client
*source_p
, struct ConfItem
*aconf
)
793 for(i
= 0; i
< LAST_TEMP_TYPE
; i
++)
795 RB_DLINK_FOREACH(ptr
, temp_klines
[i
].head
)
797 if(aconf
== ptr
->data
)
799 sendto_one_notice(source_p
,
800 ":Un-klined [%s@%s] from temporary k-lines",
801 aconf
->user
, aconf
->host
);
802 sendto_realops_snomask(SNO_GENERAL
, L_ALL
,
803 "%s has removed the temporary K-Line for: [%s@%s]",
804 get_oper_name(source_p
), aconf
->user
,
807 ilog(L_KLINE
, "UK %s %s %s",
808 get_oper_name(source_p
), aconf
->user
, aconf
->host
);
809 rb_dlinkDestroy(ptr
, &temp_klines
[i
]);
810 remove_reject_mask(aconf
->user
, aconf
->host
);
811 delete_one_address_conf(aconf
->host
, aconf
);
821 remove_prop_kline(struct Client
*source_p
, struct ConfItem
*aconf
)
826 ptr
= rb_dlinkFind(aconf
, &prop_bans
);
829 sendto_one_notice(source_p
,
830 ":Un-klined [%s@%s] from global k-lines",
831 aconf
->user
, aconf
->host
);
832 sendto_realops_snomask(SNO_GENERAL
, L_ALL
,
833 "%s has removed the global K-Line for: [%s@%s]",
834 get_oper_name(source_p
), aconf
->user
,
837 ilog(L_KLINE
, "UK %s %s %s",
838 get_oper_name(source_p
), aconf
->user
, aconf
->host
);
839 now
= rb_current_time();
840 if(aconf
->created
< now
)
841 aconf
->created
= now
;
844 aconf
->hold
= aconf
->created
;
845 operhash_delete(aconf
->info
.oper
);
846 aconf
->info
.oper
= operhash_add(get_oper_name(source_p
));
847 aconf
->flags
|= CONF_FLAGS_MYOPER
| CONF_FLAGS_TEMPORARY
;
848 sendto_server(NULL
, NULL
, CAP_BAN
|CAP_TS6
, NOCAPS
,
849 ":%s BAN K %s %s %lu %d %d * :*",
850 source_p
->id
, aconf
->user
, aconf
->host
,
851 (unsigned long)aconf
->created
,
853 (int)(aconf
->lifetime
- aconf
->created
));
854 remove_reject_mask(aconf
->user
, aconf
->host
);
855 deactivate_conf(aconf
, ptr
, now
);