Commit Graph

82 Commits

Author SHA1 Message Date
Alexander Barton 6e8cf51bb2 Implement WEBIRC command
The WEBIRC command is used by some Web-to-IRC gateways to set the correct
user name and host name of users instead of their own.

Syntax: WEBIRC <password> <username> <hostname> <ip-address>

The <password> must be set using the new configuration variable "WebircPassword" in the [Global] section of ngircd.conf.

Please note that the <ip-address> is currently not used by ngIRCd (we don't store it in the CLIENT structure, only the resolved hostname).
2010-02-11 00:01:53 +01:00
Alexander Barton 294320ed62 Enable SQUIT command for IRC Operators
This patch enables IRC Operators to use the SQUIT command as specified in
RFC 2812, section 3.1.8 "Squit".

When forwarding SQUIT commands, the server connected to the target will
drop the connection (not the target server itself!).

Please note:

 - the configuration option "AllowRemoteOper" mus be enabled on the
   server disconnecting the target to allow forwarding of SQUIT commands.
 - if the remote server is configured to establish the connection, it
   will just do this; so the disconnect is not permanent in this case!
2009-09-30 16:00:06 +02:00
Alexander Barton 113bd34878 Allow forwarding of CONNECT commands.
The syntax of the CONNECT command now is:

  - CONNECT <server-id>
  - CONNECT <server-id> <port>
  - CONNECT <server-id> <port> <target>
  - CONNECT <server-id> <port> <host> <my-pwd> <peer-pwd>
  - CONNECT <server-id> <port> <host> <my-pwd> <peer-pwd> <target>

Note: the configuration option "AllowRemoteOper" mus be enabled on the
target server to allow forwarding of CONNECT commands.
2009-09-30 16:00:06 +02:00
Florian Westphal 544b9884f4 remove or translate old comments 2009-04-21 20:58:30 +02:00
Florian Westphal 1c7b9dbe93 remove unneeded LOG_DEBUG when not compiling with DEBUG support
when ngircd is build without DEBUG enabled, LOG_DEBUG messages
are always discarded.

To avoid the extra code, ngircd has a LogDebug() wrapper which
gets removed by the compiler when compiling without DEBUG defined.

Update a few functings which were using the
Log(LOG_DEBUG, .. interface directly without #ifdef DEBUG guards.

   text	   data	    bss	    dec	    hex	filename
 127748	   1900	  28280	 157928	  268e8	ngircd.before
 126836	   1896	  28280	 157012	  26554	ngircd.after
2009-01-10 00:54:07 +01:00
Alexander Barton 5a91d62100 Ignore numeric 020 ("please wait while we process your coinnection")
Some servers send the numeric 020 ("please wait while we process your
connection") when a client connects. This is no useful information for
this server, so we simply ignore it :-)
2008-11-11 23:11:49 +01:00
Alexander Barton e5cf73b9ee Fix Validate_Args(): unused parameter "Idx" and "Req"
This patch fixes the following error message of GCC (tested with version
4.3.0) when not compiling ngIRCd in "strict RFC" mode:

parse.c: In function "Validate_Args":
parse.c:341: error: unused parameter "Idx"
parse.c:341: error: unused parameter "Req"
2008-07-27 20:35:01 +02:00
Alexander Barton a84f7dcee5 Allow mixed line terminations (CR+LF/CR/LF) in non-RFC-compliant mode
Up to now ngIRCd accepted CR+LF as well as a single CR or LF in "non RFC
compliant" mode (the default). But ngIRCd became confused when it received
data containing mixed line endings (e. g. "111\r222\n333\r\n").

This patch enables ngIRCd (in "non RFC compliant" mode) to detect CR+LF,
CR, and LF as equally good line termination sequences and to always end the
command after the first one detected.

Some clients (for exmaple Trilian) are that ... broken to send such mixed
line terminations ...

First patch proposed by Scott Perry <scperry@ucsd.edu>,
Thanks to Ali Shemiran <ashemira@ucsd.edu> for testing!
2008-06-11 16:00:38 +02:00
Alexander Barton 8644cbf197 Don't allow stray \r or \n in command parameters
If ngircd receives an input line like "COMMAND arg\nIRRELEVANT\r\n",
"arg\nIRRELEVANT" is passed as an argument to COMMAND. This can lead
to output like:

:ngircd.test.server 322 nick #chan 1 :
topicwithprecedingnewline
:ngircd.test.server 322 nick #nxtchan 1 :
[..]

Worse, this allows clients to piggyback irc commands, e.g.
"TOPIC #a :test\n:fake!~a@nonexistant JOIN :#a\r\n", which
causes the client to receive a JOIN command during /LIST output.

Bug reported by Scott Perry, first patch by Florian Westphal.
2008-05-30 14:58:25 +02:00
Alexander Barton 4e56e5341f Implement IRC commands SERVICE, SERVLIST, and SQUERY as dummy functions
SERVICE, SERVLIST, and SQUERY are required by RFC 2812 (it states in
section 3 that "all commands described in this section MUST be implemented
by any server for this protocol." -- So we implement them without (much)
actual functionality ...
2008-05-05 18:06:43 +02:00
Alexander Barton ddecfcd831 Implemented IRC commands INFO, USERS (dummy), and SUMMON (dummy). 2008-02-26 23:49:33 +01:00
Florian Westphal 3022d7cff3 Don't use Client_Type after command has been processed.
This caused a read from already free'd memory, if the processed
command (IRC_QUIT) calls Client_Destroy.
2008-02-26 23:49:33 +01:00
Florian Westphal 4add9c29ed [Parser]: Fix minor sparse warnings
parse.c:56:9: warning: symbol 'My_Commands' was not declared. Should it be static?
parse.c:107:9: warning: symbol 'My_Numerics' was not declared. Should it be static?

Also move handling of numerics into a seperate helper function.
2008-01-13 16:12:49 +00:00
Alexander Barton 47ca178a21 Introduce option to configure the maximum nick name lenth in ngircd.conf
- New configuration option "MaxNickLength" to specify the allowed maximum
  length of user nick names. Note: must be unique in an IRC network!
- Enhanced the IRC+ protocol to support an enhanced "server handshake" and
  enable server to recognice numeric 005 (ISUPPORT) and 376 (ENDOFMOTD).
  See doc/Protocol.txt for details.
2007-11-21 12:16:33 +00:00
Florian Westphal 4b9e52eb4d implement /WALLOPS as described in RFC 2812, section 4.7. 2007-08-02 10:14:26 +00:00
Florian Westphal 87f4b1c6f6 Client_GetFromConn() removed and replaced with new function Conn_GetClient() 2006-04-23 10:37:27 +00:00
Alexander Barton 4d18ac83a2 Set one second penalty on unknown commands. 2005-09-04 23:42:24 +00:00
Alexander Barton 77f54693ef Removed unnecessary #define of "LOCAL", now use plain C "static" instead. 2005-07-31 20:13:07 +00:00
Alexander Barton 74cb2e2768 Eliminate some compiler warnings ("unused parameter"). 2005-07-22 21:31:05 +00:00
Alexander Barton 162338b8c8 Ignore unknown commands received before the client is registered. 2005-06-24 20:56:46 +00:00
Alexander Barton 45404a1644 Added some Doxygen documentation. 2005-06-01 21:52:18 +00:00
Florian Westphal 8adff59223 Remove INT, LONG, BOOLEAN, STATIC, CONST, CHAR datatypes.
use stdbool.h / inttypes.h if available.
2005-03-19 18:43:48 +00:00
Alexander Barton 57c7e23622 Added #include for strings.h to fix compiler warnings. 2004-01-17 03:17:49 +00:00
Alexander Barton 2152e37722 - Added "HELP" command. 2003-01-15 13:49:20 +00:00
Alexander Barton 42c4e6c7b1 - Added support for "TRACE" command. 2003-01-13 18:56:30 +00:00
Alexander Barton fc1118cb5a - Enhanced error detection for numerics ("status codes"). 2003-01-12 22:18:46 +00:00
Alexander Barton a7956f334e - New command DISCONNECT. 2002-12-31 16:11:24 +00:00
Alexander Barton b8d7dcec77 - Adjusted includes for new "conn-func.h" header. 2002-12-30 17:15:42 +00:00
Alexander Barton 695631b298 - replaced a lot of strcpy() calls with strlcpy() which is more secure. 2002-12-26 17:04:54 +00:00
Alexander Barton 6626395c88 - replaced a lot of strcat() calls with strlcat() which is more secure. 2002-12-26 16:48:14 +00:00
Alexander Barton 17f7c6d3ed - new function Parse_GetCommandStruct(). 2002-12-18 13:53:20 +00:00
Alexander Barton 490f28ffd1 - new file header format (in english);
- new file ident semantics.
2002-12-12 12:24:18 +00:00
Alexander Barton b99af4fa47 - IRC Operators can KILL users now. 2002-12-06 17:02:39 +00:00
Alexander Barton 0c471b84f7 - neues Source-Modul "irc-info"; neuer Befehl STATS. 2002-11-30 17:39:56 +00:00
Alexander Barton 1e59617d2c - Parser auf Befehlstabelle umgestellt. 2002-11-30 15:04:57 +00:00
Alexander Barton b0b797b396 - Logging bei Prefix-Fehlern verbessert. 2002-11-28 11:02:50 +00:00
Alexander Barton 283aed75cf - neuer IRC-Befehl "TIME". 2002-11-24 18:45:43 +00:00
Alexander Barton fa3dbfd8d6 - RELOAD in REHASH umbenannt.
- neue Funktion WHOWAS.
2002-11-22 23:33:00 +00:00
Alexander Barton 799511d472 - Befehle sortiert,
- neuer Befehl RELOAD.
2002-11-22 16:36:02 +00:00
Alexander Barton dd09b17eae - Fehler-Ausgaben verbessert (Prefix-Fehler). 2002-11-20 10:54:24 +00:00
Alexander Barton ec474a4bd2 - "format-string-bugs", die zum Abbruch des Servers fuehrten, behoben. 2002-10-04 11:21:46 +00:00
Alexander Barton 5502fb271d - neuer Befehl: ADMIN 2002-09-16 09:20:27 +00:00
Alexander Barton 53f76a1dad - den BAN-Befehl gibt es gar nicht ;-) 2002-09-08 00:52:55 +00:00
Alexander Barton 3dc1621200 - IRC+-Protokoll ist nun abschaltbar. 2002-09-07 17:57:31 +00:00
Alexander Barton d1ac40391e - neue Befehle CHANINFO und CONNECT. 2002-09-03 23:54:06 +00:00
Alexander Barton 7d30c8cebc - Hmpf. "Verfruehtes" CVS-Update einiger Source-Files zurueckgenommen ... 2002-08-26 23:47:58 +00:00
Alexander Barton d645ce86e9 - Bei einem JOIN in einen persistenten Channel werden nun evtl. zu setzende
User-Modes korrekt in den Channel gemeldet.
2002-08-26 23:39:22 +00:00
Alexander Barton 5063de59b1 - Prefixe werden nur noch bei reg. Verbindungen validiert, ansonsten ignoriert. 2002-07-29 20:35:33 +00:00
Alexander Barton e0ed3aa141 - Semantik der Validate_XXX()-Funktionen verbessert,
- Validate_Prefix() mit "Leben" erfuellt ;-)
2002-07-26 21:12:24 +00:00
Alexander Barton c2f60abe55 - Anpassungen an pre-ANSI-Compiler,
- Includes aufgeraumt: Header includieren keine anderen mehr.
2002-05-27 13:09:26 +00:00