Alexander Barton [Thu, 26 Sep 2013 00:26:24 +0000 (02:26 +0200)]
Adjust log messages for invalid and spoofed prefixes
Now invalid prefixes aren't logged no more when originating from an other
server (besides in debug mode), and spoofed prefixes are correctly logged
using LOG_WARNING (from an other server) or LOG_ERR (from a client) levels.
In addition, the log message texts have been adjusted to better reflect
what will happen: commands with invalid prefixes are ignored and logged,
commands with spoofed prefixes will result in the client being disconncted
(regular users) or the command being ignored (other servers).
This cleans up logging of commands related to already KILL'ed clients.
Alexander Barton [Tue, 24 Sep 2013 23:29:23 +0000 (01:29 +0200)]
Remove CLIENT.oper_by_my, Client_SetOperByMe() and Client_OperByMe()
All places where Client_OperByMe() is used can either be converted to
Client_HasMode(Client, 'o') or Op_Check().
And Op_Check() itself can use the connection handle for deciding whether
the IRC Operator is a local user or not.
Federico G. Schwindt [Wed, 18 Sep 2013 22:51:44 +0000 (23:51 +0100)]
Add support to show user links using "STATS L"
Change "stats L" to show servers and user links and restrict it to
IRC Operators.
Alexander Barton [Mon, 23 Sep 2013 22:04:54 +0000 (00:04 +0200)]
Log an error (not info) when working directory can't be changed
Alexander Barton [Wed, 18 Sep 2013 22:17:36 +0000 (00:17 +0200)]
doc/PAM.txt: add a slightly more useful example
Federico G. Schwindt [Tue, 17 Sep 2013 16:33:12 +0000 (17:33 +0100)]
Change the certificate fingerprint digest to sha256
While here correct some indentation.
Federico G. Schwindt [Tue, 17 Sep 2013 15:16:51 +0000 (16:16 +0100)]
Change cipher defaults
Switch cipher defaults to HIGH:!aNULL:@STRENGTH (OpenSSL) or
SECURE128 (GnuTLS).
Alexander Barton [Mon, 16 Sep 2013 15:32:25 +0000 (17:32 +0200)]
Merge remote-tracking branch 'alex/bug162-SSLCipherList'
* alex/bug162-SSLCipherList:
Cipher list selection for GnuTLS
ConnSSL_Init_SSL(): correctly set CONN_SSL flag
Cipher list selection for OpenSSL
ConnSSL_InitLibrary(): Code cleanup
Federico G. Schwindt [Mon, 16 Sep 2013 01:15:49 +0000 (02:15 +0100)]
Fix server reconnection
In some error cases conn_id will be left as SERVER_WAIT and
subsequently ignored in Check_Servers(). Ensure conn_id is set to
NONE before returning from New_Server() if we couldn't establish
the connection.
Prompted by a report from gabrielgi-at-gmail-dot-com.
Alexander Barton [Sun, 15 Sep 2013 22:31:03 +0000 (00:31 +0200)]
Don't ignore SSL-related errors during startup
Without this patch, ngIRCd ignores SSL-related messages and continues
to start up but only listens on plain text communication ports -- and
this most probably isn't what the administrator wanted ...
Closes bug #163.
Alexander Barton [Sun, 15 Sep 2013 15:57:41 +0000 (17:57 +0200)]
Cipher list selection for GnuTLS
This patch implements the missing functionality for cipher list selection
using GnuTLS (our OpenSSL code has this already).
Alexander Barton [Sun, 15 Sep 2013 15:35:52 +0000 (17:35 +0200)]
ConnSSL_Init_SSL(): correctly set CONN_SSL flag
The CONN_SSL flag must be set before any calls to ConnSSL_Free()!
Alexander Barton [Sun, 15 Sep 2013 13:09:36 +0000 (15:09 +0200)]
Cipher list selection for OpenSSL
This patch introduces the possibility to arbitrarily select ciphers which
should be promoted resp. declined when establishing a SSL connection
with a client by implementing the new configuration option "CipherList".
By default, OpenSSL would accept low and medium strength and RC-4 ciphers,
which nowadays are known to be broken.
This patch only implements the feature for OpenSSL. A GnuTLS counterpart
has to be implemented in another patch ...
Original patch by Bastian <bastian-ngircd@t6l.de>.
Closes bug #162.
Alexander Barton [Sun, 15 Sep 2013 12:09:31 +0000 (14:09 +0200)]
ConnSSL_InitLibrary(): Code cleanup
Alexander Barton [Fri, 6 Sep 2013 22:18:00 +0000 (00:18 +0200)]
TRACE: fix error message when there are too many parameters
ircd 2.11 ignores additional parameters silently, but I don't think
that this is the correct behaviour either ...
Alexander Barton [Fri, 6 Sep 2013 22:05:49 +0000 (00:05 +0200)]
IRC_SetPenalty(): Code cleanup
Federico G. Schwindt [Thu, 5 Sep 2013 16:11:38 +0000 (17:11 +0100)]
Add more penalty times
Ensure before every numeric 461 there is a call to IRC_SetPenalty().
Federico G. Schwindt [Thu, 5 Sep 2013 16:01:49 +0000 (17:01 +0100)]
Rework check for number of parameters
Move most of the checks that return numeric 461 into Handle_Request().
Federico G. Schwindt [Thu, 5 Sep 2013 12:45:14 +0000 (13:45 +0100)]
Reorder checks
Move oper and Conf_MorePrivacy checks after checking the number of
parameters.
Federico G. Schwindt [Thu, 5 Sep 2013 12:07:19 +0000 (13:07 +0100)]
Move the IRC_SetPenalty() call after the asserts
Federico G. Schwindt [Thu, 5 Sep 2013 09:46:13 +0000 (10:46 +0100)]
Correct numeric returned by whois
As per RFC whois should return 431 if no nick is provided. While
here convert upper check to use irc-macros. As a bonus we get to set
the penalty for free.
Federico G. Schwindt [Thu, 5 Sep 2013 09:40:39 +0000 (10:40 +0100)]
Minor cosmetic change
Add a define to indicate any client. While I'm here use hex values
instead of decimal, it's somewhat clearer that they could be OR'ed
together.
Alexander Barton [Wed, 4 Sep 2013 22:18:49 +0000 (00:18 +0200)]
Commands.txt: Document proprietary DIE <message> parameter
Alexander Barton [Tue, 3 Sep 2013 19:33:22 +0000 (21:33 +0200)]
getpid.sh: use /bin/pidof when available
Alexander Barton [Tue, 3 Sep 2013 15:13:46 +0000 (17:13 +0200)]
Don't enforce channel types for other servers
The configuration option "AllowedChannelTypes" must only be enforced for
regular clients and not for remote servers. Channels created by other
servres are always allowed, because they already exist and the daemon
must stay in sync with the network.
Alexander Barton [Mon, 2 Sep 2013 14:37:50 +0000 (16:37 +0200)]
Only log "IDENT ... no result" when IDENT was looked up
Without this patch, ngIRCd logged the "IDENT lookup for connection X:
no result"-message even when IDENT lookups have been disabled using the
"Ident = no" configuration option, which is a little bit misleading.
Reported by "btwe" in #ngircd.
Florian Westphal [Sat, 31 Aug 2013 20:42:56 +0000 (22:42 +0200)]
ngircd: use setgid/setuid errno value in error path
Need to use saved errno value as strerror argument, else you
get bogus output ('success') in the log message.
Alexander Barton [Sat, 31 Aug 2013 12:15:09 +0000 (14:15 +0200)]
Show connection flag "s" (SSL) in RPL_TRACE{LINK|SERVER}
Now you can check if a server-to-server link is SSL-encrypted or not
using the IRC "TRACE" command.
Idea by Götz Hoffart, thanks!
Federico G. Schwindt [Mon, 26 Aug 2013 21:52:23 +0000 (22:52 +0100)]
Change away to be allocated dynamically
Alexander Barton [Mon, 26 Aug 2013 22:39:59 +0000 (00:39 +0200)]
Ignore "operation not permitted" while dropping groups
Without this exception, you can't start ngIRCd as user any more,
it is analog to setting the user and group ID.
Florian Westphal [Mon, 26 Aug 2013 22:19:31 +0000 (00:19 +0200)]
ngircd: discard supplementary group ids on startup
The intention was to switch to JUST uid:gid, but setgid is not
sufficient.
Reported-by: Michael Scherer <misc@zarb.org>
Alexander Barton [Mon, 26 Aug 2013 21:23:12 +0000 (23:23 +0200)]
Xcode: update project settings for Xcode 5
Alexander Barton [Mon, 26 Aug 2013 21:22:20 +0000 (23:22 +0200)]
Merge branch 'bug159-WebircIPA'
* bug159-WebircIPA:
Introduce Free_Client() function to free CLIENT structure
Save client IP address text for "WebIRC" users
Alexander Barton [Mon, 26 Aug 2013 20:55:00 +0000 (22:55 +0200)]
Introduce Free_Client() function to free CLIENT structure
Alexander Barton [Mon, 26 Aug 2013 20:54:00 +0000 (22:54 +0200)]
Save client IP address text for "WebIRC" users
This patch introduces a new field in the CLIENT structure, "ipa_text",
which points to an optional textual representation of the client IP
address (or NULL) which can be used to store the "real" IP address
information of a client using the "WEBIRC" protocol.
Without this patch, ngIRCd ignored the <ip-address> paramater ...
In addition, the functions Client_SetIPAText() and Client_IPAText()
have been introduced to set and get the textual representation of the
client IP address.
Client_IPAText() can be used even when no "IP address text" has been
set before, it then returns the real IP address of the connection.
Closes bug #159.
Alexander Barton [Mon, 26 Aug 2013 19:17:10 +0000 (21:17 +0200)]
Implement new configuration option "DefaultUserModes"
The new configuration option "DefaultUserModes" lists user modes that
become automatically set on new local clients right after login.
Please note that only modes can be set that the client could set on
itself, you can't set "a" (away) or "o" (IRC Op), for example! User
modes "i" (invisible) or "x" (cloaked) etc. are "interesting", though.
Default: set no modes (like without this patch).
Closes bug #160.
Federico G. Schwindt [Mon, 26 Aug 2013 11:18:46 +0000 (12:18 +0100)]
Change strdup() to strndup()
Federico G. Schwindt [Mon, 26 Aug 2013 09:47:04 +0000 (10:47 +0100)]
private strndup() implementation in case libc does not provide it
Federico G. Schwindt [Sun, 25 Aug 2013 04:26:08 +0000 (05:26 +0100)]
Cosmetic changes to METADATA
Update certfp and sort entries.
Federico G. Schwindt [Sat, 24 Aug 2013 23:07:06 +0000 (00:07 +0100)]
Silence warning
Cast the result of the operation to long, not the time(NULL) call.
On systems where sizeof(time_t) is other than long this will produce
a warning.
Federico G. Schwindt [Fri, 23 Aug 2013 10:43:28 +0000 (11:43 +0100)]
Plug memory leak
Federico G. Schwindt [Thu, 22 Aug 2013 13:40:30 +0000 (14:40 +0100)]
Implement account login support
This is done via the `accountname' METADATA command and used to
automatically identify users after netsplits or across service
restarts.
Federico G. Schwindt [Thu, 22 Aug 2013 09:58:36 +0000 (10:58 +0100)]
Fix spelling
Alexander Barton [Fri, 23 Aug 2013 19:54:40 +0000 (21:54 +0200)]
ngIRCd Release 20.3
(cherry picked from commit
bb6e2779636aa6d74bbff474880829f0183a3c94)
Conflicts:
ChangeLog
NEWS
Alexander Barton [Tue, 20 Aug 2013 23:28:49 +0000 (01:28 +0200)]
Correctly handle return code of Handle_Write()
There have been code paths that ignored the return code of Handle_Write()
when sending "notice auth" messages to new clients connecting to the
server. But because Handle_Write() would have closed the client connection
again if an error occurred, this would have resulted in new errors and
assert()'s later on that could have crashed the server (denial of service).
Only setups having the configuration option "NoticeAuth" enabled are
affected, which is not the default.
CVE-2013-5580.
Alexander Barton [Tue, 20 Aug 2013 23:15:19 +0000 (01:15 +0200)]
Enhance log messages on "recursive" connection errors
Alexander Barton [Tue, 20 Aug 2013 22:22:55 +0000 (00:22 +0200)]
Add some assert() calls to ng_ipaddr library
Alexander Barton [Tue, 20 Aug 2013 11:08:43 +0000 (13:08 +0200)]
Update ChangeLog file
Alexander Barton [Mon, 19 Aug 2013 21:31:10 +0000 (23:31 +0200)]
Debian init script: test for binary after reading defaults
This allows the system administrator to overwrite the DAEMON variable in
/etc/defaults/<name> and to use this init script even when the default
"/usr/sbin/ngircd" doesn't exist on the system.
Alexander Barton [Sat, 17 Aug 2013 20:05:59 +0000 (22:05 +0200)]
Merge branch 'ssl-log-messages'
* ssl-log-messages:
Make SSL-related log messages more readable
ConnSSL_HandleError: Code cleanup, more documentation
Alexander Barton [Wed, 14 Aug 2013 08:56:09 +0000 (10:56 +0200)]
Make SSL-related log messages more readable
- Don't use internal function names but describe the error.
- Streamline wording, use "SSL" for SSL and TLS.
- Streamline punctuation.
Federico G. Schwindt [Tue, 13 Aug 2013 17:06:34 +0000 (18:06 +0100)]
Use _IRC_ARGC_BETWEEN_OR_RETURN_ when possible
Alexander Barton [Mon, 12 Aug 2013 21:12:37 +0000 (23:12 +0200)]
ConnSSL_HandleError: Code cleanup, more documentation
Alexander Barton [Sun, 11 Aug 2013 22:02:40 +0000 (00:02 +0200)]
Change log level of "SSL connection shutting down"
Federico G. Schwindt [Sun, 11 Aug 2013 19:57:11 +0000 (20:57 +0100)]
Fix 2 bugs introduced in
74514b8c23
Channel_Modes() and Channel_Topic() return static memory that is zeroed at
creation time. Fix checking for empty modes and topic so they're propagated
correctly.
Alexander Barton [Sun, 11 Aug 2013 09:38:10 +0000 (11:38 +0200)]
configure: Don't quote IO backend type(s)
It's not needed and inconsistent compared to the other settings.
Reported by "allerbest" (Götz Hoffart) on #ngircd, thanks!
Alexander Barton [Tue, 6 Aug 2013 22:13:08 +0000 (00:13 +0200)]
IRC_SERVER(): Code cleanup
Alexander Barton [Tue, 6 Aug 2013 21:37:21 +0000 (23:37 +0200)]
Introduce new function IRC_WriteErrClient()
This function is used to send "error messages", including numerics,
back to clients and to automatically enforce a 2 second penalty. With
this patch, all error results enforces a delay for the client.
All callers of IRC_WriteStrClient(ERR_xxx) have been converted.
Please note that this patch prolongs the time "make check" needs
to complete its tests, because of lots of new enforced penalties ...
Alexander Barton [Tue, 6 Aug 2013 21:36:10 +0000 (23:36 +0200)]
irc-macros.h: Update copyright, don't forget contributors!
Alexander Barton [Tue, 6 Aug 2013 21:21:48 +0000 (23:21 +0200)]
irc-write.c: Clean up code and add more documentation comments
Alexander Barton [Tue, 6 Aug 2013 21:16:35 +0000 (23:16 +0200)]
Fix return code of some IRC_WriteXXX() functions
These functions usually write to more than one target, and therefore
can't return value indicating success or failure in a sane way. And, even
more omportant, these functions should send to as much as possible clients
and not stop at the first client which isn't reachable any more!
Alexander Barton [Tue, 6 Aug 2013 19:34:32 +0000 (21:34 +0200)]
Streamline punctuation of log messages
See commit
d38d153f for details.
Alexander Barton [Tue, 6 Aug 2013 19:14:56 +0000 (21:14 +0200)]
Update NEWS and ChangeLog files
Federico G. Schwindt [Mon, 5 Aug 2013 10:06:52 +0000 (11:06 +0100)]
More spelling corrections
Federico G. Schwindt [Mon, 5 Aug 2013 10:05:12 +0000 (11:05 +0100)]
Inline who_flags_status
Federico G. Schwindt [Sun, 4 Aug 2013 20:16:03 +0000 (21:16 +0100)]
Convert more code to use Channel_HasMode
Federico G. Schwindt [Sun, 4 Aug 2013 17:28:04 +0000 (18:28 +0100)]
Simplify mode checking on channels and users within a channel
Add Channel_HasMode() and Channel_UserHasMode() and use it where
possible.
Federico G. Schwindt [Sun, 4 Aug 2013 16:25:24 +0000 (17:25 +0100)]
Use Client_HasMode and Client_HasFlag where appropriate
Alexander Barton [Sun, 4 Aug 2013 12:11:12 +0000 (14:11 +0200)]
Merge branch 'bug152-AllowedChannelTypes'
* bug152-AllowedChannelTypes:
Implement new configuration option "AllowedChannelTypes"
Introduce "CHANTYPES" #define
Alexander Barton [Sun, 4 Aug 2013 01:06:53 +0000 (03:06 +0200)]
Implement new configuration option "AllowedChannelTypes"
The new configuration variable "AllowedChannelTypes" lists all allowed
channel types (channel prefixes) for newly created channels on the local
server. By default, all supported channel types are allowed.
If set to the empty string, local clients can't create new channels at
all, which equals the old "PredefChannelsOnly = yes" setting.
This patch deprecates the "PredefChannelsOnly" variable, too, but it is
still supported and translated to the apropriate "AllowedChannelTypes"
setting. When "PredefChannelsOnly" is processed, a warning message is
logged.
Closes bug #152.
Federico G. Schwindt [Sun, 4 Aug 2013 11:33:10 +0000 (12:33 +0100)]
More spelling fixes
Remove superflous comments, mostly in German. Fix spelling and
use american variants for consistency.
Federico G. Schwindt [Sun, 4 Aug 2013 09:15:11 +0000 (10:15 +0100)]
Change cloaked hostname to be malloc'd on demand
This shaves a few bytes when cloaked hostnames are not used and
restricts the cloakhost announcement iif there is something to
send.
Federico G. Schwindt [Sun, 4 Aug 2013 02:20:13 +0000 (03:20 +0100)]
Add Client_HasFlag() to check if a client has certain flag
Federico G. Schwindt [Sun, 4 Aug 2013 02:15:27 +0000 (03:15 +0100)]
Fix spelling
Federico G. Schwindt [Sun, 4 Aug 2013 02:14:27 +0000 (03:14 +0100)]
Rename XXX_Fingerprint to XXX_CertFp
Federico G. Schwindt [Sat, 3 Aug 2013 23:22:38 +0000 (00:22 +0100)]
Improved client announcement
Move Announce_User() to client.c and rename it to Client_Announce().
Use this in cb_introduceClient() instead of duplicating the code.
This fix the certificate fingerprint announcement for new clients.
Also ensure the certificate fingerprint is only announced if the
client supports it (`M' flag).
Alexander Barton [Sat, 3 Aug 2013 22:34:48 +0000 (00:34 +0200)]
Introduce "CHANTYPES" #define
This #define lists all the prefix characters of all supported channel
types, this is "#&+" at the moment.
Alexander Barton [Fri, 2 Aug 2013 22:29:12 +0000 (00:29 +0200)]
Merge remote-tracking branch 'fgsch/certfp'
* fgsch/certfp:
Simplify MOTD handling
Add certificate fingerprint support
Federico G. Schwindt [Fri, 2 Aug 2013 15:43:01 +0000 (16:43 +0100)]
Simplify MOTD handling
Merge Show_MOTD_Start, Show_MOTD_Sendline and Show_MOTD_End into
IRC_Show_MOTD.
Federico G. Schwindt [Fri, 2 Aug 2013 00:47:06 +0000 (01:47 +0100)]
Add certificate fingerprint support
Alexander Barton [Fri, 2 Aug 2013 22:00:47 +0000 (00:00 +0200)]
Update irc-server.c to use irc-macros.h
And add some comments :-)
Alexander Barton [Fri, 2 Aug 2013 21:59:32 +0000 (23:59 +0200)]
Commands.txt: Update more descriptions
Update description of "CHANINFO", "METADATA", "NJOIN", "SERVER", "SQUIT",
"GET", and "POST".
Alexander Barton [Fri, 2 Aug 2013 21:27:11 +0000 (23:27 +0200)]
Update irc-oper.c to use irc-macros.h
Alexander Barton [Fri, 2 Aug 2013 21:25:23 +0000 (23:25 +0200)]
Commands.txt: Update more descriptions
Update description of "CONNECT", "DIE", "DISCONNECT", "GLINE", "KILL",
"KLINE", "OPER", "REHASH", "RESTART" and "WALLOPS".
Alexander Barton [Fri, 2 Aug 2013 00:16:21 +0000 (02:16 +0200)]
Commands.txt: Fix <target> description of TRACE command
Alexander Barton [Thu, 1 Aug 2013 23:48:13 +0000 (01:48 +0200)]
Update irc-mode.c to use irc-macros.h
This includes code cleanups and more comments, too.
Alexander Barton [Thu, 1 Aug 2013 23:46:57 +0000 (01:46 +0200)]
Update irc-channel.c to use irc-macros.h
This includes code cleanups, too :-)
Alexander Barton [Thu, 1 Aug 2013 23:45:02 +0000 (01:45 +0200)]
Commands.txt: Update more descriptions
Update descriptions of "AWAY", "JOIN", "LIST", "MODE", "PART",
"TOPC", and "TRACE".
Alexander Barton [Thu, 1 Aug 2013 23:42:31 +0000 (01:42 +0200)]
Commands.txt: Streamline references to IRC+ protocol
Alexander Barton [Wed, 31 Jul 2013 22:24:10 +0000 (00:24 +0200)]
Show IRC Operator name when logging a successful OPER command
Alexander Barton [Tue, 30 Jul 2013 20:08:04 +0000 (22:08 +0200)]
Add penalty times in error paths of generic IRC helper macros
Add a 2 second penalty time when the number of parameters is invalid.
Alexander Barton [Tue, 30 Jul 2013 20:05:00 +0000 (22:05 +0200)]
Add more penalty times in error paths
This patch changes the handlers of the "PASS", "NICK", "USER",
and "SERVICE" commands to enforce a 2 second penalty when an error
like "need more/other parameters" occurs.
More functions should follow, I think ...
Alexander Barton [Tue, 30 Jul 2013 19:18:42 +0000 (21:18 +0200)]
Update irc-login.c to use irc-macros.h
This includes code cleanups, too :-)
Alexander Barton [Tue, 30 Jul 2013 19:12:24 +0000 (21:12 +0200)]
Commands.txt: Update more descriptions
Update descriptions of "NICK", "PASS", "PING", "PONG", "QUIT", "USER",
"WEBIRC", "SERVICE", and "SVSNICK".
Alexander Barton [Fri, 19 Jul 2013 16:16:12 +0000 (18:16 +0200)]
Commands.txt: Update description of "PRIVMSG", "NOTICE", and "SQUERY"
Alexander Barton [Thu, 18 Jul 2013 21:43:12 +0000 (23:43 +0200)]
Add "compile" to .gitignore file
Alexander Barton [Thu, 18 Jul 2013 21:42:00 +0000 (23:42 +0200)]
Commands.txt: Update description of the "ERROR" command
Alexander Barton [Thu, 18 Jul 2013 21:35:33 +0000 (23:35 +0200)]
Update irc.c to use irc-macros.h
This includes code cleanups and better documentation for some
functions, too.
Alexander Barton [Thu, 18 Jul 2013 20:38:19 +0000 (13:38 -0700)]
Merge pull request #4 from fgsch/master
Changes for ngircd 21.
Federico G. Schwindt [Thu, 18 Jul 2013 18:52:17 +0000 (19:52 +0100)]
Handle services in IRC_WHOIS_SendReply()
If the target is a service, advertise it as such and ignore operator mode.