about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)Author
2024-01-16Spelling fixes, mostly in file commentsAlexander Barton
2024-01-16Do IDENT requests even when DNS lookups are disabledAlexander Barton
Without this patch, disabling DNS in the configuration disabled IDENT lookups as well (for no good reason). This patch allows enabling/disabling DNS lookups and IDENT requests completely separately and enhances the messages sent to the client when "NoticeBeforeRegistration" is enabled, too. Thanks for reporting this, Miniontoby! Closes #291.
2024-01-11Channel Admins are not allowed to set Channel Owner status!Alexander Barton
This was reported back in April 2021, thanks Sarah! Subject: NGIRCD bug report Date: April 28 2021, 14:30:08 MESZ To: alex@barton.de Hello, I am writing to you to report a bug in ngircd. In any give channel, if an user is with mode +a (admin), he/she can sets mode +/-q(owner) to any other user. This is not inline with the documentation. I've looked into the code irc-mode.c, apparently an if block is missing. Below are the code snippets that I believe fixes the bug. This patch is what Sarah sent in. Thanks a lot!
2024-01-11Test suite: Update for OpenSSL 3.xAlexander Barton
2024-01-11Allow SSL client-only configurations without keys/certificatesAlexander Barton
You don't need to configure certificates/keys as long as you don't configure SSL-enabled listening ports. This can make sense when you want to only link your local daemon to an uplink server using SSL and only have clients on your local host or in you fully trusted network, where SSL is not required.
2024-01-112024 =:)Alexander Barton
2024-01-06Fix showing the "Ident" option in --configtest outputAlexander Barton
We tested for the wrong #define ... ooops!
2024-01-06Change GnuTLS "slot handling" messages to debug levelAlexander Barton
Those messages are about an internal implementation detail, not relevant for an administrator of ngIRCd.
2024-01-06Enlarge buffer for log messagesAlexander Barton
For example, SSL/TLS certificate information can easily get longer than 256 characters. So enlarge the log buffer to 1 KB.
2024-01-06Respect "SSLConnect" option for incoming connectionsAlexander Barton
Don't accept incoming plain-text ("non SSL") server connections for servers configured with "SSLConnect" enabled. If "SSLConnect" is not set for an incoming connection the server still accepts both plain-text and encrypted connections. This change prevents an authenticated client-server being able to force the server-server to send its password on a plain-text connection when SSL/TLS was intended.
2024-01-06Always initiate closing a connection on errors.Alexander Barton
Always try to close a connection with errors immediately, but try hard to avoid too much recursion. Without this patch, an outgoing server connection could get stuck in an "endless" state trying to write out data over and over again. This tries to fix 04de1423eb26.
2023-09-17Return ERR_NOTEXTTOSEND on empty PRIVMSG contentValentin Lorentz
They are dropped further down the line anyway; and sending ERR_NOTEXTTOSEND early matches other servers' behavior.
2023-09-17Merge branch 'katp32/master'Alexander Barton
Thanks Katherine Peeters for the patch and pull request! Closes #294. * katp32/master: Improve documentation for --syslog Added command line flag to enable syslog Split NoSyslog from behaviour of NoDaemon
2023-09-17Conf_Test(): Use yesno_to_str() instead of individual tests and outputAlexander Barton
2023-09-17Channel autojoin: Add missing variable in --configtest outputAlexander Barton
2023-09-17Silence compiler warning in Init_New_Client()Alexander Barton
Use strdup() instead of pointless strndup() to fix the following compiler warning: client.c: In function ‘Init_New_Client’: client.c:216:32: warning: ‘strndup’ specified bound 127 exceeds source size 5 [-Wstringop-overread] 216 | client->away = strndup(DEFAULT_AWAY_MSG, CLIENT_AWAY_LEN - 1); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2023-09-17Various fixes and enhancements for the "Autojoin" patchAlexander Barton
- Bring sample-ngircd.conf and ngircd.conf.5 description in line. - Fix configuration parsing, it always showed the 'Unknown variable "Autojoin"' error message, even when everything was perfectly fine. - And fix a build error (at least on macOS with Apple Clang 14): login.c:234:3: error: call to undeclared function 'IRC_JOIN'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] IRC_JOIN(Client, &Req); ^ The #include for the "irc.channel.h" header was missing! - Remove a unused variable that caused a compiler warning: login.c:222:12: warning: unused variable 'n' [-Wunused-variable] size_t i, n, channel_count = array_length(&Conf_Channels, sizeof(*conf_chan)); ^ - Add a explicit cast to fix a compiler warning: login.c:235:15: warning: assigning to 'char *' from 'const char[51]' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers] Req.argv[0] = conf_chan->name; ^ ~~~~~~~~~~~~~~~
2023-09-16Channel autojoin functionalityIvan Agarkov
2023-08-032023!Alexander Barton
2023-08-03Hide +i users on "WHOIS <pattern>"Alexander Barton
Let's behave like most(?) other IRC daemons (at least ircd2.11) and hide all +i users when WHOIS is used with a pattern. Otherwise privacy of this users is not guaranteed and the +i mode a bit useless ... Reported by Cahata on #ngircd, thanks!
2023-07-18Update the final "closing connection" messageAlexander Barton
Add some more information (nick name, user name, host name) and bring it in line with some other implementations (at least ircd2.11 and Hybrid).
2023-07-18Fix RPL_INVITING message: It must originate from the serverAlexander Barton
All numeric replies must originate from an IRC server, never from a client. So fix the RPL_INVITING message! Thanks tommyrot for reporting this! Closes #307.
2023-07-05Enhance log messages for refused connectionsAlexander Barton
2023-01-02Add "+DEBUG" to the version string only when configured with --enable-debugAlexander Barton
The debug log messages are always available and a runtime option (since commit c7de505c), but the assert()'s are only active when ngIRCd was configured with the "--enable-debug" option. So only add "+DEBUG" to the version string when the latter is the case.
2023-01-02Make the debug loglevel always availablemichi
This basically means to unifdef DEBUG in (almost) all places. We keep it in src/portab/portab.h so DEBUG stays available to enable assert(). Also add a comment about this.
2023-01-02Better validate MODE +k & +l parameters and return errorsAlexander Barton
Implement new numeric ERR_INVALIDMODEPARAM_MSG(696) and: - Reject channel keys with spaces and return ERR_INVALIDMODEPARAM_MSG; This was possible until now and resulted in garbled IRC commands later. - Reject empty channel keys and return ERR_INVALIDMODEPARAM_MSG; This was possible until now and resulted in garbled IRC commands later. - Return ERR_INVALIDMODEPARAM_MSG when user limit is out of bounds; This was silently ignored until now. Closes #290. Thanks Val Lorentz for reporting it!
2023-01-02Channel modes +k & +l: Always report an error when a parameter is missingAlexander Barton
This relates to #290 and considerations which errors to show when: and I think it is the better approach to give feedback instead of silently failing. Note that this code path is also used when handling modes of channels defined in "[Channel]" blocks in configuration files: in this case the client is the local server and we can't send messages to it, because it has no socket connection! Therefore we need those "is_machine" checks and log an error im this case.
2023-01-02Refactor Channel_Mode(), get rid of some nestingAlexander Barton
No functional changes.
2023-01-02Allow ircops to use WHO on any channel.michi
2022-12-27Refactor join_send_topic() into IRC_Send_Channel_Info() and use it for JOIN ↵Alexander Barton
and NJOIN handlers This reduces code duplication and brings the order of messages on JOIN and NJOIN in line. Fixes #288.
2022-12-26Send NAMES list and channel topic to NJOIN'ed usersewired
Send the NAMES list and channel topic to users "forcefully" joined to a channel using NJOIN, like they joined on their own using JOIN. Closes #288.
2022-12-26Channel mode setting: The local server is allowed to work on local channelsAlexander Barton
Don't forbid the local server to change modes on local channels: this happens when overriding modes on local (&) channels in the server configuration file, for example, and is perfectly fine. Without this patch, the server worked as expected but showed critical error messages for each local channel in its configuration file: "Got remote MODE command for local channel!? Ignored."
2022-12-25Spelling fixes, mostly in file commentsAlexander Barton
2022-12-17Use "||" instead of "|"hello-smile6
2022-12-17Fix gline/kline with cloaked hostnames9pfs
2022-12-17Convert uses of Log(LOG_DEBUG, ...) to LogDebug()Jules Maselbas
2022-11-01Improve documentation for --syslogKatherine Peeters
2022-11-01fix typo in conn.csalaaad2
2022-10-29Added command line flag to enable syslogKatherine Peeters
This allows -y / --syslog to be used to override -n / --nodaemon disabling it
2022-10-29Split NoSyslog from behaviour of NoDaemonKatherine Peeters
Allows syslog to be enabled/disabled seperately from daemonization
2022-01-012022 =:)Alexander Barton
Happy new year!
2021-12-30Fix a possible race condition in Client_Introduce()Alexander Barton
Conf_GetServer() can return NULL when the server introducing the client had a write error for example, and is being disconnected. So make sure that we have a valid server before calling Conf_NickIsService()!
2021-01-012021! :-)Alexander Barton
Happy new year!
2020-12-29Explicitely cast Conf_MaxPenaltyTime (time_t) to "long"Alexander Barton
This fixes the following compiler warning, for example on OpenBSD: conf.c: In function 'Conf_Test': conf.c:391: warning: format '%ld' expects type 'long int', but argument 2 has type 'time_t' Thanks to Götz Hoffart for reporting this!
2020-12-29Don't set AI_ADDRCONFIG, even when it existsAlexander Barton
Basically, the issue described in #281 is that the test suite uses the IPv4 address 127.0.0.1 on an IPv6-only host. But this is the "safest" thing to do in (almost) all other setups: relaying on DNS host names makes things even more complex, as different systems map 127.0.0.1 differently (including the reverse lookup; that's why we switched to 127.0.0.1 back in 2014, see commit 3f807e10457). But with AI_ADDRCONFIG set, on an IPv6-only host, we prevent 127.0.0.1 to get translated properly, even when the loopback interface has this address configured! So don't set it any more. The drawback is that the resolver possibly returns more addresses now, even of an unsupported/not connected address family; but this shouldn't do much harm in practice, as ngIRCd iterates over all returned addresses while trying to establish an outgoing connection. Closes #281.
2020-11-02Fix typo in comment: operaor -> operatorRolf Eike Beer
2020-11-02Revert "Show allowed channel types in ISUPPORT(005) numeric only"Alexander Barton
The ISUPPORT(005) numeric lists only channel prefixes which are listed in the "AllowedChannelTypes" configuration option. And if this is the empty string ("") for example, this now results in IRC clients assuming "oh, no channel prefix characters at all, so no channels at all, so no PRIVMSG can go to any channel" -- which is not the case when there are pre-defined channel set up or other servers still having channels! So "allowed channel types" != "supported channel types", and we always have to list all supported ones in the ISUPPORT(005) numeric! This reverts commit 4b7e8db418340576c95f1edad8470b66d6fe886d. Closes #285.
2020-11-01Test suite: Wait 2 seconds after reloading the daemonAlexander Barton
On reload, all listening ports are closed, configuration updated, and then opened again. Which leads to subsequent tests running while the daemon isn't listening on any ports, and that's why the tests fail. The "proper" way whould be to loop and check for open ports, but waiting is what the start-server.sh script does right now, so stick with this in reload-server.sh for now as well. This fixes the issue, at least on my RaspberryPi ... Closes #280.
2020-06-11Don't send invalid CHANINFO commands when no key is setAlexander Barton
It can happen that a channel is +k, but no key is set: for example by misconfiguring a pre-defined channel. In this case, ngIRCd sent an invalud CHANINFO command ("CHANINFO #test +Pk 0 :'", note the unset key represented by the two spaces) to its peers. Fix this and enhance the CHANINFO documentation.
2020-05-26IRC_SQUIT(): Fix use-after-free when unregistering the sending clientAlexander Barton