Commit Graph

2672 Commits

Author SHA1 Message Date
Alexander Barton 360a254be0 Enhance "ServiceMask" to handle a list of masks
The "ServiceMask" variable in "Server" blocks now can handle more than
one mask using the new MatchCaseInsensitiveList() function.

This makes marking "service clients" much more specific, which is a
good thing per se, but which is the prerequisite for reasonably
blocking these nick names, too (see commit a6dd2e3 for details).
2012-08-26 13:24:54 +02:00
Alexander Barton ab1fcebeff New function MatchCaseInsensitiveList() to check list of patterns 2012-08-26 13:11:45 +02:00
Alexander Barton a6dd2e33c2 Block nicknames that are reserved for services
This patch introduces the new function Conf_NickIsBlocked() which checks
if a given nick name matches with the "service mask" of a configured server.
And Client_CheckNick() uses this information to deny such names for regular
IRC users.

So nick names intended for IRC services are more protected and can't be used
by regular users even when the "services pseudo-server" isn't connected to
the network.

But please note:

Up to now, there can be only one "ServiceMask" pattern per server, which
most probably blocks much more nick names than really required ...
So "ServiceMask" should allow more than one pattern which can be more
specific, and most probably it should be possible to block nick names in
the global server configuration as well.

Nick names introduced by other servers/services are never restricted.
2012-08-26 12:33:21 +02:00
Alexander Barton 9d8974d509 Rename Conf_IsService() to Conf_NickIsService() 2012-08-26 12:27:51 +02:00
Alexander Barton 037b4b76df Check_Connections(): code cleanup 2012-08-26 12:04:40 +02:00
Alexander Barton 4b0f526006 Xcode: use certificate of Alex for code signing
When doing non-debug Xcode builds, use the "Developer ID Application:
Alexander Barton" certificate for code signing by default.
2012-08-22 00:50:15 +02:00
Alexander Barton 4cf65b973c "make uninstall": remove ngircd.conf if not modified
Now "make uninstall" removes the installed "ngircd.conf" file, if it
is still equal to our "sample-ngircd.conf" file and therefore hasn't
been modified by the user. If it has been modified, it isn't removed
and a notice is displayed to the user.

In addition, "make install" now displays a message when no ngircd.conf
file exists and the "sample-ngircd.conf" file will be installed as a
starting point.
2012-08-18 23:50:20 +02:00
Alexander Barton 160f728530 contrib/ngircd.service: systemd service file for ngircd
Thanks to Kyle Keen <keenerd@gmail.com>:

Date: Sat, 18 Aug 2012 08:28:22 -0400
Message-ID: <CAAKTTKNNmrB=8XtxcV6w1Q-RQ6J_xTTDGD4MHQFaDy6V3=B19Q@mail.gmail.com>
From: keenerd <keenerd@gmail.com>
To: ngircd-ml@ngircd.barton.de
Subject: [ngIRCd-ML] systemd service

Hello all.

Linked is a service file for ngircd.  Please add this to your source
tree so other people don't have to learn to write service files ;-)

https://projects.archlinux.org/svntogit/community.git/plain/trunk/ngircd.service?h=packages/ngircd

-Kyle Keen
Arch Linux TU
http://kmkeen.com
2012-08-18 16:01:51 +02:00
Alexander Barton 922540306e ngt_RandomStr(): Add implicit cast to "unsigned".
This fixes the following warning of Xcode 4.5:

 src/tool/tool.c:150:19:
  Implicit conversion loses integer precision: 'long' to 'unsigned int'
2012-08-18 12:34:11 +02:00
Alexander Barton d48e440a72 Fix a buffer overflow when initializing the random salt for "+x"
This "off by one" buffer overflow has been introduced in commit 49385a98,
"Implemented hashed cloaked hostnames for +x".
2012-08-16 23:51:28 +02:00
Alexander Barton 0709a0f050 configure.in: Use AC_CONFIG_HEADER instead of AM_CONFIG_HEADER
AM_CONFIG_HEADER is marked obsolete and will be removed in Automake 1.13.
2012-08-11 16:29:14 +02:00
Alexander Barton cfd0bddc30 Fix compiler warning when not building with ZLIB support
This fixes:

 irc.c: In function ‘Option_String’:
 irc.c:333:9: error: variable ‘options’ set but not used
2012-08-06 01:35:56 +02:00
Alexander Barton b53b12aa5f Update NEWS and ChangeLog files for hashed cloaked hostnames 2012-08-03 23:55:25 +02:00
Sebastian Köhler d0bb185cf5 Hashed hostnames for CloakHost
Implemented support for hashed hostnames for CloakHost. The admin can
use '%x' in both the CloakHost and CloakHostModeX setting. The config
option CloakHostModeX was renamed to CloakHostSalt. This salt is used
for both cloaking options.
2012-08-03 04:10:11 +02:00
Sebastian Köhler 49385a98b2 Implemented hashed cloaked hostnames for +x
CloakHostModeX can now contain '%x'. It will be replace by the hash of
the original client hostname. The new config option CloakHostModeXSalt
defines the salt for the hash function. When CloakHostModeXSalt is not
set a random salt will be generated after each server restart.

Spelling fix in defines.h
2012-08-03 04:09:37 +02:00
Alexander Barton b9e6cb3e55 ngIRCd release 19.2 2012-06-19 11:47:15 +02:00
Alexander Barton dffe5a9d60 doc/Capabilities.txt: document "multi-prefix" capability 2012-06-13 12:19:56 +02:00
Alexander Barton d7eb343ea0 ngIRCd release 19.2~rc1 2012-06-13 11:40:24 +02:00
Alexander Barton bf5610a3b9 Merge branch 'bug124-CloakHostModeX'
* bug124-CloakHostModeX:
  Describe "CloakHostModeX" in sample-ngircd.conf an ngircd.conf(5)
  Rename "CloakModeHost" option to "CloakHostModeX"
  Introduce new configuration option "CloakModeHost"

This closes bug #124.
2012-06-11 10:44:28 +02:00
Alexander Barton 7bce6780ca Update ChangeLog and NEWS files 2012-06-09 12:53:44 +02:00
Alexander Barton bf121ae95f Describe "CloakHostModeX" in sample-ngircd.conf an ngircd.conf(5) 2012-06-09 02:04:50 +02:00
Alexander Barton 7b6b492bdd Rename "CloakModeHost" option to "CloakHostModeX" 2012-06-09 01:58:40 +02:00
Christoph Biedl aa7db2c0e9 Introduce new configuration option "CloakModeHost"
This closes bug #124.
2012-06-09 01:58:25 +02:00
Alexander Barton 684e50f0a4 Correctly handle asynchronously re-established server links
Don't try to establish an outgoing server link after DNS lookup when this
server re-connected on its own in the meantime.
In addition, log a warning message if we try to update the connection
index of an already connected server structure -- and ignore it.

Up to now, both behaviour could lead to a race when the remote server
connects to this daemon while it still prepares the outgoing connection:

 - The local server prepares the new outgoing connection ...
 - in the meantime the remote server becomes connected and registered.
 - Now the new outgoing connection overwrites the (correct) socket handle,
 - then the 2nd connection becomes disconnected: "already registered",
 - and the 1st connection becomes unhandled ("gets lost") because the
   configuration structure is reset because of the wrong socket handle.

This patch hopefully fixes all these problems.
2012-06-09 01:03:48 +02:00
Alexander Barton 4a90959cb5 Log a debug message when SIGUSR2 is handled 2012-06-08 22:08:52 +02:00
Alexander Barton 9b1cf420f1 doc/Platforms.txt: more updates
Added:
 - armv6l/unkn./linux-gnueabi, gcc 4.4.5
 - i686/pc/linux-gnu, gcc 2.7.2

Updated:
 - i386/pc/solaris2.11, gcc 4.2.3

Thanks to Götz Hoffart!
2012-06-07 17:09:45 +02:00
Alexander Barton e7e47e77a3 NoticeAuth: Fix test if IDENT reply has been invalid
This fixes

 conn.c: In function ‘cb_Read_Resolver_Result’:
 conn.c:2252: warning: comparison between pointer and integer
2012-06-02 00:32:19 +02:00
Alexander Barton 695df6532e IDENT reply: only allow alphanumeric characters in user name
Only alphanumeric characters are allowed in the user name, so ignore
all IDENT replies that would violate this rule and use the one supplied
by the USER command.
2012-06-02 00:24:53 +02:00
Alexander Barton 6680b536c4 USER command: only allow alphanumeric characters in user name
Only alphanumeric characters are allowed in the user name, so terminate
the connection if any "strage" characters have been supplied by the user.

This is how other IRC daemons (like ircd2.11 and ircd-seven) behave ...
2012-06-01 23:57:51 +02:00
Alexander Barton a21a7d8b66 doc/Platforms.txt: add powerpc/apple/darwin7.9.0 2012-05-29 17:21:03 +02:00
Alexander Barton c0d059cd0e Change wording of "TLS initialized" message
Don't use the word "socket" to identify the connection number, but use the
word "connection" like on all the other messages logged.
2012-05-23 17:12:31 +02:00
Alexander Barton 7faa3ed7d6 Pidfile_Create(): Don't leak file descriptor on error path
Detected by cppcheck:
 [src/ngircd/ngircd.c:502]: (error) Resource leak: pidfd
2012-05-22 13:31:08 +02:00
Alexander Barton c9b152fa41 INSTALL: Add "satisfy prerequisites" section
Include information for RedHat/Fedora and Debian/Ubuntu based
Linux distributions.
2012-05-19 00:45:23 +02:00
Alexander Barton ae27571414 NEWS, ChangeLog: fixed some misspellings 2012-05-07 22:38:26 +02:00
Alexander Barton 5e5377a063 Numeric 005 (ISUPPORT), CHANMODES: add missing mode "r" 2012-05-01 13:42:57 +02:00
Alexander Barton 884c5bcff1 doc/Platforms.txt: add "armv7l/unknown/linux-gnueabi" 2012-04-29 22:45:46 +02:00
William Pitcock 3a2fcc32cd Add instructions for setting up Atheme. 2012-04-29 19:48:48 +02:00
Alexander Barton a8aa8c6cbc irc-cap.c: mark arguments of Handle_CAP_ACK() as "unused"
This fixes

 irc-cap.c: In function ‘Handle_CAP_ACK’:
 irc-cap.c:163: warning: unused parameter ‘Client’
 irc-cap.c:163: warning: unused parameter ‘Arg’
2012-04-29 12:39:28 +02:00
Alexander Barton f01b09ce84 irc-login.c, login.c: add missing include of "string.h"
This fixes the following warnings with GCC 4.4.5 on Linux:

 irc-login.c: In function ‘IRC_PASS’:
 irc-login.c:92: warning: implicit declaration of function ‘strlen’
 irc-login.c:92: warning: incompatible implicit declaration of built-in function ‘strlen’
 irc-login.c:113: warning: incompatible implicit declaration of built-in function ‘strlen’
 irc-login.c:129: warning: implicit declaration of function ‘strchr’
 irc-login.c:129: warning: incompatible implicit declaration of built-in function ‘strchr’
 irc-login.c:133: warning: implicit declaration of function ‘strcmp’
 irc-login.c: In function ‘IRC_SERVICE’:
 irc-login.c:556: warning: incompatible implicit declaration of built-in function ‘strchr’
 login.c: In function ‘Login_User’:
 login.c:131: warning: implicit declaration of function ‘strcmp’
2012-04-29 12:36:23 +02:00
Alexander Barton 2419a701d8 doc/Modes.txt: Document missing channel mode "e" 2012-04-29 12:11:50 +02:00
Alexander Barton 110be707c3 Merge branch 'master' of /srv/git/ngircd
* 'master' of /srv/git/ngircd:
  "multi-prefix" capability 2/2: adjust NAME and WHO handlers
  "multi-prefix" capability 1/2: implement complete CAP infrastructure
  IRC_Send_NAMES(): Code cleanup
  New function Client_CapSet() in addition to Client_Cap{Add|Del}
  "CAP REQ" starts capability negotiation and delays user registration
  Xcode: update project file for Xcode 4.3
  Correctly handle "CAP END", new client type CLIENT_WAITCAPEND
  Implement core IRC capability handling and "CAP" command
  New "login" source file
  Introduce_Client() => Client_Introduce(), and move it to client.c
2012-04-28 01:00:34 +02:00
Alexander Barton b2743af0ed contrib/platformtest.sh: support "CC=xxx MAKE=yyy ./platformtest.sh"
Now you can use contrib/platformtest.sh on platforms that require a "special"
make (not "make") or compiler (not cc/gcc) binary.
2012-04-28 00:58:23 +02:00
Alexander Barton 76565022fb Merge branch 'capabilities'
* capabilities:
  "multi-prefix" capability 2/2: adjust NAME and WHO handlers
  "multi-prefix" capability 1/2: implement complete CAP infrastructure
  IRC_Send_NAMES(): Code cleanup
  New function Client_CapSet() in addition to Client_Cap{Add|Del}
  "CAP REQ" starts capability negotiation and delays user registration
  Correctly handle "CAP END", new client type CLIENT_WAITCAPEND
  Implement core IRC capability handling and "CAP" command
  New "login" source file
  Introduce_Client() => Client_Introduce(), and move it to client.c
2012-04-28 00:49:37 +02:00
Alexander Barton 4602cb9891 "multi-prefix" capability 2/2: adjust NAME and WHO handlers
The NAME and WHO commands now return multiple usermode prfixes when
the "multi-prefix" capability is in effect for the requesting client.

See <http://ircv3.atheme.org/extensions/multi-prefix-3.1>
2012-04-28 00:39:21 +02:00
Alexander Barton 1d7e99531a "multi-prefix" capability 1/2: implement complete CAP infrastructure
Now ngIRCd is able to handle "CAP LS", "CAP REQ", "CAP LIST", and
"CAP CLEAR" commands.

"multi-prefix" can be set/unset, but has no functionality - yet!
2012-04-28 00:36:41 +02:00
Alexander Barton f0a9dbe3ad IRC_Send_NAMES(): Code cleanup 2012-04-28 00:20:42 +02:00
Alexander Barton 245782897b New function Client_CapSet() in addition to Client_Cap{Add|Del} 2012-04-27 23:56:56 +02:00
Alexander Barton 2327b17656 "CAP REQ" starts capability negotiation and delays user registration
New helper function Set_CAP_Negotiation().
2012-04-27 22:47:22 +02:00
Alexander Barton 359732af85 Xcode: update project file for Xcode 4.3
(No changes needed)
2012-04-27 15:52:09 +02:00
Alexander Barton 1dea0d91a0 platformtest.sh: Detect Open64 C compiler 2012-04-24 12:10:35 +02:00