1
0
mirror of https://github.com/osmarks/ngircd.git synced 2024-10-28 12:56:18 +00:00
Commit Graph

1580 Commits

Author SHA1 Message Date
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
a11e895045 Rename Channel_Free() to Free_Channel(), it is a local function 2009-01-05 13:53:33 +01:00
Alexander Barton
175f0af979 Clean up channel allocation table on shutdown/restart.
Silly bug: the condition of a while() loop in the Channel_Exit() function
used the wrong variable and therefore got never executed ...

This bug is in the code since the beginning (see commit bb19cfda in 2002);
shame on me!
2009-01-05 12:58:37 +01:00
Florian Westphal
40a0e9abbe Add Channel_Free().
Central function to free a channel structure and all its resources
(invite/ban lists, topic, ...).
2009-01-05 12:48:48 +01:00
Alexander Barton
0659503afd Clean up (reformat and comment) Delete_Channel() function. 2009-01-04 15:25:07 +01:00
Alexander Barton
18efc7469c Free topic array on channel deletion.
The topic array in the CHANNEL structure must be free()'d before the
channel itself becomes deleted.
2009-01-04 15:22:32 +01:00
Alexander Barton
0e4e22a7a6 Allow pre-defined server local channels ("&"). 2008-12-30 19:23:03 +01:00
Florian Westphal
dc9f42dc3c defines.h: remove MAX_LISTEN_PORTS, MAX_SERVICES
_SERVICES was never used; _LISTEN_PORTS is a leftover from
commit 51ccb5928a
('internal changes needed for future ssl support').
2008-12-27 23:51:52 +01:00
Florian Westphal
a971047bc5 Remove limit on max number of predefined channels.
This resolves Bugzilla Bug 68 ('Too many pre-defined channels configured.')
2008-12-26 01:07:56 +01:00
Florian Westphal
6500d443fc channel.c: constify a few function arguments. 2008-12-26 01:07:52 +01:00
Florian Westphal
d26a283ea9 use %ld as format specifier for posix data types
in the same vein as the earlier commit:
cast posix data types (pid_t, ...) to long and use
%ld as format specifier. This will avoid problems
when sizeof(int) != sizeof(type).

We could also cast to int, but this might truncate the value.
2008-12-26 01:07:13 +01:00
Florian Westphal
8a94ec9728 don't print pid_t type with %ld format specifier
Reported by Christoph Biedl:
ngircd[21581]: Running as user irc(39), group irc(39), with PID 140733193409613.

cast pid_t to long to avoid this.
While we are there, cast uid_t and gid_t, too.
2008-12-17 22:55:20 +01:00
Alexander Barton
85ce82e504 Testsuite start-server.sh: return correct exit code.
src/testsuite/start-server.sh returns 0 when no errors occurred and the
daemon has been startet and 1 on errors. Always returning 0 is wrong ...
2008-12-03 16:49:55 +01:00
Alexander Barton
83c699d5a5 Make testsuite (getpid.sh) work on OpenSolaris (i386/pc/solaris2.11). 2008-12-03 16:49:17 +01:00
Alexander Barton
2eb564ccaa Change formatting of some log messages
- Fix formatting of some log messages, mostly punctuation.
- cb_Connect_to_Server(): don't use string concatenation, because it
  is not supported by pre-ANSI C compilers ...
2008-11-20 23:50:26 +01:00
Alexander Barton
14baf64f41 Fix pem_passwd_cb(): unused variable "rwflag" (OpenSSL)
This patch fixes the following warning of GCC (version 4.3.2) in
function pem_passwd_cb() when compiling with OpenSSL support and
without debug code:

conn-ssl.c: In function 'pem_passwd_cb':
conn-ssl.c:122: warning: unused parameter 'rwflag'
2008-11-20 23:46:20 +01:00
Alexander Barton
4c113d8850 New configuration option "NoIdent" to disable IDENT lookups
The new configuration option "NoIdent" in ngircd.conf can be used to
disable IDENT lookups even when the ngIRCd daemon is compiled with IDENT
lookups enabled.
2008-11-19 19:11:39 +01:00
Alexander Barton
3243d9ee44 Implement the IRC command "SERVLIST"
The IRC command "SERVLIST" lists all the registered services, see RFC 2811, section 3.5.1.
The syntax is "SERVLIST [<mask> [<type>]]". The parameter <type> is not used by ngIRCd at
the moment, all registered services are of type 0 (which is the default when omitted).
2008-11-19 18:16:26 +01:00
Alexander Barton
0eda085f1e Create local &SERVER channel and log server messages to it
ngIRCd now creates a server-local channel &SERVER with channel modes
+mnPt (moderated, no messages from outside the channel, persistent and
with the topic locked) and logs all the messages to it that a user with
mode +s ("server messages") receives.

If an IRC operator withdraws the +P ("persistent") mode and the &SERVER
channel is freed because of no members, nothing special happens. The
channel can be recerated any time later and ngIRCd would begin logging
to it again.
2008-11-17 23:27:06 +01:00
Alexander Barton
2cc21caf32 Implement local channels (prefix "&")
This patch implements server-local channels, prefix "&", that are only
visible to users of the same local server and not in the network.

Patch written by Scott Perry (2008-06-04), see:
 - http://arthur.barton.de/cgi-bin/bugzilla/show_bug.cgi?id=87
 - http://arthur.barton.de/cgi-bin/bugzilla/attachment.cgi?id=24&action=view
2008-11-17 21:52:56 +01:00
Alexander Barton
7b69bc2ae8 Added some missing files of GIT tree to distribution archives
The following bits and bytes were not included in distribution archives:
 - contrib: ngindent, ngircd.sh
 - contrib/Debian: ngircd.postinst
 - contrib/MacOSX: preinstall.sh, postinstall.sh
 - doc/src: Doxyfile, header.inc.html, footer.inc.html, ngircd-doc.css
 - src/portab: splint.h
2008-11-13 23:17:32 +01:00
Alexander Barton
7ad167f4c4 Test suite: start two servers and test server-server links
I changed the test suite to start two test servers (on port 6789 and 6790),
so server-server links can be tested as well for which I included the new
test script "server-link-test.e".

In addition the documentation of the test suite (src/testsuite/README) has
been updated and is more complete now.
2008-11-13 22:46:06 +01:00
Alexander Barton
920d0636ff Add conf-ssl.h to "noinst_HEADERS"
conf-ssl.h must be listed in "noinst_HEADERS" so that it becomes included
in distribution archives generated by "make dist" and "make distcheck".
2008-11-13 00:22:25 +01:00
Alexander Barton
9f067a059d Connection counter: count outgoing connections as well.
This patch lets ngIRCd count outgoing connections as well as incoming
connections (up to now only outgoing connections have been counted). This
change is required because the Conn_Close() function doesn't know whether
it closes an outgoing connection or not and therefore would decrement the
counter below zero when an outgoing connection existed -- which would
trigger an assert() call ...

Please note that this patch changes the (so far undocumented but now fixed)
behaviour of the "MaxConnections" configuration option to account the sum
of the in- and outbound connections!
2008-11-12 01:26:04 +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
3a5b7b63ae GNUTLS: define new API types when installed library is too old
This patch enables ngIRCd to use GNUTLS in really old versions, tested
with version 1.0.16, that don't define the "new" data types ending in
xxx_t. LIBGNUTLS_VERSION_MAJOR isn't defined there as well, so we use
it to test if we must define the new types on our own.
2008-11-11 22:03:11 +01:00
Alexander Barton
9308541e6d Console log: output timestamp (seconds since start) for resolver, too 2008-11-11 22:01:27 +01:00
Alexander Barton
027cf22267 Console log: output timestamp (seconds since start of daemon) 2008-11-10 18:41:19 +01:00
Florian Westphal
125c05fba0 conn-ssl.c: work around gnutls API problems on 64 bit platforms
Alexander Barton reported a compiler warning on 64-bit platforms:
cc1: warnings being treated as errors
conn-ssl.c: In function 'ConnSSL_Init_SSL':
conn-ssl.c:403: error: cast to pointer from integer of
different size

Unfortunately, I couldn't find a real solution; the GNUTLS
API expects 'gnutls_transport_ptr_t' (which is void*),
but the default push/pull functions (send/recv) expect an int.

The only alternative solution is to pass in an address to the
file descriptor, then add send/recv wrappers that expect a pointer.

What a mess[tm].
2008-10-29 23:51:39 +01:00
Alexander Barton
fb19b05e1e GIT: don't ignore cvs-version.{h|new}, because it isn't used any more. 2008-10-29 22:33:03 +01:00
Alexander Barton
34b2f0085d Fix ForwardLookup(): "ISO C90 forbids specifying subobject to initialize"
This patch fixes the following warning of GCC (version 4.3.2) in
function ForwardLookup():

resolve.c: In function 'ForwardLookup':
resolve.c:282: warning: ISO C90 forbids specifying subobject to initialize
resolve.c:284: warning: ISO C90 forbids specifying subobject to initialize
resolve.c:285: warning: ISO C90 forbids specifying subobject to initialize
2008-10-19 20:07:35 +02:00
Alexander Barton
ce2541a826 Fix ConnSSL_LogCertInfo(): unused variable "cred" (GNUTLS)
This patch fixes the following warning of GCC (version 4.3.2) in
function ConnSSL_LogCertInfo() when compiling with GNUTLS support:

conn-ssl.c: In function 'ConnSSL_LogCertInfo':
conn-ssl.c:542: warning: unused variable 'cred'
2008-10-19 20:06:30 +02:00
Alexander Barton
f92a614a35 Enable KICK to be handled from remote servers and from services. 2008-09-23 11:53:16 +02:00
Alexander Barton
ec0b405d9d Respect RFC 1459 compatibility mode when announcing channels (no NJOIN). 2008-09-23 11:53:16 +02:00
Alexander Barton
178f9cbdac Announce IRC services in the network.
This patch
 - introduces a new server flag "S" to indicate that the server can handle
   the SERVICE command (on server links),
 - implements the IRC command "SERVICE" for server-server links,
 - uses the "SERVICE" command to announce IRC services when a new
   server connects to it,
 - and fixes the Send_Message() function to let it send messages to
   services using a "target mask".

If the remote server doesn't indicate that it can handle the "SERVICE"
command (it has not set the "S" flag), services are announced as regular
users as before.
2008-09-23 11:53:16 +02:00
Alexander Barton
6356418ae5 Change Introduce_Client() to set the correct client type (user/service). 2008-09-23 11:53:16 +02:00
Alexander Barton
28e9888764 Convert SQUERY to PRIVMSG on RFC 1459 compliant links. 2008-09-23 11:53:16 +02:00
Alexander Barton
3afa0e0658 Don't allow SQUERY to send to "target masks" and channels; only services! 2008-09-23 11:53:16 +02:00
Alexander Barton
3913de3cff Fix PRIVMSG/NOTICE handler (II): keep command when forwarding to channels.
- new function ngt_UpperStr().
- change Channel_Write() to take command name and error flag.
- remove now unneeded function Channel_Notice().
2008-09-23 11:53:15 +02:00
Alexander Barton
91e87a3705 New function ngt_UpperStr() 2008-09-23 11:53:15 +02:00
Alexander Barton
71e9ac486f Fix PRIVMSG/NOTICE handler Send_Message(): don't forward NOTICE as PRIVMSG. 2008-09-23 11:53:15 +02:00
Alexander Barton
d93030ad27 Make real use of the CLIENT_SERVICE client type.
This patch enables ngIRCd to handle IRC services as real services, and not
as "fake users":

  - Set correct client type CLIENT_SERVICE for services,
  - Change log messages to include correct client type,
  - PRIVMSG: allow users to send messages to services,
  - Send services nick names to other servers (as users).

Please note that this patch doesn't announce services as services in the
network, but as regular users (as before). Only the local server knows
of services as services (see LUSERS command, for example). It is up to
one of the next patches to fix this and to introduce the SERVICE command
in server to server communication.

The propagation of services as regular users between servers doesn't limit
the functionality of the IRC services and will be the fallback for servers
that don't support "real" services propagation in the future.
2008-09-23 11:53:15 +02:00
Alexander Barton
4e125fb67c Allow IRC services to change their nick names. 2008-09-23 11:53:15 +02:00
Alexander Barton
33f32dbd67 New function Client_TypeText() and Destroy_UserOrService().
Client_TypeText() is used to get correct naming ("Client", "Service", ...)
for log messages, and Destroy_UserOrService() is used to correctly destroy
user and services clients.
2008-09-23 11:53:15 +02:00
Alexander Barton
74aac88dbf Send_Message(): really enforce target client type. 2008-09-23 11:53:14 +02:00
Alexander Barton
02d7623074 Allow ngIRCd to detect services connected to an "virtual services server".
Introduce a new configuration variable "ServiceMask" in SERVER blocks to
define a mask matching nick names that should be treated as services.
Regular servers don't need this parameter (leave it empty, the default),
but you should set it to "*Serv" when connection ircservices, for example.

This patch allows ngIRCd to detect services, it doesn't change the
functionality: you only get different log messages ;-)
2008-09-23 11:51:16 +02:00
Alexander Barton
c5342fb467 Centralize logging functions in Introduce_Client(). 2008-09-23 11:47:17 +02:00
Alexander Barton
557be8c56b Get rid of INTRO_INFO structure again: we don't need it at all!
All the required information is already stored in the CLIENT structure
of new new connection, so pass this to Introduce_Client() and don't
invent an unneeded new structure ...
2008-09-23 11:47:17 +02:00
Alexander Barton
687784d276 Announce_User(): support RFC 1459 compatibility mode. 2008-09-23 11:47:17 +02:00
Alexander Barton
92603f7c80 Introduce_Client(): send MODES in RFC 1459 mode, too. 2008-09-23 11:47:17 +02:00
Alexander Barton
d070ec08ab numeric.c: whitespace fixes ... 2008-09-23 11:47:17 +02:00
Alexander Barton
a60465be3e Server links: detect RFC 1459 mode direct after SERVER command
This patch allows ngIRCd to detect right after receiving the SERVER command
from the peer whether the RFC 1459 compatibility mode must be used or not.
And it fixes the announcement of users during establishing new server links
with such peers.
2008-09-23 11:47:17 +02:00
Alexander Barton
14048c4717 Send and handle NICK+USER commands for user registration (RFC 1459).
This patch enables ngIRCd to deal with NICK and USER commands following
RFC 1459 to register new clients, and to send these commands instead of one
full NICK command as specified in RFC 2813 on connections that are in RFC
1459 compatibility mode.

Can be useful for e. g. IRC services that simulate a RFC 1459 server.
2008-09-23 11:47:17 +02:00
Alexander Barton
f199d63724 New function IRC_WriteStrServersPrefixFlag_CB() using a callback function. 2008-09-23 11:47:17 +02:00
Alexander Barton
4f759d8113 New function Introduce_Client() to announce new local and remote users. 2008-09-23 11:47:17 +02:00
Alexander Barton
6bc2d3d06e New connection option CONN_RFC1459.
This new connection option CONN_RFC1459 indicates that the peer on this
link only supports the IRC protocol as defined in RFC 1459 and that the
compatibility mode (e. g. for outgoing commands like NICK) should be used.
2008-09-23 11:47:17 +02:00
Alexander Barton
a5735f68d7 New global function Conn_SetOption(). 2008-09-23 11:47:16 +02:00
Alexander Barton
13f1d57e84 USER: servers and services can alter user information after registration.
This is required to do RFC 1459 style user registration on server links,
and is used by some services packages, too. See RFC 1459 section 4.1.3.
2008-09-23 11:47:16 +02:00
Alexander Barton
068d43352d NICK: allow servers and services to use RFC 1459 syntax (2 parameters).
This patch allows servers and services to call the NICK command using the
syntax defined in RFC 1459 to register new users, with only two parameters.
See section 4.1.2.

Useful for some services packages, which emulate this protocol.
2008-09-23 11:47:16 +02:00
Alexander Barton
e56bd8ff89 Whitespace fixes: remove trailing tabulator characters. 2008-09-23 11:47:16 +02:00
Florian Westphal
2fce881d96 conn-ssl.c: don't append a newline to ConnSSL_GetCipherInfo 2008-09-15 12:25:54 +02:00
Florian Westphal
ef3327d372 TLS/SSL support: code changes.
This adds the required code to enable ssl/tls support
during compile and run time, respectively.
2008-09-13 15:10:32 +02:00
Florian Westphal
bdd44eb0ab TLS/SSL support: core files.
Contains support for both OpenSSL and GNU TLS.
Certificate Authentification is not yet supported.
2008-09-13 15:08:11 +02:00
Florian Westphal
c997e04325 Fix handling of MaxConnections option
Config option claimed to be 'number of connections' but in reality this
was treated as 'largest file descriptor allowed'.

This also fixes another bug in New_connection, where the
ng_ipaddr_tostr_r error path was missing a return statement.
2008-08-30 15:37:19 +02:00
Alexander Barton
2c2c93e311 Include "mcheck.h" when using mtrace(). 2008-08-18 23:27:56 +02:00
Alexander Barton
41a23d20e4 SECURITY: Fixed a message handling bug which could crash the daemon.
Some message targets could lead to a NULL pointer dereference and therefore
could crash the daemon (denial of service).
(cherry picked from commit e493ad2d30ff80bca2556cde2212e367cb006517)
2008-08-17 17:37:36 +02:00
Alexander Barton
c769cbecb6 Enable GNU libc "memory tracing" when compiled with debug code.
This patch lets ngIRCd activate "memory tracing" of the GNU libc when
compiled with debug code (configure: --enable-debug) and the functionality
is available on the system.
(http://www.gnu.org/software/libc/manual/html_node/Allocation-Debugging.html)
2008-08-13 16:00:57 +02:00
Alexander Barton
dfc3de131c Make ngIRCd compile and run on NeXTSTEP 3.3 and OPENSTEP 4.2
by Steven D. Blackford <kb7sqi@aol.com>:

"I wanted to let you know that I've done a quick port of ngircd-0.12.0 for
NEXTSTEP3.3/OPENSTEP4.2. There wasn't a lot of changes required to get it
to compile clean, but I did make the necessary changes so that I didn't
have to use -posix flag. The NeXT has a pretty buggy POSIX implementation
so I always try to work around it. :-)
Anway, here's the changes required to get it to compile."
2008-08-01 16:21:16 +02:00
Alexander Barton
ccbbd7d1a5 GIT: added src/testsuite/message-test to ignore list. 2008-07-27 20:51:37 +02: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
5df56111c4 message-test: Disable two tests using "localhost" as host name
Some operating systems, for example OpenBSD and OpenSolaris, use
"localhost.<domain>" instead of just "localhost" for 127.0.0.1, so
the "message-test" using "localhost" failed on such systems.

Don't have an idee how to make this work on all platforms ... :-/

So I simply disabled the two affected tests to make the testsuite
run on OpenBSD and OpenSolaris again.
2008-07-27 18:03:13 +02:00
Alexander Barton
e5174c629c Fix Send_Message(): "lastCurrentTarget" may be used uninitialized
This patch fixes the following warning of GCC 4.3.1:

irc.c: In function "Send_Message":
irc.c:315: error: "lastCurrentTarget" may be used uninitialized in
this function
2008-07-27 17:16:41 +02:00
Alexander Barton
3358ad07d7 Fix t_diff(): declaration of 'div' shadows a global declaration
This patch fixes the following GCC warning message:
irc-info.c:422: warning: declaration of 'div' shadows a global declaration
2008-07-27 15:58:06 +02:00
Alexander Barton
318c8b238b Cosmetic whitespace and line length fixes, mostly in Send_Message(). 2008-07-27 15:50:51 +02:00
Alexander Barton
f8381aafb4 Added "message-test" to Makefile, so it is distrubuted and run. 2008-07-27 14:45:04 +02:00
Brandon Beresini
d4eb55c79f Cleaned up PRIVMSG and NOTICE patches. 2008-07-27 01:23:20 +02:00
Brandon Beresini
2546a13ad2 Cumulative Message Patch 2008-07-27 01:23:04 +02:00
Alexander Barton
b92a7627f3 Don't allow empty channel names ("#") in strict RFC mode.
This closes Bug #88.

Patch proposed by Eric <egrunow@ucsd.edu>, but with wrong length
comparision: please note that Channel_IsValidName() checks the name
INCLUDING the prefix, so the test must be length<=1!
2008-07-22 13:24:14 +02:00
Alexander Barton
258143897c Return 461 (syntax error) on "JOIN :" and "PART :"
Up to this patch ngIRCd did not return any result (GIT master) or a badly
formated 403 (":irc.server 403 test  :No such channel" [note the two
spaces!], branch-0-12-x) on the above commands, this patch changes the
behaviour to reflect ircd 2.11 which returns 461 in both cases.
2008-07-22 13:18:19 +02:00
Alexander Barton
477f2fd9e7 Channel_Join(): Code cleanup. 2008-07-22 13:07:57 +02:00
Alexander Barton
3f01324160 Fixes to misc-test: accept "localhost.<domain>" as well as "localhost"
Some operating systems, for example OpenBSD, use "localhost.<domain>"
instead of "localhost", so the "who-test" expecting "localhost" failed
on such systems.

(Please see 149859c5fecc..., which fixes this for the who-test already)
2008-07-21 13:40:22 +02:00
Eric Grunow
71562ebe57 Translated comments from German to English 2008-06-16 13:58:56 +02:00
Alexander Barton
258e39e89f Fix GCC warnings for possibly uninitialized variables in IRC_JOIN
This patch fixes the following two warnings of GCC 4.2.4:

irc-channel.c: In function "IRC_JOIN":
irc-channel.c:185:
 warning: "lastkey" may be used uninitialized in this function
irc-channel.c:185:
 warning: "lastchan" may be used uninitialized in this function
2008-06-16 13:18:03 +02:00
Alexander Barton
e142c50ae6 GIT: added src/src/config.h.in~ to ignore list. 2008-06-11 16:02:06 +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
6f7b669bec --configtest: return non-zero exit code if there are errors 2008-05-28 00:31:20 +02:00
Alexander Barton
951314cb79 Handle_Buffer(): code cleanup.
Both callers ignore the return code of this function, so get rid of it,
but make sure that the client is disconnected on errors.
2008-05-26 23:38:32 +02:00
Alexander Barton
d360871394 Conn_Handler(): cleanup code, add/translate comments.
In addition, the "timeout" variable has been removed because it is
unnecessary today: Handle_Buffer() handles all the data it can handle,
and io_dispatch() returns immediately when new data is available. So
we don't have to double-check but better sleep. Pointed out by Florian.
2008-05-26 21:38:27 +02:00
Scott Perry
b90f71ca2a Use strtok_r instead of strchr in IRC_JOIN.
This patch does significant cleanup on the join code by using strtok_r
instead of mangling strchr to parse channel names and keys in parallel when
a JOIN command contains a list of channels and keys.

Also adds an strtok_r implementation to libportab.
2008-05-26 21:20:03 +02:00
Alexander Barton
956bbe2c28 Reset client idle time on NICK, JOIN, and PART 2008-05-24 21:50:54 +02:00
Florian Westphal
e19f7a8c19 Remove ListenIPv4/ListenIPv6 options.
Use "Listen = list,of,addresses" instead.
2008-05-19 14:34:48 +02:00
Florian Westphal
4ed2cb1a02 make Listen parameter a comma-seperated list of addresses.
this also obsoletes ListenIPv4 and ListenIPv6 options.
If Listen is unset, it is treated as Listen="::,0.0.0.0".

Note: ListenIPv4 and ListenIPv6 options are still recognized,
but ngircd will print a warning if they are used in the config file.

Also, some plattforms require that ai_socktype
is set in the getaddrinfo() hints structure.
2008-05-19 14:27:35 +02:00
Jari Aalto
818a206a42 Add option aliases -V (for --version) and -h (for --help).
This patch adds -h and -V short options (to complement the usage).

It is based on a patch attached to Debian bug #466063, see
<http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=466063>.

Idea by Jari Aalto <jari.aalto@cante.net>,
patch adapted by Alexander Barton <alex@barton.de>.
2008-05-18 16:19:41 +02:00
Brandon Beresini
5d87f6ba80 Add tests for MOTD, VERSION, TIME, USERHOST
The misc-test.e file is also somewhat reorganized and commented here.

Patch from Brandon Beresini, Bryan Caldwell and Dana Dahlstrom.
2008-05-15 11:13:45 +02:00
Alexander Barton
d02b083543 Merge commit 'aad49bd260494878aed6795c7a897ad1d28c3082' 2008-05-13 12:14:14 +02:00
Scott Perry
70254a5553 This patch implements a (maybe) compliant WHOWAS command.
It is hard to test this in the test suite because we 1) shouldn't rely on
previous tests populating WHOWAS and 2) don't connect a user for more than 30
seconds.

Also makes WHOWAS return ERR_NONICKNAMEGIVEN_MSG as implied by RFC.
2008-05-12 18:56:31 +02:00
Florian Westphal
b1d38de4d2 If bind() fails, also print ip address and not just the port number. 2008-05-12 18:46:55 +02:00
Alexander Barton
d90cc7add0 GIT: ignore symbolic links to tests in testsuite directory
Added symbolic links to new tests (invite-test, join-test, and kick-test)
to .gitignore file.
2008-05-11 15:20:46 +02:00
Alexander Barton
149859c5fe Fixes to who-test: accept "localhost.<domain>" as well as "localhost"
Some operating systems, for example OpenBSD, use "localhost.<domain>"
instead of "localhost", so the "who-test" expecting "localhost" failed
on such systems.
2008-05-11 15:17:22 +02:00
Florian Westphal
d9c26f3aeb ng_ipaddr.h must include netinet/in.h.
compile on FreeBSD 5.4 failed with:
./../ipaddr/ng_ipaddr.h:34: error: field `sin4' has incomplete type

Reported and tested by Jefferson S Almeida.
2008-05-10 21:49:51 +02:00
Brandon Beresini
0510bbe958 Removed space after # so that Cygwin's version of expect recognizes comments. 2008-05-09 21:54:47 +02:00
Ali Shemiran
12cd554af1 Fix secret channel information leak
/who on a secret channel that the user is not a member of
now returns proper RPL_ENDOFWHO_MSG instead of nothing.
2008-05-09 21:47:31 +02:00
ashemira@ucsd.edu
5cf5ba31eb Added Cygwin uid kludge. (verified working) 2008-05-08 13:04:25 +02:00
Eric Grunow
75b719a0c8 Anglified and improved comments in channel.c and channel.h
[Dana Dahlstrom: repair tab/space conversion in patch]
2008-05-08 03:15:04 +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
Florian Westphal
3895b42d1b Add invite-test.e to test suite. 2008-05-05 16:12:41 +02:00
Dana Dahlstrom
6c81ffaece Tests for the INVITE command. 2008-05-05 16:12:41 +02:00
Dana Dahlstrom
97cc58fb13 Invite: prefix last argument with colon when necessary. 2008-05-05 16:12:41 +02:00
Dana Dahlstrom
c63d8fd051 tests for JOIN and various replies
Brandon Beresini sent me a patch yesterday adding tests for JOIN under
various circumstances, which I believe he worked on with Bryan Caldwell
and Ali Shemiran. I made a few modifications; the result is below.
2008-05-05 16:12:41 +02:00
Bryan Caldwell
3d8eda9c86 Allow KICK to handle comma-delimited lists (of channels, nicks).
includes test cases.

[fw@strlen.de:
	- move code around to avoid duplication
	- use const where possible
	- integrate test case]
2008-05-05 16:12:41 +02:00
Florian Westphal
3283d275ba Invite: Send RPL_AWAY to client sending the invite if target is away. 2008-05-05 15:52:41 +02:00
Dana Dahlstrom
faf9b6ea16 Fixes to who-test: accept any ident, escape some '*' flags.
This prevents who-test.e from failing when ngircd
is performing ident lookups and an ident server is running.
2008-05-05 15:40:00 +02:00
Florian Westphal
452fb28394 IRC_INVITE: coding style cleanup. 2008-05-05 15:39:54 +02:00
Florian Westphal
0428a1c4ea Constify some of Channel_Kick()s arguments. 2008-05-05 15:38:47 +02:00
Florian Westphal
98a8ea105c constify Client_Search() argument. 2008-05-05 15:38:43 +02:00
Rolf Eike Beer
83bfdddf99 Allow IRC ops to ignore channel limits when joining
Allow IRC ops to ignore any channel limit (bans, invite only etc.) when they
want to join a channel.
2008-05-05 14:45:28 +02:00
Alexander Barton
2a790861a1 Handle 1-character messages terminated with CR or LF correctly
Code cleanup and fix for Bug #83, "ngIRCd chokes on 1-character messages" in
function Handle_Buffer(): the buffer is now correctly cleared when ngIRCd
receives 1-character messages terminated with either CR or LF (in violation
to RFC 2812, section 2.3 "Messages", 5th paragraph).
2008-05-02 02:14:15 +02:00
Alexander Barton
4e507881f3 On AIX (for example) socklen_t is defined in sys/socket.h
On AIX and probably other systems socklen_t is defined in sys/socket.h,
so we have to include it here explicitly (tested by Florian).
2008-05-01 20:25:39 +02:00
Florian Westphal
f7c2e8223f Always enable modeless channels.
Modeless channels (+channels) are described in RFC 2811;
so my modifications to
530112b114
('Add support for modeless channels')
to disable +channels for --strict-rfc configurations
were wrong. This reverts those changes.
2008-05-01 18:08:07 +02:00
Alexander Barton
60acc62af7 Prevent GIT to complain about opless-channel-test link 2008-05-01 16:31:13 +02:00
Ali Shemiran
530112b114 Add support for modeless channels
Add support for modeless channels (+channels).

[fw@strlen.de:
 - integrate test cases
 - don't support +channels when compiled with --strict-rfc
 - do not set +o mode for channel creator
 - force +nt mode when channel is created ]
2008-05-01 15:55:12 +02:00
Alexander Barton
4a81367dac --configtest: fix missing whitespace at "ConnectIPv4" option. 2008-04-29 15:27:44 +02:00
Alexander Barton
bb6ee46892 Merge branch 'master' of git://git.breakpoint.cc/fw/ngircd-fw 2008-04-29 15:15:28 +02:00
Florian Westphal
9194319399 Testsuite: remove erroneous ConfUID setting in config file.
The config file for ngircds test suite contained obsolete
ConfUID/ConfGID settings, causing ngircd to needlesly complain when
started as non-root (which is hopefully the _normal_ case...)
2008-04-29 13:32:29 +02:00
Alexander Barton
33b1204349 Get rid of cvs-version.* and CVSDATE definition.
(cherry picked from commit b187fac244)
2008-04-25 00:14:11 +02:00
Alexander Barton
523a6fad09 Report ERR_NOTONCHANNEL when trying to part a channel one is not member of.
When trying to part a channel ("PART #channel") the client is not member of
the daemon now correctly reports the numeric ERR_NOTONCHANNEL (442) insted
of ERR_NOSUCHCHANNEL (403).
2008-04-24 23:52:54 +02:00
Alexander Barton
54b17fc201 Channel_Part(): Code and comment cleanup. 2008-04-24 23:47:33 +02:00
Alexander Barton
25f48a2a34 IRC_PART(): code and comment cleanup. 2008-04-24 23:46:59 +02:00
Florian Westphal
22fa782be7 IPv6: Add config options to disabe ipv4/ipv6 support.
This also enables ipv6-only setups.
2008-04-21 00:45:19 +02:00
Alexander Barton
a0efcdccfa Updated copyright notice to read "2001-2008". 2008-04-20 15:48:22 +02:00
Florian Westphal
8df445316a Channel_Mode: Remove duplicate code.
Incidentially, this doesn't even change the
generated code...
2008-04-19 16:58:00 +02:00
Florian Westphal
11af32466f Channel_Mode: change order of if (set) and if (client) check. 2008-04-19 16:51:42 +02:00
Florian Westphal
5538115537 Channel_Mode: Re-indent switch.
No functional changes were made.
2008-04-19 16:45:31 +02:00
Florian Westphal
b8643477ba Channel_Mode: check return type of Invite/Ban Add/Del function 2008-04-19 16:17:11 +02:00
Florian Westphal
796dcf6a62 Channel_Mode: unify 'b' and 'I' switch/case handling. 2008-04-19 14:16:17 +02:00
Florian Westphal
6b0c094809 Channel_Mode: Unify Del_Invite and Del_Ban handler 2008-04-19 14:12:06 +02:00
Florian Westphal
b36fc3b095 Constify Lists_MakeMask argument and return type. 2008-04-19 14:11:25 +02:00
Florian Westphal
2dd51a98e4 Channel_Mode: Unify Add_Invite and Add_Ban handler 2008-04-19 14:02:54 +02:00
Alexander Barton
7b33424c13 Added "portabtest" binary to .gitignore file in src/portabtest/. 2008-04-09 19:46:26 +02:00
Alexander Barton
bc63064d5c Moved .cvsignore files to .gitignore
Since we are using GIT starting from now, I converted all the
.cvsignore files to .gitignore files.
2008-04-09 18:54:52 +02:00
Florian Westphal
be844d74d3 Fix client.c sparse warnings.
client.c:72:6: warning: symbol 'Max_Users' was not declared. Should it be static?
client.c:72:21: warning: symbol 'My_Max_Users' was not declared. Should it be static?
2008-04-04 23:22:06 +02:00
Florian Westphal
637d739285 io.c: kill select FD_SETSIZE sanity check in io_library_init.
We already have way too many.
2008-04-03 23:20:26 +02:00
Florian Westphal
66e68de16a io.c: fix select FD_SETSIZE check when using epoll as io backend 2008-04-03 23:20:22 +02:00
Florian Westphal
7f44a2ad1c io.c: try to cut down the number of ifdefs.
consolidate backend-specific helpers and
add empty statinc inle stubs in the ifndef case
to let the compiler remove the functions at compile time.
2008-03-27 16:53:39 +01:00
Florian Westphal
abb1abeb77 Do not exit unconditionally if config file cannot be opened
ngircd will exit if the config file cannot be opened. While
thats okay if ngircd starts up for the first time, it isn't
when we are re-reading the config file after a /REHASH or SIGHUP.
2008-03-26 21:31:13 +01:00
Alexander Barton
ab1f48a346 Fix #include's: search log.h locally, include string.h. The latter is required because we include conn.h, which includes resolve.h, which includes ng_ipaddr.h, which contains a macro using strlcpy() ... 2008-03-11 15:42:58 +01:00
Florian Westphal
feb31e4200 IPv6 support.
all references to struct sockaddr/in_addr have been
removed from src/ngircd.
libngipaddr (in src/ipaddr/) hides all the gory details.
See src/ipaddr/ng_ipaddr.h for API description.
2008-02-26 23:50:35 +01:00
Rolf Eike Beer
44cdf1b1ca Fix sending of JOINs between servers.
This does hit only operators that join a channel with at least 2 servers active in the net
the server the oper connects to sends "channel^Go" to the other servers
the other server first searches for the channel and then strips the modes from the channel name
he has to do the other way round: first strip and then check the channel name.
2008-02-26 23:49:33 +01:00
Florian Westphal
e710e8ae37 Channel_Mode cleanups
- better indentation
- move answering request into seperate function.
2008-02-26 23:49:33 +01:00
Alexander Barton
5147b675cb Removed the SQUIT test for now, actually we don't support it yet. 2008-02-26 23:49:33 +01:00
Alexander Barton
ddecfcd831 Implemented IRC commands INFO, USERS (dummy), and SUMMON (dummy). 2008-02-26 23:49:33 +01:00
Dana Dahlstrom
2f71fbb2a1 Include flags in RPL_WHOREPLY messages.
RPL_WHOREPLY messages generated by IRC_WHO don't include flags (*,@,+)
that should appear according to this description:

http://www.mishscript.de/reference/rawhelp3.htm#raw352

Other IRC servers do include the flags.

Modify who-test.e to expose missing flags,
modify ngircd-test.conf to accommodate who-test.e, and fix
irc-info.c to correct these problems.
2008-02-26 23:49:33 +01:00
Dana Dahlstrom
1784180bf3 Don't send trailing space in MODE messages
Under some circumstances ngIRCd currently issues a channel MODE message
with a trailing space after the last parameter, which isn't permitted by
the grammar in RFC 2812 section 2.3.1:

http://tools.ietf.org/html/rfc2812#section-2.3.1

The following patch modifies mode-test.e to expose this, and modifies
irc-mode.c to correct it.
2008-02-26 23:49:33 +01:00
Florian Westphal
634ef8c131 IRC_JOIN cleanups.
- put sending of mode and forwarding of JOIN to other clients
 into seperate function.
- put sending of topic/channel names into seperate function.
- put access check into seperate function.
- translate/remove remaining german comments.
- stop if JOIN to a channel in a list (JOIN #a,#,b,#c...) fails
(This doesn't change the behaviour: skip-to-next-channel-on-error
did never work as intended)
2008-02-26 23:49:33 +01:00
Florian Westphal
4d152b771e Make IRC_WHO also search username/servername/hostname.
Dana Dahlstrom reported that IRC_WHO did not follow
RFC 2812, Section 3.6.1. Specifically:

- IRC_WHO did not send "G" flag instead if "H" if client was away
- did not search username/servername/hostname etc. if argument
  was not a channel.

Fix all of the above and tidy things up a bit.
Also add IRC_WHO test script contributed by Dana.
2008-02-26 23:49:33 +01:00
Dana Dahlstrom
c634303765 Remove duplicate Channel_FirstChannelOf().
noticed there's a way to make the loop
slightly more elegant.

[fw@strlen.de: Extra () to silence gcc.]
2008-02-26 23:49:33 +01:00
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
68f896eee0 Adjust test suite to be usable on HP/UX 11.11 :-) 2007-11-18 15:07:16 +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
43f8d149bb added "portabtest" binary to list of files to ignore. 2006-12-28 13:34:43 +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
6eb3f3055d Added support for Solaris 11. 2006-08-05 00:15:28 +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
Alexander Barton
097c7bd741 Fix up ngt_TrimStr() once more ... :-/ 2006-04-09 12:53:07 +00:00
Florian Westphal
bebfbedf3f fix ngt_TrimStr(), fix format string 2006-03-24 23:25:38 +00:00
Alexander Barton
cba9270845 ngt_TrimStr(): code cleanup. 2006-03-22 08:05:10 +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
Alexander Barton
fb9707de98 Added test if the stress-test expect script itself completes without errors. 2005-12-30 22:13:21 +00:00
Alexander Barton
db9afbbf0e Modified expect script to work with servers having IDENT support. 2005-12-30 22:12:28 +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