Anope IRC Services

Please login or register.

Login with username, password and session length
Advanced search  

News:

Pages: [1]   Go Down

Author Topic: Error with svsnick?  (Read 4340 times)

0 Members and 1 Guest are viewing this topic.

EZEki3l

  • Guest
Error with svsnick?
« on: September 08, 2006, 11:32:24 PM »

I modify a lang file and I have see that when services use
NICK_X_ILLEGAL
   Nick %s is an illegal nickname and cannot be used.
with operserv svsnick command and I think that it wrong when for exemple on unreal I type /os svsnick nick-I-want-change //
services answer
-OperServ- Nick My-nick is an illegal nickname and cannot be used.

Quote
int do_svsnick(User * u)
{
    char *nick = strtok(NULL, " ");
    char *newnick = strtok(NULL, " ");

    NickAlias *na;
    char *c;

    /* Only allow this if SuperAdmin is enabled */
    if (!u->isSuperAdmin) {
        notice_lang(s_OperServ, u, OPER_SUPER_ADMIN_ONLY);
        return MOD_CONT;
    }

    if (!nick || !newnick) {
        syntax_error(s_OperServ, u, "SVSNICK", OPER_SVSNICK_SYNTAX);
        return MOD_CONT;
    }

    /* Truncate long nicknames to NICKMAX-2 characters */
    if (strlen(newnick) > (NICKMAX - 2)) {
        notice_lang(s_NickServ, u, NICK_X_TRUNCATED,
                    newnick, NICKMAX - 2, newnick);
        newnick[NICKMAX - 2] = '';
    }

    /* Check for valid characters */
    if (*newnick == '-' || isdigit(*newnick)) {
        notice_lang(s_OperServ, u, NICK_X_ILLEGAL, newnick);
        return MOD_CONT;
    }
#define isvalid(c) (((c) >= 'A' && (c) <= '~') || isdigit(c) || (c) == '-')
    for (c = newnick; *c && (c - newnick) < NICKMAX; c++) {
        if (!isvalid(*c) || isspace(*c)) {
            notice_lang(s_OperServ, u, NICK_X_ILLEGAL, nick);
            return MOD_CONT;
        }
    }


I think at the end you must put
Quote
#define isvalid(c) (((c) >= 'A' && (c) <= '~') || isdigit(c) || (c) == '-')
    for (c = newnick; *c && (c - newnick) < NICKMAX; c++) {
        if (!isvalid(*c) || isspace(*c)) {
            notice_lang(s_OperServ, u, NICK_X_ILLEGAL, newnick);
            return MOD_CONT;


no ? correct me if I am wrong :)
Logged

n00bie

  • Anope User
  • Offline Offline
  • Gender: Male
  • Posts: 411
(No subject)
« Reply #1 on: September 09, 2006, 03:46:32 AM »

I just tested the SVSNICK command on 1.7.15 and everything is working fine for normal nicks, but i got this for the ~ prefix.

Example:
<@Global> OperServ: n00bie: svsnick TestNick ~test
-OperServ- The nick TestNick is now being changed to ~test.

but actually the nick is not changing.
Logged
I am always doing things that which I cannot do, in order that I may learn how to do it.

Dave Robson

  • Team
  • *
  • Offline Offline
  • Posts: 357
(No subject)
« Reply #2 on: September 09, 2006, 10:17:30 AM »

Logged

EZEki3l

  • Guest
(No subject)
« Reply #3 on: September 09, 2006, 03:38:29 PM »

I just speak about the notice_lang and I didn't see this bug but In the updated file from svn the notice is similar so It's right that operserv say:
Quote
-OperServ- Nick nick-I-want-to-change is an illegal nickname and cannot be used.

and not:
Quote
-OperServ- Nick // is an illegal nickname and cannot be used.

when I type:
Quote
/os svsnick nick-I-want-to-change //
?

Quote
notice_lang(s_OperServ, u, NICK_X_ILLEGAL, nick);

shouldn't be:
Quote
notice_lang(s_OperServ, u, NICK_X_ILLEGAL, newnick);
?
Logged
Pages: [1]   Go Up