1
0
mirror of https://github.com/osmarks/ngircd.git synced 2024-12-12 01:40:27 +00:00
Commit Graph

3615 Commits

Author SHA1 Message Date
Alexander Barton
843cbfc0f3 Always initiate closing a connection on errors.
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 04de1423eb.
2024-01-06 16:21:01 +01:00
Alexander Barton
9540d0c0a4 Add "hopm.service" to "Wants" and "Before" dependencies in systemd unit file 2023-10-17 16:15:38 +02:00
Alexander Barton
f31d64eb1c Update Debian package configuration
This not only bumps the "compat" version, but updates the package
dependencies and build rules accordingly.

Closes #299.
2023-09-17 23:42:08 +02:00
Alexander Barton
4a548e1220 Update config.guess and config.sub to recent versions
- config.guess: 2022-01-09
- config.sub: 2022-01-03
2023-09-17 23:39:05 +02:00
Valentin Lorentz
0714466af8 Return ERR_NOTEXTTOSEND on empty PRIVMSG content
They are dropped further down the line anyway; and sending ERR_NOTEXTTOSEND
early matches other servers' behavior.
2023-09-17 22:25:40 +02:00
Alexander Barton
445e559dbd Update and enhance the manual pages a bit 2023-09-17 22:03:12 +02:00
Alexander Barton
8fdb8f90b1 Merge branch 'katp32/master'
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-17 21:37:45 +02:00
Alexander Barton
a106d18d7d Conf_Test(): Use yesno_to_str() instead of individual tests and output 2023-09-17 20:28:52 +02:00
Alexander Barton
a7f448e713 Channel autojoin: Add missing variable in --configtest output 2023-09-17 20:27:14 +02:00
Alexander Barton
232c7382de Silence compiler warning in Init_New_Client()
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-17 20:16:35 +02:00
Alexander Barton
30ba325dde Various fixes and enhancements for the "Autojoin" patch
- 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-17 19:56:07 +02:00
Ivan Agarkov
cfd7d4288e Channel autojoin functionality 2023-09-16 12:40:33 +02:00
Alexander Barton
3b70f4ba0c 2023! 2023-08-03 14:22:53 +02:00
Alexander Barton
335ae4f0d0 Hide +i users on "WHOIS <pattern>"
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-08-03 10:57:27 +02:00
Alexander Barton
63ad3b9acd Update the final "closing connection" message
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-18 11:45:01 +02:00
Alexander Barton
0035e0d778 Fix RPL_INVITING message: It must originate from the server
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-18 11:42:07 +02:00
Alexander Barton
0f90a059b6 Enhance log messages for refused connections 2023-07-05 11:03:02 +02:00
Florian Weimer
0e678f766f configure.ng: Include <string.h> for memset in WORKING_GETADDRINFO probe
Otherwise, the probe always fails with compilers which do not
support implicit function declarations.
2023-02-05 21:35:40 +01:00
Alexander Barton
50114cd017 Add "+DEBUG" to the version string only when configured with --enable-debug
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-02 23:51:15 +01:00
michi
c7de505c91 Make the debug loglevel always available
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-02 22:39:16 +01:00
Alexander Barton
8e9c789ae1 Better validate MODE +k & +l parameters and return errors
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-02 22:32:16 +01:00
Alexander Barton
3c9c54989e Channel modes +k & +l: Always report an error when a parameter is missing
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-02 21:48:42 +01:00
Alexander Barton
0ea1715d00 Refactor Channel_Mode(), get rid of some nesting
No functional changes.
2023-01-02 21:25:28 +01:00
michi
24f956abf7 Allow ircops to use WHO on any channel. 2023-01-02 21:17:29 +01:00
Alexander Barton
0652c99b39 Remove outdated macOS "Package Maker" configuration
The tool is unavailable for many macOS versions and many years, so
remove all related files.
2022-12-29 18:06:18 +01:00
Alexander Barton
a0576f4810 We no longer use Travis-CI, remove its configuration 2022-12-29 16:48:50 +01:00
Alexander Barton
1b186cf5a0
GitHub "ngIRCd CI" Action: Use sudo(8) when installing packages 2022-12-29 16:01:52 +01:00
Alexander Barton
b49bc98b83
Add "ngIRCd CI" GitHub Action 2022-12-29 15:58:19 +01:00
Alexander Barton
55744b1863 Refactor join_send_topic() into IRC_Send_Channel_Info() and use it for JOIN and NJOIN handlers
This reduces code duplication and brings the order of messages on JOIN
and NJOIN in line.

Fixes #288.
2022-12-27 16:42:06 +01:00
ewired
5ef1a657f4 Send NAMES list and channel topic to NJOIN'ed users
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-26 17:45:44 +01:00
Alexander Barton
3e23f7d2c3 Channel mode setting: The local server is allowed to work on local channels
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-26 17:32:59 +01:00
Alexander Barton
46081d619a Update Xcode project for latest Xcode version (14.2) 2022-12-25 15:54:59 +01:00
Alexander Barton
d605a0825a README.md: Update "status" section, remove "is being actively developed" ... 2022-12-25 15:20:00 +01:00
Alexander Barton
56ed5c90ad Spelling fixes, mostly in file comments 2022-12-25 15:16:31 +01:00
hello-smile6
7b30c352a1 Use "||" instead of "|" 2022-12-17 14:54:55 +01:00
9pfs
ea7ad914c8 Fix gline/kline with cloaked hostnames 2022-12-17 14:54:55 +01:00
Jules Maselbas
93e36555e3 Convert uses of Log(LOG_DEBUG, ...) to LogDebug() 2022-12-17 14:52:44 +01:00
Katherine Peeters
dc412a450e
Improve documentation for --syslog 2022-11-01 16:21:56 -07:00
salaaad2
b0caf5984e fix typo in conn.c 2022-11-01 17:38:38 +01:00
Katherine Peeters
8f6d04095b
Added command line flag to enable syslog
This allows -y / --syslog to be used to override -n / --nodaemon disabling it
2022-10-29 21:46:46 -07:00
Katherine Peeters
2debc2e833
Split NoSyslog from behaviour of NoDaemon
Allows syslog to be enabled/disabled seperately from daemonization
2022-10-29 21:33:18 -07:00
Alexander Barton
79ffa9132b 2022 =:)
Happy new year!
2022-01-01 16:05:09 +01:00
Alexander Barton
1db3447c90 Fix a possible race condition in Client_Introduce()
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-12-30 20:31:41 +01:00
Alexander Barton
3675c7567c Enhance documentation a bit, add doc/QuickStart.md
And this file could well be expanded!
2021-12-30 20:01:44 +01:00
Alexander Barton
97ffec3d64 doc/HowToRelease.txt: "dist-tarZ" and "dist-xz" make targets can't be combined 2021-10-31 13:41:20 +01:00
Alexander Barton
71ae2b7d7f ngIRCd Release 26.1 2021-01-02 14:32:48 +01:00
Alexander Barton
65558a46e5 Update AUTHORS file 2021-01-02 14:23:45 +01:00
Alexander Barton
afb17ff08e Update config.guess and config.sub to recent versions
- config.guess: 2020-12-22
- config.sub: 2020-12-22
2021-01-02 13:36:45 +01:00
Alexander Barton
cbd8e5b5d6 Update NEWS and ChangeLog files 2021-01-01 20:07:47 +01:00
Alexander Barton
dc832cd348 Update Platforms.txt
- Add aarch64/apple/darwin (Apple CLang 12.0.0)
- Add x86_64/unknown/openbsd6.7 (gcc 4.2.1)

Thanks to Götz Hoffart <goetz@hoffart.de>
2021-01-01 20:03:58 +01:00