Anope IRC Services

Please login or register.

Login with username, password and session length
Advanced search  


Pages: [1]   Go Down

Author Topic: BOT ADD idents in 1.8 and 1.9  (Read 4509 times)

0 Members and 1 Guest are viewing this topic.


  • Guest
BOT ADD idents in 1.8 and 1.9
« on: January 07, 2010, 02:49:38 AM »

I wasn't exactly sure where to put this as it's an issue in both 1.8 and 1.9 so feel free to move it if it'd fit better elsewhere.

When adding a bot with an ident of any length that contains an apparently invalid character (I have tried - and .) Anope throws BOT_LONG_IDENT (Bot Idents may only contain 9 characters.).

I can see in the language files that BOT_BAD_IDENT is defined but is never used in the code. It seems like this is the error that should be thrown for this.

It'd also be nice if it didn't needlessly restrict the characters that can make up an ident as - and . are certainly not disallowed and I'm sure some other disallowed characters are also allowed.

The problem code in 1.8.2 looks to be on line 125-130 of bs_bot.c which checks if each character is alpha numeric and returns BOT_LONG_IDENT if not.

Suggested fix, to keep me happy is to replace those lines with:

Code: [Select]
            for (ch = user; *ch && (ch - user) < USERMAX; ch++) {
                if (!isalnum(*ch) && *ch != '.' && *ch != '-') {
                    notice_lang(s_BotServ, u, BOT_BAD_IDENT);
                    return MOD_CONT;

Not entirely sure if this would break any IRCDs that don't allow those characters and I couldn't find any information in various RFCs about exactly which characters should be allowed however, since some clients take the ident from the username of an e-mail address, it could be safe to assume A-Z 0-9 . _ % + -

« Last Edit: January 07, 2010, 03:13:51 AM by Phil Lavin »

Jan Milants

  • Team
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 1372
Re: BOT ADD idents in 1.8 and 1.9
« Reply #1 on: January 07, 2010, 07:43:49 AM »

Valid ident characters would be A-Z 0-9 . _
- is not a valid ident char. While some ircd's may be more tolerant about it, anope supports many so should stick to the standards.

This is a duplicate of bug #1118 on the tracker (which is where bugs should go..)
« Last Edit: January 07, 2010, 07:46:05 AM by Jan Milants »
If you like me donate coins to 1FBmZVT4J8WAUMHKqpWhgNVj3XXnRN1cCk :)
Pages: [1]   Go Up