Commit Graph

1077 Commits

Author SHA1 Message Date
Florian Westphal cb0d594e61 Make Channel_Part name and reason parameters 'const'. 2008-02-26 23:49:33 +01:00
Dana Dahlstrom 6bd35bf090 Implement RFC 2812 handling of "0" argument to JOIN
The students in my software-engineering class are writing IRC clients in
Java, and I'm running ngIRCd as a sandbox for them to play in. We
noticed ngIRCd doesn't obey the "JOIN 0" command specified in RFC 2812:

   JOIN 0             ; Leave all currently joined
                      channels.

http://tools.ietf.org/html/rfc2812#section-3.2.1
I believe the following patch addresses this. Cheers!

[fw@strlen.de: put it into a seperate function]
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 42db159d26 Fix wrong strncpy usage if CVSDATE defined
Hello_User() used strncpy with overlapping src/dest.
Use memmove instead.
2008-02-26 23:49:33 +01:00
Florian Westphal 59b19ea6a3 This adds support for sending NOTICEs to a channel.
[also see Bug #70 in ngircd bugzilla].

Based on a patch by Fabian Schlager <fabian.schlager@gmail.com>.
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
Florian Westphal 463c5cb7c5 IRC_PART could reference invalid memory. 2008-01-07 11:42:00 +00:00
Florian Westphal 61e6b5c0aa [Resolver]: Use dotted-decimal IP address if hostname is >= 64 2008-01-02 11:03:29 +00:00
Florian Westphal 91a6fffaa0 io_event_disable: return if event-to-disable is already off 2008-01-02 10:29:51 +00:00
Florian Westphal 2ce5b734bd kqueue: check for EV_ERROR in .flags
if kevent() returns events, check for EV_ERROR in event flags, too.
2007-12-27 18:25:26 +00:00
Florian Westphal f99f9a8f02 Fix format arg: ListenAddress was printed instead of Bind address. 2007-12-13 01:30:16 +00:00
Florian Westphal 4715ccf9ca Fix format string in error path: didn't print strerror(errno) 2007-12-13 01:05:01 +00:00
Florian Westphal 8974e90552 implement '/STAT u' (uptime) 2007-12-11 11:29:43 +00:00
Florian Westphal 2fe13f0a45 Fix fmt string: int, not long 2007-12-07 21:19:01 +00:00
Florian Westphal 20ce56cc5b include <arpa/inet.h> inside tool.h
In file included from hash.c:24:
../tool/tool.h:27: warning: `struct in_addr' declared inside parameter list
2007-11-25 18:42:37 +00:00
Florian Westphal 47a0379e2b remove ip-string from Conf_Server struct
struct Conf_Server stored the ip address to connect to
in dotted-decimal notation; but we only need this for connect()
so long-time storage isn't necessary.
2007-11-23 16:28:37 +00:00
Florian Westphal 82d32ffb28 bind ListenAddress for outgoing connections
ngircd would always use INADDR_ANY for outgoing connections;
which might not be desirable. Added new [Server] option
"Bind" to set source ip.
2007-11-23 16:26:03 +00:00
Alexander Barton 024588dbe7 Funktions to handle numerics sent to the server. 2007-11-21 12:20:32 +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
Alexander Barton 53b98fd7e9 Fixes the wrong logging output when nested servers are introduced
to the network as well as the wrong output of the LINKS command.
2007-11-20 20:02:40 +00:00
Alexander Barton 06bfb3adfb Fix code to compile using K&R C compiler and ansi2kr again. 2007-11-18 15:05:35 +00:00
Florian Westphal ad7361dfe0 if ngircd doesn't run chrooted, it tries to chdir
to the users working directory (as returned by getpwuid()).
Failing to chdir to that directory isn't an error; so
log with LOG_INFO and prefix the message with "Notice".
2007-11-15 01:03:01 +00:00
Florian Westphal 001c00b273 New config option NoDNS: disables all DNS queries. 2007-10-25 11:01:19 +00:00
Florian Westphal b861f536b2 configtest would still print "-1" for MaxConnections, MaxConnectionsIP and MaxJoins
if any of those values was set to 0.
2007-10-24 00:48:41 +00:00
Alexander Barton 8f162f4e17 Fixed propagation of channel mode 'P' on server links. 2007-10-14 12:08:57 +00:00
Florian Westphal d223b587e4 accoring to comments in the code, MaxConnections, MaxConnectionsIP and MaxJoins
options allow setting values < 0 -- this isn't the case. Comments adjusted.
2007-10-13 19:11:06 +00:00
Alexander Barton d4ed056147 Numeric 317: implemented "signon time" (displayed in WHOIS result). 2007-10-04 15:03:55 +00:00
Florian Westphal 4b9e52eb4d implement /WALLOPS as described in RFC 2812, section 4.7. 2007-08-02 10:14:26 +00:00
Alexander Barton 69081851ac SECURITY: Fixed a severe bug in handling JOIN commands, which could
cause the server to crash. Thanks to Sebastian Vesper, <net@veoson.net>.
2007-07-31 18:56:13 +00:00
Florian Westphal efcca62a35 last fix accidentially broke reconnect timer. 2007-07-21 18:46:28 +00:00
Florian Westphal cd65e0a56e Don't connect to a server if a connection to another server within the same group
is in progress.
2007-06-28 15:13:38 +00:00
Florian Westphal 2275add327 Add new server config option to disable automatic connect. (Tassilo Schweyer) 2007-06-28 05:15:12 +00:00
Florian Westphal 5675be4cd9 fix compile /w gcc 2.95 (reported by Tassilo Schweyer) 2007-06-11 20:06:46 +00:00
Alexander Barton 255edf7eab Reworked read and write buffer handling, introduced WRITEBUFFER_SLINK_LEN. 2007-05-17 23:34:24 +00:00
Alexander Barton 5930a29197 Zip_Flush(): close the connection in all error cases. 2007-05-17 15:16:47 +00:00
Florian Westphal 07d8da60de array_start() cannot legally return NULL if array_length() > 0 --> use assert(). 2007-05-17 14:46:14 +00:00
Alexander Barton 44afe042d1 Make Zip_Flush() more graceful. 2007-05-17 13:49:49 +00:00
Florian Westphal a073bc89c4 there is no need to treat servers differently than clients on the read side. 2007-05-17 12:39:25 +00:00
Florian Westphal 63e89ceb21 make needlesly global function Conn_Write static. 2007-05-09 13:21:11 +00:00
Florian Westphal 09416f36bf remove ZBUFFER constants and increase max buffer size of server links 2007-05-09 08:55:14 +00:00
Florian Westphal 508b55126f fix compressed server links 2007-05-02 12:34:30 +00:00
Alexander Barton 9f65979979 2007 :-) 2007-04-09 01:24:05 +00:00
Florian Westphal 09deb857ce - change return type of Conn_InitListeners to unsigned
- remove minor whitespace damage
2007-04-04 21:52:12 +00:00
Florian Westphal 8c14d397ba put parentheses around argument 2007-04-03 22:08:10 +00:00
Florian Westphal 99eab1e216 if we can't bind a socket we now Log the port number, too. 2007-02-21 11:06:06 +00:00
Florian Westphal c93d089736 return false instead of NULL in error path 2007-01-29 21:13:26 +00:00
Alexander Barton 429f85b77a Remove Client_DestroyNow() to keep semantik "every CONNECTON has a CLIENT". 2007-01-23 16:07:19 +00:00
Florian Westphal ea2a4b3370 fix broken IO_DEBUG build 2007-01-19 13:52:54 +00:00
Florian Westphal f9b9850662 io_event_add: return if eventtype is already registered. 2007-01-18 00:25:26 +00:00
Florian Westphal 1b852fce72 add support for predefined-channel configuration of k and l modes 2006-12-29 14:09:48 +00:00