Unreal missing off first word when klines are set

These are old archives. They are kept for historic purposes only.
Post Reply
csc2ya
Posts: 5
Joined: Fri Nov 17, 2006 6:04 pm

Unreal missing off first word when klines are set

Post by csc2ya »

This might be a bug, but it might be intended behaviour as well. I'm a co-owner of a network that runs unreal and anope.

Lately we've had problems with one of our operators, which resulted in a takeover and me getting banned from the network until the other owner got back and could sort it out, and so have had to let them go and also ban them from the network. (We still don't know how they did it as their account didn't have access to anything other than kill, but that's not the issue here)

They keep connecting under different ip's, and when I notice them, i'm klining them.

However, when I type the reason for the kline, it always omits the first word when it is set, for example:

19:25 from AgeOfMythology.4-IRC.Com - *** Permanent K:Line added for *@* on Sat Sep 5 18:25:43 2009 GMT (from Vista!~[email protected]: try)
19:25 from AgeOfMythology.4-IRC.Com - *** Notice -- Client exiting: Vacho (~Vacho@*) [User is permanently banned (try)]
19:27 from AgeOfMythology.4-IRC.Com - Vista!~[email protected] removed K:Line *@* (set at Sat Sep 5 18:25:43 2009 - reason: try) (that's not the actual ip I banned obviously....i'm not including that for security reasons)

I actually entered 'nice try' for the reason, but it always misses off the first word.

We're running unreal version 3.2.8.1 on a linux vps server.

Is this behaviour by design, or is it a bug?

Edit: On looking through the modules section, i've found why this occurs. As mentioned, it's because unreal needs a duration entered if a reason is also specified, and so it takes the first word or number entered as the duration. I'll have to get into the habit of entering kline whatever 0 reason, or do some sort of alias for mirc.

This topic can be closed.
Stealth
Head of Support
Posts: 2085
Joined: Tue Jun 15, 2004 8:50 pm
Location: Chino Hills, CA, US
Contact:

Re: Unreal missing off first word when klines are set

Post by Stealth »

This is by design, and because you or your client is not using the proper syntax.

When setting a K/Z/G:line, you must include the time parameter. The syntax is: KLINE <mask> <time> [reason]

HOWEVER, if using proper IRC message syntax, and the parameter AFTER the mask begins with a colon (:) Unreal will know you have skipped the time parameter, use the whole reason, and set the ban with set::default-bantime as the expiry time. WITHOUT the colon before the reason and the mask omitted, Unreal will expect the 2nd parameter of the command to be a time value, and attempt to evaluate it as such (which is 0).

So in short, it's by design as IRC was meant to be :)
katsklaw
Posts: 1124
Joined: Sun Apr 18, 2004 5:06 pm
Contact:

Re: Unreal missing off first word when klines are set

Post by katsklaw »

uhm, no. There is still a bug here. What's happening as the code is lazy and doesn't check for crap.

1> helpop suggests that time is optional both in the syntax as well as the examples. so if time is required, then 1 bug is that the help.conf is incorrect. Additionally Unreal should check to see if the second parameter complies with Unreal's 1d2h3m4s format and it should never confuse a simple word with a time string.

Please note that <this means required> [this means optional]

Code: Select all

 Syntax:  
          KLINE <hostmask or nick> [time] <reason> (adds a Kline)
          KLINE -<hostmask> (removes a Kline)
 Example: 
         --->KLINE *@*.aol.com Abuse (Adds a permanent K:line)<----
          KLINE *@*.someisp.com 2d Abuse (Adds a K:line for 2 days)
          KLINE Idiot 1d Please go away
          KLINE -*@*.aol.com
2> if time is indeed optional as helpop suggests, then set::default-bantime should be a required entry in the config file just like set::kline-address and those silly oper vHosts that not everyone uses.

3> It's not up to the USERS to insert colons in the proper places when issuing normal commands, that's the IRCd's job and it really should have never been mentioned. However, it doesn't go before the time, it goes before the reason KLINE <nick> <time> :<reason> not KLINE <nick> :<time> <reason>
Jobe
Official supporter
Posts: 1180
Joined: Wed May 03, 2006 7:09 pm
Location: United Kingdom

Re: Unreal missing off first word when klines are set

Post by Jobe »

katsklaw wrote:3> It's not up to the USERS to insert colons in the proper places when issuing normal commands, that's the IRCd's job and it really should have never been mentioned[/b]
To be honest I have to say I disagree, although most IRCd's are flexible in allowing no :'s, the RFC's DO require them in the right place, and given that KLINE is a non-RFC message, it is technically up to the IRC developers who impliment it to decide what format is required, but I do however agree that the documentation needs to be clear that the : is required if the time is not provided. Because to be honest if you say its not up to the user to get the format right then you might as well just say the user can send a raw message however they like and it HAS to do what they want it to.
Your IP: Image
Your Country: Image
katsklaw
Posts: 1124
Joined: Sun Apr 18, 2004 5:06 pm
Contact:

Re: Unreal missing off first word when klines are set

Post by katsklaw »

I never said it's not up to the user to get the syntax right. I said they shouldn't have to insert colons.

Syntax checking should be in place for CLIENT issued commands. It's not difficult to check a parameter to insure it's properly formatted and Unreal should know the difference between "1d2h3m4s" and "disney". If the 2nd parameter does not conform to 1d2h3m4s, then yes, lets assume that no expiry was given and either assume it's perm or insert a default time and insert a colon in front of the 2nd parameter since it's the first word of the reason and go on about our business. If we are too lazy to do that then fix help.conf. Again, in either scenario, it's still a bug.

Additionally, while KLINE is not an RFC command, there are similar commands that are similar in syntax and should be observed if for no other reason than uniformity such as QUIT, KICK, TOPIC, SQUIT and PRIVMSG to name a few. The colon prefixes a free form or multi-word text parameter in all other commands so logically it should do the same for KLINE.
Post Reply