Anope IRC Services

Anope Development => Modules => Topic started by: watergad on August 06, 2007, 01:03:35 PM

Title: Module Request: checking similar nicks
Post by: watergad on August 06, 2007, 01:03:35 PM
Hello

Im not quite good with writing Anope or UnrealIRCd modules, and  C/C++-ing a long time ago, so asking for help.

Simple module that checks nicks needed. Its not so difficult for module writing experienced programmer, but it will take too much time for me to investigate all necessary events to program it.

So, what is to do:

0 (pre-1 (: ). We have registered nick "root", for example.
1. User (connects / changes nick) with nick "r00t"
2. Module checks if we have registered nick "root", or "r0ot", or "ro0t", or "r00t". If its difficult - leave it to me. I need '0'-'o' only for example.
3. If we found one of them registered - module renames user to this found nick and then he get /ns register message, bla-bla-bla, other common routine.

Could anybody help me with such module? It seems to be similar to "ns_limitregonconnect", or "ns_restrictreg".

What for:
I have two charsets enabled: cyrillic and latin. So, for example, "o" cyrillic and "o" latin allowed to use in nicks. Such nicks are different in bytes, but visually identical. Such module can help to prevent nicks copying this way.

Possible difficulty: if it is possible to register such nick before being renamed by services, this is to be fixed too... ):

Thanks beforehand
Title:
Post by: katsklaw on August 06, 2007, 10:43:05 PM
The problem here is that only case can be called "similar", To Anope or the C programming language for that matter there is a huge distinctive difference between o and 0. Other than one would be a string and the other an integer.

Anope nor C knows how to spell as humans do, so to us root and r00t are alike .. to a programming language they are worlds apart and have nothing in common.

Even katsklaw and [katsklaw] are totally different to the programming language.

It may be possible to "teach" Anope to do a simple o for 0 replacement to see if a certain percentage of the characters match, but I doubt that the cost of the resources would be worth justifying the usefulness of the module.

[Edited on 6-8-2007 by katsklaw]
Title:
Post by: watergad on August 07, 2007, 11:04:28 AM
Quote
katsklaw
The problem here is that only case can be called "similar", To Anope or the C programming language for that matter there is a huge distinctive difference between o and 0. Other than one would be a string and the other an integer.

Thats right, but also that is why specific module needed. o and 0 is just an example, as I said, problem is charset-different similar-looking chars.
Quote
katsklaw
Anope nor C knows how to spell as humans do, so to us root and r00t are alike .. to a programming language they are worlds apart and have nothing in common.

Yes, thats why I need to program this.
Quote
katsklaw
It may be possible to "teach" Anope to do a simple o for 0 replacement to see if a certain percentage of the characters match, but I doubt that the cost of the resources would be worth justifying the usefulness of the module.

Thats what I wanted to do - to teach module what chars are "similar" to me. I think, that is still possible for me, just give an example like "o-0" (:
What is about cost of the resources... I have a small network, but with a number of youngsters dreaming they are cool hackerz faking nicks.

Otherwise, thats right, 32length nick of such letters is real trouble... kso.

Maybe some kind of key mapping is possible? For example, to define #79 key is equal to cp1251 key #206, etc. (its about 12 chars and their register variations).
Storing this "mixed charset" in DB is also weird, but...
Title: another limitation
Post by: watergad on August 07, 2007, 07:09:51 PM
Maybe, another way:
1. Transcode all char "clones" from non-latin charset to latin chars while registering nick. We store weird charset mix, but it has to be the way.

OR

2. Is it possible to limit registered nicks to server_charset_1-only nicks and server_charset_2-only nicks (and so...)?
I mean, let it be cyrillic_chars-only nicks or latin_chars-only nicks, for example. Usually, users dont need mixed nicks, right? So in rare cases when all chars of nick has clones, we can register both of these nicks and sleep calm (: