]> arthur.barton.de Git - ngircd-alex.git/log
ngircd-alex.git
11 years agoCommands.txt: Update description of the "KILL" command
Alexander Barton [Sat, 9 Mar 2013 17:00:49 +0000 (18:00 +0100)]
Commands.txt: Update description of the "KILL" command

11 years agoConn_Handler(): Don't test for penalty times
Alexander Barton [Sat, 9 Mar 2013 16:58:10 +0000 (17:58 +0100)]
Conn_Handler(): Don't test for penalty times

The Conn_Handler() main loop calls Handle_Buffer() which checks for the
"penalty time" of each client itself, so don't do it twice.

11 years agoDon't read SSL client data before DNS resolver is finished
Alexander Barton [Sat, 9 Mar 2013 16:44:34 +0000 (17:44 +0100)]
Don't read SSL client data before DNS resolver is finished

Fix the cb_clientserver_ssl() callback function to not read in and store SSL
encrypted client data before the asynchronous DNS resolver sub-process has
finished: This could have resulted in discarding the resolved client hostname
and IDENT reply afterwards, because in some situations (timing dependent) the
NICK and USER commands could have already been read in from the client,
stored in the buffer, and been processed.

Thanks to Julian Brost for reporting the issue and testing, and to Federico
G. Schwindt <fgsch@lodoss.net> for helping to debug it!

11 years agoIncrease password length limit to 64 characters
Alexander Barton [Fri, 8 Mar 2013 18:31:57 +0000 (19:31 +0100)]
Increase password length limit to 64 characters

Closes bug #154.

11 years agodoc/Services.txt: Update Anope status and URL
Alexander Barton [Tue, 26 Feb 2013 08:38:27 +0000 (09:38 +0100)]
doc/Services.txt: Update Anope status and URL

11 years agoCommands.txt: Update description of the "KICK" command
Alexander Barton [Sun, 24 Feb 2013 17:53:33 +0000 (18:53 +0100)]
Commands.txt: Update description of the "KICK" command

11 years agoCommands.txt: Update description of the "INVITE" command
Alexander Barton [Sun, 24 Feb 2013 17:53:10 +0000 (18:53 +0100)]
Commands.txt: Update description of the "INVITE" command

11 years agoirc-op.c: use irc-macros.h
Alexander Barton [Sun, 24 Feb 2013 17:51:54 +0000 (18:51 +0100)]
irc-op.c: use irc-macros.h

11 years agoirc-cap.c: use irc-macros.h
Alexander Barton [Sun, 24 Feb 2013 17:51:43 +0000 (18:51 +0100)]
irc-cap.c: use irc-macros.h

11 years agoirc-op.c: Update source code documentation
Alexander Barton [Sun, 24 Feb 2013 17:50:12 +0000 (18:50 +0100)]
irc-op.c: Update source code documentation

11 years agoirc-cap.c: Update source code documentation
Alexander Barton [Sun, 24 Feb 2013 17:49:07 +0000 (18:49 +0100)]
irc-cap.c: Update source code documentation

11 years agoAdd new _IRC_ARGC_EQ_OR_RETURN_ macro to irc-macros.h
Alexander Barton [Sun, 24 Feb 2013 15:20:27 +0000 (16:20 +0100)]
Add new _IRC_ARGC_EQ_OR_RETURN_ macro to irc-macros.h

11 years agoAdd new _IRC_ARGC_BETWEEN_OR_RETURN_ macro to irc-macros.h
Alexander Barton [Sun, 24 Feb 2013 15:14:13 +0000 (16:14 +0100)]
Add new _IRC_ARGC_BETWEEN_OR_RETURN_ macro to irc-macros.h

11 years agoirc-cap.c: move static functions to the top of the file
Alexander Barton [Sun, 24 Feb 2013 15:08:17 +0000 (16:08 +0100)]
irc-cap.c: move static functions to the top of the file

And remove now unnecessary (local) prototypes.

11 years agoUpdate Doxygen configuration
Alexander Barton [Fri, 22 Feb 2013 17:11:26 +0000 (18:11 +0100)]
Update Doxygen configuration

11 years agoClean up Xcode project file, remove outdated files, add missing
Alexander Barton [Fri, 15 Feb 2013 21:54:36 +0000 (22:54 +0100)]
Clean up Xcode project file, remove outdated files, add missing

11 years agosrc/testsuite/README: add whois-test.e
Alexander Barton [Fri, 15 Feb 2013 21:54:32 +0000 (22:54 +0100)]
src/testsuite/README: add whois-test.e

11 years agoirc-login.c: conenction -> connection
Alexander Barton [Fri, 22 Feb 2013 14:15:22 +0000 (15:15 +0100)]
irc-login.c: conenction -> connection

Introduced by commit d3ef2239 as of Sun Jan 16 2011 ...
Thanks to Patrik Schindler <poc@pocnet.net> for reporting this!

11 years agoMerge branch 'bug151-iconv' into master
Alexander Barton [Fri, 15 Feb 2013 20:59:28 +0000 (21:59 +0100)]
Merge branch 'bug151-iconv' into master

* bug151-iconv:
  configure: search for iconv_open as well as libiconv_open

11 years agoMerge branch 'bug153-ServerMask' into master
Alexander Barton [Fri, 15 Feb 2013 20:59:06 +0000 (21:59 +0100)]
Merge branch 'bug153-ServerMask' into master

* bug153-ServerMask:
  Update irc-info.c to use irc-macros.h
  Add new irc-macros.h to project
  irc-info.c: add/streamline function documentation comments
  irc-info: move static functions at the top of the file
  Implement new function Client_SearchServer()

Conflicts:
src/ngircd/irc-info.c

11 years agoconfigure: search for iconv_open as well as libiconv_open
Alexander Barton [Fri, 15 Feb 2013 20:32:08 +0000 (21:32 +0100)]
configure: search for iconv_open as well as libiconv_open

On some installations iconv_open() is actually libiconv_open().
iconv_open() is the glibc version while libiconv_open() is the libiconv
version. This patch enables ngIRCd to detect both cases.

Tested on OpenBSD 5.1.

Closes bug #151.

11 years agoconfigure: conversation -> conversion
Alexander Barton [Fri, 15 Feb 2013 20:26:47 +0000 (21:26 +0100)]
configure: conversation -> conversion

11 years agongIRCd Release 20.2
Alexander Barton [Fri, 15 Feb 2013 11:18:02 +0000 (12:18 +0100)]
ngIRCd Release 20.2

(cherry picked from commit c45d9dd1f08fddb95fa01d62c69848cd753a3161)

11 years agoKICK: Fix denial of service bug
Sebastian Köhler [Thu, 14 Feb 2013 18:21:01 +0000 (19:21 +0100)]
KICK: Fix denial of service bug

Test if the user that it is to be kicked is on the channel before user
channel modes are tested. Otherwise assert( cl2chan != NULL ); in
line 742 would fail and stop the service.

11 years agosighandlers.c: Update some log messages
Alexander Barton [Tue, 12 Feb 2013 23:26:16 +0000 (00:26 +0100)]
sighandlers.c: Update some log messages

11 years agomy_sd_listen_fds(): really return an "int"
Alexander Barton [Mon, 11 Feb 2013 22:25:13 +0000 (23:25 +0100)]
my_sd_listen_fds(): really return an "int"

This fixes the following warning using Apple LLVM version 4.2
(clang-425.0.24) on OS X:

  src/ngircd/conn.c:157:9: Implicit conversion loses integer
                           precision: 'long' to 'int'

11 years agoMerge branch 'bug155-allowAtInUser'
Alexander Barton [Mon, 11 Feb 2013 12:58:30 +0000 (13:58 +0100)]
Merge branch 'bug155-allowAtInUser'

* bug155-allowAtInUser:
  Allow "@" character in user names for authentication

11 years agoAllow "@" character in user names for authentication bug155-allowAtInUser
Alexander Barton [Mon, 11 Feb 2013 12:57:54 +0000 (13:57 +0100)]
Allow "@" character in user names for authentication

The "@" character isn't allowed in IRC usernames, because it is the
separator between user name and hostname in IRC masks:

  <nickname>!<username>@<hostname>

This patch accepts user names including "@" characters, saves the
unmodified name for authentication but stores only the part in front
of the "@" character as "IRC user name". And the latter is how
ircd2.11, Bahamut, and irc-seven behave as well.

Closes bug #155.

11 years agoMerge branch 'systemd'
Alexander Barton [Sun, 10 Feb 2013 19:43:56 +0000 (20:43 +0100)]
Merge branch 'systemd'

* systemd:
  ngircd.sock: explicitely bind to IPv4 and IPv6 addresses
  Show address and port of sockets passed-in by systemd(8)
  Check type of sockets passed-in by systemd(8)
  Adjust severity levels of some log messages
  New configuration option "IdleTimeout": exit daemon when idle
  Implement support for systemd(8) "socket activation"
  contrib/README: add more files

11 years agongircd.sock: explicitely bind to IPv4 and IPv6 addresses systemd
Alexander Barton [Sun, 10 Feb 2013 19:37:55 +0000 (20:37 +0100)]
ngircd.sock: explicitely bind to IPv4 and IPv6 addresses

11 years agoShow address and port of sockets passed-in by systemd(8)
Alexander Barton [Sun, 10 Feb 2013 19:21:35 +0000 (20:21 +0100)]
Show address and port of sockets passed-in by systemd(8)

11 years agoCheck type of sockets passed-in by systemd(8)
Alexander Barton [Sun, 10 Feb 2013 19:20:58 +0000 (20:20 +0100)]
Check type of sockets passed-in by systemd(8)

This patch makes sure that ngIRCd doesn't try to handle sockets of
unsupported types, for example of AF_INET6 sockets when ngIRCd isn't
compiled with support for IPv6 ...

11 years agoAdjust severity levels of some log messages
Alexander Barton [Sun, 10 Feb 2013 19:18:44 +0000 (20:18 +0100)]
Adjust severity levels of some log messages

11 years agoCommands.txt: spelling fixes ...
Alexander Barton [Sat, 9 Feb 2013 23:35:03 +0000 (00:35 +0100)]
Commands.txt: spelling fixes ...

11 years agoMerge branch 'HelpText'
Alexander Barton [Sat, 9 Feb 2013 23:29:30 +0000 (00:29 +0100)]
Merge branch 'HelpText'

* HelpText: (22 commits)
  Commands.txt: Update description of the "USERS" command
  Commands.txt: Update description of the "SUMMON" command
  Commands.txt: Update description of the "SERVLIST" command
  Commands.txt: Update description of the "WHOWAS" command
  Commands.txt: Update description of the "WHOIS" command
  Commands.txt: Update description of the "WHO" command
  Commands.txt: Update description of the "VERSION" command
  Commands.txt: Update description of the "USERHOST" command
  Commands.txt: Update description of the "TIME" command
  Commands.txt: Update description of the "STATS" command
  Commands.txt: Update description of the "NAMES" command
  Commands.txt: Update description of the "MOTD" command
  Commands.txt: Update description of the "LUSERS" command
  Commands.txt: Update description of the "LINKS" command
  Commands.txt: Update description of the "ISON" command
  Commands.txt: Update description of the "INFO" command
  Commands.txt: Update description of the "ADMIN" command
  Commands.txt: Add description for the "CHARCONV" command
  Commands.txt: Add description for the "CAP" command
  Commands.txt: Import descriptions from "rbose/command_help"
  ...

11 years agoCommands.txt: Update description of the "USERS" command HelpText
Alexander Barton [Sat, 9 Feb 2013 23:25:19 +0000 (00:25 +0100)]
Commands.txt: Update description of the "USERS" command

11 years agoCommands.txt: Update description of the "SUMMON" command
Alexander Barton [Sat, 9 Feb 2013 23:25:09 +0000 (00:25 +0100)]
Commands.txt: Update description of the "SUMMON" command

11 years agoCommands.txt: Update description of the "SERVLIST" command
Alexander Barton [Sat, 9 Feb 2013 23:24:52 +0000 (00:24 +0100)]
Commands.txt: Update description of the "SERVLIST" command

11 years agoCommands.txt: Update description of the "WHOWAS" command
Alexander Barton [Sat, 9 Feb 2013 23:24:34 +0000 (00:24 +0100)]
Commands.txt: Update description of the "WHOWAS" command

11 years agoCommands.txt: Update description of the "WHOIS" command
Alexander Barton [Sat, 9 Feb 2013 23:24:14 +0000 (00:24 +0100)]
Commands.txt: Update description of the "WHOIS" command

11 years agoCommands.txt: Update description of the "WHO" command
Alexander Barton [Sat, 9 Feb 2013 23:23:59 +0000 (00:23 +0100)]
Commands.txt: Update description of the "WHO" command

11 years agoCommands.txt: Update description of the "VERSION" command
Alexander Barton [Sat, 9 Feb 2013 23:23:43 +0000 (00:23 +0100)]
Commands.txt: Update description of the "VERSION" command

11 years agoCommands.txt: Update description of the "USERHOST" command
Alexander Barton [Sat, 9 Feb 2013 23:23:27 +0000 (00:23 +0100)]
Commands.txt: Update description of the "USERHOST" command

11 years agoCommands.txt: Update description of the "TIME" command
Alexander Barton [Sat, 9 Feb 2013 23:23:10 +0000 (00:23 +0100)]
Commands.txt: Update description of the "TIME" command

11 years agoCommands.txt: Update description of the "STATS" command
Alexander Barton [Sat, 9 Feb 2013 23:22:50 +0000 (00:22 +0100)]
Commands.txt: Update description of the "STATS" command

11 years agoCommands.txt: Update description of the "NAMES" command
Alexander Barton [Sat, 9 Feb 2013 23:22:24 +0000 (00:22 +0100)]
Commands.txt: Update description of the "NAMES" command

11 years agoCommands.txt: Update description of the "MOTD" command
Alexander Barton [Sat, 9 Feb 2013 23:20:41 +0000 (00:20 +0100)]
Commands.txt: Update description of the "MOTD" command

11 years agoCommands.txt: Update description of the "LUSERS" command
Alexander Barton [Sat, 9 Feb 2013 23:20:19 +0000 (00:20 +0100)]
Commands.txt: Update description of the "LUSERS" command

11 years agoCommands.txt: Update description of the "LINKS" command
Alexander Barton [Sat, 9 Feb 2013 23:19:59 +0000 (00:19 +0100)]
Commands.txt: Update description of the "LINKS" command

11 years agoCommands.txt: Update description of the "ISON" command
Alexander Barton [Sat, 9 Feb 2013 23:19:41 +0000 (00:19 +0100)]
Commands.txt: Update description of the "ISON" command

11 years agoCommands.txt: Update description of the "INFO" command
Alexander Barton [Sat, 9 Feb 2013 23:19:20 +0000 (00:19 +0100)]
Commands.txt: Update description of the "INFO" command

11 years agoCommands.txt: Update description of the "ADMIN" command
Alexander Barton [Sat, 9 Feb 2013 23:18:36 +0000 (00:18 +0100)]
Commands.txt: Update description of the "ADMIN" command

11 years agoUpdate irc-info.c to use irc-macros.h bug153-ServerMask
Alexander Barton [Sat, 9 Feb 2013 22:58:11 +0000 (23:58 +0100)]
Update irc-info.c to use irc-macros.h

This includes:

 - move IRC_SetPenalty() at the beginning of the handler functions,
 - use macros provided by irc-macros.h,
 - code cleanup.

The main benefits of this patch are core size reduction, streamlined
structure of the handler functions, and enhanced functionality:
because of the _IRC_GET_TARGET_SERVER_OR_RETURN_() macro using the
Client_SearchServer() function, the target of the specific IRC command
can now be given server names, server mask, or the nickname of a user
connected to the server.

Closes bug #153.

11 years agoAdd new irc-macros.h to project
Alexander Barton [Sat, 9 Feb 2013 22:55:42 +0000 (23:55 +0100)]
Add new irc-macros.h to project

This file prvides some macros for common tasks required by functions
implementing handlers for IRC commands:

 * _IRC_ARGC_LE_OR_RETURN_
 * _IRC_ARGC_GE_OR_RETURN_
 * _IRC_GET_SENDER_OR_RETURN_
 * _IRC_GET_TARGET_SERVER_OR_RETURN_

11 years agoirc-info.c: add/streamline function documentation comments
Alexander Barton [Sat, 9 Feb 2013 22:33:29 +0000 (23:33 +0100)]
irc-info.c: add/streamline function documentation comments

Add missing comments, streamline wording, and remove references to the
RFCs: this will be added to ./doc/Commands.txt with an other patch and
we want to avoid redundancy ...

11 years agoirc-info: move static functions at the top of the file
Alexander Barton [Sat, 9 Feb 2013 22:18:49 +0000 (23:18 +0100)]
irc-info: move static functions at the top of the file

11 years ago"WHO <hostmask>": use displayed hostname for matching
Alexander Barton [Fri, 8 Feb 2013 16:18:43 +0000 (17:18 +0100)]
"WHO <hostmask>": use displayed hostname for matching

Use the currently "displayed hostname" (which can be cloaked!) for
hostname matching, not the real one. In other words: don't display
all the cloaked users on a specific real hostname!

Thanks to DNS <dns@rbose.org> for reporting this issue.

11 years agoImplement new function Client_SearchServer()
Alexander Barton [Tue, 5 Feb 2013 12:04:11 +0000 (13:04 +0100)]
Implement new function Client_SearchServer()

This function returns the server structure of a client or a given "mask";
it is useful for implemention handlers for commands like "COMMAND *.net",
which should work on a server matching "*.net".

Please note that the local server is always returned when it matches the
mask, but besides that, the order is completely arbitrary.

11 years agoNew configuration option "IdleTimeout": exit daemon when idle
Alexander Barton [Mon, 4 Feb 2013 22:15:53 +0000 (23:15 +0100)]
New configuration option "IdleTimeout": exit daemon when idle

This patch implements a new configuration option "IdleTimeout" in the
[Limits] section of the configuration file which can be used to set a
timeout (in seconds) after which the whole daemon will shutdown when no
more connections are left active after handling at least one client.

The default is 0, "never".

This can be useful for testing or when ngIRCd is started using "socket
activation" with systemd(8), for example.

11 years agoImplement support for systemd(8) "socket activation"
Alexander Barton [Mon, 4 Feb 2013 20:46:20 +0000 (21:46 +0100)]
Implement support for systemd(8) "socket activation"

This patch enables ngIRCd to work with listening sockets already
initialized and passed-in by systemd(8) and hereby to support on-demand
"socket activation".

systemd(8) uses two environment variables to pass information about the
sockets to ngIRCd, LISTEN_PID and LISTEN_FDS, and this mechanism only
kicks in when both variables are set. In all other cases, and therefore
in most installations out there, nothing changes at all.

Please note:
If socket activation is in effect, ngIRCd will not initialize any (other)
soeckets on its own! All sockets must be configured in the systemd(8)
socket unit configuration file in this case, see ./contrib/ngircd.socket
for example.

Probably it would be interesting to match passed-in sockets to configured
listening sockets and to initialize all the remaining ones not already
set up by systemd(8), but this is kept back for an other patch ...

See
 - <http://0pointer.de/blog/projects/socket-activation.html>
 - <http://0pointer.de/blog/projects/socket-activation2.html>
 - <http://www.freedesktop.org/software/systemd/man/systemd.socket.html>

11 years agocontrib/README: add more files
Alexander Barton [Mon, 4 Feb 2013 20:31:42 +0000 (21:31 +0100)]
contrib/README: add more files

11 years agoRename ports_initlisteners() to Init_Listeners()
Alexander Barton [Sun, 27 Jan 2013 20:10:50 +0000 (21:10 +0100)]
Rename ports_initlisteners() to Init_Listeners()

11 years agoNewListener(): Code cleanup
Alexander Barton [Sun, 27 Jan 2013 19:57:25 +0000 (20:57 +0100)]
NewListener(): Code cleanup

11 years agoEnable WHOIS to display information about IRC Services
Alexander Barton [Sun, 3 Feb 2013 20:32:53 +0000 (21:32 +0100)]
Enable WHOIS to display information about IRC Services

This patch introduces the new numeric 310(RPL_WHOISSERVICE) and enables
WHOIS to display information about IRC services. This numeric is used
for this purpose by InspIRCd, for example -- but as usual, other numerics
are in use, too, like 613 in UltimateIRCd ...

Please note that neither the Operator (+o) not the "bot status" (+B)
of an IRC service id displayed in the output.

Change suggested by Federico G. Schwindt <fgsch@lodoss.net>, Thanks.

11 years agoCommands.txt: Add description for the "CHARCONV" command
Alexander Barton [Sun, 3 Feb 2013 18:02:42 +0000 (19:02 +0100)]
Commands.txt: Add description for the "CHARCONV" command

11 years agoCommands.txt: Add description for the "CAP" command
Alexander Barton [Sun, 3 Feb 2013 17:59:44 +0000 (18:59 +0100)]
Commands.txt: Add description for the "CAP" command

11 years agoExit message: use singular & plural :-)
Alexander Barton [Sun, 27 Jan 2013 22:22:00 +0000 (23:22 +0100)]
Exit message: use singular & plural :-)

11 years agoautogen.sh: Check for autoconf/automake wrapper scripts
Alexander Barton [Sun, 27 Jan 2013 11:54:48 +0000 (12:54 +0100)]
autogen.sh: Check for autoconf/automake wrapper scripts

For example OpenBSD uses a "autoconf" and "automake" wrapper script which
tells the user to set AUTOCONF_VERSION and AUTOMAKE_VERSION environment
variables. This patch enhances autogen.sh to not detect these wrapper
scripts as regular autoconf/automake commands but to set the required
environment variables after detecting the real "command-X.Y" commands.

Tested on OpenBSD 5.1.

11 years agoautogen.sh: Don't use "egrep -o", use "sed"
Alexander Barton [Sun, 27 Jan 2013 11:25:58 +0000 (12:25 +0100)]
autogen.sh: Don't use "egrep -o", use "sed"

"egrep -o" isn't portable and not available on OpenBSD, for example. So
let's use sed instead to get the automake version. The expression used
now is less specific but should work as well ...

11 years agoIRC_WHO_Channel(): Use strlcpy() instead of strcpy()
Alexander Barton [Sun, 27 Jan 2013 00:00:32 +0000 (01:00 +0100)]
IRC_WHO_Channel(): Use strlcpy() instead of strcpy()

This fixes the following warning, at least on OpenBSD 4.8:

 irc-info.o(.text+0x2427): In function `IRC_WHO':
 src/ngircd/irc-info.c:896: warning: strcpy() is almost always misused,
                            please use strlcpy()

11 years agoStreamline punctuation of log messages
Alexander Barton [Sat, 26 Jan 2013 15:52:41 +0000 (16:52 +0100)]
Streamline punctuation of log messages

Make sure that all log messages end with a correct punctuation mark.

The rules for formatting log messages are:

 1. Add punctuation marks to all messages passed to the actual logging
    functions like Log() and LogDebug().
 2. Don't add any punctuation marks to messages that are stored in
    variables for later use or are passed over the network.
 3. IP addresses, DNS host names and IRC server names should be quoted.
 4. Messages originating in the network should be quoted (at least if
    they are "untrusted" or variable).

Most probably this patch doesn't fix all mistakes, but it should be a
good starting point ...

11 years agoconfigure: "netinet/in_systm.h" is optional
Alexander Barton [Thu, 24 Jan 2013 21:45:00 +0000 (22:45 +0100)]
configure: "netinet/in_systm.h" is optional

The header file "netinet/in_systm.h" already is optional in ngIRCd, so
don't require it in the configure script. Now ngIRCd can be built on
Minix 3 again :-)

11 years agocontrib/Debian/rules: Do no compress Commands.txt
DNS [Tue, 22 Jan 2013 20:36:03 +0000 (21:36 +0100)]
contrib/Debian/rules: Do no compress Commands.txt

This is required, because ngIRCd can't use a compressed file as
help text ...

(cherry picked from commit 6d09b4f366f656f6d2732ea96a653e086380e458)

11 years agoAUTHORS: Update list of contributors
Alexander Barton [Wed, 23 Jan 2013 18:45:00 +0000 (19:45 +0100)]
AUTHORS: Update list of contributors

11 years agoAUTHORS: Use "email address syntax"
Alexander Barton [Wed, 23 Jan 2013 18:41:52 +0000 (19:41 +0100)]
AUTHORS: Use "email address syntax"

11 years agoCommands.txt: Import descriptions from "rbose/command_help"
Alexander Barton [Wed, 23 Jan 2013 14:16:33 +0000 (15:16 +0100)]
Commands.txt: Import descriptions from "rbose/command_help"

Import command description texts from the "rbose/command_help" branch,
which have been written by DNS <dns@rbose.org> -- thanks a lot!

11 years agoCommands.txt: Reorder some commands
Alexander Barton [Wed, 23 Jan 2013 14:02:46 +0000 (15:02 +0100)]
Commands.txt: Reorder some commands

Reorder some commands and introduce new section "Connection Handling".
Idea by DNS <dns@rbose.org>, thanks!

11 years agoCommands.txt: Fix some wording and spelling
Alexander Barton [Wed, 23 Jan 2013 13:51:19 +0000 (14:51 +0100)]
Commands.txt: Fix some wording and spelling

11 years agongircd.service: Use "forking" service type
Alexander Barton [Tue, 22 Jan 2013 23:41:02 +0000 (00:41 +0100)]
ngircd.service: Use "forking" service type

Don't run ngIRCd in forground mode but let it daemonize itself. This
enhances the log output of "systemctl status ngircd.service", because
now ngIRCd doesn't print out its PID and timestamp on each log message
which is redundant: it becomes logged by systemd/journald already.

11 years agoReturn better "Connection not registered as server link" errors
Alexander Barton [Tue, 22 Jan 2013 09:54:06 +0000 (10:54 +0100)]
Return better "Connection not registered as server link" errors

Now ngIRCd returns a more specific error message for numeric
ERR_NOTREGISTERED(451) when a regular user tries to use a command that
isn't allowed for users but for servers: ERR_NOTREGISTEREDSERVER(451).

11 years agoMODE: don't report error on "more modes than parameters"
Alexander Barton [Sun, 13 Jan 2013 15:52:00 +0000 (16:52 +0100)]
MODE: don't report error on "more modes than parameters"

Don't report ERR_NEEDMOREPARAMS(461) when a MDOE command with more modes
than nicknames is handled, as well as for channel limit and key changes
without specifying the limit or key parameters.

This is how a lot (all?) other IRC servers behave, including ircd2.11,
InspIRCd, and ircd-seven. And because of clients (tested with Textual and
mIRC) sending bogus MODE commands like "MODE -ooo nick", end-users got the
expected result as well as correct but misleading error messages ...

If ngIRCd is compiled using "strict mode", these errors are still reported.

Reported-by: Tim <tim@stackwatch.net>
11 years agoCorrectly detect when SSL subsystem must be initialized
Alexander Barton [Mon, 7 Jan 2013 17:42:57 +0000 (18:42 +0100)]
Correctly detect when SSL subsystem must be initialized

This patch introduces the new function Conf_SSLInUse() to check when the
current server configuration requires the SSL subsystem to be initialized
and accounts incoming as well as outgoing connections -- so this fixes
commit bb20aeb9 ("Initialize SSL when needed only, and disable SSL on
errors") which only handled the inbound case  ...

Tested-by: Brett Smith <brett@w3.org>
11 years agoconfigure: use AS_HELP_STRING for --with-iconv
Alexander Barton [Sun, 6 Jan 2013 16:46:06 +0000 (17:46 +0100)]
configure: use AS_HELP_STRING for --with-iconv

11 years agoautogen.sh: Enforce serial test harness on automake >=1.13
Alexander Barton [Sat, 5 Jan 2013 02:05:56 +0000 (03:05 +0100)]
autogen.sh: Enforce serial test harness on automake >=1.13

11 years agoautogen.sh: Reformat messages.
Alexander Barton [Sat, 5 Jan 2013 01:37:55 +0000 (02:37 +0100)]
autogen.sh: Reformat messages.

11 years agoMerge branch 'bug145-ProvideHelp'
Alexander Barton [Wed, 2 Jan 2013 22:41:46 +0000 (23:41 +0100)]
Merge branch 'bug145-ProvideHelp'

* bug145-ProvideHelp:
  Use "${docdir}/Commands.txt" as help text file
  Add a note that "help file" is updated on startup and REHASH only
  Add doc/Commands.txt which should document all commands
  Implement Help() function parsing and returning the help text
  Document "HelpFile" in sample-ngircd.conf and ngircd.conf.5
  Implement new configuration option "HelpFile"
  IRC_HELP(): Code cleanup
  Refactor Read_Motd() into Read_TextFile()

11 years agongIRCd Release 20.1 rel-20.1
Alexander Barton [Wed, 2 Jan 2013 21:37:55 +0000 (22:37 +0100)]
ngIRCd Release 20.1

11 years agoUse "${docdir}/Commands.txt" as help text file bug145-ProvideHelp
Alexander Barton [Tue, 1 Jan 2013 18:25:06 +0000 (19:25 +0100)]
Use "${docdir}/Commands.txt" as help text file

11 years agoUpdate Copyright notices for 2013
Alexander Barton [Tue, 1 Jan 2013 18:23:56 +0000 (19:23 +0100)]
Update Copyright notices for 2013

11 years agoAdd a note that "help file" is updated on startup and REHASH only
Alexander Barton [Tue, 1 Jan 2013 14:35:49 +0000 (15:35 +0100)]
Add a note that "help file" is updated on startup and REHASH only

11 years agoAdd doc/Commands.txt which should document all commands
Alexander Barton [Tue, 1 Jan 2013 14:09:09 +0000 (15:09 +0100)]
Add doc/Commands.txt which should document all commands

This document can be used as "help text", too, see configuration option
"HelpFile" in ngircd.conf(5).

Please note that this file in its current state is far from complete, only
a few commands are documented, but you should get an idea how it works.

So please send in patches adding the remaining parts! :-)

11 years agoImplement Help() function parsing and returning the help text
Alexander Barton [Tue, 1 Jan 2013 13:57:03 +0000 (14:57 +0100)]
Implement Help() function parsing and returning the help text

This function parses the already read in help text and sends the requested
portions to the user. Parsing is done as following when a user user
issues a "HELP <cmd>" command:

 1. Search the file for a line "- <cmd>",
 2. Output all subsequent lines that start with a TAB (ASCII 9) character
    to the client using NOTICE commands, treat lines containing a single "."
    after the TAB as empty lines.
 3. Break at the first line not starting with a TAB character.

This format allows to have information to each command stored in this file
which will not be sent to an IRC user requesting help which enables us to
have additional annotations stored here which further describe the origin,
implementation details, or limits of the specific command.

A special "Intro" block is returned to the user when the HELP command is
used without a command name.

11 years agoAllow ERROR command on server and service links only
Alexander Barton [Mon, 31 Dec 2012 20:46:41 +0000 (21:46 +0100)]
Allow ERROR command on server and service links only

Ignore it and add a penalty time on all other link types.

11 years agoDocument "HelpFile" in sample-ngircd.conf and ngircd.conf.5
Alexander Barton [Mon, 31 Dec 2012 20:03:23 +0000 (21:03 +0100)]
Document "HelpFile" in sample-ngircd.conf and ngircd.conf.5

11 years agoImplement new configuration option "HelpFile"
Alexander Barton [Mon, 31 Dec 2012 18:29:52 +0000 (19:29 +0100)]
Implement new configuration option "HelpFile"

This new configuration option allows to specify a specially formatted
text file which can be used by the HELP command to provide information
about the commands and their syntaxes.

11 years agoIRC_HELP(): Code cleanup
Alexander Barton [Mon, 31 Dec 2012 18:27:32 +0000 (19:27 +0100)]
IRC_HELP(): Code cleanup

11 years agoRefactor Read_Motd() into Read_TextFile()
Alexander Barton [Mon, 31 Dec 2012 18:26:31 +0000 (19:26 +0100)]
Refactor Read_Motd() into Read_TextFile()

Now this function allows to read arbitrary text files into arrays.

11 years agoGet rid of Conn_ResetPenalty(), it is unused
Alexander Barton [Mon, 31 Dec 2012 17:23:21 +0000 (18:23 +0100)]
Get rid of Conn_ResetPenalty(), it is unused

11 years agoMode setting: only check channel user modes when on channel
Alexander Barton [Mon, 31 Dec 2012 17:13:18 +0000 (18:13 +0100)]
Mode setting: only check channel user modes when on channel

Only check the channel user modes of the initiator if he is joined to
this channel and not an IRC operator enforcing modes (which requires
the configuration option "OperCanUseMode" to be enabled), because trying
to check channel user modes of a non-member results in this assertion:

 Assertion failed: (cl2chan != NULL), function Channel_UserModes,
  file channel.c, line 742.

This closes bug #147, thanks to James Kirwill <james.kirwill@bk.ru>
for tracking this down!

11 years agoAdd some more casts in assert() statemens
Alexander Barton [Tue, 25 Dec 2012 18:21:40 +0000 (19:21 +0100)]
Add some more casts in assert() statemens

This fixes the following warning messages of gcc 4.5.3 on Cygwin when
building with debug code enabled:

 ng_ipaddr.c: In function ‘ng_ipaddr_init’:
 ng_ipaddr.c:52:2: warning: comparison between signed and
                   unsigned integer expressions
 ng_ipaddr.c:53:20: warning: comparison between signed and
                    unsigned integer expressions

 resolve.c: In function ‘ForwardLookup’:
 resolve.c:271:3: warning: comparison between signed and
                  unsigned integer expressions