1
0
mirror of https://github.com/unrealircd/unrealircd.git synced 2026-07-07 00:03:12 +02:00
Commit Graph

8235 Commits

Author SHA1 Message Date
Bram Matthys 53fa3c44f5 Remove /REHASH -motd and -opermotd and get rid of some rehash quirks. 2021-08-05 14:00:37 +02:00
Bram Matthys 5e94b1cddb Newlog updates in serv.c 2021-08-05 13:49:36 +02:00
Bram Matthys b3fca01472 Newlog: update oper.c 2021-08-05 13:27:38 +02:00
Bram Matthys a19135d2a2 Guard against ULOG_INFO / LOG_INFO mixups :D
No such mistakes have been made yet, but.. bound to happen.
2021-08-05 12:15:55 +02:00
Bram Matthys 9889ed386b Newlog: for zero TS, such as a expiry_at of 0 which means never/infinity,
return a timestamp of null in JSON. And also blackhole some shit.
2021-08-05 11:47:21 +02:00
Bram Matthys f5852ce534 Newlog: add log_data_timestamp() and use ISO8601 timestamps in JSON
logging. We already did so for the "timestamp" of the log message,
but now also do it in other log messages that have a timestamp,
such as "set_at" and "expire_at" in TKL entries.
2021-08-05 11:11:21 +02:00
Bram Matthys 91ba0ca441 More updates to TKL for new log system. Also in the spamfilter hit
message we now show the action that was taken.
2021-08-05 10:48:34 +02:00
Bram Matthys dbdfb7c656 Update TKL code to use new logging system. Make the TKL add/del/expiry
messages more consistent at the same time.
2021-08-05 10:19:05 +02:00
Bram Matthys 952cb121c2 ircd.c: use new logging code
Also shorten the timesync messages a bit.. hope that won't cause confusion :D
2021-08-05 08:27:52 +02:00
Bram Matthys c27ed2ed81 Log: CONFIG_LOADED / CONFIG_NOT_LOADED 2021-08-05 08:02:55 +02:00
Bram Matthys 4a62e6ddaa Add log catagory 'config' and use CONFIG_ERROR_GENERIC,
CONFIG_WARNING_GENERIC and CONFIG_INFO_GENERIC from
config_error(), config_warn() and config_status() respectively.

...not that i like these generic ones, but it is a start.
2021-08-05 07:59:10 +02:00
Bram Matthys b23f7e77c7 Add unreal_log_raw() if you want to log a buffer directly without expanding
the $stuff in it. This is unusual, but possible in some cases.
Generally people should use unreal_log(), though.
2021-08-05 07:54:22 +02:00
Bram Matthys 413def178c Add early loglevel to snomask code. Hardcoded atm. 2021-08-05 07:34:03 +02:00
k4be 15ac841aea Do not show "Read error" quit message on regularly closed connections 2021-07-19 16:53:05 +02:00
k4be 3a9e4f98ac Add option for notifying chanops about invitations by normal users.
Normally, channel operators are only notified when another chanop
invites someone to their channel - as this would allow the user to
join the channel later if it becomes invite-only. This is still
the default behaviour. But now, it can be configured to notify
operators about any invitation done to their channel, eitner by
another op or by normal user. This will allow them to see whether
someone floods others with invitations to their channels.
Enable the option with set::normal-user-invite-notification yes;
2021-07-17 18:07:02 +02:00
k4be b6bd9a4d97 Fix typo 2021-07-17 10:54:14 +02:00
k4be 47ec109fce Fix crash on /REHASH with exceptionally large number of client capabilities loaded. 2021-07-16 22:58:23 +02:00
k4be 637ef7e99d Add IRCv3 SETNAME support 2021-07-16 18:34:11 +02:00
k4be e294656175 Merge branch 'unreal60_dev+invite' into unreal60_dev 2021-07-16 18:02:44 +02:00
k4be be534a7aa1 Merge branch 'unreal60_dev' of github.com:syzop/unrealircd-next into unreal60_dev 2021-07-16 18:02:22 +02:00
k4be 12c2bb42c2 Remove unused piece of code 2021-07-15 19:29:19 +02:00
k4be bbc2bc9cd5 Add IRCv3 invite-notify cap 2021-07-15 19:25:46 +02:00
k4be 036b61dbc6 Rewrite invite notification mechanism 2021-07-15 19:10:07 +02:00
k4be 3ede47c7fa Remove invite moddata access from core (without breaking the api) 2021-07-15 16:13:02 +02:00
k4be db8ff94e7a Free invite moddata properly 2021-07-15 15:52:04 +02:00
k4be cd64a34634 Fix for previous commit 2021-07-15 15:51:47 +02:00
k4be 8e676c1f2a We are never going to store invite for remote clients 2021-07-15 15:22:41 +02:00
Bram Matthys abc80cfdd9 Enable ASan (address sanitizer) during U6 development 2021-07-15 12:51:50 +02:00
k4be c97b9bb494 Move invites from core to module 2021-07-14 20:20:56 +02:00
k4be 6b09b942bf INVITE messages may come from a server too 2021-07-14 19:25:48 +02:00
Bram Matthys d7fcc90014 Change lost_server_link() prototype and log errors properly for both TLS and non-TLS.
Not really satisfied with the way the TLS socket error is logged yet, but ok..
2021-07-14 14:13:02 +02:00
Bram Matthys 9987b6b862 Temporarily send all unreal_log() msgs to sendto_realops() 2021-07-14 14:12:22 +02:00
Bram Matthys eb4ac65125 Update lost_server_link() to use unreal_log() and log the proper
socket error message such as Connection refused.
2021-07-14 13:58:29 +02:00
Bram Matthys 49fe200243 unreal_log(), connect_server and report_error() / report_baderror():
* Converted 90% of the socket and linking errors to use unreal_log()
* Add log_data_socket_error(fd) and $socket_error
* This also makes connect_server() 'void' and removes all of the error
  reporting from the callers (there was 3x code duplication due to that)
* Don't use report_error and report_baderror anymore in socket.c
* More to follow...
2021-07-14 13:33:18 +02:00
Bram Matthys f50d97474e Fix unreal_log() with $vars that are integers not working.
This adds json_get_value().
2021-07-14 11:36:27 +02:00
Bram Matthys 1068960b9a We now compile with -Wformat-nonliteral by default.
This adds __attribute__((format(printf,X,Y))) to several functions.
It also adds checking only for the non-literal case to some functions
such as unreal_log/unreal_do_log.

This so we can more easily detect format string issues. Especially now with
the recoding of the logger and with possible future mistakes in this area
in UnrealIRCd 6 itself or in third party modules.

The check is currently disabled in these files, which are TODO items:
* src/send.c: still much work to do
* src/socket.c: due to report_error and report_baderror().
  I want to get rid of these functions and integrate them
  in the new logger anyway.
* src/serv.c: only disable for hunt_server()
2021-07-14 11:15:49 +02:00
Bram Matthys 01c418c4d5 src/log.c errors should use errno, not ERRNO, as the latter actually
uses WSAGetLastError() on Windows, which obviously makes no sense.
This mistake comes from the original ircd_log() by the way.
2021-07-13 19:58:14 +02:00
k4be c25f4a4538 Fix hang on a module attempting to assign (unusually) large amount of CAPs 2021-07-12 21:00:38 +02:00
Bram Matthys 05aeba9ba9 Get rid of Debug(()) function calls. I never use it anyway. 2021-07-12 18:54:38 +02:00
Bram Matthys a57bdba220 Move CONFIG_TEST/CONFIG_RUN stuff for logging from conf.c to log.c
Still some other stuff to move too eg rehash/freeing stuff etc.
2021-07-12 18:00:41 +02:00
Bram Matthys 76b1d756dd Make ircd_log() call new unreal logger. Start of transition.
Broken now:
- All filtering (log::flags)
- Everything is seen as error unknown UNKNOWN

Working:
- log::type json
- logging still works, other than the limitations of above
2021-07-12 17:49:42 +02:00
Bram Matthys b871d2a177 Add log::type for 'json' (work in progress) 2021-07-12 17:24:16 +02:00
Bram Matthys f2eef5caca Remove old leftover code in logger 2021-07-12 17:01:33 +02:00
Bram Matthys f89348d26c Add JSON logger - initial work 2021-07-12 14:37:25 +02:00
Bram Matthys 757adc76dd Bump version to 6.0.0-git and start release notes with a clean slate. 2021-07-12 14:17:46 +02:00
k4bek4be c5a6f3c549 Make CHATHISTORY subcommands case-insensitive. (#157) 2021-07-11 09:24:56 +02:00
Ramiro Bou 0985728662 Adding sequential-fallback autoconnect strategy (#151)
After successful server connection it will restart from the beginning of the link blocks again.
2021-07-11 09:24:14 +02:00
Val Lorentz 67bfd41e44 chathistory: Use more explicit messages on INVALID_TARGET failure message (#150) 2021-07-11 09:09:18 +02:00
Bram Matthys d726c3aadd Bump version to 5.2.2-git as this is git / work in progress. 2021-07-10 10:03:46 +02:00
Bram Matthys d3c98c73c2 Fix issue where saslmechlist could not be set by services server.
This broke SASL services autodetection and also sasl=x,y,z in CAP.
Reported by Valware in https://bugs.unrealircd.org/view.php?id=5960

Of course the easiest solution would be just to set .remote_write=1
for this, which is what I've just done for the 5.2.1.1 release.
But there seems to be a pattern here. When a server wants to write
its own object (irc1.example.net writing to the MD object of
irc1.example.net) we have the problem that that object is both
"our client" and from the other server POV it is "themselves".
On one hand you may want to allow that (eg for 'saslmechlist'), on
the other hand a server writing its own 'certfp' sounds like a bad
idea in principle.
So we now add a new option for the 'self' case and make some MD
objects use it. In fact, in the core we now have zero MD objects
using remote_write. We keep the option available though, for example
for k4be's geoip modules and possibly future features.

Module API change:
* .self_write added which allows a server to write to its own object
  (irc1.example.net writing to the MD object of irc1.example.net)
* .remote_write still exists too if you want to allow remote servers
  to write to your own objects
* Note that in all cases, servers can always write to their own
  (child) client objects.

Changes:
* The link-security MD changed from .remote_write=1 to .self_write=1
* The salmechslist MD now has .self_write=1, this fixes the actual bug
2021-07-10 09:14:18 +02:00