]>
Commit | Line | Data |
---|---|---|
3bd189cb JR |
1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"> |
2 | <HTML> | |
3 | <HEAD> | |
4 | <TITLE> [Ircservices-coding] akill sanity checking | |
5 | </TITLE> | |
6 | <LINK REL="Index" HREF="index.html" > | |
7 | <LINK REL="made" HREF="mailto:ircservices-coding%40ircservices.za.net?Subject=%5BIrcservices-coding%5D%20akill%20sanity%20checking&In-Reply-To="> | |
8 | <META NAME="robots" CONTENT="index,nofollow"> | |
9 | <META http-equiv="Content-Type" content="text/html; charset=us-ascii"> | |
10 | <LINK REL="Previous" HREF="000000.html"> | |
11 | <LINK REL="Next" HREF="000002.html"> | |
12 | </HEAD> | |
13 | <BODY BGCOLOR="#ffffff"> | |
14 | <H1>[Ircservices-coding] akill sanity checking</H1> | |
15 | <B>Andy Smith</B> | |
16 | <A HREF="mailto:ircservices-coding%40ircservices.za.net?Subject=%5BIrcservices-coding%5D%20akill%20sanity%20checking&In-Reply-To=" | |
17 | TITLE="[Ircservices-coding] akill sanity checking">andy at strugglers.net | |
18 | </A><BR> | |
19 | <I>Sat Jan 27 04:18:06 PST 2001</I> | |
20 | <P><UL> | |
21 | <LI>Previous message: <A HREF="000000.html">[Ircservices-coding] subscribe dropper@softhome.net | |
22 | </A></li> | |
23 | <LI>Next message: <A HREF="000002.html">[Ircservices-coding] Re: [IRCServices] Services 4.5pre0 released | |
24 | </A></li> | |
25 | <LI> <B>Messages sorted by:</B> | |
26 | <a href="date.html#1">[ date ]</a> | |
27 | <a href="thread.html#1">[ thread ]</a> | |
28 | <a href="subject.html#1">[ subject ]</a> | |
29 | <a href="author.html#1">[ author ]</a> | |
30 | </LI> | |
31 | </UL> | |
32 | <HR> | |
33 | <!--beginarticle--> | |
34 | <PRE>Hi, | |
35 | ||
36 | There's a FIXME in the ADD section of do_akill from akill.c regarding | |
37 | wanting a better way to check for an insane akill mask. I've found the | |
38 | following idea useful: | |
39 | ||
40 | for (i = strlen(mask) - 1; | |
41 | i > 0 && mask[i] != '@'; i--) { | |
42 | if (! strchr("*?.", mask[i])) { | |
43 | nonwild++; | |
44 | } | |
45 | } | |
46 | ||
47 | if (AkillWildThresh && nonwild < AkillWildThresh) { | |
48 | notice_lang(s_OperServ, u, | |
49 | OPER_AKILL_MASK_TOO_GENERAL); | |
50 | return; | |
51 | } | |
52 | ||
53 | i.e. it counts from right to left in the mask checking how many characters | |
54 | there are which don't match '?', '*' or '.'. AkillWildThresh would be a | |
55 | config option, an example setting of 4 would prevent the following akills: | |
56 | ||
57 | *@* | |
58 | *@?* | |
59 | *@*?com | |
60 | *@*.com | |
61 | ||
62 | but would allow akills such as: | |
63 | ||
64 | *@*a.com | |
65 | *@foobar* | |
66 | ||
67 | Works for me, and is nicely configurable. | |
68 | ||
69 | -- | |
70 | Andy Smith <<A HREF="http://www.ircservices.za.net/mailman/listinfo/ircservices-coding">andy at strugglers.net</A>> | |
71 | ||
72 | ||
73 | </PRE> | |
74 | ||
75 | <!--endarticle--> | |
76 | <HR> | |
77 | <P><UL> | |
78 | <!--threads--> | |
79 | <LI>Previous message: <A HREF="000000.html">[Ircservices-coding] subscribe dropper@softhome.net | |
80 | </A></li> | |
81 | <LI>Next message: <A HREF="000002.html">[Ircservices-coding] Re: [IRCServices] Services 4.5pre0 released | |
82 | </A></li> | |
83 | <LI> <B>Messages sorted by:</B> | |
84 | <a href="date.html#1">[ date ]</a> | |
85 | <a href="thread.html#1">[ thread ]</a> | |
86 | <a href="subject.html#1">[ subject ]</a> | |
87 | <a href="author.html#1">[ author ]</a> | |
88 | </LI> | |
89 | </UL> | |
90 | ||
91 | </body></html> |