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_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 int 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 int 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 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 int 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
)
221 if(kline_queued
== 0)
223 rb_event_addonce("check_klines", check_klines_event
, NULL
,
224 ConfigFileEntry
.kline_delay
);
236 * parv[1] - server targeted at
237 * parv[2] - tkline time (0 if perm)
243 ms_kline(struct Client
*client_p
, struct Client
*source_p
, int parc
, const char *parv
[])
245 int tkline_time
= atoi(parv
[2]);
247 /* 1.5-3 and earlier contains a bug that allows remote klines to be
248 * sent with an empty reason field. This is a protocol violation,
249 * but its not worth dropping the link over.. --anfl
251 if(parc
< 6 || EmptyString(parv
[5]))
254 propagate_generic(source_p
, "KLINE", parv
[1], CAP_KLN
,
255 "%d %s %s :%s", tkline_time
, parv
[3], parv
[4], parv
[5]);
257 if(!match(parv
[1], me
.name
))
260 if(!IsPerson(source_p
))
263 handle_remote_kline(source_p
, tkline_time
, parv
[3], parv
[4], parv
[5]);
268 me_kline(struct Client
*client_p
, struct Client
*source_p
, int parc
, const char *parv
[])
270 /* <tkline_time> <user> <host> :<reason> */
271 if(!IsPerson(source_p
))
274 handle_remote_kline(source_p
, atoi(parv
[1]), parv
[2], parv
[3], parv
[4]);
279 handle_remote_kline(struct Client
*source_p
, int tkline_time
,
280 const char *user
, const char *host
, const char *kreason
)
282 char *reason
= LOCAL_COPY(kreason
);
283 struct ConfItem
*aconf
= NULL
;
286 if(!find_shared_conf(source_p
->username
, source_p
->host
,
287 source_p
->servptr
->name
,
288 (tkline_time
> 0) ? SHARED_TKLINE
: SHARED_PKLINE
))
291 if(!valid_user_host(source_p
, user
, host
))
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 if(strlen(reason
) > BANREASONLEN
)
315 reason
[BANREASONLEN
] = '\0';
317 /* Look for an oper reason */
318 if((oper_reason
= strchr(reason
, '|')) != NULL
)
323 if(!EmptyString(oper_reason
))
324 aconf
->spasswd
= rb_strdup(oper_reason
);
326 aconf
->passwd
= rb_strdup(reason
);
329 apply_tkline(source_p
, aconf
, reason
, oper_reason
, tkline_time
);
331 apply_kline(source_p
, aconf
, reason
, oper_reason
);
333 if(ConfigFileEntry
.kline_delay
)
335 if(kline_queued
== 0)
337 rb_event_addonce("check_klines", check_klines_event
, NULL
,
338 ConfigFileEntry
.kline_delay
);
350 * parv[1] - kline to remove
351 * parv[2] - optional "ON"
352 * parv[3] - optional target server
355 mo_unkline(struct Client
*client_p
, struct Client
*source_p
, int parc
, const char *parv
[])
360 char *h
= LOCAL_COPY(parv
[1]);
361 struct ConfItem
*aconf
;
364 if(!IsOperUnkline(source_p
))
366 sendto_one(source_p
, form_str(ERR_NOPRIVS
), me
.name
, source_p
->name
, "unkline");
370 if((host
= strchr(h
, '@')) || *h
== '*' || strchr(h
, '.') || strchr(h
, ':'))
372 /* Explicit user@host mask given */
374 if(host
) /* Found user@host */
378 /* check for @host */
384 /* check for user@ */
390 user
= splat
; /* no @ found, assume its *@somehost */
396 sendto_one_notice(source_p
, ":Invalid parameters");
400 /* possible remote kline.. */
401 if((parc
> 3) && (irccmp(parv
[2], "ON") == 0))
403 if(!IsOperRemoteBan(source_p
))
405 sendto_one(source_p
, form_str(ERR_NOPRIVS
),
406 me
.name
, source_p
->name
, "remoteban");
410 propagate_generic(source_p
, "UNKLINE", parv
[3], CAP_UNKLN
, "%s %s", user
, host
);
412 if(match(parv
[3], me
.name
) == 0)
418 aconf
= find_exact_conf_by_address(host
, CONF_KILL
, user
);
420 /* No clustering for removing a propagated kline */
421 if(propagated
&& (aconf
== NULL
|| !aconf
->lifetime
) &&
422 rb_dlink_list_length(&cluster_conf_list
) > 0)
423 cluster_generic(source_p
, "UNKLINE", SHARED_UNKLINE
, CAP_UNKLN
,
424 "%s %s", user
, host
);
428 sendto_one_notice(source_p
, ":No K-Line for %s@%s", user
, host
);
435 remove_prop_kline(source_p
, aconf
);
437 sendto_one_notice(source_p
, ":Cannot remove global K-Line %s@%s on specific servers", user
, host
);
441 if(remove_temp_kline(source_p
, aconf
))
444 remove_permkline_match(source_p
, aconf
);
451 * parv[1] - target server
452 * parv[2] - user to unkline
453 * parv[3] - host to unkline
456 ms_unkline(struct Client
*client_p
, struct Client
*source_p
, int parc
, const char *parv
[])
458 /* parv[0] parv[1] parv[2] parv[3]
459 * oper target server user host */
460 propagate_generic(source_p
, "UNKLINE", parv
[1], CAP_UNKLN
, "%s %s", parv
[2], parv
[3]);
462 if(!match(parv
[1], me
.name
))
465 if(!IsPerson(source_p
))
468 handle_remote_unkline(source_p
, parv
[2], parv
[3]);
473 me_unkline(struct Client
*client_p
, struct Client
*source_p
, int parc
, const char *parv
[])
476 if(!IsPerson(source_p
))
479 handle_remote_unkline(source_p
, parv
[1], parv
[2]);
484 handle_remote_unkline(struct Client
*source_p
, const char *user
, const char *host
)
486 struct ConfItem
*aconf
;
488 if(!find_shared_conf(source_p
->username
, source_p
->host
,
489 source_p
->servptr
->name
, SHARED_UNKLINE
))
492 aconf
= find_exact_conf_by_address(host
, CONF_KILL
, user
);
495 sendto_one_notice(source_p
, ":No K-Line for %s@%s", user
, host
);
500 sendto_one_notice(source_p
, ":Cannot remove global K-Line %s@%s on specific servers", user
, host
);
504 if(remove_temp_kline(source_p
, aconf
))
507 remove_permkline_match(source_p
, aconf
);
514 * side effects - kline as given, is added to the hashtable
518 apply_kline(struct Client
*source_p
, struct ConfItem
*aconf
,
519 const char *reason
, const char *oper_reason
)
521 add_conf_by_address(aconf
->host
, CONF_KILL
, aconf
->user
, NULL
, aconf
);
522 bandb_add(BANDB_KLINE
, source_p
, aconf
->user
, aconf
->host
,
523 reason
, EmptyString(oper_reason
) ? NULL
: oper_reason
, 0);
525 /* no oper reason.. */
526 if(EmptyString(oper_reason
))
528 sendto_realops_snomask(SNO_GENERAL
, L_ALL
,
529 "%s added K-Line for [%s@%s] [%s]",
530 get_oper_name(source_p
), aconf
->user
, aconf
->host
, reason
);
531 ilog(L_KLINE
, "K %s 0 %s %s %s",
532 get_oper_name(source_p
), aconf
->user
, aconf
->host
, reason
);
536 sendto_realops_snomask(SNO_GENERAL
, L_ALL
,
537 "%s added K-Line for [%s@%s] [%s|%s]",
538 get_oper_name(source_p
), aconf
->user
, aconf
->host
,
539 reason
, oper_reason
);
540 ilog(L_KLINE
, "K %s 0 %s %s %s|%s",
541 get_oper_name(source_p
), aconf
->user
, aconf
->host
, reason
, oper_reason
);
544 sendto_one_notice(source_p
, ":Added K-Line [%s@%s]",
545 aconf
->user
, aconf
->host
);
552 * side effects - tkline as given is placed
555 apply_tkline(struct Client
*source_p
, struct ConfItem
*aconf
,
556 const char *reason
, const char *oper_reason
, int tkline_time
)
558 aconf
->hold
= rb_current_time() + tkline_time
;
559 add_temp_kline(aconf
);
561 /* no oper reason.. */
562 if(EmptyString(oper_reason
))
564 sendto_realops_snomask(SNO_GENERAL
, L_ALL
,
565 "%s added temporary %d min. K-Line for [%s@%s] [%s]",
566 get_oper_name(source_p
), tkline_time
/ 60,
567 aconf
->user
, aconf
->host
, reason
);
568 ilog(L_KLINE
, "K %s %d %s %s %s",
569 get_oper_name(source_p
), tkline_time
/ 60, aconf
->user
, aconf
->host
, reason
);
573 sendto_realops_snomask(SNO_GENERAL
, L_ALL
,
574 "%s added temporary %d min. K-Line for [%s@%s] [%s|%s]",
575 get_oper_name(source_p
), tkline_time
/ 60,
576 aconf
->user
, aconf
->host
, reason
, oper_reason
);
577 ilog(L_KLINE
, "K %s %d %s %s %s|%s",
578 get_oper_name(source_p
), tkline_time
/ 60,
579 aconf
->user
, aconf
->host
, reason
, oper_reason
);
582 sendto_one_notice(source_p
, ":Added temporary %d min. K-Line [%s@%s]",
583 tkline_time
/ 60, aconf
->user
, aconf
->host
);
587 apply_prop_kline(struct Client
*source_p
, struct ConfItem
*aconf
,
588 const char *reason
, const char *oper_reason
, int tkline_time
)
590 aconf
->flags
|= CONF_FLAGS_MYOPER
| CONF_FLAGS_TEMPORARY
;
591 aconf
->hold
= rb_current_time() + tkline_time
;
592 aconf
->lifetime
= aconf
->hold
;
594 replace_old_ban(aconf
);
596 rb_dlinkAddAlloc(aconf
, &prop_bans
);
597 add_conf_by_address(aconf
->host
, CONF_KILL
, aconf
->user
, NULL
, aconf
);
599 /* no oper reason.. */
600 if(EmptyString(oper_reason
))
602 sendto_realops_snomask(SNO_GENERAL
, L_ALL
,
603 "%s added global %d min. K-Line for [%s@%s] [%s]",
604 get_oper_name(source_p
), tkline_time
/ 60,
605 aconf
->user
, aconf
->host
, reason
);
606 ilog(L_KLINE
, "K %s %d %s %s %s",
607 get_oper_name(source_p
), tkline_time
/ 60, aconf
->user
, aconf
->host
, reason
);
611 sendto_realops_snomask(SNO_GENERAL
, L_ALL
,
612 "%s added global %d min. K-Line for [%s@%s] [%s|%s]",
613 get_oper_name(source_p
), tkline_time
/ 60,
614 aconf
->user
, aconf
->host
, reason
, oper_reason
);
615 ilog(L_KLINE
, "K %s %d %s %s %s|%s",
616 get_oper_name(source_p
), tkline_time
/ 60,
617 aconf
->user
, aconf
->host
, reason
, oper_reason
);
620 sendto_one_notice(source_p
, ":Added global %d min. K-Line [%s@%s]",
621 tkline_time
/ 60, aconf
->user
, aconf
->host
);
623 sendto_server(NULL
, NULL
, CAP_BAN
|CAP_TS6
, NOCAPS
,
624 ":%s BAN K %s %s %lu %d %d * :%s%s%s",
625 source_p
->id
, aconf
->user
, aconf
->host
,
626 (unsigned long)aconf
->created
,
627 (int)(aconf
->hold
- aconf
->created
),
628 (int)(aconf
->lifetime
- aconf
->created
),
630 oper_reason
? "|" : "",
631 oper_reason
? oper_reason
: "");
636 * inputs - client placing kline, user@host, user buffer, host buffer
637 * output - 0 if not ok to kline, 1 to kline i.e. if valid user host
641 find_user_host(struct Client
*source_p
, const char *userhost
, char *luser
, char *lhost
)
645 hostp
= strchr(userhost
, '@');
647 if(hostp
!= NULL
) /* I'm a little user@host */
649 *(hostp
++) = '\0'; /* short and squat */
651 rb_strlcpy(luser
, userhost
, USERLEN
+ 1); /* here is my user */
655 rb_strlcpy(lhost
, hostp
, HOSTLEN
+ 1); /* here is my host */
661 /* no '@', no '.', so its not a user@host or host, therefore
662 * its a nick, which support was removed for.
664 if(strchr(userhost
, '.') == NULL
&& strchr(userhost
, ':') == NULL
)
666 sendto_one_notice(source_p
, ":K-Line must be a user@host or host");
670 luser
[0] = '*'; /* no @ found, assume its *@somehost */
672 rb_strlcpy(lhost
, userhost
, HOSTLEN
+ 1);
675 /* would break the protocol */
676 if (*luser
== ':' || *lhost
== ':')
678 sendto_one_notice(source_p
, ":Invalid K-Line");
687 * inputs - user buffer, host buffer
688 * output - 0 if invalid, 1 if valid
692 valid_user_host(struct Client
*source_p
, const char *luser
, const char *lhost
)
694 /* # is invalid, as are '!' (n!u@h kline) and '@' (u@@h kline) */
695 if(strchr(lhost
, '#') || strchr(luser
, '#') || strchr(luser
, '!') || strchr(lhost
, '@'))
697 sendto_one_notice(source_p
, ":Invalid K-Line");
704 /* already_placed_kline()
706 * inputs - source to notify, user@host to check, tkline time
707 * outputs - 1 if a perm kline or a tkline when a tkline is being
709 * side effects - notifies source_p kline exists
711 /* Note: This currently works if the new K-line is a special case of an
712 * existing K-line, but not the other way round. To do that we would
713 * have to walk the hash and check every existing K-line. -A1kmm.
716 already_placed_kline(struct Client
*source_p
, const char *luser
, const char *lhost
, int tkline
)
718 const char *reason
, *p
;
719 struct rb_sockaddr_storage iphost
, *piphost
;
720 struct ConfItem
*aconf
;
723 aconf
= find_exact_conf_by_address(lhost
, CONF_KILL
, luser
);
724 if(aconf
== NULL
&& ConfigFileEntry
.non_redundant_klines
)
727 if((t
= parse_netmask(lhost
, (struct sockaddr
*) &iphost
, &bits
)) != HM_HOST
)
741 aconf
= find_conf_by_address(lhost
, NULL
, NULL
, (struct sockaddr
*) piphost
,
742 CONF_KILL
, t
, luser
, NULL
);
745 /* The above was really a lookup of a single IP,
746 * so check if the new kline is wider than the
750 p
= strchr(aconf
->host
, '/');
751 if(bits
> 0 && (p
== NULL
|| bits
< atoi(p
+ 1)))
757 /* setting a tkline, or existing one is perm */
758 if(tkline
|| ((aconf
->flags
& CONF_FLAGS_TEMPORARY
) == 0))
760 reason
= aconf
->passwd
? aconf
->passwd
: "<No Reason>";
762 sendto_one_notice(source_p
,
763 ":[%s@%s] already K-Lined by [%s@%s] - %s",
764 luser
, lhost
, aconf
->user
, aconf
->host
, reason
);
772 /* remove_permkline_match()
774 * hunts for a permanent kline, and removes it.
777 remove_permkline_match(struct Client
*source_p
, struct ConfItem
*aconf
)
779 sendto_one_notice(source_p
, ":K-Line for [%s@%s] is removed", aconf
->user
, aconf
->host
);
781 sendto_realops_snomask(SNO_GENERAL
, L_ALL
,
782 "%s has removed the K-Line for: [%s@%s]",
783 get_oper_name(source_p
), aconf
->user
, aconf
->host
);
785 ilog(L_KLINE
, "UK %s %s %s", get_oper_name(source_p
), aconf
->user
, aconf
->host
);
787 remove_reject_mask(aconf
->user
, aconf
->host
);
788 bandb_del(BANDB_KLINE
, aconf
->user
, aconf
->host
);
789 delete_one_address_conf(aconf
->host
, aconf
);
794 /* remove_temp_kline()
796 * inputs - username, hostname to unkline
798 * side effects - tries to unkline anything that matches
801 remove_temp_kline(struct Client
*source_p
, struct ConfItem
*aconf
)
806 for(i
= 0; i
< LAST_TEMP_TYPE
; i
++)
808 RB_DLINK_FOREACH(ptr
, temp_klines
[i
].head
)
810 if(aconf
== ptr
->data
)
812 sendto_one_notice(source_p
,
813 ":Un-klined [%s@%s] from temporary k-lines",
814 aconf
->user
, aconf
->host
);
815 sendto_realops_snomask(SNO_GENERAL
, L_ALL
,
816 "%s has removed the temporary K-Line for: [%s@%s]",
817 get_oper_name(source_p
), aconf
->user
,
820 ilog(L_KLINE
, "UK %s %s %s",
821 get_oper_name(source_p
), aconf
->user
, aconf
->host
);
822 rb_dlinkDestroy(ptr
, &temp_klines
[i
]);
823 remove_reject_mask(aconf
->user
, aconf
->host
);
824 delete_one_address_conf(aconf
->host
, aconf
);
834 remove_prop_kline(struct Client
*source_p
, struct ConfItem
*aconf
)
838 ptr
= rb_dlinkFind(aconf
, &prop_bans
);
841 sendto_one_notice(source_p
,
842 ":Un-klined [%s@%s] from global k-lines",
843 aconf
->user
, aconf
->host
);
844 sendto_realops_snomask(SNO_GENERAL
, L_ALL
,
845 "%s has removed the global K-Line for: [%s@%s]",
846 get_oper_name(source_p
), aconf
->user
,
849 ilog(L_KLINE
, "UK %s %s %s",
850 get_oper_name(source_p
), aconf
->user
, aconf
->host
);
851 if(aconf
->created
< rb_current_time())
852 aconf
->created
= rb_current_time();
855 aconf
->hold
= aconf
->created
;
856 operhash_delete(aconf
->info
.oper
);
857 aconf
->info
.oper
= operhash_add(get_oper_name(source_p
));
858 aconf
->flags
|= CONF_FLAGS_MYOPER
| CONF_FLAGS_TEMPORARY
;
859 sendto_server(NULL
, NULL
, CAP_BAN
|CAP_TS6
, NOCAPS
,
860 ":%s BAN K %s %s %lu %d %d * :*",
861 source_p
->id
, aconf
->user
, aconf
->host
,
862 (unsigned long)aconf
->created
,
864 (int)(aconf
->lifetime
- aconf
->created
));
865 remove_reject_mask(aconf
->user
, aconf
->host
);
866 deactivate_conf(aconf
, ptr
);