Commit Graph

1172 Commits

Author SHA1 Message Date
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
Alexander Barton 949a4ef793 Added .cvsignore files to hide generated files from CVS. 2006-12-28 13:20:07 +00:00
Alexander Barton f74781647a array_free(): enable debug code only when DEBUG_ARRAY is #define'd. 2006-12-28 12:53:41 +00:00
Alexander Barton 5c78230283 New configure option "--without-select"; when usin epoll() IO API include
support for select() as well by default and fall back on runtime when needed.
2006-12-26 16:00:45 +00:00
Alexander Barton 262d945284 Fixed typo in #ifdef which tests if this header is already included or not. 2006-12-25 22:53:52 +00:00
Florian Westphal 4243cae985 register io handler before creating new local client structure 2006-12-25 01:11:12 +00:00
Florian Westphal 40226d26b2 revert to last good revision again 8-/ 2006-12-17 23:04:45 +00:00
Florian Westphal d2f7d3087d do not call Conn_Close when io_event_create fails 2006-12-17 22:55:07 +00:00
Florian Westphal 3f1e03edd9 fix possibe buffer-off-by one 2006-12-17 22:52:43 +00:00
Florian Westphal 23e7f7f0dd don't call Resolve_Shutdown() when io_event_create fails 2006-12-17 22:50:51 +00:00
Florian Westphal 8cb0e3af68 removed errouneous FD_SETSIZE limit when not using select() 2006-12-16 22:48:34 +00:00
Florian Westphal 5040d56489 minor cleanup 2006-12-07 22:24:14 +00:00
Florian Westphal fb0fbe908d remove unused function Channel_PCount 2006-12-07 22:23:39 +00:00
Florian Westphal fa7bb2790a moved invite/ban lists to channel structure 2006-12-07 17:57:20 +00:00
Florian Westphal 5877bca4bc fix RPL_LOCALUSERS_MSG (%ld -> %lu) 2006-12-02 14:24:36 +00:00
Florian Westphal 37602d1523 Log(LOG_DEBUG, .. -> LogDebug() 2006-12-02 14:10:48 +00:00
Florian Westphal a09034563a predefined channels MUST start with '#', but this is not very intuitive,
since # is also used as a comment character in ngircd.conf. Thus
we prefix the name with '#' if it is missing.
2006-11-20 19:32:07 +00:00
Alexander Barton 5b35b101f2 Fixed validation of server names containing digits. 2006-11-10 10:05:00 +00:00
Florian Westphal 058d3085a9 New configuration option "PredefChannelsOnly": if set, make
all JOINs to-non existants channel return ERR_BANNEDFROMCHAN_MSG,
restricting users to those channels defined in the config file.
2006-11-05 13:03:46 +00:00
Florian Westphal 018e351630 -Whitespace Damage; Client_OperCount(), Client_UnknownCount(), Client_MyServerCount() return unsigned long 2006-10-07 10:40:52 +00:00
Florian Westphal 6e105bf87e channel maxusers now unsigned long 2006-10-06 21:32:58 +00:00
Florian Westphal 61966a6088 add const qualifier to Hash() and Matche() Arguments 2006-10-06 21:23:47 +00:00
Florian Westphal 27c96632f1 Client_IsValidNick: no need to strcpy. 2006-10-06 19:57:56 +00:00
Florian Westphal 4108e16be6 Channel_Join was severely broken. 2006-10-05 18:26:54 +00:00
Alexander Barton 4e02bdc322 Update info text of local server after re-reading configuration. 2006-10-03 10:59:40 +00:00
Alexander Barton ca5e09865e Removed an unused variable -- but where did it come from!? Strange ... 2006-10-03 10:28:38 +00:00
Florian Westphal d8950c5dd0 cleaned up Channel_IsValidName (now uses strcspn()) 2006-10-02 21:55:49 +00:00
Alexander Barton 257312b102 Changed Numerics 265 and 266 to follow ircd 2.11.x "standards". 2006-10-01 19:13:32 +00:00
Alexander Barton 27d947fb7d Allow PASS syntax defined in RFC 1459 for server links, too.
Removed client status CLIENT_GOTPASSSERVER.
2006-10-01 19:05:00 +00:00
Alexander Barton bed98979dc Enhanced ISUPPORT message (numeric 005). 2006-10-01 19:03:05 +00:00
Florian Westphal 4c6c6ecf0e array_get: no need to multiply again. remove unneeded checks. remove array_free_wipe(). 2006-09-30 21:49:46 +00:00
Florian Westphal a2f5a05ff8 io_close_poll()s closing brace mysteriously disappeared... fixed. 2006-09-19 18:21:30 +00:00
Florian Westphal 639eb40035 Added support for the /dev/poll i/o interface. 2006-09-17 10:41:06 +00:00
Florian Westphal 0d6f9d4e3e simplify io_library_init* 2006-09-16 16:47:27 +00:00
Florian Westphal 147de9dfa9 add support for the poll() interface 2006-09-16 15:00:09 +00:00
Florian Westphal f6e729443e cleanup 2006-09-16 14:49:26 +00:00
Florian Westphal e426c131c7 fix embarassing fileptr leak 2006-09-16 12:22:09 +00:00
Florian Westphal e2aacff7d4 s/Log(LOG_DEBUG/LogDebug(/ , translated comments, etc. 2006-08-12 11:58:21 +00:00
Florian Westphal 0eccdbc137 -whitespace damage 2006-08-12 11:56:24 +00:00
Florian Westphal 939ee6a39b simplify Resolve_Read(). 2006-08-12 11:54:23 +00:00
Florian Westphal 83caef4598 if compiling without -DDEBUG, make LogDebug 'static inline' so gcc optimizes it away. 2006-08-05 09:16:21 +00:00
Alexander Barton 47026e14ce Don't assert() when a pre-defined channel has no topic. 2006-07-24 22:54:09 +00:00
Alexander Barton 63626449f8 Flag the format parameter of LogDebug() as "unused" when not compiling with
debug code to avoid gcc warnings. Added some documentation comments.
2006-07-23 23:23:45 +00:00
Alexander Barton 184eb1c54b Removed unused variable "ret" when using the select() API. 2006-07-23 23:11:44 +00:00
Alexander Barton 5ce6bf28d1 Removed (theoretically) division by zero; reformated some code. 2006-07-23 23:05:20 +00:00
Alexander Barton f1f94f07e1 Validate "ServerName" variable. 2006-07-23 16:42:45 +00:00
Alexander Barton 3e8978d836 Allow DIE to send a message to all locally connected clients. Closes bug #48. 2006-07-23 15:43:18 +00:00
Alexander Barton 9a2d4eef44 "Enhanced" debug message for Handle_Write(), only print when data in buffer. 2006-07-23 15:22:56 +00:00
Alexander Barton 0d5fc770d3 Output some debug messages only if DEBUG_ZIP is #define'd. 2006-07-23 15:19:20 +00:00
Alexander Barton 5590f8624b Don't include conn.h, conn-func.h is enough. 2006-07-23 14:55:40 +00:00
Alexander Barton 47e581e453 Updated copyright notice ;-) 2006-07-23 12:07:33 +00:00
Florian Westphal 3833f8aae3 remove fd from io_event structure 2006-07-12 19:27:12 +00:00
Florian Westphal 161340d486 ALIGN_XXX( v ) macros now leave v alone if it was already aligned. 2006-07-01 22:11:48 +00:00
Alexander Barton e9e1fa459b Sorted channel modes alphabetically. 2006-06-15 20:28:15 +00:00
Alexander Barton 00ab67dcdb The third parameter of bind() is of type "socklen_t", not "int". 2006-05-12 11:53:04 +00:00
Alexander Barton dd3a3bc603 Use some more specific data types (e. g. pid_t vs. int), make "SPLint" happy :-) 2006-05-10 21:24:01 +00:00
Florian Westphal 0a3f562f36 make splint complain less... 2006-05-10 17:33:36 +00:00
Florian Westphal 9dfd42a7e6 disabled most (rather annoying) debug messages using DEBUG_ARRAY / DEBUG_IO defines 2006-05-09 17:02:40 +00:00
Alexander Barton 2af87e9152 Handle time shifts backwards gracefully. 2006-05-09 14:49:08 +00:00
Florian Westphal 185004cb30 kqueue support was completely broken; seemed to work on FreeBSD just because of sheer luck. 2006-05-07 10:54:42 +00:00
Florian Westphal 4a2eea2939 minor cleanup, removed unneeded check in safemult_sizet 2006-05-07 10:52:47 +00:00
Alexander Barton 6d3686e73d Send invite and ban lists only once and not repeatedly for every channel. 2006-04-30 21:31:43 +00:00
Florian Westphal 5d0ba011c7 Fix Connection Pool resizing. 2006-04-29 16:19:46 +00:00
Florian Westphal 87f4b1c6f6 Client_GetFromConn() removed and replaced with new function Conn_GetClient() 2006-04-23 10:37:27 +00:00
Florian Westphal 8067bab106 changes some comments, minor cleanup 2006-04-23 10:33:37 +00:00
Florian Westphal bebfbedf3f fix ngt_TrimStr(), fix format string 2006-03-24 23:25:38 +00:00
Florian Westphal 2a9ffe7037 use strlcat return value; don't call time() repeatedly. 2006-03-18 22:27:09 +00:00
Florian Westphal 4000e01b28 corrected return value 2006-03-16 20:14:16 +00:00
Florian Westphal 68d3d36dd6 removed silly if (foo) { if (foo){ }} statement 2006-03-16 19:56:34 +00:00
Florian Westphal eedfc35bbc s/gehoert// 2006-03-11 10:43:49 +00:00
Florian Westphal d39d3ec4b9 Client_RegisterWhowas(): call time() only once 2006-03-11 10:33:30 +00:00
Alexander Barton 79dfd60a0c Don't use "awk" directly, instead use $(AWK) variable. 2006-03-11 01:48:50 +00:00
Alexander Barton 29ad5e0d94 Moved now local prototype of Client_New() to C file, renamed it to
Init_New_Client() and cleaned up some code and comments.
2006-03-11 01:37:31 +00:00
Florian Westphal 7e8ac0afcf Client_New() not used outside client.c -> static 2006-03-10 20:25:29 +00:00
Florian Westphal 93df629b69 changed connection structure to array-api 2006-02-16 19:21:57 +00:00
Florian Westphal 66060dbce9 new Function: LogDebug() 2006-02-08 17:33:28 +00:00
Florian Westphal 0701afedee removed Resolve_SUCCESS() Macro and Res_Stat->sucess boolean (no longer used/needed) 2006-02-08 15:24:10 +00:00
Florian Westphal a17745d6d7 Make connid same as connection fd. 2006-02-08 15:20:21 +00:00
Florian Westphal 1249acfdba removed obsolete "int Conn_MaxFD" 2006-02-02 21:00:21 +00:00
Florian Westphal c8fb6a2258 simplify IRC_Show_MOTD() 2006-01-27 17:19:58 +00:00
Florian Westphal 4b2f966b7e Fix Bugzilla #64 -- ngicrd did not reconnect to other servers after failed forward dns lookup. 2005-12-09 09:26:55 +00:00
Alexander Barton 0570e13cac Minor whitespace fixes. 2005-11-21 16:31:30 +00:00
Alexander Barton 6b21249151 Remove direct call of Conf_UnsetServer(): it's already indirectly called
by Conn_Close() a few lines above.
2005-11-21 15:06:37 +00:00
Alexander Barton bc09a3e487 Changed Handle_Write() to not close sockets itself but to call Conn_Close. 2005-10-11 19:29:23 +00:00
Alexander Barton ff218617db gcc 4: "warning: declaration of 'dup' shadows a global declaration". 2005-09-24 17:06:54 +00:00
Florian Westphal b65358b17c avoid 2nd time() call in Check_Servers(), improve comments 2005-09-24 02:48:46 +00:00
Florian Westphal e9f3e69f36 use io_close instead of plain close in Conn_ExitListeners() 2005-09-24 02:20:00 +00:00
Florian Westphal 5b2364b236 merge new resolver code 2005-09-12 19:10:20 +00:00
Florian Westphal 4db29b0076 Minimal changes (needed for merging resolver changes) 2005-09-11 11:42:48 +00:00
Florian Westphal 0aae3ec5d7 Mostly formatting; changes needed for SSL merge 2005-09-10 23:42:12 +00:00
Florian Westphal 468a1c7767 Handle_Write(): Report write attempts on closed sockets when in debug mode. 2005-09-05 09:10:08 +00:00
Alexander Barton ab3ac4e466 Removed obsolete debug message. 2005-09-05 08:11:11 +00:00
Alexander Barton 4d18ac83a2 Set one second penalty on unknown commands. 2005-09-04 23:42:24 +00:00
Alexander Barton 660b529c10 Add debug code to Conn_SetPenalty(). 2005-09-04 23:38:32 +00:00
Florian Westphal 565129f992 io_close(): explicitly remove fd from epoll set 2005-09-04 13:38:59 +00:00
Florian Westphal fc4cd39202 Wait for DNS reverse lookup (and ident request) before writing results to pipe. 2005-09-03 11:17:16 +00:00
Florian Westphal 6444442931 fix fd leak (happens on failure of fork() ). 2005-09-02 21:47:30 +00:00
Alexander Barton e899c75d7e Updated copyright notice. 2005-09-02 17:12:58 +00:00
Florian Westphal cae9a3aee5 small formatting change 2005-09-02 17:01:23 +00:00
Alexander Barton e708790566 JOIN now supports more than one channel key at a time. 2005-09-02 15:46:49 +00:00
Florian Westphal dd3d2e2c39 Complain if MyPassword starts with ':'. (Reported by Ben Korvemaker) 2005-09-02 13:58:52 +00:00
Florian Westphal 9275dc4dc4 reformatted Handle_SERVER() 2005-09-02 13:50:52 +00:00
Alexander Barton af9123fd82 Cleaned up some code, comments and log/debug messages. 2005-09-02 13:28:30 +00:00
Alexander Barton ca32c1b311 Implementec numeric "333": Time and user name who set a channel topic. 2005-09-02 12:50:25 +00:00
Alexander Barton a5b5a6a99a Make PONG handler compatible with ngIRCd <= 0.9 ("make it more relaxed"). 2005-09-01 10:51:24 +00:00
Florian Westphal c65343e719 reformatted a few lines. 2005-08-30 22:08:00 +00:00