Anope IRC Services

Please login or register.

Login with username, password and session length
Advanced search  

News:

Pages: [1]   Go Down

Author Topic: misc_sqlcmd and latest build  (Read 4312 times)

0 Members and 1 Guest are viewing this topic.

BeBoo

  • Anope User
  • Offline Offline
  • Posts: 8
    • http://www.blueliquidx.net
misc_sqlcmd and latest build
« on: October 21, 2008, 03:16:33 PM »

Hello,

We have been using the misc_sqlcmd module for a little while now with success. Since the latest updates to the core code, the module will no longer build and spits out some errors. I know the module coder hasn't been around so I'm hoping I can get some assistance from anyone here to possibly fix the code for the new anope. The errors I am receiving are as follows:

Code: [Select]
misc_sqlcmd_nick.c: In function ‘sqlcmd_handle_nickreg’:
misc_sqlcmd_nick.c:107: error: incompatible types in assignment
misc_sqlcmd_nick.c: In function ‘sqlcmd_handle_nickconf’:
misc_sqlcmd_nick.c:164: error: incompatible types in assignment

For those of you without the code, I have included some segments of the code that it mentions. I do not know any C so sorry if I missed something that might be needed to assist in this issue. The last line in each code block is the line it mentions in the error.

Code: [Select]
NickRequest *nr = NULL, *anr = NULL;
--snip--
nr = makerequest(av[0]);
nr->passcode = sstrdup(passcode);
nr->password = sstrdup(pass);

Code: [Select]
NickRequest *nr = NULL;
NickAlias *na = NULL;
--snip--
pass = sstrdup(nr->password);
if (nr->email)
  email = sstrdup(nr->email);
na = makenick(nr->nick);
if (na) {
  len = strlen(pass);
  na->nc->pass = smalloc(PASSMAX);

Thank you very much to anyone who can assist with this!!
Logged

Jan Milants

  • Team
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 1372
Re: misc_sqlcmd and latest build
« Reply #1 on: October 21, 2008, 06:35:36 PM »

nr->passcode and nr->password are no longer char* and thus cannot be assigned with a sstrdup(). both are now a char[PASSMAX]. Same goes for nc->password.

I don't know how the variables are fetched by the module from sql or how php delivers them, but both should make sure it s considered a buffer which can potentially contain null characters, in the middle of a hash for example. this is the reason it was changed in the core, the module should also handle this accordingly.
« Last Edit: October 21, 2008, 06:37:32 PM by Viper »
Logged
If you like me donate coins to 1FBmZVT4J8WAUMHKqpWhgNVj3XXnRN1cCk :)
Pages: [1]   Go Up