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
*);
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_buf
[HOSTLEN
+ 3], *host
= host_buf
+ 1;
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)
134 if(parc
>= loc
+ 2 && !irccmp(parv
[loc
], "ON"))
136 if(!IsOperRemoteBan(source_p
))
138 sendto_one(source_p
, form_str(ERR_NOPRIVS
),
139 me
.name
, source_p
->name
, "remoteban");
143 target_server
= parv
[loc
+ 1];
147 if(parc
<= loc
|| EmptyString(parv
[loc
]))
149 sendto_one(source_p
, form_str(ERR_NEEDMOREPARAMS
),
150 me
.name
, source_p
->name
, "KLINE");
154 reason
= LOCAL_COPY(parv
[loc
]);
156 if(parse_netmask_strict(host
, NULL
, NULL
) == HM_ERROR
)
158 sendto_one_notice(source_p
,
159 ":[%s@%s] looks like an ill-formed IP K-line, refusing to set it",
164 if(target_server
!= NULL
)
166 propagate_generic(source_p
, "KLINE", target_server
, CAP_KLN
,
167 "%d %s %s :%s", tkline_time
, user
, host
, reason
);
169 /* If we are sending it somewhere that doesnt include us, stop */
170 if(!match(target_server
, me
.name
))
173 /* Set as local-only. */
176 /* if we have cluster servers, send it to them.. */
177 else if(!propagated
&& rb_dlink_list_length(&cluster_conf_list
) > 0)
178 cluster_generic(source_p
, "KLINE",
179 (tkline_time
> 0) ? SHARED_TKLINE
: SHARED_PKLINE
, CAP_KLN
,
180 "%lu %s %s :%s", tkline_time
, user
, host
, reason
);
182 if(!valid_user_host(source_p
, user
, host
))
185 if(!valid_wild_card(user
, host
))
187 sendto_one_notice(source_p
,
188 ":Please include at least %d non-wildcard "
189 "characters with the user@host",
190 ConfigFileEntry
.min_nonwildcard
);
194 if(propagated
&& tkline_time
== 0)
196 sendto_one_notice(source_p
, ":Cannot set a permanent global ban");
200 if(already_placed_kline(source_p
, user
, host
, tkline_time
))
205 aconf
->status
= CONF_KILL
;
206 aconf
->created
= rb_current_time();
207 aconf
->host
= rb_strdup(host
);
208 aconf
->user
= rb_strdup(user
);
210 aconf
->info
.oper
= operhash_add(get_oper_name(source_p
));
212 if(strlen(reason
) > BANREASONLEN
)
213 reason
[BANREASONLEN
] = '\0';
215 /* Look for an oper reason */
216 if((oper_reason
= strchr(reason
, '|')) != NULL
)
221 if(!EmptyString(oper_reason
))
222 aconf
->spasswd
= rb_strdup(oper_reason
);
224 aconf
->passwd
= rb_strdup(reason
);
227 apply_prop_kline(source_p
, aconf
, reason
, oper_reason
, tkline_time
);
228 else if(tkline_time
> 0)
229 apply_tkline(source_p
, aconf
, reason
, oper_reason
, tkline_time
);
231 apply_kline(source_p
, aconf
, reason
, oper_reason
);
233 check_one_kline(aconf
);
238 * parv[1] - server targeted at
239 * parv[2] - tkline time (0 if perm)
245 ms_kline(struct MsgBuf
*msgbuf_p
, struct Client
*client_p
, struct Client
*source_p
, int parc
, const char *parv
[])
247 int tkline_time
= atoi(parv
[2]);
249 /* 1.5-3 and earlier contains a bug that allows remote klines to be
250 * sent with an empty reason field. This is a protocol violation,
251 * but its not worth dropping the link over.. --anfl
253 if(parc
< 6 || EmptyString(parv
[5]))
256 propagate_generic(source_p
, "KLINE", parv
[1], CAP_KLN
,
257 "%d %s %s :%s", tkline_time
, parv
[3], parv
[4], parv
[5]);
259 if(!match(parv
[1], me
.name
))
262 if(!IsPerson(source_p
))
265 handle_remote_kline(source_p
, tkline_time
, parv
[3], parv
[4], parv
[5]);
269 me_kline(struct MsgBuf
*msgbuf_p
, struct Client
*client_p
, struct Client
*source_p
, int parc
, const char *parv
[])
271 /* <tkline_time> <user> <host> :<reason> */
272 if(!IsPerson(source_p
))
275 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 check_one_kline(aconf
);
338 * parv[1] - kline to remove
339 * parv[2] - optional "ON"
340 * parv[3] - optional target server
343 mo_unkline(struct MsgBuf
*msgbuf_p
, struct Client
*client_p
, struct Client
*source_p
, int parc
, const char *parv
[])
348 char *h
= LOCAL_COPY(parv
[1]);
349 struct ConfItem
*aconf
;
350 bool propagated
= true;
352 if(!IsOperUnkline(source_p
))
354 sendto_one(source_p
, form_str(ERR_NOPRIVS
), me
.name
, source_p
->name
, "unkline");
358 if((host
= strchr(h
, '@')) || *h
== '*' || strchr(h
, '.') || strchr(h
, ':'))
360 /* Explicit user@host mask given */
362 if(host
) /* Found user@host */
366 /* check for @host */
372 /* check for user@ */
378 user
= splat
; /* no @ found, assume its *@somehost */
384 sendto_one_notice(source_p
, ":Invalid parameters");
388 /* possible remote kline.. */
389 if((parc
> 3) && (irccmp(parv
[2], "ON") == 0))
391 if(!IsOperRemoteBan(source_p
))
393 sendto_one(source_p
, form_str(ERR_NOPRIVS
),
394 me
.name
, source_p
->name
, "remoteban");
398 propagate_generic(source_p
, "UNKLINE", parv
[3], CAP_UNKLN
, "%s %s", user
, host
);
400 if(match(parv
[3], me
.name
) == 0)
406 aconf
= find_exact_conf_by_address(host
, CONF_KILL
, user
);
408 /* No clustering for removing a propagated kline */
409 if(propagated
&& (aconf
== NULL
|| !aconf
->lifetime
) &&
410 rb_dlink_list_length(&cluster_conf_list
) > 0)
411 cluster_generic(source_p
, "UNKLINE", SHARED_UNKLINE
, CAP_UNKLN
,
412 "%s %s", user
, host
);
416 sendto_one_notice(source_p
, ":No K-Line for %s@%s", user
, host
);
423 remove_prop_kline(source_p
, aconf
);
425 sendto_one_notice(source_p
, ":Cannot remove global K-Line %s@%s on specific servers", user
, host
);
429 if(remove_temp_kline(source_p
, aconf
))
432 remove_permkline_match(source_p
, aconf
);
437 * parv[1] - target server
438 * parv[2] - user to unkline
439 * parv[3] - host to unkline
442 ms_unkline(struct MsgBuf
*msgbuf_p
, struct Client
*client_p
, struct Client
*source_p
, int parc
, const char *parv
[])
444 /* parv[0] parv[1] parv[2] parv[3]
445 * oper target server user host */
446 propagate_generic(source_p
, "UNKLINE", parv
[1], CAP_UNKLN
, "%s %s", parv
[2], parv
[3]);
448 if(!match(parv
[1], me
.name
))
451 if(!IsPerson(source_p
))
454 handle_remote_unkline(source_p
, parv
[2], parv
[3]);
458 me_unkline(struct MsgBuf
*msgbuf_p
, struct Client
*client_p
, struct Client
*source_p
, int parc
, const char *parv
[])
461 if(!IsPerson(source_p
))
464 handle_remote_unkline(source_p
, parv
[1], parv
[2]);
468 handle_remote_unkline(struct Client
*source_p
, const char *user
, const char *host
)
470 struct ConfItem
*aconf
;
472 if(!find_shared_conf(source_p
->username
, source_p
->host
,
473 source_p
->servptr
->name
, SHARED_UNKLINE
))
476 aconf
= find_exact_conf_by_address(host
, CONF_KILL
, user
);
479 sendto_one_notice(source_p
, ":No K-Line for %s@%s", user
, host
);
484 sendto_one_notice(source_p
, ":Cannot remove global K-Line %s@%s on specific servers", user
, host
);
488 if(remove_temp_kline(source_p
, aconf
))
491 remove_permkline_match(source_p
, aconf
);
498 * side effects - kline as given, is added to the hashtable
502 apply_kline(struct Client
*source_p
, struct ConfItem
*aconf
,
503 const char *reason
, const char *oper_reason
)
505 add_conf_by_address(aconf
->host
, CONF_KILL
, aconf
->user
, NULL
, aconf
);
506 bandb_add(BANDB_KLINE
, source_p
, aconf
->user
, aconf
->host
,
507 reason
, EmptyString(oper_reason
) ? NULL
: oper_reason
, 0);
509 /* no oper reason.. */
510 if(EmptyString(oper_reason
))
512 sendto_realops_snomask(SNO_GENERAL
, L_ALL
,
513 "%s added K-Line for [%s@%s] [%s]",
514 get_oper_name(source_p
), aconf
->user
, aconf
->host
, reason
);
515 ilog(L_KLINE
, "K %s 0 %s %s %s",
516 get_oper_name(source_p
), aconf
->user
, aconf
->host
, reason
);
520 sendto_realops_snomask(SNO_GENERAL
, L_ALL
,
521 "%s added K-Line for [%s@%s] [%s|%s]",
522 get_oper_name(source_p
), aconf
->user
, aconf
->host
,
523 reason
, oper_reason
);
524 ilog(L_KLINE
, "K %s 0 %s %s %s|%s",
525 get_oper_name(source_p
), aconf
->user
, aconf
->host
, reason
, oper_reason
);
528 sendto_one_notice(source_p
, ":Added K-Line [%s@%s]",
529 aconf
->user
, aconf
->host
);
536 * side effects - tkline as given is placed
539 apply_tkline(struct Client
*source_p
, struct ConfItem
*aconf
,
540 const char *reason
, const char *oper_reason
, int tkline_time
)
542 aconf
->hold
= rb_current_time() + tkline_time
;
543 add_temp_kline(aconf
);
545 /* no oper reason.. */
546 if(EmptyString(oper_reason
))
548 sendto_realops_snomask(SNO_GENERAL
, L_ALL
,
549 "%s added temporary %d min. K-Line for [%s@%s] [%s]",
550 get_oper_name(source_p
), tkline_time
/ 60,
551 aconf
->user
, aconf
->host
, reason
);
552 ilog(L_KLINE
, "K %s %d %s %s %s",
553 get_oper_name(source_p
), tkline_time
/ 60, aconf
->user
, aconf
->host
, reason
);
557 sendto_realops_snomask(SNO_GENERAL
, L_ALL
,
558 "%s added temporary %d min. K-Line for [%s@%s] [%s|%s]",
559 get_oper_name(source_p
), tkline_time
/ 60,
560 aconf
->user
, aconf
->host
, reason
, oper_reason
);
561 ilog(L_KLINE
, "K %s %d %s %s %s|%s",
562 get_oper_name(source_p
), tkline_time
/ 60,
563 aconf
->user
, aconf
->host
, reason
, oper_reason
);
566 sendto_one_notice(source_p
, ":Added temporary %d min. K-Line [%s@%s]",
567 tkline_time
/ 60, aconf
->user
, aconf
->host
);
571 apply_prop_kline(struct Client
*source_p
, struct ConfItem
*aconf
,
572 const char *reason
, const char *oper_reason
, int tkline_time
)
574 aconf
->flags
|= CONF_FLAGS_MYOPER
| CONF_FLAGS_TEMPORARY
;
575 aconf
->hold
= rb_current_time() + tkline_time
;
576 aconf
->lifetime
= aconf
->hold
;
578 replace_old_ban(aconf
);
580 rb_dlinkAddAlloc(aconf
, &prop_bans
);
581 add_conf_by_address(aconf
->host
, CONF_KILL
, aconf
->user
, NULL
, aconf
);
583 /* no oper reason.. */
584 if(EmptyString(oper_reason
))
586 sendto_realops_snomask(SNO_GENERAL
, L_ALL
,
587 "%s added global %d min. K-Line for [%s@%s] [%s]",
588 get_oper_name(source_p
), tkline_time
/ 60,
589 aconf
->user
, aconf
->host
, reason
);
590 ilog(L_KLINE
, "K %s %d %s %s %s",
591 get_oper_name(source_p
), tkline_time
/ 60, aconf
->user
, aconf
->host
, reason
);
595 sendto_realops_snomask(SNO_GENERAL
, L_ALL
,
596 "%s added global %d min. K-Line for [%s@%s] [%s|%s]",
597 get_oper_name(source_p
), tkline_time
/ 60,
598 aconf
->user
, aconf
->host
, reason
, oper_reason
);
599 ilog(L_KLINE
, "K %s %d %s %s %s|%s",
600 get_oper_name(source_p
), tkline_time
/ 60,
601 aconf
->user
, aconf
->host
, reason
, oper_reason
);
604 sendto_one_notice(source_p
, ":Added global %d min. K-Line [%s@%s]",
605 tkline_time
/ 60, aconf
->user
, aconf
->host
);
607 sendto_server(NULL
, NULL
, CAP_BAN
|CAP_TS6
, NOCAPS
,
608 ":%s BAN K %s %s %lu %d %d * :%s%s%s",
609 source_p
->id
, aconf
->user
, aconf
->host
,
610 (unsigned long)aconf
->created
,
611 (int)(aconf
->hold
- aconf
->created
),
612 (int)(aconf
->lifetime
- aconf
->created
),
614 oper_reason
? "|" : "",
615 oper_reason
? oper_reason
: "");
620 * inputs - client placing kline, user@host, user buffer, host buffer
621 * output - false if not ok to kline, true to kline i.e. if valid user host
625 find_user_host(struct Client
*source_p
, const char *userhost
, char *luser
, char *lhost
)
629 hostp
= strchr(userhost
, '@');
631 if(hostp
!= NULL
) /* I'm a little user@host */
633 *(hostp
++) = '\0'; /* short and squat */
635 rb_strlcpy(luser
, userhost
, USERLEN
+ 1); /* here is my user */
639 rb_strlcpy(lhost
, hostp
, HOSTLEN
+ 1); /* here is my host */
645 /* no '@', no '.', so its not a user@host or host, therefore
646 * its a nick, which support was removed for.
648 if(strchr(userhost
, '.') == NULL
&& strchr(userhost
, ':') == NULL
)
650 sendto_one_notice(source_p
, ":K-Line must be a user@host or host");
654 luser
[0] = '*'; /* no @ found, assume its *@somehost */
656 rb_strlcpy(lhost
, userhost
, HOSTLEN
+ 1);
659 /* would break the protocol */
660 if (*luser
== ':' || *lhost
== ':')
662 sendto_one_notice(source_p
, ":Invalid K-Line");
671 * inputs - user buffer, host buffer
672 * output - false if invalid, true if valid
676 valid_user_host(struct Client
*source_p
, const char *luser
, const char *lhost
)
678 /* # is invalid, as are '!' (n!u@h kline) and '@' (u@@h kline) */
679 if(strchr(lhost
, '#') || strchr(luser
, '#') || strchr(luser
, '!') || strchr(lhost
, '@'))
681 sendto_one_notice(source_p
, ":Invalid K-Line");
688 /* already_placed_kline()
690 * inputs - source to notify, user@host to check, tkline time
691 * outputs - true if a perm kline or a tkline when a tkline is being
692 * set exists, else false
693 * side effects - notifies source_p kline exists
695 /* Note: This currently works if the new K-line is a special case of an
696 * existing K-line, but not the other way round. To do that we would
697 * have to walk the hash and check every existing K-line. -A1kmm.
700 already_placed_kline(struct Client
*source_p
, const char *luser
, const char *lhost
, int tkline
)
702 const char *reason
, *p
;
703 struct rb_sockaddr_storage iphost
, *piphost
;
704 struct ConfItem
*aconf
;
707 aconf
= find_exact_conf_by_address(lhost
, CONF_KILL
, luser
);
708 if(aconf
== NULL
&& ConfigFileEntry
.non_redundant_klines
)
711 t
= parse_netmask_strict(lhost
, &iphost
, &bits
);
715 else if (t
== HM_IPV6
)
720 aconf
= find_conf_by_address(lhost
, NULL
, NULL
, (struct sockaddr
*) piphost
,
721 CONF_KILL
, t
, luser
, NULL
);
724 /* The above was really a lookup of a single IP,
725 * so check if the new kline is wider than the
729 p
= strchr(aconf
->host
, '/');
730 if(bits
> 0 && (p
== NULL
|| bits
< atoi(p
+ 1)))
736 /* setting a tkline, or existing one is perm */
737 if(tkline
|| ((aconf
->flags
& CONF_FLAGS_TEMPORARY
) == 0))
739 reason
= aconf
->passwd
? aconf
->passwd
: "<No Reason>";
741 sendto_one_notice(source_p
,
742 ":[%s@%s] already K-Lined by [%s@%s] - %s",
743 luser
, lhost
, aconf
->user
, aconf
->host
, reason
);
751 /* remove_permkline_match()
753 * hunts for a permanent kline, and removes it.
756 remove_permkline_match(struct Client
*source_p
, struct ConfItem
*aconf
)
758 sendto_one_notice(source_p
, ":K-Line for [%s@%s] is removed", aconf
->user
, aconf
->host
);
760 sendto_realops_snomask(SNO_GENERAL
, L_ALL
,
761 "%s has removed the K-Line for: [%s@%s]",
762 get_oper_name(source_p
), aconf
->user
, aconf
->host
);
764 ilog(L_KLINE
, "UK %s %s %s", get_oper_name(source_p
), aconf
->user
, aconf
->host
);
766 remove_reject_mask(aconf
->user
, aconf
->host
);
767 bandb_del(BANDB_KLINE
, aconf
->user
, aconf
->host
);
768 delete_one_address_conf(aconf
->host
, aconf
);
771 /* remove_temp_kline()
773 * inputs - username, hostname to unkline
775 * side effects - tries to unkline anything that matches
778 remove_temp_kline(struct Client
*source_p
, struct ConfItem
*aconf
)
783 for(i
= 0; i
< LAST_TEMP_TYPE
; i
++)
785 RB_DLINK_FOREACH(ptr
, temp_klines
[i
].head
)
787 if(aconf
== ptr
->data
)
789 sendto_one_notice(source_p
,
790 ":Un-klined [%s@%s] from temporary k-lines",
791 aconf
->user
, aconf
->host
);
792 sendto_realops_snomask(SNO_GENERAL
, L_ALL
,
793 "%s has removed the temporary K-Line for: [%s@%s]",
794 get_oper_name(source_p
), aconf
->user
,
797 ilog(L_KLINE
, "UK %s %s %s",
798 get_oper_name(source_p
), aconf
->user
, aconf
->host
);
799 rb_dlinkDestroy(ptr
, &temp_klines
[i
]);
800 remove_reject_mask(aconf
->user
, aconf
->host
);
801 delete_one_address_conf(aconf
->host
, aconf
);
811 remove_prop_kline(struct Client
*source_p
, struct ConfItem
*aconf
)
816 ptr
= rb_dlinkFind(aconf
, &prop_bans
);
819 sendto_one_notice(source_p
,
820 ":Un-klined [%s@%s] from global k-lines",
821 aconf
->user
, aconf
->host
);
822 sendto_realops_snomask(SNO_GENERAL
, L_ALL
,
823 "%s has removed the global K-Line for: [%s@%s]",
824 get_oper_name(source_p
), aconf
->user
,
827 ilog(L_KLINE
, "UK %s %s %s",
828 get_oper_name(source_p
), aconf
->user
, aconf
->host
);
829 now
= rb_current_time();
830 if(aconf
->created
< now
)
831 aconf
->created
= now
;
834 aconf
->hold
= aconf
->created
;
835 operhash_delete(aconf
->info
.oper
);
836 aconf
->info
.oper
= operhash_add(get_oper_name(source_p
));
837 aconf
->flags
|= CONF_FLAGS_MYOPER
| CONF_FLAGS_TEMPORARY
;
838 sendto_server(NULL
, NULL
, CAP_BAN
|CAP_TS6
, NOCAPS
,
839 ":%s BAN K %s %s %lu %d %d * :*",
840 source_p
->id
, aconf
->user
, aconf
->host
,
841 (unsigned long)aconf
->created
,
843 (int)(aconf
->lifetime
- aconf
->created
));
844 remove_reject_mask(aconf
->user
, aconf
->host
);
845 deactivate_conf(aconf
, ptr
, now
);