[IRCServices] ircservices 5.1.11 RFC 1459 protocol module broken?
Andrew Church
achurch at achurch.org
Sat Nov 8 01:59:41 PST 2008
Fixed, thanks for the report.
As for which protocol is "most advanced", it's hard to say; each protocol
has its own different set of features. The rfc1459, ts8, dalnet, and
undernet-p9 protocols are all archaic at this point, but most of the other
protocols supported by Services are reasonably modern and suitable for use.
--Andrew Church
achurch at achurch.org
http://achurch.org/
>Hello!
>
>I'm working on getting ngIRCd connected to the ircservices 5.1.11
>package, at the moment I'm using the RFC 1459 protocol module and
>enhanced ngIRCd to understand server and user registration according
>to this older RFC.
>
>Thereby I encountered a problem: ircservices all the time answered
>with the following error message:
>
>----------> cut here <----------
>debug: Received: :a.irc.net PASS srvPWD 0210-IRC+ ngircd|dev:CHLZ PZ
>debug: Received: :a.irc.net SERVER a.irc.net 1 :A Server Info Text
>debug: Received: NICK test :1
>debug: Received: :test USER ~alex localhost a.irc.net :Alex
>debug: Received: :test MODE test :+w
>debug: user: MODE +w for nonexistent nick test from test: test +w
>----------> cut here <----------
>
>"nonexistent nick test" ... hm!?
>
>Digging through the source code of ircservices, I found the folowing
>code in modules/protocol/rfc1459.c, line 42 ff.:
>
>----------> cut here <----------
>static void m_user(char *source, int ac, char **av)
>{
> char *new_av[7];
> if (ac != 5)
> return;
>----------> cut here <----------
>
>So this function checks if the USER command das 5(!) parameters. BUT:
>according to RFC 1459 the USER command only has 4 parameters, see
>section 4.1.3:
>
>----------> cut here <----------
>4.1.3 User message
>
> Command: USER
> Parameters: <username> <hostname> <servername> <realname>
>
>[...]
>----------> cut here <----------
>
>So the above mentioned test in ircservices always silently failed.
>
>Proposed patch:
>
>----------> cut here <----------
>--- rfc1459.c.ORIG 2008-08-13 21:28:33.000000000 +0200
>+++ rfc1459.c 2008-08-13 21:27:51.000000000 +0200
>@@ -43,8 +43,11 @@ static void m_user(char *source, int ac,
>{
> char *new_av[7];
>
>- if (ac != 5)
>+ if (ac != 4) {
>+ module_log_debug(1, "USER message: wrong number of parameters"
>+ " (%d) for source `%s'", ac, source ?
>source : "?");
> return;
>+ }
> new_av[0] = source; /* Nickname */
> new_av[1] = (char *)"0"; /* # of hops (was in NICK command... we
>lose) */
> new_av[2] = (char *)"0"; /* Timestamp */
>----------> cut here <----------
>
>Can you tell me if I'm correct? Or do I overlook something?
>
>And can you tell me which protocol module is the "most advanced" or
>"best"?
>
>Thanks a lot!
>Alex
>------------------------------------------------------------------
>To unsubscribe or change your subscription options, visit:
>http://lists.ircservices.za.net/mailman/listinfo/ircservices