]> arthur.barton.de Git - ngircd-alex.git/log
ngircd-alex.git
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 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 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 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

11 years agoMakefiles: Correctly quote sed expressions
Alexander Barton [Tue, 25 Dec 2012 18:13:55 +0000 (19:13 +0100)]
Makefiles: Correctly quote sed expressions

Now the Makefiles support spaces in "$sysconfdir", which isn't uncommon
for Cygwin for example, when $HOME contains whitespaces ("/home/User Name")
and ngIRCd is installed into the user home ("./configure --prefix=$HOME").

11 years agoAdd Cygwin binaries (*.exe) to .gitignore files
Alexander Barton [Tue, 25 Dec 2012 17:52:49 +0000 (18:52 +0100)]
Add Cygwin binaries (*.exe) to .gitignore files

11 years agoAdd a cast in ForwardLookup() to fix a gcc warning on Cygwin
Alexander Barton [Tue, 25 Dec 2012 17:49:28 +0000 (18:49 +0100)]
Add a cast in ForwardLookup() to fix a gcc warning on Cygwin

This fixes the following warning message of 4.5.3 on Cygwin:

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

11 years agongIRCd Release 20 rel-20
Alexander Barton [Mon, 17 Dec 2012 12:14:32 +0000 (13:14 +0100)]
ngIRCd Release 20

11 years agoUpdate NEWS and ChangeLog files
Alexander Barton [Wed, 12 Dec 2012 10:06:35 +0000 (11:06 +0100)]
Update NEWS and ChangeLog files

11 years agoAllow user names up to 20 characters
Alexander Barton [Mon, 10 Dec 2012 09:41:36 +0000 (10:41 +0100)]
Allow user names up to 20 characters

This patch allows user names up to 20 characters when ngIRCd has not been
configured for "strict RFC mode".

Patch suggested by Brett Smith <brett@w3.org>, see
<http://arthur.barton.de/pipermail/ngircd-ml/2012-October/000579.html>.

11 years agongIRCd 20~rc2 rel-20-rc2
Alexander Barton [Sun, 2 Dec 2012 17:51:51 +0000 (18:51 +0100)]
ngIRCd 20~rc2

11 years agoUpdate NEWS and ChangeLog files
Alexander Barton [Sun, 2 Dec 2012 17:49:11 +0000 (18:49 +0100)]
Update NEWS and ChangeLog files

11 years agoUpdate doc/Platforms.txt
Alexander Barton [Mon, 26 Nov 2012 10:54:23 +0000 (11:54 +0100)]
Update doc/Platforms.txt

11 years agoRework cloaked hostname handling, implement "METADATA cloakhost"
Alexander Barton [Sat, 24 Nov 2012 15:15:35 +0000 (16:15 +0100)]
Rework cloaked hostname handling, implement "METADATA cloakhost"

Now ngIRCd uses two fields internally, one to store the "real" hostname
and one to save the "cloaked" hostname. And both fields can be set
independently using the "METADATA host" and "METADATA cloakhost" commands.

This allows "foreign servers" (aka "IRC services") to alter the real and
cloaked hostnames of clients without problems, even when the user itself
issues additional "MODE +x" and "MODE -x" commands.

11 years agoRPL_UMODEIS: send correct target name, even on server links
Alexander Barton [Sat, 24 Nov 2012 14:57:45 +0000 (15:57 +0100)]
RPL_UMODEIS: send correct target name, even on server links

11 years agoClient_HostnameCloaked() -> Client_HostnameDisplayed()
Alexander Barton [Sat, 24 Nov 2012 12:37:56 +0000 (13:37 +0100)]
Client_HostnameCloaked() -> Client_HostnameDisplayed()

11 years agoplatformtest.sh: Only generate configure script when missing
Alexander Barton [Tue, 13 Nov 2012 22:21:09 +0000 (23:21 +0100)]
platformtest.sh: Only generate configure script when missing

11 years agoUpdate platformtest.sh to follow autoconf changes
Alexander Barton [Tue, 13 Nov 2012 21:42:49 +0000 (22:42 +0100)]
Update platformtest.sh to follow autoconf changes

11 years agoTest suite: correctly execute tests when stdout is redirected
Alexander Barton [Tue, 13 Nov 2012 21:41:23 +0000 (22:41 +0100)]
Test suite: correctly execute tests when stdout is redirected

11 years agoAdd a few casts, fix compiler warnings on NetBSD 5
Alexander Barton [Mon, 12 Nov 2012 21:39:57 +0000 (22:39 +0100)]
Add a few casts, fix compiler warnings on NetBSD 5

This fixes a few warnings of this type:
  XXX.c: In function 'AAA':
  XXX.c:YY: warning: array subscription has type 'char'

Tested on NetBSD 5.0.2 with gcc 4.1.3.

11 years agoirc-info.c: Use strlcpy() instead of strcpy()
Alexander Barton [Sun, 11 Nov 2012 15:46:57 +0000 (16:46 +0100)]
irc-info.c: Use strlcpy() instead of strcpy()

This fixes the following warning of gcc (tested on OpenBSD 5.0:)
  irc-info.c:990: warning: strcpy() is almost always misused,
                  please use strlcpy

11 years agongIRCd 20~rc1 rel-20-rc1
Alexander Barton [Sun, 11 Nov 2012 15:03:40 +0000 (16:03 +0100)]
ngIRCd 20~rc1

11 years agoUpdate Xcode project files
Alexander Barton [Sun, 11 Nov 2012 11:40:47 +0000 (12:40 +0100)]
Update Xcode project files

11 years agoconf.c: Use strlcpy() instead of strcpy()
Alexander Barton [Sun, 11 Nov 2012 10:18:53 +0000 (11:18 +0100)]
conf.c: Use strlcpy() instead of strcpy()

This fixes the following warning of gcc on OpenBSD 5.0:
  conf.c:728: warning: strcpy() is almost always misused, please use strlcpy()

11 years agotool.h: Don't check for and #define PF_INET
Alexander Barton [Sun, 11 Nov 2012 10:05:21 +0000 (11:05 +0100)]
tool.h: Don't check for and #define PF_INET

This is correctly handled by ipaddr/ng_ipaddr.h today, and the check
in tool.h isn't required any more -- and caused errors on OpenBSD 5.0:

  In file included from ./../tool/tool.h:23:
  /usr/include/arpa/inet.h:74:
    warning: "struct in_addr" declared inside parameter list

11 years agoconf-ssl.h: Use "gnutls_session_t" instead of "gnutls_session"
Alexander Barton [Sun, 11 Nov 2012 09:49:06 +0000 (10:49 +0100)]
conf-ssl.h: Use "gnutls_session_t" instead of "gnutls_session"

This fixes the following warning with current versions of GnuTLS:
  conf-ssl.h:36: warning: "gnutls_session" is deprecated

11 years agoAdd new IRC+ server flag "X": "XOP modes supported"
Alexander Barton [Sat, 10 Nov 2012 22:33:19 +0000 (23:33 +0100)]
Add new IRC+ server flag "X": "XOP modes supported"

This flag indicates, that the server supports the enhanced "xop channel
user modes", like channel owner, admin, and halfop. This information is
used to make sure that no unsupported CHANINFO commands are sent to
servers not supporting such mode prefixes, for example.

11 years agoUpdate autoconf/automake version numbers in doc/HowToRelease.txt
Alexander Barton [Sat, 10 Nov 2012 20:50:36 +0000 (21:50 +0100)]
Update autoconf/automake version numbers in doc/HowToRelease.txt

11 years agoUpdate NEWS and ChangeLog files
Alexander Barton [Sat, 10 Nov 2012 20:49:02 +0000 (21:49 +0100)]
Update NEWS and ChangeLog files

11 years agoRemove Anope "ngircd" protocol module patches
Alexander Barton [Sun, 4 Nov 2012 12:58:25 +0000 (13:58 +0100)]
Remove Anope "ngircd" protocol module patches

Starting with Anope 1.9.8, the ngIRCd protocol module is included in the
Anope distribution, so there's no longer any need to support our own (but
now heavily outdated!) patches. Therefore remove them.

11 years agodoc/Services.txt: Update documentation for Anope 1.9.8
Alexander Barton [Sat, 10 Nov 2012 20:24:55 +0000 (21:24 +0100)]
doc/Services.txt: Update documentation for Anope 1.9.8

Starting with Anope 1.9.8, the ngIRCd protocol module is rewritten from
scratch by "DukePyrolator" and included in the Anope distribution. So no
patching is required any more, yeah!

Drawback: Anope 1.9.8 is in development and not yet released ...

11 years agoCorrectly add irc-metadata.{c|h} to Makefile.ng ... cmd-METADATA
Alexander Barton [Mon, 5 Nov 2012 22:57:14 +0000 (23:57 +0100)]
Correctly add irc-metadata.{c|h} to Makefile.ng ...

11 years agodoc/Protocol.txt: Document METADATA command
Alexander Barton [Mon, 5 Nov 2012 22:51:52 +0000 (23:51 +0100)]
doc/Protocol.txt: Document METADATA command

11 years agoGenerate "METADATA host" commands on "MODE +/-x"
Alexander Barton [Mon, 5 Nov 2012 22:49:12 +0000 (23:49 +0100)]
Generate "METADATA host" commands on "MODE +/-x"

Use "METADATA host" commands to let servers supporting this command
know which (possibly cloaked) hostname is in effect for a specific
client. This prevents "double cloaking" of hostnames and even cloaked
hostnames are in sync on all servers supporting "METADATA" now.

11 years agoDon't cloak already cloaked hostname when using METADATA
Alexander Barton [Mon, 5 Nov 2012 22:46:26 +0000 (23:46 +0100)]
Don't cloak already cloaked hostname when using METADATA

A client for which a METADATA command has been received from one of
its peers got the client flag "M" set. So it's safe to assume that
such a client gets "METADATA host" commands for its cloaked hostname
and the server must not cloak the hostname on its own, even when the
client mode "+x" is set.

11 years agoImplement METADATA command to update client metadata
Alexander Barton [Mon, 5 Nov 2012 22:34:21 +0000 (23:34 +0100)]
Implement METADATA command to update client metadata

The METADATA command can be used by other servers to update "metadata"
of registered clients, like the client info text ("real name"), user
name, and hostname:

  :<prefix> METADATA <target> <key> :<value>

It is distributed in the network, unknown <key> names are silently ignored
and passed on, too. This allows for further extensions.

11 years agodoc/Protocol.txt: add/fix CHARCONV description
Alexander Barton [Mon, 5 Nov 2012 22:11:41 +0000 (23:11 +0100)]
doc/Protocol.txt: add/fix CHARCONV description

11 years agoPredefChannelsOnly: Fix message for non pre-defined channels
DNS777 [Tue, 16 Oct 2012 05:28:44 +0000 (07:28 +0200)]
PredefChannelsOnly: Fix message for non pre-defined channels

If PredefChannelsOnly is enabled, and if someone tries to create
a channel which does not exist, then the error message is a 474.
The 474 Error message changed recently and does not match anymore:
'Cannot join channel (+b) -- You are banned'.

Changed the error message to numeric 403 'No such channel'.

Bug introduced by commit 9a82304a.

(cherry picked from commit 2c2e08f34187a33c1da745995c5f213e33a91410)

11 years agoTest suite: add some "remote checks" to whois-test.e
Alexander Barton [Sun, 4 Nov 2012 18:50:02 +0000 (19:50 +0100)]
Test suite: add some "remote checks" to whois-test.e

11 years agoSend NICK commands with prefix of (target) user
Alexander Barton [Sun, 4 Nov 2012 17:01:49 +0000 (18:01 +0100)]
Send NICK commands with prefix of (target) user

Now NICK commands are always generated using the prefix of the target
user, even when the nickname change has been initiated by some other
(pseudo) server or using the SVSNICK command. In this case, the prefix
of the initiator has been used, but this isn't compatible with clients
(at least weechat and irssi don't handle such NICK commands correctly).

11 years agoUpdate doc/Services.txt, sort services alphabetically
Alexander Barton [Sun, 4 Nov 2012 12:22:26 +0000 (13:22 +0100)]
Update doc/Services.txt, sort services alphabetically

11 years agoImplement SVSNICK command to change remote nicknames
Alexander Barton [Fri, 2 Nov 2012 16:50:31 +0000 (17:50 +0100)]
Implement SVSNICK command to change remote nicknames

The SVSNICK command allows other servers (and services on
"pseudo-servers") to forcefully change nicknames of remote users.

Syntax: ":<from> SVSNICK <oldnick> <newnick>"

The SVSNICK command itself doesn't change the nickname, but it becomes
forwarded to the server to which the user is connected to. And then this
server initiates the real nickname changing using regular NICK commands.

This allows to still run networks with old servers not supporting the
SVSNICK command, because SVSNICK commands for nicknames on such servers
are silently ignored and don't cause a desync of the network.

11 years agoIRC_NICK(): Code cleanup, new function Change_Nick()
Alexander Barton [Fri, 2 Nov 2012 13:36:29 +0000 (14:36 +0100)]
IRC_NICK(): Code cleanup, new function Change_Nick()

11 years agoSpelling fix: "nick name" -> "nickname"
Alexander Barton [Fri, 2 Nov 2012 13:30:19 +0000 (14:30 +0100)]
Spelling fix: "nick name" -> "nickname"

11 years agoXcode: correctly #define PACKAGE and PACKAGE_NAME
Alexander Barton [Fri, 2 Nov 2012 13:16:58 +0000 (14:16 +0100)]
Xcode: correctly #define PACKAGE and PACKAGE_NAME

11 years agoFix warning message introduced when cleaning up IRC_SERVER()
Alexander Barton [Mon, 29 Oct 2012 10:44:45 +0000 (11:44 +0100)]
Fix warning message introduced when cleaning up IRC_SERVER()

This reverts a not intentional code change and fixes the following compiler
warning message (tested with gcc 4.4.5):

 irc-server.c: In function "IRC_SERVER":
 irc-server.c:142: warning: suggest parentheses around operand of "!"
                            or change "&" to "&&" or "!" to "~"

11 years agoMake server reconnect time a little bit more random server-link-async
Alexander Barton [Sun, 28 Oct 2012 19:19:57 +0000 (20:19 +0100)]
Make server reconnect time a little bit more random

Add randomly up to 15 seconds to the reconnect delay for outgoing server
links when the connection has been "short" and therefore the "ConnectRetry"
delay is being enforced.

This should make it even more unlikely that two servers deadlock each
other when both are trying to connect to the other one at the same time,
for example in test environments.

11 years agoDon't accept connections for servers already beeing linked
Alexander Barton [Sun, 28 Oct 2012 18:48:24 +0000 (19:48 +0100)]
Don't accept connections for servers already beeing linked

If two servers try to link each other, there was a time frame that
could result in one connection overwriting the other, e. g. the incoming
connection overwriting the status of the outgoing one. And this could
lead to all kind of weirdness (even crashes!) later on.

So now such incoming connections are dropped. But this most probably
prevents the two servers from linking until timing changes somehow
(network latency?) because each server drops the incoming connection of
the other one, so no connection survives in the end.

But this has to be addressed by an other patch ...

11 years agoIRC_SERVER(): Code cleanup
Alexander Barton [Sun, 28 Oct 2012 17:52:37 +0000 (18:52 +0100)]
IRC_SERVER(): Code cleanup

11 years agoUse lowercase "package name" for syslog logging again
Alexander Barton [Mon, 29 Oct 2012 09:24:27 +0000 (10:24 +0100)]
Use lowercase "package name" for syslog logging again

This is how ngIRCd up to release 19.2 behaved; "bug" introduced by commit
67e882, "configure.in: require autoconf 2.67 and automake 1.11", which
changed the "PACKAGE_NAME" to "ngIRCd"; so use "PACKAGE" which still is
the lowercase version for initializing syslog logging.

11 years agoDocument new configuration option "MaxListSize"
Alexander Barton [Sun, 28 Oct 2012 19:36:58 +0000 (20:36 +0100)]
Document new configuration option "MaxListSize"

11 years agoMake the maximum /list reply length a configurable limit.
Brett Smith [Thu, 25 Oct 2012 18:46:29 +0000 (14:46 -0400)]
Make the maximum /list reply length a configurable limit.

11 years agoUpdate NEWS and ChangeLog files
Alexander Barton [Wed, 24 Oct 2012 20:03:56 +0000 (22:03 +0200)]
Update NEWS and ChangeLog files

11 years agoAllow remote servers and IRC Ops to change channel topics
Alexander Barton [Fri, 19 Oct 2012 17:45:44 +0000 (19:45 +0200)]
Allow remote servers and IRC Ops to change channel topics

Remote servers are always allowed to change all channel topics,
and IRC Operators are allowed to change all channel topics if the
configuration option "OperCanUseMode" is enabled.

Bug introduced by commit 7b01bb8 and reported by DNS777.

11 years agoIncreased maximum number of possible user and channel modes
DNS [Wed, 10 Oct 2012 23:53:20 +0000 (01:53 +0200)]
Increased maximum number of possible user and channel modes

Currntly ngIRCd supports 13 user and 15 channel modes, because there
have been quite a few additions since our last release. But our data
structures can only hold 15 user and -- even worse! -- only 9 channel
modes! So enlarge the buffers to 20 bytes (actually 21 including NULL)
to allow storing of all mode characters and to have some space left
for more modes to come ...

(cherry picked from commit 8996d777621d88d4bcc439ab4792b2814920687f)

11 years agoUpdate error messages for user mode +b and channel Mode +M.
DNS777 [Fri, 19 Oct 2012 16:37:33 +0000 (18:37 +0200)]
Update error messages for user mode +b and channel Mode +M.

Replaced error message for channel mode +M with ERR_NEEDREGGEDNICK_MSG
(used by Bahamut, inspircd, ircu & Unreal too) and using numeric 477
and the msg simliar like inspircd.

Replaced the error message ERR_CANNOTSENDTONICK_MSG for user mode +b
with ERR_NONONREG_MSG and using numeric 486, similar like unrealircd.

(cherry picked from commit 55a61ab17f63a9e757b7c7598c31b98ce5a132e8
and commit 3737d9ab7da1ea0485cefc07c65dc5308bf0db02)

11 years agoTest suite: add more checks to whois-test.e
Alexander Barton [Mon, 15 Oct 2012 19:39:08 +0000 (21:39 +0200)]
Test suite: add more checks to whois-test.e

11 years agoAdd "i586/pc/haiku" to doc/Platforms.txt
Alexander Barton [Thu, 11 Oct 2012 15:05:21 +0000 (15:05 +0000)]
Add "i586/pc/haiku" to doc/Platforms.txt

11 years agoDisable UID/GID checks on "single user OS"
Alexander Barton [Thu, 11 Oct 2012 14:54:13 +0000 (14:54 +0000)]
Disable UID/GID checks on "single user OS"

Don't abort on "single user operating systems" that don't know more than
one user account and therefore can't change user and group IDs.

Currently, the only such system supported by ngIRCd is Haiku, a BeOS
clone.

11 years agoSearch gethostbyname() in libbind and libnetwork
Alexander Barton [Thu, 11 Oct 2012 14:50:45 +0000 (14:50 +0000)]
Search gethostbyname() in libbind and libnetwork

This is required for Haiku (BeOS clone) at least.

11 years agoUpdate manual pages
Alexander Barton [Tue, 9 Oct 2012 11:13:01 +0000 (13:13 +0200)]
Update manual pages

Among other little things, bring project description in line with website.

11 years agoTest suite: add test for user mode "b"
Alexander Barton [Mon, 8 Oct 2012 10:15:34 +0000 (12:15 +0200)]
Test suite: add test for user mode "b"

11 years agoImplement user mode "b": block messages
DNS777 [Mon, 8 Oct 2012 10:11:04 +0000 (12:11 +0200)]
Implement user mode "b": block messages

When a user has set mode "b", all private messages and notices to this
user are blocked if they don't originate from a registered user, an IRC Op,
server or service. The originator gets an error numeric sent back in this
case, ERR_CANNOTSENDTONICK_MSG(976), which is/was(?) used by KineIRCd, too.

This closes bug #144.

11 years agoFix ERR_CANNOTSENDTOCHAN_MSG message
Alexander Barton [Sun, 7 Oct 2012 13:11:05 +0000 (15:11 +0200)]
Fix ERR_CANNOTSENDTOCHAN_MSG message

This error message is not only used if one can not send to a channel
because it is moderated, but for _all_ reasons when a message can not
be delivered (moderated, banned, no external messages, ...), so strip
the "(+m) -- Moderated" part of the error message again.

Bug introduced by commit 9a82304a.

11 years agoShorten filenames of Anope protocol module patchfiles
Alexander Barton [Sun, 7 Oct 2012 10:06:11 +0000 (12:06 +0200)]
Shorten filenames of Anope protocol module patchfiles

Filenames have been too long and couldn't be stored in all tar
archive formats ...

11 years agoWHOIS: show RPL_WHOISHOST_MSG to all IRC Ops in the network
Alexander Barton [Sat, 6 Oct 2012 22:05:25 +0000 (00:05 +0200)]
WHOIS: show RPL_WHOISHOST_MSG to all IRC Ops in the network

Not only show RPL_WHOISHOST_MSG to local IRC opreators, but show
it to all IRC operators in the network. And don't show it to anybody
if the "more privacy" configuration option is enabled.

This closes bug #134.

11 years agoTest suite: make expect scripts more verbose testsuite-verbose
Alexander Barton [Mon, 24 Sep 2012 21:05:24 +0000 (23:05 +0200)]
Test suite: make expect scripts more verbose

Now tests.sh transforms each expect script it executes using sed(1)
and inserts a 'puts -nonewline stderr "."' in front of each "expect"
command.

11 years agoTest suite: remove indentation of messages
Alexander Barton [Mon, 24 Sep 2012 20:25:58 +0000 (22:25 +0200)]
Test suite: remove indentation of messages

11 years agoMerge branch 'bug141-ModesQq'
Alexander Barton [Sat, 6 Oct 2012 20:37:57 +0000 (22:37 +0200)]
Merge branch 'bug141-ModesQq'

This closes bug #141.

* bug141-ModesQq:
  KICK-protect IRC services
  Implement channel mode "Q" and user mode "q"

Conflicts:
src/ngircd/defines.h
src/ngircd/messages.h