Anope IRC Services

Please login or register.

Login with username, password and session length
Advanced search  

News:

Pages: [1]   Go Down

Author Topic: Confusion with UserKeys  (Read 7075 times)

0 Members and 1 Guest are viewing this topic.

katsklaw

  • Supporter
  • Anope User
  • Offline Offline
  • Posts: 537
Confusion with UserKeys
« on: October 31, 2012, 03:45:52 AM »

We've seen an issue on the Unreal IRCd forum where an user specified an UserKey that started with a 0 and it seems it failed to pass the parser which tossed back the userkey must be a positive integer error. Thread is at: http://forums.unrealircd.com/viewtopic.php?f=3&t=7685

I know 1.8 is supposedly your stable branch but could a note be added to your example.conf stating the UserKeys shouldn't start with 0?
Logged

Denver Freeburn

  • Anope User
  • Offline Offline
  • Gender: Male
  • Posts: 11
    • My Blog
Re: Confusion with UserKeys
« Reply #1 on: October 31, 2012, 02:41:28 PM »

Hi. Did you add this to the bug tracker?
If not, I'll do it
Logged
I'm climbing through the wrecking of all my twisted dreams but this cheap investigation just can't stifle all my screams and I'm waiting.. waiting at the crossroads.. waiting for you

Charles Kingsley

  • Contributor
  • *
  • Offline Offline
  • Posts: 1405
Re: Confusion with UserKeys
« Reply #2 on: October 31, 2012, 03:25:15 PM »

Agree.
Logged

Adam

  • Team
  • *
  • Offline Offline
  • Posts: 463
Re: Confusion with UserKeys
« Reply #3 on: October 31, 2012, 05:30:24 PM »

It looks like this is strtol() reporting this error, I don't think there is a very easy fix for this
Logged

katsklaw

  • Supporter
  • Anope User
  • Offline Offline
  • Posts: 537
Re: Confusion with UserKeys
« Reply #4 on: October 31, 2012, 05:41:59 PM »

It looks like this is strtol() reporting this error, I don't think there is a very easy fix for this

I think simply telling users to not use 0 as the first character in the directive description in example.conf is the easiest solution instead of changing the source code in a stable branch. If someone wants to do a bug report, that would be great.
Logged

Charles Kingsley

  • Contributor
  • *
  • Offline Offline
  • Posts: 1405
Re: Confusion with UserKeys
« Reply #5 on: October 31, 2012, 06:03:28 PM »

Denver's done one already, I agree just updating the config is sensible.
Logged

Naram Qashat

  • Team
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 192
    • CBX's Sprite Animations
Re: Confusion with UserKeys
« Reply #6 on: October 31, 2012, 06:21:43 PM »

Making the config say not to put a 0 at the beginning could work.  Because what is happening is that the number is being seen as octal and if you have an 8 or 9 anywhere in the string, the conversion stops there.

After a little digging, it seems that the proper solution is 2 things.  First being that we shouldn't have the base set to 0, but rather to 10.  Second being that we need to be resetting errno before each strtol call we make and then only check the value of errno for it to be 0 or not (right now it's checking the value of *endptr, which is not indicative of an error).
Logged

Denver Freeburn

  • Anope User
  • Offline Offline
  • Gender: Male
  • Posts: 11
    • My Blog
Re: Confusion with UserKeys
« Reply #7 on: October 31, 2012, 06:56:12 PM »

http://bugs.anope.org/view.php?id=1457

Comment from Adam says it's fixed, although his comment up there threw me off
Logged
I'm climbing through the wrecking of all my twisted dreams but this cheap investigation just can't stifle all my screams and I'm waiting.. waiting at the crossroads.. waiting for you

Adam

  • Team
  • *
  • Offline Offline
  • Posts: 463
Re: Confusion with UserKeys
« Reply #8 on: October 31, 2012, 07:00:11 PM »

I didn't think it was easy to fix. CBX then offered some input, I found a solution based on it, and committed it.
Logged

Denver Freeburn

  • Anope User
  • Offline Offline
  • Gender: Male
  • Posts: 11
    • My Blog
Re: Confusion with UserKeys
« Reply #9 on: October 31, 2012, 07:01:51 PM »

Ah right.
Caught up now.
Sorry - braindead today
Logged
I'm climbing through the wrecking of all my twisted dreams but this cheap investigation just can't stifle all my screams and I'm waiting.. waiting at the crossroads.. waiting for you
Pages: [1]   Go Up