1
0
mirror of https://github.com/unrealircd/unrealircd.git synced 2026-06-23 22:26:36 +02:00

4165 Commits

Author SHA1 Message Date
Bram Matthys 684f6515d4 "CAP LS" may only respond 1 line, we now advertise less. "CAP LS 302" unaffected.
When not using version 302, such as with "CAP LS", the specification does not
allow us to use continuation lines. This means all advertised caps must fit
into one line. That is no longer always the case, especially if you load 3rd
party capabilities. So we need to scratch advertising some capabilities to
<302 clients.

"CAP LS 302" is unaffected. Note that version 302 in the specification exists
since at least November 2017, so most clients use that one.

According to https://ircv3.net/software/clients the following clients are
affected by this change:

Desktop Clients
* KVIrc
* Circe
* catgirl
* BitchX
* Pidgin
* LimeChat

Mobile Clients
* IRC for Android
* LimeChat

And various older versions of other clients (obviously).

NOTE: The source is only that IRCv3 page. I did not check manually.

For this particular commit. We filter out various unrealircd.org informative
CAPs and the vendor specific json-log. So that isn't much of a problem.
However, in the future we may be forced to filter out more capabilities to
make room. It would be much better if all clients are on >=302. Also, I
should mention we are not the only IRCd out there, so I can't vouch on what
other IRCds (will) do when hitting this non-302-limit.

Reported by ProgVal in https://bugs.unrealircd.org/view.php?id=6630
2026-06-22 09:19:38 +02:00
Bram Matthys 12d92fcba5 a more minor update:
1) obviously only provide ASan report if relevant (eg memory issue),
   not for like priv escalation :)
2) "If you are submitting issues and fail to follow the procedure above"
   was in the AI/tooling paragraph, but just in case someone reads it
   out of that context we now scope AGAIN it to that ONLY.
   This so normal users (that have nothing to do with AI/tooling)
   are not scared off in reporting real issues.

[skip ci]
2026-06-21 10:15:38 +02:00
Bram Matthys 5a93480976 SECURITY.md: add "Scope" and "Use of AI or other tools"
And a minor README.md update to add a few more links.
2026-06-21 09:47:21 +02:00
Bram Matthys cf5703fec0 Windows packager: get rid of in-innosetup-signing (handled outside this now) 2026-06-20 14:01:41 +02:00
Bram Matthys 2475f25596 ** UnrealIRCd 6.2.6-rc1 ** 2026-06-20 10:53:01 +02:00
Bram Matthys 3fafd32067 Fix end marker missing for 0 result in some CHATHISTORY BETWEEN. 2026-06-20 09:35:16 +02:00
Bram Matthys 8d1df6a823 Make nofakelag also mean that deliberate add_fake_lag() does not lag up.
Eg on failed oper attempts, that sort of things. Previously it was still
adding fake lag. This complicated unrealircd-tests :).

As always, nofakelag should never be used in normal conditions, it
disables the most important protection we have (fake lag bumping).
If you want lower lag for a group of users, the right tool is
set::anti-flood::name-of-security-group::lag-penalty and ::lag-penalty-bytes
See https://www.unrealircd.org/docs/Special_users
2026-06-20 09:22:20 +02:00
Bram Matthys 09a732e2c1 Redo draft/chathistory-end from yesterday in a different way.
The previous mechanism (from yesterday) was a bit too simple at the
chathistory.c where returned_lines < limit would set the end tag but
it would not deal with the situation where returned_lines == limit
which is ambigious. So we had to move up a layer (or is it down?),
don't handle this in chathistory.c but in the backend. A new struct
field r->reached_end was added for this (set by backend).
2026-06-20 08:32:28 +02:00
Bram Matthys 570c32ea67 Fix CHATHISTORY TARGETS sending one target too little if limit is hit
And attach draft/chathistory-end when exactly 'limit' targets exist
and nothing more.
2026-06-19 21:33:49 +02:00
Bram Matthys 37977fcfe6 Don't send draft/chathistory-end for AROUND. As around does not have
a directorion, but is a midpoint, and we send X lines above Y under,
so end does not make sense there anyway (which of the two ends?).

We simply avoid sending it.
2026-06-19 21:28:15 +02:00
Valerie Liu 59d497726b chathistory: implement draft/chathistory-end tag (PR #337)
Signals to the client that it has reached the end of the history and
there are no more messages to fetch. The tag is attached to the BATCH
opener when the server returns the last page of results.

Only sent to clients that negotiated the draft/chathistory capability.
2026-06-19 21:19:10 +02:00
Valerie Liu f5d59dd152 Support ratified tags for reply-tag and no-implicit-names (PR #336)
The IRCv3 specifications for these have been ratified:
- https://ircv3.net/specs/client-tags/reply
- https://ircv3.net/specs/extensions/no-implicit-names

Both the draft and ratified names are supported during a transition period.
2026-06-19 20:17:02 +02:00
Bram Matthys ecde1b6479 Add bounds checking to message_tag_escape().
This fixes an OOB write that cannot be reached by users. Only a
hostile server could cause it in some situations. Even then, in
my tests this did not cause a crash (it goes into bss too, not
heap or stack).
2026-06-19 19:43:13 +02:00
Bram Matthys b5f45d0160 Update NULL check in config_item_allowed_for_config_file() - no real issue.
This is unreachable in current code paths, but could be some day.
2026-06-18 19:55:59 +02:00
Bram Matthys 320d2c28ef Fix theoretical OOB write in chmode_str(). In practice this is no issue.
Not in UnrealIRCd itself: it is only used in one place, STATS with a
big buffer. And unrealircd-contrib 3rd party modules has no consumers.
2026-06-18 19:20:26 +02:00
Bram Matthys d7962e1bbb Fix crash (NULL pointer) with old-style set::anti-flood block
(we should actually remove this one day :D)
2026-06-17 20:43:18 +02:00
Bram Matthys e7459df725 Another URL API fix 2026-06-17 20:38:46 +02:00
Bram Matthys 4966b59812 Update release notes
[skip ci]
2026-06-17 19:49:35 +02:00
Bram Matthys c100059fa7 Add new function: append_name_list(). Use it at two places where we
print copy-pastable config blocks. Previously we used add_name_list(),
which uses insert at beginning, which would reverse the order.

Also changed duplicate_name_list() to preserve order. Previously
it reversed the order of all items.
2026-06-17 18:41:09 +02:00
Bram Matthys ce6f078262 Deal better with multiple spkifp, such as ECC + ML-DSA. We now cache them
and "./unrealircd genlinkblock" outputs multiple password ".." { spkifp; }
lines in such a case.

Other than that some cleaning up of recently-added-functions that are
now no longer needed: we now create ctx_link_server and ctx_link_client
that represent set::server-linking::tls-options for incoming and outgoing
links. Which can be NULL, and then we use ctx_server / ctx_client (set::tls).
Also add proper documentation on this.

When using ./unrealircd spkifp, tell ./unrealircd genblock is cooler.
Nah.. it takes more factors into account, genlinkblock, so is preferred :D
2026-06-17 15:45:01 +02:00
Bram Matthys 1162da4a9e * Server linking and certificates: we now treat listener blocks that are
`serversonly` (such as port 6900 in the example.conf) and link { } blocks
  in a different way than regular listen { } blocks:
  * If there are different certificates used in the serversonly listen block
    vs link blocks, then this is almost always means server linking is broken,
    so we now print a warning on boot and rehash.
  * We also print an 'advice' if any of these are not using (long-lived)
    self-signed certificate. This is because CA issued certificates are
    typically not suitable because they typically rotate keys and thus change
    the `spkifp`. Changing spkifp breaks server linking. We will now print
    an advice along with command and config block instructions to fix it.
  * We now use `set::server-linking::tls-options` for link { } blocks
    and listen { } blocks that are `serversonly`. All the rest uses the
    `set::tls` settings by default (eg the regular listen { } block on 6697).
    * This means our guide on
      [Using Let's Encrypt with UnrealIRCd](https://www.unrealircd.org/docs/Using_Let's_Encrypt_with_UnrealIRCd)
      and generic usage is more intuitive. You just set both set settings
      and then no longer need to use any tls-options in listen blocks or link
      blocks. The example conf has also been updated with this.
    * If `set::server-linking::tls-options` is not configured, it defaults
      to `set::tls`, so there is no unexpected behavior change for anyone.
  * In a future release we will make server linking with `spkifp` mandatory,
    so all of this helps with getting people ready for that, making such
    a future transition smooth.

TODO: Update wiki, better wording in release notes, etc.

This also changes the default example conf:

/* RECOMMENDED:
 * Everyone should be using IRC over SSL/TLS on port 6697. However, to use
 * it properly, you have to get a "real" certificate instead of the
 * self-signed default certificate that was generated by the installer.
 * The Let's Encrypt initiative allows you to get a free certificate that is
 * issued by a trusted Certificate Authority. Instructions are at:
 * https://www.unrealircd.org/docs/Using_Let's_Encrypt_with_UnrealIRCd
 *
 * When you follow that guide you will have a "dual certificate" setup:
 * set::tls:
 *   Your trusted CA certificate, served to clients on port 6697.
 *   (key and certificate change and renew every xx days automatically)
 * set::server-linking::tls-options
 *   A long-lived self-signed certificate for server linking, with
 *   a stable 'spkifp' signature that you use in link blocks.
 *   This certificate is used automatically in "serversonly" listen blocks
 *   (port 6900 in this configuration file) and automatically used for all
 *   link { } blocks.
 *
 */
//set {
//      tls {
//              certificate "/etc/letsencrypt/live/irc.example.org/fullchain.pem";
//              key "/etc/letsencrypt/live/irc.example.org/privkey.pem";
//      }
//      server-linking {
//              tls-options {
//                      certificate "tls/server.cert.pem";
//                      key "tls/server.key.pem";
//              }
//      }
//}
2026-06-16 20:50:56 +02:00
Bram Matthys 8d783204dd JSON-RPC: Remote RPC was broken and causing "not authorized" error messages.
This was used by `server.rehash` and `server.module_list`. Plus,
this release `user.get` under some circumstances. This is now
fixed but requires the target server to be on UnrealIRCd 6.2.6.
If the target server does not meet this condition then we error
telling the server "does not support remote JSON-RPC".

This was first reported by AdmiraL- in https://bugs.unrealircd.org/view.php?id=6611
2026-06-13 16:04:43 +02:00
Bram Matthys 2089aa4ec4 In RPC_CALL_ERROR show the actual error 2026-06-13 14:49:11 +02:00
Bram Matthys 7667307b0e JSON-RPC user.get can now expose more fields by forwarding the request
to the server where the user is actually on. Think of idle time etc.

* JSON-RPC: We can now route `user.get` requests to the server that user is
  on. This so we can fetch all fields for that user (including flood
  counters, idle time, snomask) that are normally not available remotely.
  * We do this automatically in `user.get` when `object_detail_level` is 5+.
  * You can force this explicitly with `object_remote_fetch` set to `true`.
    So you can also use it with detail level 2 if you want, e.g. if you
    don't need the flood counters but do want the idle time.
  * When RRPC is not available we answer ourselves (so safe fallback, but
    you won't have the local-only fields).

Oh and we deliberately don't do this in `user.list`, as doing it there
would mean a single request could result in hundreds of semi-`user.get`
calls across multiple servers.
2026-06-13 12:40:44 +02:00
Bram Matthys 65f918e8e9 Add json_expand_flood_counts() and make available in Central Spamreport
and JSON-RPC.

This exposes the newly added flood counters from
4384f1127b and
029675f867 in JSON.

I didn't want to put it in every JSON log message. So right now it
is only in:
* JSON-RPC with object_detail_level >= 5.
* Central Spamreport

I may expand it later to one or a few other areas.
2026-06-13 12:09:09 +02:00
Bram Matthys 3000381493 Fix multiline-concat behavior for fallback clients.
We were merging draft/multiline-concat lines together server-side before
sending them to non-multiline clients. This could truncate oversized merged
lines. We now simply send them as separate lines.

Reported by ProgVal in https://bugs.unrealircd.org/view.php?id=6628
2026-06-13 10:29:46 +02:00
Bram Matthys 029675f867 Similar to previous, add total_channel_flood_count() for +f/+F limits exceeded
* `total_channel_flood_count('..setting..')` returns the number of
  times `+f`/`+F` limits were exceeded by that user in all channels
  the user is or was in. Available are: `nick`, `join`, `knock`, `msg`,
  `ctcp`, `text`, `repeat` and `paste` (and `all` for the sum).
2026-06-13 07:46:51 +02:00
Bram Matthys 4384f1127b Crule: new server_flood_count() for nick, away, join etc floods.
Suggested by westid in https://bugs.unrealircd.org/view.php?id=6477

* New [crule function](https://www.unrealircd.org/docs/Crule) that return
  the number of times a flood was blocked for that user. For example,
  `server_flood_count('away')` returns the number of time away-flood
  was exceeded. Aslo available: `nick`, `join`, `invite`, `knock`,
  `vhost` and `conversations`. Plus, there is `all` for a total of all.
  * This can be used in a security-group::rule or spamfilter::rule.
    Eg: `spamfilter { rule "server_flood_count('nick')>4"; action gline; }`

This also - internally - adds a mechanism to run spamfilter rule-only-
filters after the command handler, whenever a tag value or other thing
changed. That's part of this commit.
2026-06-12 17:43:51 +02:00
Bram Matthys e2ed1ceca2 Load multiline by default and update release notes a little. 2026-06-11 19:57:53 +02:00
Bram Matthys 57ca415c26 Add whitespace deletion in buildvarstring() so template can have a space.
Basically if a $variable is empty, and there is a space before it in the
template string then we delete that space.

May seem (or is) a bit over the top but this way the template stays clean,
and it may be used/useful in other places as well.

This is a behavior change, but I think we can live with it. One can opt-
out via BUILDVARSTRING_KEEP_SPACE_FOR_EMPTY_VAR.
2026-06-11 19:19:53 +02:00
Bram Matthys 5850ec9434 Show TKL IDs (and related spamfilter TKL ID, if any) in TKL_ADD, TKL_DEL,
TKL_EXPIRE and SPAMFILTER_MATCH messages.

This uses the newly added functions log_data_optional_string() and
log_data_optional_name_value(). The first shows the optional string
like "abc" and the second expands to "[name: value]". What's also new
is that both of these will swallow a preceding space if there is no value.
This so you can just use "Something. $optional_string" and it will
expand to "Something." if $optional_string is empty. This makes things
less hacky and more human readable :)
2026-06-10 19:48:38 +02:00
Bram Matthys 62f3cda8f2 Make spamfilter IDs start with "SPAM" to be more visible. And this also
means shun IDs now start with "H". Update release notes.

This, after i realized that for like *LINEs that are added by spamfilter
the two ID fields in "STATS gline" are a bit confusing as to which ID is
what. Now the spamfilter one starts with "SPAM" so there can be no
confusion. The gline one still starts with "G" as before.

Since I kept the generated ID length the same, this means there is less
bits available for the spamfilter ID, but there are rarely more than 1000
spamfilters, and in that scenario there's just as little birthday attack
collision % as with 200k glines, just to illustrate (~0.0015% vs ~0.0018%)
2026-06-10 15:37:20 +02:00
Bram Matthys faecdd66cd Config-file based *LINES/Spamfilter: preserve hit counters between rehashes.
Unlike non-config-based TKLs - which go through tkldb - they are still not
preserved through restarts. But at least they are not lost due to REHASH.
This is done via a save+restore, a bit complicated, but we have little
choice (other than not doing this at all).

This also moves remove_config_tkls() from conf.c to tkl.c
2026-06-10 14:30:39 +02:00
Bram Matthys d5b799d3de Server bans and Spamfilters now track how often they are hit and the time
of the last hit, eg in `STATS gline` for GLINEs. These counts happen on
each individual server and are not network-wide. This allows IRCOps to see
which entries never get any hits and can potentially be removed.
* Important exception: config-based spamfilters/bans lose their counters
  on `REHASH` and restart atm.
* For non-config TKLs, the hit count and last hit timestamp are preserved
  across reboots (via tkldb).
* Again, see *Developers and protocol* for the exact STATS field.

The spamfilter hits already existed but all the rest is new.

Suggested by BlackBishop in https://bugs.unrealircd.org/view.php?id=6304
(in particular, time of the last hit)
2026-06-08 13:44:00 +02:00
LeCoyote 74557f2378 help.fr.conf: translation update, include eline, tline, new snomasks (#342) 2026-06-08 12:21:35 +02:00
Bram Matthys 27a086b03a Add TKL IDs via message tags in S2S.
By default - assuming you don't set set::reject-message things by yourself -
the *LINE id is appended at the end of the rejection that is shown to the
user, like: [ID: G7K2MP9WQX3].

Also new is spamfilter to *LINE mapping, so you can see which *LINE was
set by which SPAMFILTER. For this STATS gline and friends were enhanced.
In fact, multiple fields were added there, including some that are 0
(zero) placeholders at the moment. These will be set in a future commit.
Some things were combined here so we only have to break STATS and tkldb
database format once (unless i made a mistake, then the follow up commit
will correct that i guess :D).

This was requested by Hero in https://bugs.unrealircd.org/view.php?id=4397
in 2015. Again by musk in https://bugs.unrealircd.org/view.php?id=4397
in 2022. And on IRC by Chris and others.

As you can see it was not SUPER easy and a lot of thought went into this
(and in terms of S2S traffic it is part of something bigger too)
2026-06-07 17:19:00 +02:00
Bram Matthys b19573d562 Update release notes
[skip ci]
2026-06-05 18:29:57 +02:00
Bram Matthys 3571c9e75b Create BASEDIR with 0700. Just like we already did for almost all subdirs.
Only for ~/unrealircd/lib/ we had this ommision, and for ~/unrealircd itself.
I doubt this means a change for users, as all subdirs were already 0700
so then tightening of ~/unrealircd is not very important.
And only upsides... making things safer..
2026-06-05 17:24:25 +02:00
Bram Matthys be08bc2e33 Let's call it "./unrealircd mkcert" instead (like mkpasswd). Fix test suite. 2026-06-05 16:51:22 +02:00
Bram Matthys 982325fc82 Move "make pem" to "./unrealircd makecert" and make tools use this
and refer to this as well.

Suggested by PeGaSuS in https://bugs.unrealircd.org/view.php?id=6610

This also moves extras/tls.cnf to doc/conf/tls/tls.cnf which
also gets installed in ~/unrealircd/conf/tls/ (or whatever CONFDIR is)

And just to be clear: this means you can run "./unrealircd makecert"
without needing to go into BUILDDIR (or even having it at all).

At the same time, the generation commands have been modified slightly
so two warnings during certificate generation are no longer there.
2026-06-05 16:08:40 +02:00
Bram Matthys cbc9213d5e Similarly to previous, fix allow channel::except and spamfilter::except
so they actually work.
2026-06-05 10:36:46 +02:00
Bram Matthys 425a9b978a Fix deny channel::mask not working if security group. Reported by PeGaSuS. 2026-06-05 10:06:33 +02:00
Bram Matthys dee26e2e12 Add const to third argument of unreal_create_match() 2026-06-05 10:00:14 +02:00
Bram Matthys f0c0feff4f Set PCRE2 limits explicitly (to more sensible defaults), reported by Link420. 2026-06-05 09:43:22 +02:00
Bram Matthys caa01c9c8c Call update_known_user_cache() right before "Client connecting" log.
This is after PRE_LOCAL_CONNECT hook and can be useful in case some
module in there did something to the user that made them known-users.

And mention explicitly to module devs if they have things like
authentication mods that may move users between known<->unknown
that they should update the cache.
2026-05-20 10:16:29 +02:00
Bram Matthys 5e8a859102 Bump version and add placeholder empty release notes 2026-05-17 10:52:29 +02:00
Bram Matthys cfa1d7614c Another fix in url_unreal for rogue HTTPS servers (not super important) 2026-05-17 10:51:32 +02:00
Bram Matthys b46c0f20ab OutgoingWebRequest max_size is now also obeyed for file-backed URL API.
And the defines are more clear now (if .max_size is not set by caller.

DOWNLOAD_MAX_SIZE_MEMORY_BACKED: 1M
DOWNLOAD_MAX_SIZE_FILE_BACKED: 50M

The file-backed is mostly a defense-in-depth measure, so we don't
store infinite amounts of data in a download. Even though, in practice,
these - at least at the moment in unrealircd itself - all come from
trusted paths like remote includes.

In url_unreal.c we do the counting ourselves. In url_curl.c we use the
option CURLOPT_MAXFILESIZE_LARGE but this does not ensure it in all
cases so we still do our own counting as well in that file as well.
2026-05-17 10:30:11 +02:00
Bram Matthys 8b93339e42 url_unreal: limit chunked transfer header length (hardening) 2026-05-17 10:07:14 +02:00
Bram Matthys 1250b7f014 ** UnrealIRCd 6.2.5 ** 2026-05-15 13:35:12 +02:00
Bram Matthys 75bd6e87d3 Fix set::antimixedutf8::except not working
Reported by Le_Coyote in https://bugs.unrealircd.org/view.php?id=6625
2026-05-15 09:23:19 +02:00
Bram Matthys 9ba54b7eb3 Add +x to HELPOP SNOMASKS 2026-05-15 09:15:04 +02:00
Bram Matthys 69b2116826 Fix typo in linking message, mentioned by Gottem. 2026-05-14 11:24:49 +02:00
Bram Matthys 0f62b20972 Bump maxperip and connthrottle module version to 2.0.0 2026-05-13 15:40:50 +02:00
Bram Matthys 0007ccda47 Connthrottle has a start delay, but this makes no sense for the ipv6 stuff.
The start delay is there for the rate limit (since lots of users may
connect after starting the server). The IPv6 is not a ratelimit but a limit.
2026-05-13 13:34:21 +02:00
Bram Matthys 80771ac3b4 Handle some invalid values. Not an issue now, but if some caller screws up. 2026-05-13 13:09:48 +02:00
Bram Matthys 4af3695347 Show BUG_CT_NEGATIVE_COUNTER also in non-DEBUGMODE and limit to 5:60.
Not only that one, but all BUG_CT_* connthrottle "something isn't
right here" messages.
2026-05-13 13:08:38 +02:00
Bram Matthys 31b43dcb08 Fix CONNTHROTTLE_CHECK and use <addr>/<prefix> in 'STATS maxperip'
just like we do in 'STATS connthrottle'.
2026-05-13 08:30:45 +02:00
Bram Matthys 4c0d830ae1 Write release notes. 2026-05-08 19:24:07 +02:00
Bram Matthys a4361b7c90 Add set::known-cloud-services [yes|no] (enabled by default)
Install default maxperip/connect-flood exception for IRC platforms
that are so big that they are known to trip default maxperip restrictions
(per IPv4 IP or per IPv6 /64: 3 local users, 4 network-wide users)
on dozens of networks and that publish a stable list of IP ranges.
Currently only IRCCloud qualifies for this.

IRCCloud is in example conf since May 2023 (commit 82dbc4a297) as:
except ban { mask *.irccloud.com; type { maxperip; connect-flood; } }.
Unfortunately DNS sometimes fails to resolve. We have seen this happen
during an outage or server restart. People then mass-connect, but DNS
is not fully working (yet), leading to unresolved hostnames.

Recent stricter maxperip treatment for /64 IPv6 and the new /56, /48
and /32 restrictions in connthrottle make this problem worse. Without
these IP exceptions it would cause unwanted rejections.

If you don't want this, use: set { known-cloud-services no; }
(And then presumably you also don't want the except ban block
 that example conf has been shipping since 2023)
2026-05-07 09:15:36 +02:00
Bram Matthys 05ef211900 For connthrottle rate limiting (new-users) now check except tkl type 'c'
(connect-flood). Those users are exempt and not counted towards new users.

And the new ipv6-unknown-users-limit in connthrottle (which has nothing
do with rates, but counts, similar to maxperip, but only on unknown-users)
now checks tkl type 'm' (maxperip). Those are counted as "except unknowns".

This is more of what the admin would expect.
2026-05-06 18:54:10 +02:00
Bram Matthys 8bafd33286 Update example.conf with the new set::connthrottle::ipv6-unknown-users-limit
functionality.
[skip ci]
2026-05-06 10:28:32 +02:00
Bram Matthys 3e6f9f06e2 set::connthrottle::disabled-when::reputation-gathering default of 1 week
was stated in docs at https://www.unrealircd.org/docs/Connthrottle but
if this item was not there then the default was actually zero (0).
Now, that isn't too common, since we ship with example.conf with the
connthrottle block as shown there, so lots of users have the proper
default, but just in case someone hand-writes or removed that connthrottle
settings block ("because they are the default)"... :)
2026-05-06 09:39:40 +02:00
Bram Matthys e5be93a9f8 Suppress high rate events via set::log-throttle (similar to Linux kernel)
And ship with these by default (no need to copy this set block):

set {
	log-throttle {
		CONNTHROTTLE_IPV6_LIMIT 100:60;
		MAXPERIP_LIMIT 100:60;
	};
};

You can do the same for other events, or even override existing ones,
and use the special value "unlimited" to turn default set ratelimits off:

set {
	log-throttle {
		CONNTHROTTLE_IPV6_LIMIT 50:60;
		MAXPERIP_LIMIT unlimited;
	};
};

Suggested in 2020 at https://bugs.unrealircd.org/view.php?id=5523
(and keeping it simple)
2026-05-05 19:07:42 +02:00
Bram Matthys f765905b15 New snomask 'x' (set by default): maxperip/connthrottle connect rejections
When a client is rejected by maxperip (not new) or connthrottle
ipv6-unknown-users-limit (that one is new), a notice to +s +x will be sent.

maxperip ipv4 example:
*** Client testuser4 with IP 1.2.3.4 rejected: maxperip limit exceeded (4 global, max 3)

maxperip ipv6 with /64 example:
*** Client testuser4 with IP 2001:dbe:0:0:0:0:0:4 rejected: maxperip limit exceeded for 2001:dbe::/64 (4 local, max 3)

connthrottle example where /56 limit is exceeded:
*** Client testuser5 with IP 2001:db8:cafe:abcd:0:0:0:5 rejected:
    connthrottle ipv6-unknown-users-limit (cidr-56, max 4) exceeded for
    2001:db8:cafe::/56 (5 unknown / 0 excepted / 0 known)

Oh and this commit also fixes a typo in existing CONNTHROTTLE events,
which previously were CONNTHROTLE (a missing T).
2026-05-05 16:33:19 +02:00
Bram Matthys 0940ed5d13 Update the messages regarding too many (new) connections.
Changed "Too many connections from your IP" to have "[maxperip]" at the end.
Also create new setting and swap it with existing-one-during-development.

Long story short, we now have 3 different messages for these limits:

set::reject-message::too-many-connections
 "Too many connections from your IP [maxperip]"

set::reject-message::too-many-connections-ipv6-range
 "Too many connections from your IPv6 range ($prefix_addr/$prefix_len) [maxperip]"

set::reject-message::too-many-new-connections-ipv6-range
 "Too many new connections from this IPv6 range ($prefix_addr/$prefix_len) [connthrottle]"

So we explicitly mention whether it is maxperip or connthrottle limiting the
user, that should provide enough clue to the IRCOp if the user pastes the
message to them.
2026-05-05 13:24:01 +02:00
Bram Matthys 32e7dbfb3c Add connthrottle self-test that (only) runs in DEBUGMODE.
This verifies state every second. Obviously not for production.
2026-05-05 10:03:26 +02:00
Bram Matthys 2ae69be391 Implement IPv6 CIDR restrictions for unknown-users
Will do more in follow-up commits.
2026-05-05 10:03:25 +02:00
Bram Matthys 46e404f95f Remove setting that never worked and refer to set::default-ipv6-clone-mask 2026-05-05 10:03:25 +02:00
Bram Matthys 3a429dbd42 Add helper functions and start the IPv6 /128 to /64 transition in
connect-flood and maxperip module. This so they actually take
set::default-ipv6-clone-mask into account.

This also changes the maxperip module to a more simple method of
just freeing all entries and rebuilding the hash table on load.
That's necessary since now set::default-ipv6-clone-mask can change.
2026-05-05 10:03:22 +02:00
Bram Matthys 4adaddeee1 set_client_ip() was not updating client->sockhost. That meant in WEBIRC
situations connect-flood may not be working (it used the webirc ip,
which is almost always exempt, instead of the spoofed IP).
2026-05-05 09:51:19 +02:00
Bram Matthys 665d01b7ea Update release notes
[skip ci]
2026-05-02 19:34:30 +02:00
Bram Matthys 99f1f6a047 Update libsodium to 1.0.22. They may have fixed that arm64 compile issue ;)
We previously upgraded to 1.0.21 and then downgraded to 1.0.20.

Benefit of 1.0.22 is that they also claim to have fixed a warning flood
i am getting with clang 22.
2026-05-02 19:15:07 +02:00
Bram Matthys b96c1d2d1e Add autoconf/m4/pkg.m4 for now because otherwise my Ubuntu 26.04
uses their pkg.m4 which made pkg-config a hard requirement.
Such a hard requirement is probably fine later, but.. i don't want
to suddenly require that of users during UnrealIRCd 6 series.
2026-05-02 19:14:10 +02:00
Bram Matthys c0f68bfd08 Deprecate link::verify-certificate, as 'Client Authentication EKU' is being
dropped by public certificate authorities (as per Chrome Root Program).

The fix is to simply use 'spkifp'. The config warning has all the details.
2026-05-01 19:47:28 +02:00
Bram Matthys 17f78de265 Bump version to 6.2.5-git 2026-05-01 19:47:03 +02:00
Bram Matthys 717c9cbfa5 Fix OOB write on URL callback with 2GB+ response. Add new size limit.
The OOB write did not happen on file-backed downloads, such as remote
includes. It only happened for memory-backed requests, which are only
these 4 in standard UnrealIRCd: centralblocklist, central spam report,
other spamreport blocks (eg to dronebl) and the log block with
destination webhook. All those 4 cases are very likely to be trusted
web servers, given the nature of the data you are sending to them.

The fix was to extend the size fields everywhere to 64 bits. It was
applied to both URL backends: url_unreal.c and url_curl.c.

The new API feature is a 'max_size' in OutgoingWebRequest, which
defaults to 1MB. This is only used for memory-backed responses,
so not for real file downloads. This fixes not only the reported
bug but also the case where a rogue webserver was unbounded in
terms of what response it could send back, potentially filling
up gigabytes of server memory.

Reported by Link420.
2026-04-21 19:46:21 +02:00
Bram Matthys abbbcd16a9 ** UnrealIRCd 6.2.4 ** 2026-04-17 06:13:38 +02:00
Bram Matthys bd0dea4a0e Compile fixes for OpenSSL 4.0.0
This does two things:
* We now only compile src/openssl_hostname_validation.c on
  really old OpenSSL's. This was already unused/dead code
  for most OpenSSL's but we always compiled it in until now.
* Added 'const' to please OpenSSL 4.0.0 while not breaking
  OpenSSL 1.0.x. And yeah i'm happy to drop OpenSSL 1.0.x
  support real soon... but not this month yet.
2026-04-15 15:12:34 +02:00
Bram Matthys a89f098a22 Fix mmdb library on Windows and use it by default 2026-04-10 18:44:39 +02:00
Bram Matthys 3c71a03781 Update subdomain URL 2026-04-10 17:44:25 +02:00
Bram Matthys e39ea1f483 Add file_get_contents function (not used atm yet) 2026-04-10 16:53:52 +02:00
Bram Matthys dbc3182462 Update -DTESTSUITE +f/+F exemption.
The "not setting +F" stuff didn't work, as due to netmerge - which
can even happen without a split when joining clients on both sides -
this would revert to +F normal basically.

So we just explicitly exempt in the join and msg code.

All this is for unrealircd-tests.
2026-04-08 17:50:16 +02:00
Bram Matthys babb86818f S2S: Fix memory leak on RRPC with wrong source (either rogue server or very rare) 2026-04-07 17:59:07 +02:00
Bram Matthys 35974ee46d Fix silly missing bufsize-- in xmlescape(). Not exploitable.
This XML code is only used for DroneBL submission with no user-
controlled variables (except $ip). Still, silly mistake to make
and who knows what other XML stuff will happen in the future.
2026-04-06 08:50:58 +02:00
Bram Matthys bc086e3ffe Add and update doxygen docs for module API 2026-04-04 19:40:03 +02:00
Bram Matthys c0597aa82a Another Windows fix 2026-04-04 09:57:40 +02:00
Bram Matthys 945fb65759 Error when using CommandOverrideAdd() before MOD_LOAD,
since in MOD_INIT the command may not have been added yet thus
then you get silly module-load-order issues, such as in
previous commit 281d0cce9b
2026-04-04 09:08:41 +02:00
Bram Matthys 281d0cce9b multiline: mv CommandOverrideAdd() to MOD_LOAD so module order doesn't matter 2026-04-04 08:51:25 +02:00
Bram Matthys 1334304426 Sigh...
[skip ci]
2026-04-04 08:17:34 +02:00
Bram Matthys 778cf4de82 ** UnrealIRCd 6.2.4-rc1 ** 2026-04-04 08:00:48 +02:00
Bram Matthys f47396a7db Keep using geoip_classic on Windows for this rc1.
geoip_mmdb doesn't compile on Windows, will look at it after rc1.
Also almost forgot to set this GEOIP_ENGINE ;)
2026-04-04 07:56:05 +02:00
Bram Matthys 0931008874 Fix Windows compile 2026-04-04 07:37:44 +02:00
Bram Matthys dc6740bfb7 Small code cleanup (identical branches) 2026-04-04 07:06:18 +02:00
Bram Matthys 7aa1157474 Downgrade libsodium to 1.0.20 to fix arm64 compile issue
Version 1.0.21 which we shipped with 6.2.3 has this bug, reported
by PhotoJim at https://bugs.unrealircd.org/view.php?id=6615.

And yes, libsodium also has this weird -stable thing, which does
have the fix, but that's basically just a snapshot of their git
version, it's a .tar.gz that gets updated every X time and it does
not have a GPG signature, while I have the policy nowadays to
verify GPG signatures for libraries we ship. So I am option to just
downgrade a version, for now, which is fine since we shipped with
1.0.20 for quite some time until recently.
2026-04-04 06:51:41 +02:00
Bram Matthys 70a05cb591 Update release notes a bit
[skip ci]
2026-04-03 19:24:10 +02:00
Bram Matthys 781aecf95a Fix batch reference length. We had two with different sizes.
There is no hard cap on batch reference length, so we had to make one up.
It is now a clear #define MAXBATCHREFLEN 48, which should be plenty.
No sane client is going to use like a 64 byte batch reference :D

So we did use 48, but we also accidentally used BATCHLEN at another
place. BATCHLEN is 22 and refers to how many bytes we generate, so
that is not appropritate.

Thanks to Valware for spotting this.
2026-04-03 16:38:34 +02:00
Bram Matthys 71fe07b445 Update release notes (fix link)
[skip ci]
2026-04-03 09:58:22 +02:00
Bram Matthys fa2f78fe94 Optimize multiline delivery to channels (use LineCache)
This wasn't done before, because optimizing stuff can always introduce
nice new issues. But is kinda necessary now since the previous way was
very inefficient. This now builds all the necessary buffers for multiline
clients and for non-multiline clients. And then iterates through both
types of clients, sending what they need. Instead of doing it the other
way around.

I had the dillema to either expose the linecache API and have everything
in multiline.c. Or, i do not expose linecache, and we do everything in
send.c. The downside of the latter is that if there is mistake then we
can't simply reload (or unload) the module to solve it. So, I have chosen
to expose the linecache API (sure, less clean) since that leaves us with
options if we screw up, plus it means everything related to multiline
sending is nicely in multiline.c, which is i guess just as good as an
argument as well ;)
2026-04-03 09:04:33 +02:00
Bram Matthys 36baf946a3 Guard against multiline+history amplification attacks in CHATHISTORY.
Add a little fake lag based on history result: 400ms for 50 lines
under normal conditions where 50 lines = 50 lines. But this can go
up to 5000ms for worst-case amplification attacks where requesting
50 lines actually returns 50*15=750 lines when each line is a multiline
with max-lines, which gets you close to 350k+. This would only happen
if someone on the channel is doing evil stuff (with presumably consent
of the ops).

Also guard against hiting max sendq. If we are too close, then we
reject the CHATHISTORY request rather than quiting with "Max SendQ
exceeded". This protects against an attack where someone would be
tricked into joining a channel with amplified history (as explained
in previous paragraph), their client would do an automatic CHATHISTORY
request and then the victim would exceed max sendq and thus be killed.

And yes, this and maaaaany other multiline + history interactions
and many "buts" and security/flood concerns are why this implemtnation
took (and still takes) a lot of hours to get right :D.
2026-04-03 07:59:11 +02:00
Bram Matthys a1dc459a33 Update +H limit and write release notes regarding draft/multiline support.
For +H we now temporarily allow overshooting. This only matters for low limits.
Multiline batches are atomic so we have to choose to keep them as a whole
or remove the complete batch. So if +H 5:1h and the last message was a 15-line
multiline event, what do we do? We allow temporary overshooting to store the
15 lines. As said, the alternative would be to store 0 lines which would be
worse in terms of functionality, and the small overshoot is defensible.

For higher limits (where the +H line limit is bigger than multiline max-lines),
we always stay under the +H limit. Eg if all history in a channel consists
of 15 line multiline events and we have +H 100 then we will store 90, not 105.
It's only for +H linelimit < max-lines that this matters, because there the
zero-lines consequence sucks too much ;)
2026-04-02 20:24:21 +02:00
Bram Matthys 04ffe335f1 Send CAP NEW multiline=max-lines=.. on unknown-users<->known-users transition 2026-04-02 18:29:12 +02:00
Bram Matthys 46be05d42f Multiline: fix memory leaks and missing inner tags 2026-04-02 17:34:44 +02:00
Bram Matthys 8c0590cda2 Add multiline support in history. 2026-03-30 19:09:20 +02:00
Bram Matthys 72de809548 Add auto-generated translations for HELPOP CHMODEF about 'p'.
To be honest i don't even like the Dutch one myself but at least
it is a placeholder. Translators are free to fix it ;).
2026-03-30 16:28:27 +02:00
Bram Matthys 143882a358 Add a BUG_EFUNCTIONADD_NOT_OFFICIAL if trying to add efunctions from
modules that are not marked as official.
2026-03-30 14:59:25 +02:00
Bram Matthys 1df465a6a5 Add +f subtype 'p' (for 'paste'). So [2p]:15 means max 2 pastes per 15s.
This way you can limit the number of pastes going on in a channel, as
this is from everyone in that channel (like 'm') not individual (like 't').
If it is exceeded then we will simply reject the BATCH, similar to
how action d(rop) works for some other subtypes. You won't see the paste
on the channel, only the sending user receives an error (MULTILINE_PASTE_LIMIT).

Small note: a multiline BATCH of just 2 lines is not considered a paste.
We consider a multiline of 3+ lines as a paste. I think that is reasonable,
since a two-line-multiline is not that much of a paste ;).

In the default anti-flood profile (+F normal) we also set 2p per 15s,
so this means channels are by default limited to 2 pastes per 15s max.
Of course, you can override this with +f [4p]:15 or whatever you like.
In terms of +F profiles, the defaults are (maximum x pastes per 15 seconds):
very-strict: 1p
strict: 1p
normal: 2p
relaxed: 2p
very-relaxed: 3p
2026-03-30 14:55:03 +02:00
Bram Matthys b0dba4bede Add draft/multiline support with a default max-lines of 15 for known-users
and 7 for unknown-users (with max-bytes 5250 and 1500 respectively). This
allows pasting a short snippet of code, config file, text from a site, etc.

With multiline you have the guarantee that:
1) You will see the entire text with no delay between lines
2) You won't see another persons chat half-way through such a paste
3) For multiline supporting clients it is now clear that all the text
   belongs to each other, which can make selecting/copying it easier.
This basically means short snippets/pastes like that can be completely on
IRC again. No need for a pastebin for it. Though, you may still need such
a service if you are pasting more lines.

Regarding the implementation in UnrealIRCd:
* Clients without multiline get individual fallback lines (concat lines
  merged, blank lines skipped, as per spec). And we know that clients like
  weechat - which does support multiline - also shows all lines and not
  only a few plus snippet style "[.."]. That is another reason for only
  allowing 15 lines by default and not something much more. Otherwise all
  those clients would get a big wall of text, which just sucks.
* Spamfilter (also) runs on the full text of all lines together, so
  splitting a phrase across lines does not evade spamfilter.
* Fakelag: a client can send the BATCH start+PRIVMSG (or NOTICE)+BATCH end
  at full speed. We impose no fake lag there. Also, the multiline default
  max-lines and max-bytes are lower than the example class::recvq of 8000,
  so should be perfectly safe. If the entire BATCH is accepted then we
  will impose fake-lag afterwards, with a cap of 15 seconds maximum.
  If the BATCH is rejected, we impose half the fakelag plus 2sec.
* If the time between BATCH start and BATCH end is more than 15 seconds
  then the BATCH is rejected (set::multiline::batch-timeout).
* The BATCH is atomic (either you see it all, or you see none of it):
  * When the client sends it to server, it is buffered first.
  * Only after the batch close the server indicates if it is accepted
    or rejected. This has various reasons, two of them are: 1) The client
    is going to send everything in one go anyway and not wait for a
    response between each PRIVMSG, and 2) we can't do many checks in the
    buffering stage and skip those after, that would cause a TOCTOU
    problem (eg. a banned user still being able to speak).
  * If any line gets rejected due to spamfilter or other case
    (eg +c, +b ~text with block, etc etc), the entire batch is rejected
  * Locally we deliver all or nothing (as said)
  * S2S we buffer the batch as well, so if a server splits after having
    received 10 lines out of 15, then clients will not see anything.
* We send max-lines and max-bytes, this is the hard upper limit.
* A multiline can still be limited more tight if:
  * +f with 't' or 'm' restricts to fewer lines,
    eg +f [5t]:15, which means max 5 lines per 15 seconds,
    means the max accepted multiline is 5 for that channel.
  * +F works the same, except that default +F normal does not
    have a 't' at the moment and 'm' is very high (50) so
    practically not limited by default.
  * There will be a future +f flood subtype for some more control

TODO: we will send CAP NEW on unknown-users <-> known-users to
      indicate the new max-lines value if you transition security groups

TODO: chat history does not yet include multiline batches.
2026-03-30 13:16:48 +02:00
Bram Matthys 8bfc599697 Guard against EfunctionAdd() from outside MOD_TEST.
As this can keep someone busy for half an hour wondering why things crash...
2026-03-28 10:35:05 +01:00
Bram Matthys eb798510fd Pass the fake lag added msec in ClientContext and add subtract_fake_lag() 2026-03-27 07:46:29 +01:00
Bram Matthys f329a64991 The IsFloodLimit() used a hardcoded channel parameter. This was not a problem.
But is dangerous if the macro would be used where it mattered.
2026-03-26 17:28:51 +01:00
Bram Matthys 14cb15c632 Don't call -m upgrade or -m compile-all if zero src/modules/third/*.c
Reported by bss.
2026-03-25 14:01:42 +01:00
Bram Matthys 6ad7f7dccf And use binary search now that we have so many crule functions... 2026-03-24 19:37:12 +01:00
Bram Matthys ed16dad40e Add a bunch of crule functions:
* Boolean checks: is_oper, is_local, has_swhois
* Match functions: match_class, match_server, match_vhost,
  match_realhost, match_away, match_asname, match_operlogin,
  match_operclass, match_sni, match_tls_cipher
* Numeric counters: connections_from_ip, channel_count,
  channel_member_count, idle_time
* Traffic stats: messages_sent, messages_received, bytes_sent,
  bytes_received
* Text analysis: text_byte_count, text_character_count, word_count,
  uppercase_percentage, digit_percentage, non_ascii_percentage,
  max_repeat_count, mixed_utf8_score, unicode_block_count

Will do a more thorough audit and look at adding some kind of
tests tomorrow.
2026-03-24 19:33:55 +01:00
Bram Matthys 3dd449139b Conditional Config: add @warning "aaa" and @error "bbb"
As usual, this is mostly for configuration templates that you use for
multiple servers, that sort of things, eg.

@if !environment("ADMIN")
@error "Environment variable ADMIN is not set"
@endif

This also adds a change in conf.c so @define, @error and
@warning are skipped in @if blocks that evaluate to false
(that's obviously what everyone wants :D). So that fixes a
previous bug with @define in @if.
2026-03-23 18:47:16 +01:00
Bram Matthys 8adfdf95a0 Little code cleanup in config preprocessor. 2026-03-23 18:13:14 +01:00
Bram Matthys 3521d96f9d This adds module-version("examplemod") and using functions in $define,
such as $define ADMIN environment("ADMIN")
2026-03-23 17:58:36 +01:00
Bram Matthys cf101ca114 Conditional Config: add @if environment("VARNAME") == "something"
to check environment variables.

This also means functions can now return values, so some changes
under the hood. This also moves the <=, >=, <, > ops code.
2026-03-23 17:33:02 +01:00
Bram Matthys 93a485db21 Conditional Config: add support for @else
Actually surprisingly easy due to simply flipping item->negative :D
2026-03-22 19:36:54 +01:00
Bram Matthys 100abaa82d Conditional Config: add support for <, >, <= and >= in @if $SOMETHING ...
And also don't require double quotes on the right hand side.

So you now use something like: @if $MAXCONNECTIONS >= 1024
2026-03-22 19:16:51 +01:00
Bram Matthys 2346aa3977 Code cleanup in conf_preprocessor.c (Conditional Config) 2026-03-22 19:02:29 +01:00
Bram Matthys 17a8182efc Condition Config: add minimum-version() and file-exists().
So: `@if minimum-version("6.2.4")` and `@if file-exists("filename")`.
2026-03-22 18:41:30 +01:00
Bram Matthys 9258875d0f Add @if module-exists("third/coolmod") so you can conditionally
loadmodule + set config items

This checks the file on-disk, which is slightly different than
@if module-loaded("third/coolmod") which checks if it is loaded.
2026-03-22 18:20:36 +01:00
Bram Matthys 27864e8d0e Add new variables in Conditional Config (https://www.unrealircd.org/docs/Conditional_config):
$CONFDIR, $DATADIR, $LOGDIR, $TMPDIR, $DOCDIR, $MODULESDIR, $MAXCONNECTIONS.
2026-03-22 18:07:17 +01:00
Bram Matthys 82481cc083 NO_GEOIP_CONFIG => NO_DEFAULT_GEOIP to make it consistent
As we also have NO_DEFAULT_RPC_SOCKET and NO_DEFAULT_LOG_MEMORY_BLOCK
2026-03-22 17:58:36 +01:00
Bram Matthys ba3fa1d7b6 Update GeoIP question in ./Config and use some magic to support both
geoip_classic and geoip_mmdb in modules.default.conf with Conditional
Config, a dynamic loadmodule line, and auto-updates.

Somewhere in a later version, probably 6.2.5, we will default to mmdb
for all cases.
2026-03-22 17:52:57 +01:00
Bram Matthys b7cd383186 Fix nested @if blocks in config file not working correctly
When using nested @if blocks (e.g. @if module-loaded() inside
@if defined()), only the outermost condition was evaluated.
Inner conditions were silently ignored, causing blocks to be
included even when the inner condition was false.

Also walk the full chain in the loadmodule @if module-loaded()
restriction check.
2026-03-22 17:36:28 +01:00
Bram Matthys 9b83fc0db9 Allow @if with loadmodule, just not module-loaded(). We need this. 2026-03-22 17:07:46 +01:00
Bram Matthys d467005816 Bleh :) 2026-03-22 16:20:25 +01:00
Bram Matthys 69c9130da1 Bump version to 6.2.4-git 2026-03-22 13:45:28 +01:00
Bram Matthys d150da8ea5 Make "geoip_mmdb" the default GEOIP module. So it receives testing.
I still need to update ./Config. I guess we will remove that question
entirely.
2026-03-22 13:38:20 +01:00
Bram Matthys f884bfe755 Another workaround for test suite. 2026-03-22 13:25:36 +01:00
Bram Matthys d6f93e8566 Test suite: update extras/tests/tls/testssl_profiles/pqc.txt
Due to commit 7b48fdca1a
2026-03-22 13:13:30 +01:00
Bram Matthys 806c883a7f Rename geoip_maxmind to geoip_mmdb with a backwards-compatible warn.
This is a mmdb backend which supports various GeoIP providers,
and we no longer use the maxmind library, so this makes sense.
2026-03-22 12:29:00 +01:00
Bram Matthys 172ace9750 geoip_maxmind: use our own mmdb implementation
This is mainly due to licensing. The libmaxminddb library uses the
Apache license, which meant if we would compile it in by default it
would effectively transform our "GPLv2 or later" to "GPLv3 or later".
Our implementation is ISC licensed, so we can include and enable it
by default and keep things at "GPLv2 or later". This is also why we
used geoip_classic in the first place as default and compiled in,
and not the mmdb variant.

The mmdb.c is based on the specification, using the Go implementation
as a reference during development (ISC licensed), initially implemented
with the help of Claude Opus 4.6. After that substantial changes were
made to make it match UnrealIRCd's style and to make things less error
prone: C style changes, allocation and zero termination of strings in
the library, auto-NULL in variadic functions so the caller cannot
forget NULL there (similar to our unreal_log/do_unreal_log), using
enums as the return type instead of int (similar to curl), adding
doxygen docs, etc.

This also means the old mmdb library dependency has been dropped,
including from configure/autoconf.

At the moment we still use the geoip classic library by default,
including those DB files. The idea is we will switch over sometime
later after this current new MMDB stuff has received more testing.

This also makes us more flexible, since .mmdb files have become the
de-facto standard for pretty much all geoip vendors.
2026-03-22 12:10:18 +01:00
Bram Matthys 89bce01c31 Fix OOB write in geoip_csv if the .csv file is bad / malicious.
This module is rarely used but analysis showed that there was an
OOB write in the country name, and two small off-by-ones in code
and continent.

Again, this only matters if the CSV file you are importing is bad
or malicious. And we use stack protection in UnrealIRCd so this
should then "only" cause a crash.
2026-03-16 14:10:29 +01:00
Bram Matthys f944990c54 Fix some flagged stray semicolon in C code (;;) 2026-03-16 09:53:22 +01:00
Bram Matthys 198c9279e1 Fix a check in hash_get_chan_bucket(). The only caller is from list.c
which already ensures in bounds, so not an issue. But who knows in the
future there will be other functions that use it and then the check
is misleading as it doesn't cover all cases.
2026-03-16 09:14:07 +01:00
Bram Matthys e4d6b51d04 Add certificate/key check to CONFIG INIT. So we properly stop booting
or rehashing if there is an error loading them (at least try harder).
Right now they are only in CONFIG LOAD, which is too late to stop things.

Previously "./unrealircd configtest" showed an error but still said
"Configuration test passed OK". And REHASH passed similar. Now, it
is a real error.

This is not to be confused with a "file does not exist" error, which
we already handled properly. It's the less usual ones, like wrong key.

Only downside is more init_ctx() calls, which can be a bit heavy on
various platforms, slowing boot or REHASH down. Should be fine though...
2026-03-15 15:59:09 +01:00
Bram Matthys 08f90d4006 Make certificate_quality_check() work on OpenSSL 3+.
This isn't really important, as you can read below, but was a FIXME item.

This function checks for RSA keys that are less than 2048 bits, so
RSA 1024 is rejected. This was added in UnrealIRCd 5.0.0 (Dec 2019).
RSA 1024 was already looong considered insecure. And those using it
should have been flagged from there on.

OpenSSL 3 changed the API, and this function was never updated to have
the same check with OpenSSL 3+ until now. Fortunately, OpenSSL 3.0.0
onwards reject 1024 bit RSA by default, so that doesn't really matter.
For reference, OpenSSL 3 was released in Sep 2021 and first appeared
in Ubuntu LTS 22.04 (Apr 2022) and Debian 12 (Jun 2023).
However, if you set SECLEVEL to 0 (eg in system-wide openssl.cnf),
it would allow those keys, which is pretty much expected but also not
what we want at UnrealIRCd. From now on, for those rare situations,
we reject it as well.
2026-03-15 10:54:16 +01:00
Bram Matthys 7b48fdca1a Default TLS groups: use tuple syntax with slash to prefer X25519MLKEM768,
even if it costs an extra round-trip due to HRR (Hello Retry Request).
This is IRC after all, where connections live minutes, hours, days,
so that extra round trip is worth it if it means better security.

The TL;DR is: we try harder to use X25519MLKEM768.

The longer story is as follows:

In TLSv1.3, the client will indicate which groups it supports (eg
a list of 4 items) and which ones it speculates to be used (very
often just 2 items). Some TLS clients may not include X25519MLKEM768
in this initial speculation, but only f.e. X25519 and prime256v1
even though X25519MLKEM768 is communicated via their "supported" list.
Without this patch, we would then settle with one of those 2.
With this patch, we will send a Hello Retry Request, allowing to
use X25519MLKEM768.

This is rare, though, most TLS client implementations that have
X25519MLKEM768 will bet on it to be used (the 2 they bet on is
often X25519MLKEM768 & X25519). That's many browsers like Chrome,
OpenSSL, Go, etc.

GnuTLS usually will do this as well, but under some configurations
it may bet on 2 classic crypto to be used. For that specific (type
of) situation, this patch will help to use X25519MLKEM768.
This can be tested with OpenSSL to simulate such an implementation:
openssl s_client -connect 127.0.0.1:6697 -groups X25519MLKEM768:*X25519
Before this patch, it would result in X25519 (because that is the
speculated group, with the asterisk). After this patch it will
cause X25519MLKEM768 to be used.

The tuple syntax is in 3.5.0+ and our UNREALIRCD_DEFAULT_TLS_GROUPS_PRIMARY
with X25519MLKEM768 also requires 3.5.0+ so this is an easy change.

Oh and, this commit comment is rather long for a 1 byte change :D
2026-03-15 07:06:46 +01:00
Bram Matthys 27a3fb8d97 unreal_server_compat: fix always using EXBTYPE_BAN even for +e/+I.
For the extbans that we ship, no problem, as this isn't used in
any of our extbans, but for third party it may matter, or for us
in the future.

Just something we came across while looking into the issue from
previous commit.
2026-03-14 10:20:24 +01:00
Bram Matthys 31005e18b1 Fix extbans in +I not being converted to letter bans to older servers.
This affects servers without NEXTBANS, such as anope 2.0.x series
(anope 2.1.x is not affected as it supports NEXTBANS).

Non-NEXTBANS servers only support letter extbans so we are supposed
to convert ~security-group:known-users to ~G:known-users when sending
to such a server, in unreal_server_compat. And we did this well for
the MODE command for +beI. In SJOIN we did this correctly for +b/+e
but not for +I due to a silly code mistake.

This bug is present since 6.0.0 but wasn't noticed until now.

To be a real problem you need something like:
1. Anope 2.0.x series (or other services without NEXTBANS)
2. A channel with +I extbans
3. KEEPMODES set on that channel

Then what happens is when services boot:
1. UnrealIRCd will sync with anope 2.0.x and incorrectly send
   named bans, which will confuse anope. But nothing strange
   happens yet at this point.
2. Then on next server sync (eg anope restart or unreal restart)
   anope will try to restore these but they end up with weird
   entries like +I *!*@~security-group:known-users
   (note the *!*@ prefix)

And it should be noted that this would also happen in a situation
with UnrealIRCd 5 + UnrealIRCd 6 servers, but UnrealIRCd 5 is
End Of Life anyway.

Reported by BlackBishop and Sadie two days ago. Thanks!
2026-03-13 13:57:41 +01:00
Bram Matthys bcaaaa5949 Fix crash on Windows because of missing MODVAR / __declspec(dllimport)
on 'known_users', which is accessed by the reputation module.
2026-03-11 14:39:15 +01:00
Bram Matthys c3600f0f3a CI: If $USE_SHIPPED_LIBS is 1, then build with shipped libraries from extra/ 2026-03-07 18:34:55 +01:00
Bram Matthys 2d145b0f2c ** UnrealIRCd 6.2.3 ** 2026-03-06 08:23:30 +01:00
Bram Matthys 98709af7a3 modules.optional.conf: extjwt::service::method is required
(which is fine, i think)
2026-03-06 08:22:53 +01:00
Bram Matthys cc1c1c5a73 Update doc/unrealircd_wiki.zim for 6.2.3
[skip ci]
2026-03-06 08:02:19 +01:00
Bram Matthys a841911882 Mention extjwt { } in the release notes: it had API updates, build tests
and we now have documentation on the wiki.

Plus some other textual changes.

[skip ci]
2026-03-06 07:44:13 +01:00
Bram Matthys 7865675917 Fix OOB write if a trusted linked server sends malicious data.
NOTE: Linked servers are considered trusted in UnrealIRCd.

This is not exploitable beyond a crash, due to -fstack-protector-all,
a hardening compiler flag we added many years ago. Even without
that flag it would be rather difficult, and i didn't manage to,
but this should never happen anyway since this flag is only
missing in gcc/clang versions that are more than 15 years old.

This issue was introduced by the move to CMD_BIGLINES in
6c5de62c18 in 6.2.2 release.
2026-03-06 07:14:10 +01:00
Bram Matthys 87e4249a09 extjwt: don't free modes/umodes, they are taken care of by payload. 2026-03-04 17:07:06 +01:00
Bram Matthys c4c082d0b7 And restore this LDFLAGS as well
This completes the fix from e1211adb3b
2026-03-04 11:01:05 +01:00
Bram Matthys e1211adb3b Restore LDFLAGS after setting it in library compiles
But is this enough...?
2026-03-04 10:49:20 +01:00
k4be deff636c74 extjwt: Remove OpenSSL deprecation warnings 2026-03-04 09:38:05 +01:00
Bram Matthys 9289ef7c83 Mention JSON-RPC there as well
[skip ci]
2026-03-04 09:18:20 +01:00
Bram Matthys fc82176cd0 Update README with Mastodon and tell at least something about supported systems.
Mention tested systems as well (which is narrower than supported systems).
And merge documentation and support, since users will usually be after both.
2026-03-04 09:15:36 +01:00
Bram Matthys 7a46caa1da tls-tests: pin to a specific testssl.sh commit hash. 2026-03-03 17:08:35 +01:00
Bram Matthys de2d72b592 Update Build CI. Tightening it down and fail-fast to false. 2026-03-03 07:16:44 +01:00
Bram Matthys 648a10494f Add -DTESTSUITE and use it from extras/build-tests/nix/build.
In particular, this disables default +F for #__SYNC__ channels.
The test suite has a "+F off" but when on 3 servers, each 75
clones are connecting, the MODE is too late and the join limit
is already reached sometimes. Causing tests to fail.
2026-02-28 15:26:57 +01:00
Bram Matthys 426289e377 Drop really verbose logging from build tests as it makes things too slow 2026-02-28 12:18:11 +01:00
Bram Matthys b06a3a34d0 Update extras/build-tests/nix/run-tests.bbwrapper to fix FreeBSD issue. 2026-02-28 12:04:34 +01:00
Bram Matthys 55fda3456d Update TLS tests with pqc_arm.txt (on rpi 5, slightly differs from pqc.txt)
OpenSSL prefering X25519 vs secp521r1 for ECDH and vice versa,
still looks fine.
2026-02-28 10:47:38 +01:00
Bram Matthys cd317e678c Update release notes on latest two changes.
[skip ci]
2026-02-25 15:21:57 +01:00
Bram Matthys 70d6cb2589 If no 3rd party modules are installed, then skip the module upgrade step.
This means we don't do an HTTPS call at build time when unnecessary.
2026-02-25 15:04:49 +01:00
Bram Matthys 17037b0694 Fix build failing if DNS is not working. Building UnrealIRCd should never fail
because it has no internet access, like when fetching the repository
(modules.list file) of 3rd party modules.

Previously I had..
url_start_async(request);
synchronous_http_request_in_progress = 1;
.. which worked fine for the "cannot connect case", like port blocked
or timeout connecting. But if DNS fails then the step of setting
synchronous_http_request_in_progress = -1 (so failed) already happens
during the url_start_async(request); call, and then the line after it
sets 'synchronous_http_request_in_progress = 1;' so we miss that it
failed and wait in the I/O loop forever.
Simply swapping the two lines of code fixes this.

The other change is that when running the ModuleManager in "make" we should
ignore the exit code. I probably broke that while refactoring and adding
non-zero exit codes in de modulemanager past few months for this release.
2026-02-25 14:58:11 +01:00
Bram Matthys bd1ccde9c3 ** UnrealIRCd 6.2.3-rc2 ** 2026-02-25 08:28:20 +01:00
Bram Matthys 2f839c85f7 Reorder some release notes items 2026-02-23 10:54:12 +01:00
Bram Matthys 93c26c2d42 Update release notes. 2026-02-23 10:04:08 +01:00
Bram Matthys 3a96bdf6ec Add set::allow-setident (default: 'no'), set::allow-setname ('yes')
Two new settings that control the use of `SETIDENT` and `SETNAME`:
* [set::allow-setident](https://www.unrealircd.org/docs/Set_block#set::allow-setident)
  now defaults to 'no'. Previously all users were allowed to change their
  ident (taking into account
  [set::allow-userhost-change](https://www.unrealircd.org/docs/Set_block#set::allow-userhost-change)
  restrictions).
* [set::allow-setname])(https://www.unrealircd.org/docs/Set_block#set::allow-setname)
  has a default of 'yes' which matches older UnrealIRCd versions (no change).
  Perhaps some admins who use controlled (web)chats may want to set this
  to 'no' if users are not supposed to change their realname/gecos.
  This is probably rare, but they have the option now.
2026-02-23 08:58:39 +01:00
Bram Matthys a6cdd4b548 Use the exact same approach for argon2 as the other libs
(fixes build)
2026-02-23 08:04:31 +01:00
Bram Matthys d19919df07 Add extras/build-tests/nix/hardening-check.sh so i can use from BuildBot. 2026-02-23 07:48:47 +01:00
Bram Matthys 3e9ce77dc6 Hardening: build the last 2 remaining libs with hardening flags too
Library argon2 uses a makefile without configure, so works a bit different
And GeoIP i forgot because it was in a different autoconf file.
2026-02-23 07:17:02 +01:00
Bram Matthys 4c01372e3b Move orig_cflags="$CFLAGS" to after AC_PROG_CC_C99
As otherwise the shipped libs don't (necessarily) get -O2 -g,
which in turn means _FORTIFY_SOURCE=3 won't work.
2026-02-22 20:15:33 +01:00
Bram Matthys ae245865ea Pass hardening flags to libraries that we build/ship ourselves (if any)
Previously we didn't and that means that if any shipped lib was used,
without hardening, this would cause non-CET libraries to silently disable
CET for the entire process, and partial RELRO on the libs means the
full RELRO in UnrealIRCd is much less useful.

Actually, system libs on Debian/Ubuntu don't even have full RELRO atm,
but hey, we try to do better, also.. some other OS/distro might
have it on and who knows Debian/Ubuntu change their mind later..
2026-02-22 19:50:46 +01:00
Bram Matthys dcd8f738fe Remove -fzero-call-used-regs=used-gpr again. This is apparently not
as useful as initially thought. I thought kernel hardening checker
was in favor of it, and they were, but they dropped it in Oct 2023.

(i added it 2-3hrs ago in 0ab1221a38)
2026-02-22 19:02:31 +01:00
Bram Matthys 5cc59192bc Hardening: add -mbranch-protection=standard for arm64 that support it.
e.g. raspberry pi 5, aws ec2 graviton2 and higher, etc.

This does the same as -fcf-protection on x64 (well, those that support it).
2026-02-22 18:29:17 +01:00
Bram Matthys 4d4a43984c Hardening: add -ftrivial-auto-var-init=zero
This zeroes out variables that COULD be accessed before being set
(so to prevent access to unitialized variables). We are generally
very careful about this in our code, but in 3rd party modules this
is less the case. And still useful in case we ourselves screw up.
2026-02-22 16:38:55 +01:00
Bram Matthys 0ab1221a38 Hardening: add -fzero-call-used-regs=used-gpr
Is defense in depth to make ROP harder. In general this is reported to
have a performance impact of 2% worst-case. Linux kernel reports 1%.
Should be closer to 0% for us, or that 1% if i am wrong.
https://lwn.net/Articles/870045/ has some background on this.
2026-02-22 16:33:38 +01:00
Bram Matthys d668c4b78b Hardening: add -fstrict-flex-arrays=3
This should help gcc/clang with finding more OOB write bugs.

It does mean that 3rd party modules can no longer use the something like:
struct { char name[1]; }
and then alloc(sizeof(struct) + length of name)

instead the struct element needs to be name[];
...and they would need to alloc(sizeof(struct) + length of name + 1)

No 3rd party modules in unrealircd-contrib use this so.. hopefully fine.
2026-02-22 16:26:57 +01:00
Bram Matthys 014925496b Forgot a few more of those [1] that need to be []
(see previous commit)
2026-02-22 16:24:55 +01:00
Bram Matthys 7d45e69fd2 Use C99 flexible array members, like name[], instead of name[1]
in NameList, Tag, Watch and HistoryLogLine.
This does mean the allocation routines need a +1 everywhere, but
I think I got all of them. I also don't see them being used directly
in such a way in 3rd party modules (which is logical, as they
should use the API and not allocate such structs directly).

Also, SpamExcept has been removed as it was not used anywhere.
2026-02-22 16:11:41 +01:00
Bram Matthys fb0649f14a Use full RELRO for modules (use HARDEN_LDFLAGS in MODULEFLAGS)
Previously, due to HARDEN_LDFLAGS missing in MODULEFLAGS we were
only partial RELRO instead of full RELRO. This is a defense-in-
depth measure but is good to have and the ommission was unintended.
2026-02-22 15:37:45 +01:00
Bram Matthys 8be6337e71 Update release notes
[skip ci]
2026-02-22 13:28:56 +01:00
Bram Matthys 19d17832fe Remove set::restrict-extendedbans as it didn't work. Simply don't load
the particular extended ban module if you don't want it.

For example, if you include the default modules.default.conf and, say,
you don't want ~quiet extbans then you add this in your unrealircd.conf:

blacklist-module "extbans/quiet";
2026-02-22 13:07:57 +01:00
Bram Matthys 6933e1839b Update extban_conv_param_nuh_or_extban() to use MAXBANLEN
instead of arbitrary 256 and such. Also makes it so other people
reading this code will understand better that MAXBANLEN is the
real limit here and not 256 (which is never reached because
the cut off already happens at 200).
2026-02-22 12:42:44 +01:00
Bram Matthys d38a106879 Enforce MAXBANLEN (which is MODEBUFLEN) at some more places.
This shouldn't be needed except for some corner cases, like if some
third party module does not limit their stuff properly, in S2S
or if channeldb contains some weird long entry or something.
2026-02-22 12:38:01 +01:00
Bram Matthys ac86029a61 Make convert_regular_ban() and extban_conv_param_nuh() consistently
allow bans of NICKLEN+USERLEN+HOSTLEN+3. Previously NICKLEN was
ommitted for some reason, which also explains why this ban-
simplification-routine exists in the first place. I think we can
make it use this full n!u@h space. Especially since we already allow
this for bans like ~quiet (the full n!u@h) and other extbans can be
quite long as well, it no longer makes sense to limit it here.

Small detail: in extban_conv_param_nuh() we used +32 which i think
is from the times when we had to deal with prefixes like ~quiet,
which is no longer the case, this routine is only about the final
suffix after the last : in a ban.
2026-02-22 11:58:15 +01:00
Bram Matthys 979f44bde4 Linking: upon duplicate server we could SQUIT the wrong one.
This would cause a bit of a mess, that usually would be resolved a few
seconds later, but still a mess. I had this on irc*.unrealircd.org
myself when rerouting a server from a backup-hub to primary-hub
a few months ago.
2026-02-22 11:37:09 +01:00
Bram Matthys d79161019a Clear client->local->proto for users.
This is not an issue now in all code paths, but if someone accidentally uses
SupportXYZ() without checking IsServer() then it would be an issue.

In the past we used client->local->proto for client flags as well, but this
has been split off to client->local->caps a while ago.

I guess we should rename client->local->proto to something more server-ish
in a later major release to indicate this as well.
2026-02-22 10:37:01 +01:00
Bram Matthys 371cb487b9 Fix missing "return;" in "Bad ulines" rejection of a server. 2026-02-22 10:00:32 +01:00
Bram Matthys 43da14f7c6 Get rid of old confusing comment in src/parse.c regarding commands with 0 flags
if (cmptr->flags != 0) { /* temporary until all commands are updated */

But that is impossible, as CommandAdd()->CommandAddInternal() already has:

if (!flags)
{
        config_error("CommandAdd(): Could not add command '%s': flags are 0", cmd);

And this is the case since commit ceb04cc3eb
from July 15, 2015.
2026-02-22 08:05:18 +01:00
Bram Matthys 059abc4b56 "STATS fdtable" is mostly for debugging. Simplify read/write handler display
and callback data in non-DEBUGMODE. Also because exposing pointers like
this can defeat ASLR. These STATS are oper-only though, but hey, defense in
depth... and the pointer values don't make sense to non-devs anyway,
so why show them in the first place.
2026-02-21 19:41:56 +01:00
Bram Matthys b467e4e147 JSON-RPC: Fix missing mtag issued by in user.part
We use mtag_add_issued_by() to prepare it but then pass NULL
in do_cmd() so it was basically useless.

Also compile fix for previous (forgot to git ammend)
2026-02-21 16:22:36 +01:00
Bram Matthys ec4ccbde82 Fix memory leak on JSON-RPC log.send and fix a small auth url parse thing.
Actually that auth url method is not documented, we should probably remove it.
2026-02-21 16:18:34 +01:00
Bram Matthys b93cb14623 Fix crash due to fix from a few hours ago (5580b294f4) 2026-02-21 16:04:50 +01:00
Bram Matthys d22f65364c Make duplicate deny link::rule items an error.
(as otherwise using duplicated generates only a warning and could memleak)
2026-02-21 14:57:41 +01:00
Bram Matthys f81fd965ea Mask item or security-group: add check for duplicate rule / exclude-rule 2026-02-21 14:55:13 +01:00
Bram Matthys b55a4b84e0 Blacklist hit with a soft ban action: fix memory leak if multiple hits occur.
So, if the IP was on multiple blacklists.
2026-02-21 14:43:41 +01:00
Bram Matthys 8740774d25 Not important but.. this did not free element 255. 2026-02-21 14:01:29 +01:00
Bram Matthys f20b62ea3b Fix memory leak on blacklist hit if using soft bans 2026-02-21 13:59:10 +01:00
Bram Matthys fae9dacf5d Fix some small REHASH leaks: tld->channel, link->connect_ip,
allow->server (last one is very rare).
2026-02-21 13:56:30 +01:00
Bram Matthys 28a8bee041 Don't use 'client' in CENTRAL_BLOCKLIST_ERROR, prolly copy-paste error.
Not really important as it is not part of the normal log message (only JSON).
2026-02-21 13:49:26 +01:00
Bram Matthys f59b937f3b Fix leak if central-blocklist returns "error" JSON string (very rare) 2026-02-21 13:45:47 +01:00
Bram Matthys 5580b294f4 Fix memory leak if using spamfilter::except. 2026-02-21 13:20:17 +01:00
Bram Matthys be479aa890 The buffer in spamfilter_build_user_string() was too small causing cut off.
This affects the spamfilter 'u' target. It didn't overflow but was cut off,
potentially causing a NON-MATCH where it could have been a MATCH instead.
2026-02-21 13:18:30 +01:00
Bram Matthys 2ac09de148 Fix central spamfilter with "stop" action, due to using same &var twice. 2026-02-21 13:13:15 +01:00
Bram Matthys 6130c1b5ae Update Windows build because library package with cURL changed
due to switch to 'cmake'. This is for unrealircd-libraries-6.2.3.zip from
https://www.unrealircd.org/docs/Windows_external_libraries_for_UnrealIRCd
2026-01-31 14:35:55 +01:00
Bram Matthys d8e631bacb ** UnrealIRCd 6.2.3-rc1 **
(not 6.2.2-rc1 :D)
[skip ci]
2026-01-31 10:14:21 +01:00
Bram Matthys bb4d1b528f ** UnrealIRCd 6.2.2-rc1 **
(Actually the Windows build is still building :D)
2026-01-31 09:44:57 +01:00
Bram Matthys 287184649c Update doc/unrealircd_wiki.zim to version of 2026-01-31. 2026-01-31 09:43:35 +01:00
Bram Matthys a93ab146b6 Add rpc/message and rpc/security_group modules for Windows build 2026-01-31 07:54:14 +01:00
Bram Matthys 4218010000 Update curl-ca-bundle to latest version (Dec 2 04:12:02 2025 GMT)
[skip ci]
2026-01-30 13:00:33 +01:00
Bram Matthys 6083c039cd Update shipped libs: PCRE2 (10.47), Jansson (2.15.0), Sodium (1.0.21) 2026-01-30 12:58:12 +01:00
Bram Matthys c24424bb50 JSON-RPC: throttle.set did not do anything
Reported by adator in https://bugs.unrealircd.org/view.php?id=6608
2026-01-30 07:39:37 +01:00
Bram Matthys bd1e25d017 Slightly raise default set::handshake-timeout from 30 to 40 seconds. 2026-01-28 09:44:49 +01:00
Bram Matthys 91d5114a1e Whitespace fix
[skip ci]
2026-01-28 09:38:39 +01:00
Bram Matthys ad1b59b4bd Update release notes a bit (what we have so far)
[skip ci]
2026-01-28 09:37:45 +01:00
Bram Matthys 728807d233 Set SSL_OP_NO_RX_CERTIFICATE_COMPRESSION by default.
Every time compression has been used in TLS it has been a source of
trouble. We don't care about such optimizations anyway since connections
are long-lived in IRC. We are not some kind of webserver where every
millisecond counts.
2026-01-27 19:31:25 +01:00
Bram Matthys e083852e86 Create separate resolver channel resolver_channel_https for HTTPS requests.
This one has DNS caching enabled[*], which makes sense for this case.

[*] If using c-ares 1.31.0 or later. That version was released in June 2024.
The shipped-with-UnrealIRCd library version is 1.34.6, so qualifies.
However, if using system c-ares (which is automatically the case, if detected)
then many systems don't have it. The first Linux distro versions that qualify:
* Fedora 40
* Debian 13
* Ubuntu 25.04 (non-LTS) and future Ubuntu 26.04 (LTS)
* Etc...
2026-01-26 09:57:07 +01:00
Bram Matthys a887de92ce Add extra safety in register_user() against shunned users. 2026-01-25 12:56:52 +01:00
Bram Matthys 8467969878 Don't show confusing CENTRAL_BLOCKLIST_TIMEOUT when user is shunned.
Previously it showed this warning and said "Allowing user .. in unchecked"
when the user got shunend by CBL. Usually harmless but.. had a report
where it possibly was not (though that was an older UnrealIRCd version).
In any case, confusing, solved now!
2026-01-25 12:54:30 +01:00
Bram Matthys ef75962a70 We now use a non-zero exitcode if ./unrealircd module install ... fails
Reported by ikci in https://bugs.unrealircd.org/view.php?id=6578
2026-01-23 13:15:17 +01:00
Bram Matthys af0f1fdd6b ModuleManager: check version of local module, don't overwrite if it is newer.
This was a long standing requests by devs.

So if third/something is version 1.2.3 in the repository, and you have
src/modules/third/something.c which is version 1.2.4 then neither
'./unrealircd module upgrade' nor './unrealircd module upgrade third/something'
will overwrite the module. It will stay the local 1.2.4 version.
A new status inst/LOCAL was added "module installed, local version is newer
than available online"

The command './unrealircd install third/something' would still (re)install
the online version, though, i think that makes sense.

When working on this I noticed that './unrealircd module upgrade' previously
always recompiled the module, even if it was not updated. This is no longer so.
2026-01-23 11:56:48 +01:00
Bram Matthys 91930e3631 Bleh, just use "*" in ERR_INVALIDMODEPARAM for the param.
Otherwise you get into trouble if client does things like:
MODE #test +l ::a
MODE #test +l :a b c
And I am too lazy to handle these cases :D
2026-01-23 08:48:34 +01:00
Bram Matthys d413959e57 Chanmode +l: when coming from an IRC client, reject <=0 instead of transforming.
Reject it with an ERR_INVALIDMODEPARAM, just like we do for +k.

I think the higher number transforming is fine, but this <=0 transformation
is odd as it almost never is what the user actually intended.

In S2S traffic we still transform, as rejecting there is more problematic,
(causing a desync) and transforming it there is not a major issue, anyway.

Reported by ProgVal in https://bugs.unrealircd.org/view.php?id=6602
2026-01-23 08:45:34 +01:00
Bram Matthys 2dd23d13b7 Silently drop TAGMSG to users who refuse PRIVMSG/NOTICE also (umode +D, +R),
since the message/notice would not make it through either.
This also means someone can no longer iterate through users to see who
is +D/+R by sending a "silent" TAGMSG. (Silent in the sense that the
end-user usually would not have noticed)

Suggested in https://bugs.unrealircd.org/view.php?id=6579 by zw32h (I think)

This also means HOOKTYPE_CAN_SEND_TO_USER now allows you to NOT to
set errmsg, to silently drop a message. Previously we would crash
deliberately on such a situation to enforce that all modules would
set a proper errmsg.
2026-01-23 08:23:22 +01:00
Bram Matthys 3925cea089 Update release notes a bit
[skip ci]
2026-01-23 08:11:01 +01:00
Bram Matthys c2db2715c0 Fix post-registration SASL not working due to change from a few days ago.
(commit 0cf0c0faa2)

This was caused by register_user() being called twice, while it should
only have been called if !IsUser().

Reported by ProgVal in https://bugs.unrealircd.org/view.php?id=6606
My BuildBot screen was also all red :D.
2026-01-23 07:48:01 +01:00
Bram Matthys a5f1aa7f34 Print a [BUG] line if register_user() is called twice. Deliberately crash
when running in DEBUGMODE.
2026-01-23 07:42:57 +01:00
Bram Matthys eea4cfa762 Modulemanager: support compile-flags and always look at modulemanager block
1) We now always look at the module { } block even for unmanaged modules
   (so .c files that you put manually in src/modules/third)
2) New module::compile-flags to allow specifying compile flags / libraries / etc.

See https://www.unrealircd.org/docs/Special_module_manager_block_in_source_file

So the new stuff is:

module {
        .....
        // Simple library dependency:
        compile-flags "-lsomelib";
        // Can even use:
        compile-flags "$(mysql_config --cflags) $(mysql_config --libs)";
        .....
}

This was requested long ago by various people.

And yes, this allows shell commands to be executed if the 3rd party indicates so.
The added risk should be small, since the module could do similarly evil stuff at
runtime, unless you compile with a totally different user compared to runtime.
The most common case where compile time vs runtime is completely different would
be for packaging (deb/rpm/whatever), which presumably ship with zero 3rd party
modules, so then there shouldn't be a concern either.

Obviously, for 3rd party modules in the unrealircd-contrib repository we screen
modules to make sure they don't do anything evil: "No malicious code or intent"
in https://www.unrealircd.org/docs/Rules_for_3rd_party_modules_in_unrealircd-contrib
2026-01-19 09:48:37 +01:00
Bram Matthys 34e3469f91 Merge branch 'unreal60_dev' of github.com:unrealircd/unrealircd into unreal60_dev 2026-01-19 09:04:51 +01:00
Bram Matthys 96f4954e2b Compile ALL 3rd party modules through modulemanager, including unmanaged.
This gets rid of src/buildmod and unifies the process a little, which
i need later.

We still compile the 3rd party modules unconditionally and twice (during
both make and make install). Which is a quirk that is in there since U6
and maybe U5 already :D. That's because we don't check if header files
have changed. There was previously a "is the .c file newer than the .so"
in there, though, that is gone now. Anyway, that's something for later.

Another quirk is that we do not halt compile if a 3rd party module fails
to compile. Which was sortof intentional at one point but.. is not ideal,
so will probably changed as well.

Anyway, that's not why i am doing all this stuff right now...
2026-01-19 09:02:53 +01:00
Valerie Liu 1dd6e9b07b Fix indentation in sasl.c return statement (PR #333) 2026-01-18 19:32:11 +01:00
Bram Matthys 0cf0c0faa2 Wait for SASL to complete during handshake (success/fail/timeout).
This is to guard against clients that do like CAP LS 302, NICK, USER,
AUTHENTICATE, CAP END, without waiting for the SASL result.

Previously "CAP END" would abort SASL if the response was not in yet.

Now "CAP END" will cause us to wait for SASL success/fail/timeout
and when that happens we will end the handshake and the user will
come online (or not, if e.g. banned).

In other words, SASL is no longer canceled upon premature CAP END.

And yeah, clients should wait, as is mentioned in
https://ircv3.net/specs/extensions/sasl-3.1
"it is RECOMMENDED to only send CAP END when the SASL exchange is
 completed or needs to be aborted"
But since it is a recommendation and not a hard requirement, we'll
be nice and handle this situation server-side.

Of course, clients could still misbehave then by sending stuff
blindly after CAP END, like JOIN events, without even checking
if they got numeric 001 and so on... so in that sense it shifts
the problem a bit.. but.. at least that type of waiting is
hopefully more common :D
2026-01-18 19:06:59 +01:00
Silent 275f04c76c Fix Y2038 bug on Windows in unreal_setfilemodtime (PR #332)
Int32x32To64 macro internally truncates the arguments to int32,
while time_t is 64-bit on most/all modern platforms.
Therefore, usage of this macro creates a Year 2038 bug.
2026-01-11 07:33:49 +01:00
Bram Matthys 1c461db46d Call update_known_user_cache() right before HOOKTYPE_REMOTE_CONNECT.
Set known_users=NULL during a very limited period, just to be safe.
(Note that it can also be NULL during initial boot, which is a
 longer period, which is why we always NULL-check in the code that
 accesses it, but this aside)
2026-01-10 10:36:40 +01:00
Bram Matthys 0cf9fb1cb0 Also update_known_user_cache() from AllowClient(), just before
calling HOOKTYPE_ALLOW_CLIENT and (potentially) allowing the client in.
2026-01-10 10:32:07 +01:00
Bram Matthys 4235a183e3 Call update_known_user_cache() when reputation score reaches known-users
threshold.

* Possible transition to known-users:
* - logged in is already handled by HOOKTYPE_ACCOUNT_LOGIN so we don't care about those
* - score reached (or just over) the minimum reputation score
* Caveat: if having multiple connections from the same IP then
* the first one may theoretically not have crossed in some cases.
* Ah well, it is a cache, not some precise thingy.
2026-01-10 10:15:09 +01:00
Bram Matthys 76aa3a12a6 Add SecurityGroup *known_users, to more quickly fetch those settings.
And use this in a couple of core routines.

This is to speed things up a liiittle.
2026-01-10 10:14:47 +01:00
Bram Matthys 7374fcc83f Add client->known_user_cached as a quick way to determine if the
user is in known-users or in unknown-users. Not used anywhere yet.

Every 2 minutes we rescore all users. Or more specifically: every
5 seconds we rescore 1/24th of all users. That's the slow update path.

On certain events that cause a likely/possible transition, we update
the cache immediately. At the moment that is on IP change and account
login/logout. More will be added later.
2026-01-10 09:57:18 +01:00
Bram Matthys 34ab517d9e Fix possible problem with channel in config-file, such as security group
or elsewhere. I don't think this is an actual problem, but at least the
fix from 1abf73309a was inconsistent,
if we check for b->client further down, then we should not be reading
from it a few lines up. As said, don't think this code is reached in
practice, but hey...
2026-01-04 10:31:38 +01:00
Bram Matthys de05bb9654 Bump version to 6.2.3-git and write some early release notes 2026-01-04 10:20:46 +01:00
Bram Matthys 21d58a7ebd Do the same as previous commit for the help.*.conf translations
This transplants commits 2868c3fedb
to doc/conf/help/help.*.conf
2026-01-04 09:47:37 +01:00
Bram Matthys 2868c3fedb help.conf: try to be consistent by documenting only end-user commands,
thus removing commands that are only supposed to be used by IRC clients.
We don't intend to document things like CAP, PONG, etc here.

Remove ISON, PONG, WATCH. Also remove DALINFO which no longer exists.

Re-index the USERCMDS and OPERCMDS table. This removes no longer existing
commands and may also have added some that were not in the index.

Moved STATS from USERCMDS to OPERCMDS since by default it is Oper-only
(and very likely is so effectively in practice).

Maybe PRIVMSG is a bit inconsistent in all this, since users don't type
that but usually it is like MSG. But yeah.. okay.. i can live with that.

As an aside, I don't like services commands being documented in HELPOP,
but that is another matter. These should be 100% documented in the wiki
first before they are scratched in the HELPOP. Right now some are still
missing.
2026-01-04 09:36:01 +01:00
Bram Matthys 2ca1dd0000 Warn about something like ban user { mask { asn { 12 34; } } reason "go away"; }
Where 12 34; is wrong and should have been 12; 34;
Reported by roger.
2026-01-03 20:17:18 +01:00
Bram Matthys 4e3989f304 Add ban user { ....; soft yes; } as an easy way to add a soft-ban from
the config file, without having to resort to things like mask %~asn:XXX;
Now you can just use:
ban user {
	asn { 11111; 22222; 33333; 44444; }
	soft yes;
	reason "This ASN is not allowed. If you have an account you can still bypass";
}

Requested by nobody but sounds like a good idea :)
2026-01-03 19:59:52 +01:00
Pedro Catalão d0a553790d Fix typo in Windows installation instructions link (PR #331) 2026-01-03 10:34:44 +01:00
Bram Matthys 1abf73309a Fix crash when using Extended Server Ban with invalid syntax in config file.
Reported for 'country', but also applied to 'asn', 'certfp' and 'channel'.
2025-12-26 12:25:05 +01:00
Bram Matthys c85c16f78c JSON-RPC: server_ban and server_ban_exception: expand mask/match items
Previously these showed up as "name":"<match item>", now they show
up properly like this:
        "match": {
          "account": "Syzop"
        },

(... and have no "name" item)

Also expand spamfilter::except while we are at it.
2025-12-14 10:37:50 +01:00
Bram Matthys ded89d1935 JSON-RPC: Make connthrottle.status use config::except and change "state".
* I changed "state":"active" to "state":"monitoring" to make clear it is
  not throttling at that moment but actively monitoring the situation.
* The config::except stuff was previously shown directly under config
  and only 3 particular items (that are most popular). Now we expand to
  sub-item "except" and use json_expand_security_group() to expand all
  the mask items, in a consistent way, just like for security groups.

{
  "jsonrpc": "2.0",
  "method": "connthrottle.status",
  "id": 123,
  "result": {
    "enabled": true,
    "throttling_this_minute": false,
    "throttling_previous_minute": false,
    "state": "monitoring",
    "start_delay_remaining": 0,
    "reputation_gathering": false,
    "counters": {
      "local_count": 0,
      "global_count": 0
    },
    "stats_last_minute": {
      "rejected_clients": 0,
      "allowed_except": 0,
      "allowed_unknown_users": 0
    },
    "config": {
      "local_throttle_count": 20,
      "local_throttle_period": 60,
      "global_throttle_count": 30,
      "global_throttle_period": 60,
      "start_delay": 180,
      "except": {
        "identified": true,
        "reputation_score": 24
      }
    }
  }
}
2025-12-14 10:26:28 +01:00
Bram Matthys c990848d2f Make json_expand_security_groups() really expand all and reorder some.
* Add some missing fields, such as destination, but mostly in the
  exclude- area where a bunch were missing (some of those are a bit
  far fetched, but hey, they exist, so should be shown if in use).
* Re-order fields to more closely match the struct (still not 100%)
* Extended fields, such as "account" and "country", now show up
  directly under the security group, just like the other fields,
  such as "reputation_score". This is also how they show up in the
  config file, so hide the the fact that internally in the struct it
  is stored differently.
* Add a comment in SecurityGroup struct in include/struct.h to make
  it clear you have to add/update stuff at 7 places if you are adding
  something new.
2025-12-14 10:11:09 +01:00
Bram Matthys 426040d870 Move json_expand_security_group() from rpc/security_group to core
and don't include name/priority if it is called for a match item
(which don't have a name or priority).
2025-12-14 09:43:52 +01:00
Bram Matthys 806fa83dd7 ** UnrealIRCd 6.2.2 ** 2025-12-12 12:16:31 +01:00
Bram Matthys 65a1f657b9 Fix testssl profiles to match output of new version of testssl.sh. 2025-12-12 11:57:42 +01:00
Bram Matthys 94d4ded864 Update c-ares to 1.34.6 and update release notes. 2025-12-12 10:13:49 +01:00
Bram Matthys fd52b71081 Setting set::tls::certificate and set::tls::key did not override the default
certificate or key. It added the cert/key to the list of certs, like a
"dual cert" approach.

This was caused by commit 877d151da4,
which indeed adds support for "dual cert" (or more).

I have now deferred setting the default to happen only if no
set::tls::certificate is specified, as you would expect.

We (already) used a similar delayed-initialization / deferred setting
approach in the ::tls-options inheritance code (for blocks like
listen, sni, link, etc.)

Just as a slightly related reminder, we do normally suggest keeping the
conf/tls/server.cert.pem and conf/tls/server.key.pem for server linking
and then use a cert from a trusted CA in the listen block for 6697 etc.
See https://www.unrealircd.org/docs/Using_Let's_Encrypt_with_UnrealIRCd
for more information (and the 'why').
2025-12-10 19:00:12 +01:00
Bram Matthys bda03caf81 modules.default.conf: fix warning of comment in comment, due to rpc/*
Change comment style. Counter-intuitive, but fits the rest of the file.
2025-12-06 17:08:58 +01:00
Valerie Liu 7964345c0b Add RPC methods for security_group and connthrottle (#328)
New RPC methods:
- security_group.list: List all security groups
- security_group.get: Get details of a specific security group
- connthrottle.status: Get full connection throttle status, counters, and config
- connthrottle.set: Enable/disable connection throttling
- connthrottle.reset: Reset connection throttling counts

This also adds json_expand_mask_list(), json_expand_name_list(), and
json_expand_nvplist() to src/json.c for reuse by RPC modules.
2025-12-06 14:58:57 +01:00
Bram Matthys d2586a4b9c Add a blob of text (comment) about JSON-RPC in modules.default.conf
A link to https://www.unrealircd.org/docs/JSON-RPC and such is nice.
And also explain that not all JSON-RPC modules will be in rpc/*.
Sometimes it makes more sense to just put everything in the same
module, such as connthrottle RPC stuff in the connthrottle module.
2025-12-06 09:52:34 +01:00
Valerie Liu 65f85a1b28 JSON-RPC: Add message.* (PR #327 from Valware)
* message.send_privmsg
* message.send_notice
* message.send_numeric
* message.send_standard_reply
2025-11-28 12:24:19 +01:00
Bram Matthys a9ddc3768b Fix some lines ending with \r\r\n instead of \r\n with labeled-response.
Reported by andymandias in https://bugs.unrealircd.org/view.php?id=6406
2025-11-20 11:27:29 +01:00
Bram Matthys 8715e54059 Fix some wording in release notes
[skip ci]
2025-11-19 09:06:56 +01:00
Bram Matthys 1cdf3594ba Make a start with the (very early) release notes
[skip ci]
2025-11-19 08:53:41 +01:00
Bram Matthys 2653b5152e Fix crash if you don't load usermodes/bot or usermodes/noctcp.
It should be perfectly fine if you choose not to load these modules but,
while optimizing / speeding up the find_user_mode() function, i made
it crash in case the hunted user mode does not exist. Oops.
2025-11-19 08:21:27 +01:00
Bram Matthys 242267c280 Fix github CI 2025-11-15 18:40:59 +01:00
Bram Matthys b1210024c6 Bump scratch buffer too, or we would overflow due to previous commit 2025-11-15 18:40:04 +01:00
Bram Matthys 6c5de62c18 Add CMD_BIGLINES support to SJOIN (incoming only)
We still propagate in a non-biglines way, no plan to change that atm.
This is just future-proofing. More testing/auditing needs to be done,
especially to see if buffers are sufficient.
2025-11-15 17:05:45 +01:00
Bram Matthys 3c0046be8b Attempt to fix fight with Gottem's auditorium module.
delayjoin was setting +d if there are invisible users still,
but it should only do that if the channel was +D earlier and
not in all cases (like if some other module is dealing with
invisible users).
2025-11-12 17:51:17 +01:00
Bram Matthys 61ebd34a1e Fix compile error and add URL validation: valid UTF8, no spaces, no low ASCII 2025-11-12 10:53:43 +01:00
Bram Matthys 68f01814be Some minor updates to previous.
* We try to keep the dynconf variables the same name as in the conf
  (well, with hyphens to underscores, and there are some exceptions)
* Remove unnecessary but otherwise harmless second safe_free()
* The URL could have been too long. It is now limited to 360 characters,
  which should be plenty.
2025-11-12 10:14:27 +01:00
Valerie Liu 557595fd1c Implement IRCv3 network icon support (PR #326)
set { network-icon 'https://...........'; }
https://ircv3.net/specs/extensions/network-icon
2025-11-12 10:01:42 +01:00
Valerie Liu f7865140ad Allow '/' in ISUPPORT tokens (PR #325)
Relax requirements for ISUPPORT tokens a little bit, to include '/', which allows for vendor-prefixed isupport tokens. More info:
- https://modern.ircdocs.horse/#rplisupport-005
- https://github.com/ircdocs/modern-irc/issues/250

PR from Valware in https://github.com/unrealircd/unrealircd/pull/325
2025-11-09 09:28:26 +01:00
Valerie Liu c723292ec9 Add HOOKTYPE_MOTD so modules can add their own MOTD lines before RPL_ENDOFMOTD (PR #324) 2025-11-09 09:16:23 +01:00
Bram Matthys 6064fdb054 Small ./Config change to walk through older release directories 2025-11-09 09:04:58 +01:00
Bram Matthys d7a6868950 Bump version to 6.2.2-git 2025-11-09 09:01:34 +01:00
Bram Matthys 4e0eaecb33 Run ./configure for PCRE2 also with original CFLAGS
(and not with the ones we add during ./Config like -Wall -Wextra etc...)

Seen while debugging some other problem
2025-11-07 18:39:40 +01:00
Bram Matthys 8e6ee0ba6a JSON: Make channel.kick check if the user is in channel and
throw an error (JSON_RPC_ERROR_USERNOTINCHANNEL) if this is not the case.
Previously we returned success.

Also, if using DEBUGMODE (never on production servers), the server
would crash if the user is not in the channel.
2025-11-04 17:57:06 +01:00
Bram Matthys 09032ec868 ** UnrealIRCd 6.2.1 ** 2025-11-02 16:10:26 +01:00
Bram Matthys ced1382eab Fix channel messages not showing up on remote servers (6.1.2-rc2 bug).
This required two members on the same server and channel mode +H to be set
(or set::broadcast-channel-messages 'always', then also with -H).

The cause was a (normally harmless) optimization in
1473f52603 which meant we would loop
through remote servers for the case of +H.

And then the real cause a bug in the linecache system, which
caused servers to be seen as LCUT_NORMAL because locally
connected servers are MyConnect()->true.

And then on the wire (S2S) a message would look like..
:nick!user@host PRIVMSG ...
But nick!user@host is not valid in normal S2S traffic and on the receiving
server is seen as a nick@server message (and 'nick!user' is never found
on 'server' where server is actually a user host)... seems like an
old relic, but this aside.
This in turn, causing the message to be dropped (unknown source),
and the PRIVMSG handler is not called at all.

Bug reported by CrazyCat and then PeGaSuS managed to reproduce the
issue later on irc.unrealircd.org. Thanks!

As said, this only affects 6.1.2-rc2 and chmode +H.
2025-11-02 15:53:42 +01:00
Bram Matthys 89d8653583 Fix missing const in check_version()
Arguments were const char * in the EFunction but not in the actual function,
flagged by UBSan. Similar to 8c26cec5fc.
2025-10-31 09:54:36 +01:00
Bram Matthys 3510722cef url_unreal: fix relative redirects not working
When using build-in UnrealIRCds https support, a redirect to
https://etc... was working fine, but an internal redirect to /xyz
would fail.
2025-10-31 09:41:50 +01:00
Val Lorentz 295d0932fb message-tags: Fix length checks (PR #323)
The fix in da703efdf4 (6.2.1-rc1) was
incorrect because it swapped the limits for clients and servers
2025-10-31 09:32:00 +01:00
Bram Matthys 663a33e981 Update release notes a bit on webhooks and other recent improvements.
[skip ci]
2025-10-29 14:07:09 +01:00
Bram Matthys 3a35689a43 Adjust the "To ensure UnrealIRCd automatically starts on system startup" text
at the end of "make install". Previously it mentioned installing a
Cron job, now it also mentions Systemd.
2025-10-29 10:39:36 +01:00
Bram Matthys fea1d2ab8b Add two systemd unit files in extras/startup:
Use extras/startup/unrealircd.service if you want a system-wide unit
file, which is normally what people tend to use. The benefit of this
is that it allows setting some security options.

Use extras/startup/unrealircd_user.service if you want a user unit
file. This works if you don't have root on the machine.
2025-10-29 10:13:04 +01:00
Bram Matthys 82417d0cd2 Don't write PID file if running in foreground mode (-F) and error on
./unrealircd [start|stop|restart] commands if unrealircd is running
but without a pid, which will be the case if running through systemd.

The systemd example unit files will be in a future commit.
2025-10-29 10:04:32 +01:00
Bram Matthys 82f21df20b Make unrealircd binary mention at least -F
Reported by henk in https://bugs.unrealircd.org/view.php?id=6424
2025-10-29 08:17:35 +01:00
Valerie Liu c16d602cc2 Add webhooks functionality to log blocks (PR #322) 2025-10-27 08:50:38 +01:00
Bram Matthys b31c394cd0 When channel flood protection kicks in, tell chanops how to get more info,
namely via "MODE #channel +F".

Enhance "MODE #channel +F" by explaining a bit more (like, actions a chanop
can do to change things).

Example of protection kicking in:

*** Channel CTCPflood detected (limit is 7 per 15 seconds), setting mode +C. Type "/MODE #test +F" to get more information on channel flood protection.

Then if you type "MODE #test +F":

Channel '#test' has effective flood setting '[7c#C15,30j#R10,10k#K15,40m#M10,8n#N15]:15' (flood profile 'normal')
-
You are currently using the default anti-flood profile normal.
If you want to change to a different anti-flood profile, for example because flood protection is kicking in too quickly
or too late, then you can use MODE #test +F <profile>. See the list of profiles below (ordered from lax to strict).
List of available flood profiles for +F:
          off: []:0
 very-relaxed: [7c#C15,60j#R10,10k#K15,90m#M10,10n#N15]:15
      relaxed: [7c#C15,45j#R10,10k#K15,60m#M10,10n#N15]:15
       normal: [7c#C15,30j#R10,10k#K15,40m#M10,8n#N15]:15
       strict: [7c#C15,15j#R10,10k#K15,40m#M10,8n#N15]:15
  very-strict: [7c#C15,10j#R10,10k#K15,30m#M10,5n#N15]:15
See also https://www.unrealircd.org/docs/Channel_anti-flood_settings

(And actually there is some bold text there too)

Indirectly suggested in https://bugs.unrealircd.org/view.php?id=6580
by rafaelgrether and PeGaSuS (being more clear to IRCOps what is happening).
2025-10-25 15:30:17 +02:00
Bram Matthys 5b6037698a Forgot to add 3 modules in Windows makefile.
[skip ci]
2025-10-23 19:05:09 +02:00
Bram Matthys 58c37b67f9 ** UnrealIRCd 6.2.1-rc2 ** 2025-10-23 18:02:43 +02:00
Bram Matthys 1feb7bbbfe Workaround gcc UBSan bug triggering -Wstringop-overread 2025-10-17 17:04:52 +02:00
Bram Matthys 23fc12c71c Update doc/unrealircd_wiki.zim (current wiki) 2025-10-17 11:25:27 +02:00
Bram Matthys f5a5dae4aa Make sanitizer question in ./Config not only enable ASan but also UBSan
(both AddressSanitizer and UndefinedBehaviorSanitizer)

This previously helped finding 8c26cec5fc

Also update the ./Config text a bit, eg about ASan not running OK on FreeBSD,
which only affects <14.2 as per https://bugs.unrealircd.org/view.php?id=6470#c23412
2025-10-17 09:27:43 +02:00
Bram Matthys ad991e9d0b Move "web" too from MODDATATYPE_CLIENT to MODDATATYPE_LOCAL_CLIENT
Since this is always about a local connection
2025-10-17 08:29:09 +02:00
Bram Matthys 8067ee3ad2 Move some modules using MODDATATYPE_CLIENT to MODDATATYPE_LOCAL_CLIENT
authprompt
blacklist
blacklistrecheck

This frees up 3 positions in MODDATATYPE_CLIENT
2025-10-17 08:25:06 +02:00
Bram Matthys 1d774de862 Add MODDATATYPE_* to MODULE for IRCOps 2025-10-17 08:19:15 +02:00
Bram Matthys b3821c3c4f Code cleanup: now that MDInfo is split by [req.type],
we don't need to check for type == req.type anymore.
2025-10-15 08:32:28 +02:00
Bram Matthys c1dff43c8d Make the "ModDataAdd: out of space" error message more helpful 2025-10-15 08:31:27 +02:00
Bram Matthys a52281dc28 Some more attempts to kill a proxy crash bug 2025-10-14 19:52:57 +02:00
Bram Matthys da703efdf4 Fix OOB write in message tag S2S parsing, introduced in 6.2.1-rc1.
This would happen if a remote server (trusted server traffic) would
come up with a 8K message tag (or actually name or value of 8K).
2025-10-14 16:51:31 +02:00
Bram Matthys 5c587e6230 Fix crash in new ISUPPORT command (if sent by remote server)
That is, trusted S2S traffic.
2025-10-14 16:44:17 +02:00
Bram Matthys 7f1d42856f Some minor rewording of release notes / adding links 2025-10-12 15:26:43 +02:00
Bram Matthys 15e367a822 ** UnrealIRCd 6.2.1-rc1 ** 2025-10-12 15:10:32 +02:00
Bram Matthys 058affe028 Fix crash with proxy { } block and if client is killed after parse_proxy_header().
Have not tried to reproduce but this could happen if the client is Z-Lined.
2025-10-11 10:22:41 +02:00
Bram Matthys 0607a63d91 Write a lot more in release notes 2025-10-10 19:21:02 +02:00
Bram Matthys 01ffa1c98f Merge branch 'unreal60_dev' of github.com:unrealircd/unrealircd into unreal60_dev 2025-10-10 08:44:15 +02:00
Bram Matthys 6a837bf669 inetntop() was using a wrong sizeof() which could trigger a message
about an overflow with eg 'STATS maxperip' (IRCOp-only command).
Also, STATS maxperip failed to return 1 in the hook, resulting in
unnecessary STATS help output after the list.
2025-10-10 08:42:38 +02:00
Rafael Grether 1182bd4430 Fix ./Config printing a message about 'make' not installed on OpenBSD (PR #321)
Replace 'make --version' check with 'command -v' for better BSD and non GNU/Linux support.
2025-10-08 09:11:47 +02:00
Bram Matthys 32570ad2f8 And let's add an IsUser() here too. This isn't a problem atm,
since it is only called from JOIN (so always a user), but you
never know in the future...
2025-10-07 18:35:16 +02:00
Bram Matthys 789ef5aa4c Fix crash due to recent commits. Don't call invisible_user_in_channel for servers. 2025-10-07 18:33:27 +02:00
Bram Matthys 99ae01edf8 Fix tls-tests after last chgs 2025-10-06 14:23:04 +02:00
Bram Matthys be8e2f4764 CI: Add -slightlyfast so ban expiry test is skipped (that one runs in BuildBot anyway)
This to keep the CI at GitHub reasonably fast.
2025-10-06 11:52:52 +02:00
Bram Matthys 7cb3b50737 run-test: add $RUNTESTFLAGS 2025-10-06 11:52:04 +02:00
Bram Matthys cfaae0533d Move testssl.sh cloning to tls-tests 2025-10-06 11:34:02 +02:00
Bram Matthys f0b6a648a3 Add CI badge to top of README 2025-10-06 11:14:16 +02:00
Bram Matthys acab7240c9 CI: Whoops.. missed the last line. 2025-10-06 11:05:24 +02:00
Bram Matthys 03423e155c GitHub Actions: add Linux CI (in addition to existing BuildBot)
We already run CI since 2014, first via Travis CI, then when it became
paid we switched to self-hosted BuildBot in 2019. Later that year
GitHub Actions came also in existence, but we already switched over to
BuildBot by then so didn't use it.

We will still use BuildBot on self-hosted to test various Ubuntu and
Debian distro versions, FreeBSD and Windows. Also, in the BuildBot we
have our own pre-build environment where we run Services tests (with
both anope and atheme), we run TLS there (again on all those distros
with various OpenSSL versions). And we also test both clang and gcc.

So what is new? Well, now we will also run a "quick test" via GitHub
Actions, like most projects out there on GitHub. Not the services test,
not the TLS tests, but simply latest Ubuntu and then clang+gcc.
The main benefit of this is that it will also show up on Pull Requests
and makes it "public" as our BuildBot page is restricted.
2025-10-06 11:01:28 +02:00
Bram Matthys 573f65efb5 Add extras/tests/tls/tls-tests.bbwrapper which i use for BuildBot 2025-10-06 10:07:22 +02:00
Bram Matthys 85ce779f93 Use $NOSERVICES instead of $FREEBSD if we want to skip services tests 2025-10-06 09:32:11 +02:00
Bram Matthys 4a3d3bf72f extras/tests/tls/tls-tests: split these off in an additional step
A side-effect is that this will keep unrealircd and services running.
2025-10-06 08:58:17 +02:00
Bram Matthys 07b99d1429 extras/build-tests/nix/build: support additional CPPFLAGS
and output something more useful.
2025-10-06 08:55:17 +02:00
Bram Matthys 326b1cd349 quit_sendto_local_common_channels(): rename some variables
Previous was way too confusing where user was actually a client and
channels was actually a membership struct. And then you got like
user->user and channels->channel. No, let's make this conform to
the same style that we use elsewhere. Who the hell wrote this !??
Oh, it seems I did :D
2025-10-05 16:23:02 +02:00
Bram Matthys 301c7915a7 Optimize +D stuff in quit_sendto_local_common_channels()
1) Similar to sendto_local_common_channels() go through local_members
   instead of all channel members
2) We have the membership info, so use user_can_see_member_fast()
2025-10-05 16:14:28 +02:00
Bram Matthys ef8394c64d Optimization: avoid find_member_link()'s where possible
This mainly affects MODE #channel +vhoaq and such. And as with all these
optimizations it mostly affects channels with more than 10 people (eg
hundreds or thousands).

Also did add_member_mode() and del_member_mode() but those are not
used by our own code because we always use fast versions anyway.
Oh yeah and the +D invisibility shit via set_user_invisible():
that one i didn't benchmark but should be better as well for
large channels.
2025-10-05 16:03:35 +02:00
Bram Matthys 5f2f020183 Make unreal_copyfile() copy in 16k chunks instead of 1k 2025-10-05 14:05:52 +02:00
Bram Matthys aaa3179676 Avoid running make_cloakedhost() twice for remote clients.
This saves around 5% unrealircd CPU in 100k remote clone tests.
2025-10-05 11:18:11 +02:00
Bram Matthys 9310c655b9 We can do the umode change by UID. Not that it matters much :D.
And parv[0] is always NULL in UnrealIRCd.
2025-10-05 11:02:02 +02:00
Bram Matthys 5b6c00946a Optimize set_user_modes_dont_spread(): use _cmd_uid() directly.
Only downside is that mtags would be NULL, but we don't use it in
cmd_uid() so that's okay. This saves us from generating mtags in
do_cmd() when we don't need it. And also a command handler lookup
and all that. Saves around 8% of unrealircd CPU for 100k connects.
2025-10-05 11:00:00 +02:00
Bram Matthys 80189a6ce9 Replace a HasCapability() with HasCapabilityFast()
Since mtags_to_string() is a function that is called a lot, this matters.
2025-10-05 10:34:25 +02:00
Bram Matthys fa8a0b2083 Make IsSynched() check if both the "far" server and the "near" server are
synched. Both need to be checked, because:
* The "far" server may be fully synched to "near" (and thus tagged as synced)
  but the "near" server may be introducing the "far" server, when
  we are connecting to "near"
* The "near" server may be fully synched but the "far" server is connecting
  in and may thus not be synched yet

In reality, things are even more complex, since one would have to verify
the whole chain of links. But.. yeah.

Long-story short: this fixes things like "User xyz joined #xxxxx" logging
where this showed up while the server was linking in. It is not supposed to
log that, similar to how we not log all 1000 users as newly connecting when
a 1000-user-server links in. In fact, it didn't already log that for
directly-connected-servers, but for far servers it did previously.

And... that again gave performance issues if you were connecting like a
100k-user far server.. since you suddenly had 100k * numchannels join events
being logged (which surprisingly still only took 6 seconds for 100k entries,
but still, it is wrong to do so and can be avoided).
2025-10-05 10:26:01 +02:00
Bram Matthys 9b493cfe6a Avoid a get_floodsettings_for_user() call for servers.
This didn't show up in initial profiling, but now that other areas
are faster, this one starts to show up with 15% for 100k-clone remote
server traffic. Easy change :D
2025-10-05 09:02:51 +02:00
Bram Matthys c729d18a8c Add (faster) remove_user_from_channel_withmb() and use it from various places.
We can use this when we already have the Membership struct, which is the
case for PART, (SA)JOIN 0 and QUIT. Saves a couple of iterations.
2025-10-05 09:01:08 +02:00
Bram Matthys af0a784464 Make member & membership point to each other so lookups can be much faster.
This also makes them proper list items, again to make certain fast operations
possible. Main thing is that removing an entry does not require us to walk
all of those lists. Not all code has been modified yet to benefit this,
actually only very little, the most performance-impacting ones.

This fixes SQUIT of a server with 100k users in a single channel taking
40 seconds of 100% CPU. It now takes only 1 second.
Reported by craftxbox in https://bugs.unrealircd.org/view.php?id=6484

(Can't make member & membership one entry atm, that would be too much change in U6)
2025-10-05 08:32:43 +02:00
Bram Matthys 55dd4601f2 Change some find_member_link() to find_membership_link() which is faster.
The first one iterates through all channel members (can be hundreds or thousands)
and the latter goes through the channels a user is in (typically <15).
2025-10-04 20:46:20 +02:00
Bram Matthys 68ef88c0c4 Move from HOOKTYPE_VISIBLE_IN_CHANNEL to invisible setting in member->memb_flags.
This so we can use fast(er) techniques here and there.

New functions are:
channel_has_invisible_users(client)
set_user_invisible(client, channel, 1|0)
Existing functions:
invisible_user_in_channel(client, channel)
user_can_see_member(user, target, channel)
user_can_see_member_fast()

This is work in progress, although the tests seem to pass atm.
2025-10-04 20:33:46 +02:00
Bram Matthys 1473f52603 Another sendto_channel() optimization in case of some PRIVMSGs.
When the channel is +H we broadcast to all servers, so we can simplify
that case and don't need to iterate the channel->members.
The same is true if set::broadcast-channel-messages is set to 'always',
though that is not known to be used much.
2025-10-04 08:50:42 +02:00
Bram Matthys e92b8ef3ad Fix uninitialized variable in sendto_channel() 2025-10-03 19:14:44 +02:00
Bram Matthys 2e21e7fdbf Make sendto_local_common_channels() use channel->local_members.
This too should be a significant performance improvement for multi-
server networks. Especially since this isn't just num_channel_members
of 1 channel, but about common channels, so could easily be like all
channel members of 10 channels combined.

This function is used for NICK, QUIT, and notification for CAP-
enabled clients for setname, account and away changes.
2025-10-03 19:13:39 +02:00
Bram Matthys cfe3ce38b2 testssl_profiles/*txt: TLS 1.2 -> TLSv1.2, etc... 2025-10-03 18:47:32 +02:00
Bram Matthys 569a12055f Add channel->local_members and use it in sendto_channel().
This makes things a lot faster on multi-server networks, especially for
big channels where most of the clients in the channel are remote users.

This should be non-module-API-breaking, as all code uses the
add_user_to_channel() and remove_user_from_channel() functions.

Still need to spread this to other code, more optimizations possible.
2025-10-03 18:11:03 +02:00
Bram Matthys 86e7ab307a Bump dbufs from 4k to 8k. Gives a 5% performance improvement.
That is, during my tests with 1000 TLS clients doing a couple of commands,
including one big one (WHO #channel on a 1000 user channel).

I also tested an SSL_writev() implementation (which would gather up to 16k)
but it gives very comparable speed and caries more risk of doing so in a
stable series. I think we can live with the 4 kilobyte extra per local
client in the year 2025 (and later).
2025-10-03 16:11:52 +02:00
Bram Matthys 902802a8dc I/O engine: don't request write notification if we don't need it.
In testing with 1000 TLS clients this saves around 16% of unrealircd
CPU time (so not 16% CPU, but 16% of whatever % unrealircd cpu is).
2025-10-03 16:02:51 +02:00
Val Lorentz 45ef8d1cf1 Fix multi-prefix (#320) 2025-09-30 23:57:45 +02:00
Bram Matthys d5332ca765 Fix memory leak in JSON-RPC stats.get 2025-09-30 16:50:06 +02:00
Bram Matthys ac9709531a Fix windows compile which was broken on Sep 17 by commit
0c17276039.
2025-09-29 19:41:07 +02:00
Bram Matthys 792eca7d4d Fix chathistory test fail... duh.. accidentally set a local var. 2025-09-29 18:04:41 +02:00
Bram Matthys 15c8b1aa40 Optimization: Use HasCapabilityFast() in whox.c and extended-monitor.c
The whox one saves a lookup for each channel member (so eg 500 for a
channel with 500 members). The extended-monitor saves it on delivering
watch/monitor notifications, so depends on the # of subscriptions.
And that's each time such a command is called. We now only lookup on
MOD_LOAD.
2025-09-29 18:00:14 +02:00
Bram Matthys 80a381c76a Optimization: history: use HasCapabilityFast() instead of HasCapability()
This makes it so the capability bit lookup is done only once on module load
and not on each client JOIN.
2025-09-29 17:20:06 +02:00
Bram Matthys e42610ebba Optimize MONITOR / WATCH to do ModData lookup only at MOD_LOAD()
instead for each MONITOR / WATCH command.
We use the same technique in other modules, eg for websockets.
2025-09-29 16:56:16 +02:00
Bram Matthys c0a46abd60 ModData API: add ModDataInfo .priority item and use it to speed up
things by making the keys with the most lookups first, e.g. "reputation",
"geoip", "certfp". This order is based on actual lookup counts during a
quick test with 250 clones doing some typical IRC traffic.

Key:		Lookups:	Position before:	After split:	After split+order:
"reputation"	20362		37			14		1
"geoip"		10555		44			15		2
"certfp"	9264		23			8		3
"webirc"	7407		27			10		4
"websocket"	7110		55			19		5

We could also consider going for a hash table, but this may be "good enough" for now.
2025-09-29 16:50:44 +02:00
Bram Matthys db6476e1ab ModData API (internal): split the single linked list into 7 lists, to speed
up moddata_client_get() etc -> findmoddata_byname().
Apparently we have 52 moddata registrations (that is without 3rd party modules)
so otherwise it is a loooong linked list.
2025-09-29 16:22:08 +02:00
Bram Matthys 51625592cb Get rid of a memset() of 16k in labeled response implementation.
This was done in lr_pre_command() and lr_post_command().
Nowadays we have BIGLINES stuff from servers that cause MAXLINELENGTH
to be 16k, so the LabeledResponseContext ended up being 16k+.
Although we normally have the policy to zero out complete structs
in UnrealIRCd instead of only individual members (for safety,
easy to overlook security bugs), in this case we will do zeroing
of struct members explicitly. Added some warnings about this too
in the source code. Zeroing 16k twice for each command is a bit
too much waste.
2025-09-28 18:24:23 +02:00
Bram Matthys cf2c3baca5 Whoops.. fix compile. 2025-09-28 18:02:12 +02:00
Bram Matthys 2ee12bf326 Make SHA256 30% faster when used for cloaking and other very small inputs,
simply by re-using the context.

The slowdown happened due to commit a541b8f4ad
in June 2021 when converting to OpenSSL 3+ code. Now it is basically
back to the pre-openssl-v3 speeds.
2025-09-28 17:24:11 +02:00
Bram Matthys b3fd6b9bca Optimization: use umode_letter_to_handler[] for faster has_user_mode()
and find_user_mode(). That's one array of 256 elements, instead of
iterating a linked list where - if you are unfortunate - one may
need like 26 iterations.

In sendto_channel() we did the check for user mode +T before the
sendflags & SKIP_CTCP, that makes no sense and caused useless CPU.
We now do it the other way around, and also only lookup the user
mode just once (if needed).

The umode_letter_to_handler[] code may crash, it is not well tested
yet, only had two runs so far. Seems to work ok even with REHASH tho,
but have not tested delayed module unloading for example.
2025-09-28 16:49:20 +02:00
Bram Matthys e3b92cc084 away_join() optimization: don't bother if user is not away.
Otherwise we are iterating <num channel members> all for nothing.
2025-09-28 16:20:19 +02:00
Bram Matthys 5a02d4f52c Get rid of the *@unrealircd.com mask in the example vhost as it is commented out
now anyway. And thus, get rid of the related comment as well.
2025-09-28 10:41:00 +02:00
Bram Matthys c8431b7cb8 Make client->local->caps a 64 bit unsigned int on all archs.
This was previously a "long", which could cause issues on 32 bit archs.
We ship with 28 CAPs now, and that's without 3rd party modules, so...

This is similar to the client->flags bumping in 2023
(a3ed1eabd9).
2025-09-28 10:03:04 +02:00
Bram Matthys a2e099bf47 Extbans: fix various syntax error / usage examples where old single letter
is used instead of the full name (eg ~S instead of ~certfp).
We have named extended bans since UnrealIRCd 6.0.0 (2021) already...
2025-09-25 19:27:34 +02:00
Bram Matthys ddfe7c535c Make TLINE use server_ban_parse_mask() so it uses the same logic as GLINE.
This fixes something like TLINE ~country:us not automatically converting
to ~country:US, since previously conv_param() was not called. But it also
means other code is used in the same way as GLINE (other type of rejections),
for example invalid server ext ban will print a better error with syntax
info (e.g. TLINE ~certfp:xx).

That ~country issue was reported by adamus1red in https://bugs.unrealircd.org/view.php?id=6581
2025-09-25 19:16:11 +02:00
Bram Matthys 65b69f9164 Sync away_since in S2S traffic from now on.
See also comment in f42bab778e
about away_since in JSON-RPC.
2025-09-24 13:47:53 +02:00
Bram Matthys 995b67f785 Module manager: add "last-updated" property to generated module list. 2025-09-24 09:58:21 +02:00
Bram Matthys 53707f27b9 Fix unitialized variable in link config test, due to commit from yesterday
(4c6e259681).
2025-09-22 08:25:18 +02:00
Bram Matthys 602f6c7238 URL API: add .minimum_tls_version, and use TLS1_3_VERSION for central-blocklist.
Something like:

 #ifdef TLS1_3_VERSION
        w->minimum_tls_version = TLS1_3_VERSION;
 #endif
        url_start_async(w);

Require TLSv1.3 for central-blocklist and spamreport calls, unless your
OpenSSL does not support it, which should be rare.

At some point in the future I will make this endpoint TLSv1.3+ only.
2025-09-21 14:24:06 +02:00
Bram Matthys 507061af46 Add tls-options::signature-algorithms for those who want to override the default.
We don't set it in UnrealIRCd at the moment, so this is just to override
the OpenSSL defaults at the moment. It is good to have this exposed, in
case some vulnerability is discovered or you need some flexibility in
tweaking this.
2025-09-21 13:55:24 +02:00
Bram Matthys b0b6cc81e2 This belongs to the autoconf upgrade too (see previous) 2025-09-21 13:39:12 +02:00
Bram Matthys fd5db98c88 Rebuild ./configure after upgrade of autoconf 2.71 to 2.72 2025-09-21 13:37:31 +02:00
Bram Matthys d1b1a413cf Make code that sets TLS groups also apply to client context.
(groups were previously called ecdh-curves)
2025-09-21 13:32:04 +02:00
Bram Matthys 4c6e259681 You can now use "password" multiple times in the conf (eg in allow::password).
allow {
	mask *;
	password "secret";
	password "letmein";
}

This is always an "OR" type of match, any match means you pass.

I was actually doing this for the dual-cert stuff from previous commit,
where this can come in handy:

link irc1.example.org {
...
    password "AHMYBevUxXKU/S3pdBSjXP4zi4VOetYQQVJXoNYiBR0=" { spkifp; };
    password "jNw8P4QMg9tqjEJ4/lFikXBNHdIGSeN2B4/T322VjIo=" { spkifp; };
...
}
2025-09-21 11:42:59 +02:00
Bram Matthys 877d151da4 Support multiple TLS certificates/keys, e.g. ECDSA + ML-DSA (PQC).
In the past a dual cert/key setup could have been useful for RSA + ECDSA
but nowadays all clients support ECDSA so that makes little sense.
The reason it is added now is so you can use ECDSA + ML-DSA or some
other [regular crypto] + [post quantum crypto] combination.
Actually, you could even use more than two.

To use this in the config file, simply use the certificate and key
directive multiple times. Just be sure to load the certificates and keys
in the same order. We will print a helpful error if you fail to do so.

Note that for Post Quantum Cryptography the most important step today
was/is to protect against the "Harvest now, decrypt later" scenario
https://en.wikipedia.org/wiki/Harvest_now,_decrypt_later which is a
"passive attack". That's why in UnrealIRCd 6.2.0 we enabled
X25519MLKEM768 if it is available (OpenSSL 3.5.0 and later).
While, this commit, and this talk about dual ECDSA and ML-DSA, is about
when a quantum computer exists and actively does a man in the middle
attack. That's not a realistic scenario in 2025 and according to experts
also not in the next few years. We just make the UnrealIRCd code-
base ready to have this feature for when it is needed / will be used,
and to get this tested properly.

For testing the dual ECDSA and ML-DSA setup I used the following
command to create the 2nd cert/key (self-signed):

openssl req -x509 -nodes -newkey mldsa65 \
  -keyout ~/unrealircd/conf/tls/server.key.mdsa65.pem \
  -out ~/unrealircd/conf/tls/server.cert.mdsa65.pem \
  -days 3650

And then:

listen {
        ip *;
        port 6697;
        options { tls; }
        tls-options {
                certificate "ssl/server.cert.pem";
                key "ssl/server.key.pem";
                certificate "ssl/server.cert.mdsa65.pem";
                key "ssl/server.key.mdsa65.pem";
        }
}

When running openssl s_client -connect 127.0.0.1:6697 it shows ML-DSA is used:
...
Peer signature type: mldsa65
Negotiated TLS1.3 group: X25519MLKEM768
...

And with openssl s_client -connect 127.0.0.1:6697 -sigalgs "RSA+SHA256:RSA+SHA384:ECDSA+SHA256:ECDSA+SHA384"
it shows ECDSA is used:
..
Peer signature type: ecdsa_secp384r1_sha384
Negotiated TLS1.3 group: X25519MLKEM768
..

This is just for testing purposes (self signed cert). As of right
now (Sep 2025), you can not get a trusted certificate with ML-DSA,
as the CA/Browser Forum only allows issueing RSA and ECDSA keys.
Also, all the trusted Certificate Authorities use RSA or ECDSA.
And, again, all this is not ML-DSA specific, it should work for
other dual/multi combinations, and.. who knows they even go for
something hybrid.

A downside of dual certs is that this makes the whole spkifp thing more
complicated because if you use 2 certs/keys you now have 2 possible
fingerprints (spkifp) that could match in e.g. server linking.

While coding this, I also changed the 'STATS P' output to use the txt
numeric instead of notice, and be more verbose in its output for TLS
listeners: printing the certificate(s) and key(s).
2025-09-21 10:32:29 +02:00
Bram Matthys ccc80477ef Fix OOB read in UTF8ONLY code from today. 2025-09-20 17:40:34 +02:00
Bram Matthys b4e65b1414 Fix various "too early" cutoffs with new set::utf8-only feature 2025-09-20 15:52:31 +02:00
Bram Matthys dbb2d1a5c8 Move isupport_check_for_changes() to the 'isupport' module.
This function was added a short while ago, and well it seems to be
able to be possible in a module. Since the 'isupport' module is mandatory
and this is ISUPPORT related, it is the right place.
Can't move isupport_snapshot() because modules might not be loaded yet
or things are currently unloading, i think. Not important anyway.

Also, make things work if there are more changes than would fit
on one isupport line. Although I didn't really test this..
Ended up splitting things in 3 helper functions to avoid some
goto and/or duplicate code and stuff. The alternative was, surprisingly,
even more ugly.
2025-09-20 15:44:56 +02:00
Bram Matthys 595f56007b Add the ISUPPORT command, which simply calls the efunction.
Call the efunction from 005 introduction as well, so it uses the
batch, if needed. And yeah we opt to send the 005's always, even
if it was already sent in the handshake (or not).

Some re-indenting (spaces to tabs).

And call the efunction from VERSION as well.

For "VERSION remote.server" we don't send them in a batch as these
are not numeric 005 but 105. These are for information purposes only
and should not confuse the client (eg not to act upon).
2025-09-20 14:56:26 +02:00
Bram Matthys 5cb2428567 Some code cleanup to previous, and apparently the batch type is 'draft/isupport'
and not 'draft/extended-isupport'.
2025-09-20 14:40:16 +02:00
Bram Matthys e78a6a6dbf isupport & extended-isupport module, work in progress.
This is mostly from Valware PR https://github.com/unrealircd/unrealircd/pull/310
Will do more changes in later commits..
2025-09-20 14:34:28 +02:00
Bram Matthys 9e490196a8 set::send-isupport-updates: Valware added this, but this is now expanded
to all ISUPPORT tokens, instead of only CHANMODES, PREFIX and STATUSMSG.
E.g. changing set::min-nick-length would also broadcast the change.

Technically we will call isupport_snapshot() before the rehash (or before
delayed module unload) and then after modules were reloaded/unloaded we
call isupport_check_for_changes(). This uses the ISUPPORT system in a
general way, so works the same for all tokens.

https://www.unrealircd.org/docs/Set_block#set::send-isupport-updates

TODO: Deal with more than X changes (is currently an abort, crash)

TODO: batch for draft/extended-isupport
2025-09-20 14:05:35 +02:00
Bram Matthys f22f8d0dcd Add set::utf8-only: if set to 'yes' this means all IRC traffic is UTF only.
See https://www.unrealircd.org/docs/Set_block#set::utf8-only and the
UTF8ONLY specification at https://ircv3.net/specs/extensions/utf8-only
for more information.

Reported by PeGaSuS, who reported it based on a #unreal-support message
from uMut, who reported it based on a message from itsonlybinary.
This closes https://bugs.unrealircd.org/view.php?id=6458

This feature still needs to go through our internal tests.
2025-09-20 09:00:52 +02:00
Bram Matthys d763b9c1e3 Some crash reporter tweaks like TLSv1.3+ and max size
(will still use TLSv1.2 if OpenSSL does not support TLSv1.3,
 though.. OpenSSL 1.1.1 that introduced it is from Sep 2018)
2025-09-17 20:11:18 +02:00
Bram Matthys 0c17276039 Move https_new_ctx() from src/url_unreal.c to src/tls.c so it is
always available (also w/cURL) so it can be used by the crash
reporter. And delete duplicate code crashreport_init_tls()
function since it is now unused.

As always, duplicate code causes problems when one is changed and
the other is not. This also happened here, where the curves or
TLS groups where set in url_unreal but not in the crash reporter.
Now that one is minor, but the danger is clear.
2025-09-17 19:57:03 +02:00
Bram Matthys 1685d5243f Write some early release notes
[skip ci]
2025-09-17 13:05:00 +02:00
Bram Matthys 5e54ab5ed7 Remove some old #ifdef SO_ERROR. That's always available on POSIX and Windows. 2025-09-17 11:01:46 +02:00
Bram Matthys a6ae945499 Fix built-in https fetcher to also try IPv6.
Without this fix, on an IPv6-only host UnrealIRCd would give you:
[warn] /home/ircd/unrealircd/conf/modules.default.conf:309: Failed to download 'https://www.unrealircd.org/files/geo/classic/GeoIP.dat': Could not connect: Network is unreachable
[warn] Continuing anyway...

This fixes https://bugs.unrealircd.org/view.php?id=6249, which was
also similarly reported by progval in https://bugs.unrealircd.org/view.php?id=6073

This implements only a simple try-IPv4-then-IPv6 approach in case of
clear connect errors. There is no happy eyeball like approach (where it
gives IPv6 a 250ms head start and then tries IPv4 in parallel), if there
is really a 15sec timeout then it doesn't retry IPv6 either (in case you
have IPv4, there is a route, but packets end up blackholed), nor does it
try all IP addresses that the resolver returns (then again, that's not
strictly related to happy eyeballs or IPv4/IPv6).
That would require some major overhaul that is not planned in U6. If you
want better/great protocol support you can always enable cURL in ./Config.
2025-09-17 10:59:04 +02:00
Bram Matthys 82bf4a6beb Add logging category "advice" that is used by best practices (color: blue).
Maybe a bit odd since only <10 things use this category but it makes it
stand out as a separate thing much better. As for a level (not that it
matters) it is between 'info' and 'warn'.
2025-09-15 14:21:51 +02:00
Bram Matthys 2798276316 add -Wno-unterminated-string-initialization
Without this on some new compilers this raises a warning (or error with -Werror):
const char hexchars[16] = "0123456789abcdef";

The alternative is to add __attribute__((nonstring)) at the various places
that need it. But 1) that requires various ifdefs to support old compilers, and
2) This doesn't catch anything meaningful in our code anyway and the odds of
it doing so seem slim.
2025-09-15 07:47:44 +02:00
Bram Matthys 0b147e8044 Probably helps if i include the file that i added in the Makefile
(fix broken compile)
2025-09-14 18:05:09 +02:00
Bram Matthys 817abc4101 Add security-group::server-port and similary in match item, to match
users by server port (eg 6667, 6697, 8000, etc).

This also adds security-group::exclude-server-port for consistency.

And in crules the function server_port() returns the server port number,
so you can use rule 'server_port()>6690' for example.

Note that for remote clients this will only work after previous
commit (b2d0ec1af3) is loaded on all
servers, otherwise all remote clients are seen as having a server_port
of zero (0). Though you probably usually only care about this on local
users anyway.
2025-09-14 17:28:04 +02:00
Bram Matthys b2d0ec1af3 Move/add local_port & server_port to ModData, so remote clients can be tracked.
This is sent over the wire as early moddata, just like "operlogin" and "operclass"
2025-09-14 17:03:34 +02:00
Bram Matthys f73dbfd7ee Remove previous UnrealIRCd PGP key from doc/KEYS (key expired and succeeded) 2025-09-14 15:41:54 +02:00
Valerie Liu a08d1faba7 JSON-RPC: Use issuer in set_by by default (PR #317 from Valware)
In TKLs like server bans, spamfilter, etc.
2025-09-14 15:38:35 +02:00
Bram Matthys f42bab778e Include 'away' information in JSON-RPC users object.
Reported/requested by CrazyCat: https://forums.unrealircd.org/viewtopic.php?p=40990
Inspired by Valware's PR: https://github.com/unrealircd/unrealircd/pull/319

This adds "away_reason" and "away_since". Note that the latter may not be as
reliable for remote users at the moment, because in case there was a split and
the server (re)connects, the away_since will be the time of the server resync
and not the original time that the user went away.
2025-09-14 15:27:10 +02:00
Bram Matthys 7a63239dde Fix memory leak with DEBUGMODE enabled (should only be used by devs).
In debug mode we also - in the JSON log - log the source file and
line number in every log message. This requires special care. A good
start was made earlier but that fix was incorrect.
Should be good now... at least when i ran tests the leak that was
previously there was gone.

The original issue was that I used (again, only in DEBUGMODE):
 #define unreal_log(...) do_unreal_log(__VA_ARGS__, log_data_source(__FILE__, __LINE__, __FUNCTION__), NULL)
But, some functions call unreal_log with something like:
unreal_log(.....
           xyz ? log_data_client("xyz", xyz) : NULL);
And then the expanded function arguments may become:
NULL,
log_data_source(...)
And since it is a vararg list the first NULL already terminates it and the
log_data_source() is never iterated, stays unseen, and thus stays unfreed.

A fix for that was made in 42caa34b5c:
do {
	LogData *lds = log_data_source(__FILE__, __LINE__, __FUNCTION__);
	do_unreal_log(__VA_ARGS__, lds, NULL); log_data_free(lds);
} while(0)

but in practice we still freed at the wrong place... it was still being
freed in the do_unreal_log() (or a child) function and the log_data_free()
actually didn't free anything.

All that is now fixed in this commit.
2025-09-14 15:08:48 +02:00
Bram Matthys 8c26cec5fc Fix 'const' in various functions: various arguments were const char *
in the EFunction but not in the actual function. That's bad since it
means the "const guarantee" got lost. And one or two similar cases with
incorrect parameter types and mismatching return types. This was
found with some analyzer, we had no bugreports with regards to this.
2025-09-14 15:01:39 +02:00
Bram Matthys 13217cc6ff Bump version to 6.2.1-git 2025-09-14 14:57:43 +02:00
Bram Matthys 9042dd21c0 ** UnrealIRCd 6.2.0.2 ** 2025-09-14 14:21:47 +02:00
Bram Matthys 64eab2c6ae antimixedutf8: fix extended latin, like éí accents leading to a high score.
The 4 unicode blocks are now treated as one big Latin block
Latin-1 Supplement, Latin Extended-A, Latin Extended-B ==mapped=to==> Basic Latin

Reported by CrazyCat in https://bugs.unrealircd.org/view.php?id=6576
2025-09-13 18:54:25 +02:00
Bram Matthys 4cc51af280 ** UnrealIRCd 6.2.0.1 **
This version (only) fixes some incorrect "best practices" warnings
2025-09-12 07:55:33 +02:00
Bram Matthys 74538e77d4 Another best practices fix: this one is with listen-nontls-port.
It could cause a spurious
"Your config has NO errors, but you received some best practices tips above, in summary"
even though no best practices were displayed... which was a bit mysterious.

Also, ::listen-nontls-port was actually meant to be called ::listen-tls-only
so accept both forms from now on. The reason it was supposed to be like that
is that all best-practices options are... best practices...
hashed passwords, trusted cert, trusted cert with valid hostname,
listening on a nontls port... ? NOPE! listen-tls-only! Aaaaa.
2025-09-10 16:45:52 +02:00
Bram Matthys 400a6080ab Actually make it possible for set::best-practices::trusted-cert-valid-hostname
to be turned off (it was seen as an unknown option). Reported by PeGaSuS.
2025-09-10 16:30:57 +02:00
Bram Matthys 76934cb815 Fix incorrect message about non-trusted SSL/TLS certificate when you use
the default certificate/key (conf/tls/server.cert.pem) even when that
cert is valid and issued by a trusted CA (like Let's Encrypt).
You would get such an incorrect "best practices advice" on-boot, but
(fortunately) not on each subsequent REHASH.

This was because the TLS system was not yet initialized completely at
the time of the best practices checks, ctx_server was NULL. This is
now solved by re-ordering some function calls.
This does change some win_error() and config_load_failed() stuff for
Windows so I hope that's okay.

Reported by Bun-Bun.
2025-09-10 07:35:50 +02:00
Bram Matthys bc27eb48fb ** UnrealIRCd 6.2.0 ** 2025-09-09 18:10:49 +02:00
Bram Matthys 399dfde33e Update curl-ca-bundle.crt to Tue Aug 12 03:12:01 2025 GMT 2025-09-08 20:10:11 +02:00
Bram Matthys 256308a707 Switch back to OpenSSL for the Windows build:
* In 2016 we switched from OpenSSL to LibreSSL because the OpenSSL
  codebase was in a bit of bad shape and LibreSSL promised to be a
  more modern codebase. Now, almost a decade later, OpenSSL has had
  many code cleanups and is more security aware (code audits etc),
  especially since OpenSSL v3 things are looking OK and it seems
  LibreSSL doesn't have much progress nowadays. Which is understandable
  as they have a lot fewer coders available but has an effect on things
  like how long it took for TLSv1.3 to appear and for other new things
  like PQC. It also seems like security fixes are now slower than
  OpenSSL instead of the other way around. Anyway, I think they did their
  job well (together with other people) in "triggering" the OpenSSL
  project to get things back on track. Let's switch back now.
* For context: it seems several Linux distro's that used to do go for
  LibreSSL have also switched back to OpenSSL.
* LibreSSL is still and will continue to be a supported library to
  use with UnrealIRCd (especially with OpenBSD and FreeBSD in mind).
  So, if there are any issues (compile problems, configuration problems,
  some feature not detected), then please report it on our bug tracker
  at https://bugs.unrealircd.org/ ! We will have to rely more on such
  user-reports now that the main devs will likely only work with OpenSSL.

Also... i have cleaned up the Makefile.windows a bit to be more consistent
Hopefully i didn't make a mistake there...

[skip ci]
2025-09-08 17:02:56 +02:00
Bram Matthys e58768eb65 antimixedutf8: ignore general punctuation block transitions
Since those can happen in ordinary text.
2025-09-06 14:02:31 +02:00
Bram Matthys e8673a06df Fix crash with "STATS tld" if tld::motd is not set. (Only IRCOps can do STATS
requests normally, unless the niche feature set::allow-user-stats is used)

The tld::motd was made optional in Jun 2022 commit 1fe6119026.
Not setting it is probably a bit rare, which explains why this bug was only
reported yesterday (Aug 2025) via the crash reporter.
2025-08-30 08:38:21 +02:00
Bram Matthys ed5bbe6ecb Stop sending 'draft/bot', and only send 'bot' (ratified 26-apr-2022)
This, obviously, only for umode +B users.
2025-08-02 17:15:43 +02:00
Bram Matthys 7603317c9b Fix some potentially confusing wording in release notes.
Just in case someone thinks we are going to msg users on plaintext ports
by default, no we don't that, or at least not this year.
This is purely a "best practices" advice to admins on config load.
[skip ci]
2025-08-01 12:09:30 +02:00
Bram Matthys 5b2c9a9890 Re-order some release notes items (mention spamfilter enhancements earlier)
[skip ci]
2025-08-01 11:43:46 +02:00
Bram Matthys aa8a8ee135 ** UnrealIRCd 6.2.0-beta3 **
This one will also be announced on the mailing list (beta1 and beta2 were not)
2025-08-01 11:28:37 +02:00
Bram Matthys 19e4a6fee9 Crash reporter: shut down TLS session gracefully
It seems like otherwise the request may not come through fully, not sure
but this seems to fix it in my tests.
2025-08-01 11:21:43 +02:00
alice 2c7bcebaca Make spamfilter:input-conversion accept deconfuse and deconfused for confusables (#316) 2025-08-01 07:39:43 +00:00
Bram Matthys 24fde4f889 Fix crash on "REHASH -dns" (IRCOp only)
Reported by vectr0n in https://bugs.unrealircd.org/view.php?id=6538
2025-07-31 17:53:40 +02:00
Bram Matthys 5e6bcaea33 After netsplit, wait for class::connfreq seconds before connecting to server.
Isn't that what it was supposed to do? Well, yes and no, previously
it only guaranteed that between reconnects (so the 2nd try not being
before class::connfreq than the 1st try), but there were no guarantees
for the first time period directly after a squit.

* When a netsplit happens and
  [set::server-linking::autoconnect-strategy](https://www.unrealircd.org/docs/Set_block#set::server-linking)
  is `sequential` (which is the default) or `sequential-fallback`
  (which is a good value for leafs) then we now consistently wait for
  [class::connfreq](https://www.unrealircd.org/docs/Class_block)
  seconds before trying to connect to the (same or next) server.
  By default this is 15 seconds in the example configuration
  server class. The reason for this is to provide a consistent behavior.
  Previously we waited semi-randomly for 0 to class::connfreq seconds.
  The previous behavior caused the picking of 'next server to try' to
  be inconsistent, which especially caused issues for `sequential-fallback`.
  If you want quicker recovery times in case of a netsplit, simply lower
  the value of [class::connfreq](https://www.unrealircd.org/docs/Class_block)
  in your configuration file, e.g. to 5 instead of 15 seconds.

Oh yeah and for connect-strategy 'parallel' things stay as is, with
the wait of 0 to class::connfreq per-server, which seems fine for that.
Unless you want a 'BOOM!' effect of mass reconnects instantly, in
which case you can just set class::connfreq very low.
2025-07-30 09:10:22 +02:00
Bram Matthys 84a1e59a44 Best practices: check if the certificate is actually valid for me::name.
That is, if the set::best-practices::trusted-cert check is on and passed
("certificate is valid and issued by a trusted CA") then we also
do this new set::best-practices::trusted-cert-valid-hostname check:

/* If the trusted-cert check passes, then we do another check to see if
 * the certificate is valid for me::name. Since users usually connect to your
 * server by your server name it is important for the certificate to be
 * valid for that name. Unless you really only care about e.g. irc.example.net,
 * and not about individual irc2.example.net server names, in which case you
 * can turn this off, but not sure if that is good practice.
 */
trusted-cert-valid-hostname yes;
2025-07-28 09:55:01 +02:00
Bram Matthys 44177f8c86 No valid trusted cert: change wording a bit ("you don't have any valid certificate"...)
Expired: this is a warning, not an error (we still want to boot the ircd)
Expired: handle the case for link::verify-certificate explicitly to avoid confusion
2025-07-28 09:19:27 +02:00
Bram Matthys 5abea8d4d2 Update release notes a bit with recent changes
[skip ci]
2025-07-27 09:52:37 +02:00
Bram Matthys 7c66adf196 Don't warn plaintext ports open if set::plaintext-policy::user is 'deny'
(.. since users won't get online then anyway)
2025-07-27 08:38:08 +02:00
Bram Matthys f39269c518 Fix uninitialized variable in config test for listen { }
Caused by previous commit 990fe22e64
2025-07-27 08:33:46 +02:00
Bram Matthys 990fe22e64 Print a best practices message if any plaintext port is open (eg 6667).
Ports that listen on 127.0.0.1 or ::1 are ignored (useful for e.g. services)

Looks like this:
[info] You have at least one IRC plaintext port open (such as 5668). Nowadays, everyone should be using SSL/TLS (on port 6697). See https://www.unrealircd.org/docs/Use_TLS.

See that https://www.unrealircd.org/docs/Use_TLS for more info (feedback welcome)

All this is in addition to somewhat related 29ce0ce29a:
[info] Your SSL/TLS certificate is not issued by a trusted Certificate Authority.
[info] It is highly recommended to use a 'real certificate'. To get a free one, see: https://www.unrealircd.org/docs/Using_Let's_Encrypt_with_UnrealIRCd

If applicable, that message is printed first, the 6667 one comes after ;)

Suggested in https://bugs.unrealircd.org/view.php?id=6500
and numerous times / discussions on IRC over the past years
It's finally time.. no.. it's overdue..
2025-07-26 16:02:33 +02:00
Bram Matthys d468473876 Add a comment about port 6667 in example.conf
/* Standard IRC port 6667:
 * Insecure plaintext (NOT for production servers)
 * This listen block is here only for quick testing.
 * Delete or comment out this listen block on production servers
 * and use TLS on port 6697 instead.
 */

Also throw it in translated example*conf's (in English),
the translators can translate it.
2025-07-26 14:45:09 +02:00
Bram Matthys eae1a2e99a Remove some check for U4 (<4.0.16+). Shouldn't matter but otherwise
one could possibly miss this cert verification warning. And since
that will later become an error, it is even more important to
notice such a (hopefully unusual) case quickly.
2025-07-26 13:34:40 +02:00
Bram Matthys 6b0d81fb77 Make a warning actually a warning 2025-07-26 13:31:50 +02:00
Bram Matthys a73186362b * Add link::options::no-certificate-verification
* Code cleanup: split connect flags in CONNECT_OUTGOING_* and CONNECT_*
* Don't print tls_link_notification_verify() stuff for localhost conns
2025-07-26 13:26:46 +02:00
Bram Matthys 26fb6b70d6 Fix localhost S2S link downgrading link-security.
On the incoming side it was correctly identified as link sec 2,
but on the outgoing side the localhost check failed and caused link sec 1 or 0.

Bug has beent here for a while but I don't think many people
link two UnrealIRCd servers over localhost that are on production
(i do, when dev'ing, but then I don't care about linksec, obviously)

Also, this wouldn't flag services from 2 to 0 because this bug only
affected outgoing UnrealIRCd server connections.
2025-07-26 13:24:00 +02:00
Bram Matthys 8f23550122 Since 2017[*] we warn about active MITM risks if a cert of a server link is
not verified. This changes the wording from "You may want to consider" to
a warning, makes it more strong and that in the future we will reject this
by default.

Actually still pondering to reject it now already by default, but let's start
with this commit first...
2025-07-26 12:22:49 +02:00
Bram Matthys fe569346b0 Call unrealircd_set_tls_groups() from url_unreal (remote includes) as well.
For url_curl it seems too complicated, added a comment there.
2025-07-25 14:03:54 +02:00
Bram Matthys 6178e2b94f *** UnrealIRCd 6.2.0-beta2 *** 2025-07-25 10:31:44 +02:00
Bram Matthys bf7edb5a51 Add extras/tests/tls/testssl_profiles/pqc.txt
Is same as baseline.txt but with this line added:
+"FS_KEMs","127.0.0.1/127.0.0.1","5901","OK","X25519MLKEM768","",""

This so debian 13 test succeeds (and other future distros with OpenSSL 3.5+)
2025-07-24 18:26:37 +02:00
Bram Matthys 11ba1edff1 Update release notes on the Post-quantum cryptography (PQC) enhancements:
* [set::tls](https://www.unrealircd.org/docs/TLS_Ciphers_and_protocols):
    Rename `ecdh-curves` to `groups` (the old name will continue to work)
  * Add (and prefer) the `X25519MLKEM768` hybrid group, which is a mix
    of `X25519` that is commonly used today and quantum-safe `ML-KEM-768`.
    This to protect against
    ["harvest now, decrypt later"](https://en.wikipedia.org/wiki/Harvest_now,_decrypt_later).
  * To benefit from this, OpenSSL 3.5.0 or later (released April 2025)
    is required on the server, and similarly a client that supports this.
    At the time of writing, almost all Linux distros don't have such an
    OpenSSL version yet (which is not a problem, this new feature will simply
    not be available). Notably Debian 13 (when released in August
    2025) will have it. LibreSSL does not support it either yet, so our
    Windows build does not have this feature.
  * Also, change the TLS information on-connect and in WHOIS etc. from
    something like `TLSv1.3-TLS_CHACHA20_POLY1305_SHA256` to
    `TLSv1.3/X25519/TLS_CHACHA20_POLY1305_SHA256`. In other words: using
    slashes as separators and showing the group / key exchange in the middle.
    The group is only shown on newer OpenSSL versions. If someone would
    use the new PQC hybrid group mentioned above then their TLS info would
    start with `TLSv1.3/X25519MLKEM768/`.
  * TL;DR: better secrecy against future quantum attacks, even though
    not many clients or servers support it at the moment.

[skip ci]
2025-07-24 16:00:03 +02:00
Bram Matthys 8a4dae71fb Fix compile problem with LibreSSL (and possibly OpenSSL <3.0.0).
Caused by 31d51fbb04
2025-07-24 15:40:43 +02:00
Bram Matthys d146da4a07 Change the cipherinfo, such as in [secure: TLSv1.3...] and in WHOIS.
Previously this was like:
TLSv1.3-TLS_CHACHA20_POLY1305_SHA256
It is now changed to be like:
TLSv1.3/X25519/TLS_CHACHA20_POLY1305_SHA256

So:
* Changed from '-' to '/' because sometimes the cipher(suite)
  contains a hyphen (TLSv1.2 and earlier)
* Show the key exchange "group" in the middle, such as X25519
  for the usual non-PQC case and X25519MLKEM768 for hybrid group
  with PQC.
* The group is shown in OpenSSL 3.0.0+ (and obviously you need
  OpenSSL 3.5.0 to ever see X25519MLKEM768 there, but that is
  something different)
2025-07-24 15:32:00 +02:00
Bram Matthys 0729382ba2 Rename ::ecdh-curves to groups and add X25519MLKEM768 to group list.
Post-quantum cryptography (PQC). Release notes will follow later.
2025-07-24 14:47:49 +02:00
Bram Matthys 9035859f0e Channel flood protection is now on by default. You can use +F to override.
[Channel flood protection by default](https://www.unrealircd.org/docs/Channel_anti-flood_settings):
This is an important change that IRCOps and chanops should know about:
* By default we now apply the anti-flood profile "normal", which should be fine for most channels.
* If a chanop does not want this they can override this by setting
  `MODE +F` with [another profile](https://www.unrealircd.org/docs/Channel_anti-flood_settings#Channel_mode_F_profiles).
* For example, for a channel with hundreds of users and lots of activity
  `+F relaxed` may be more appropriate. Or, chanops can turn anti-flood
  off entirely by setting `+F off`
* The reason for this change is that many admins and chanops in practice
  don't seem to use `+f` or `+F`. With this change they are now protected "by default"
  when no MODE `+f` or `+F` is set.
* Advanced users can can grab the detailed effective settings with `MODE #test F`
2025-07-16 14:59:42 +02:00
Bram Matthys 31d51fbb04 * UnrealIRCd can now be used if your OpenSSL does not provide MD5
(there will be an error if you use `cloak_md5`, but everything
  will work fine if you use `cloak_sha256`).

We phased out MD5 usage years ago, so it is only contained to
the old cloaking module. In fact that was the only reason we
started to provide the SHA256 cloaking module, simply so it
isn't using old MD5.

Of course, for module coders this means they should not call
DoMD5() or md5hash(), but that would be rare. Currently zero
modules in unrealircd contrib do this and it makes no sense
to start using it nowadays anyway.
2025-07-15 19:09:32 +02:00
Bram Matthys a911497290 Mention Text Analysis in release notes
[skip ci]
2025-07-14 18:48:48 +02:00
Bram Matthys 93980ee004 Include TextAnalysis in antimixedutf8 hit as well. And use "text_analysis"
and not "textanalysis" for the JSON, to keep naming of multi-word stuff
consistent.

Example:
--snip--
  "text_analysis": {
    "antimixedutf8_points": 20,
    "unicode_blocks": 9,
    "num_bytes": 55,
    "num_unicode_characters": 20,
    "deconfused": "Valware is ualwaring",
    "deconfused": "This is a testtestte",
    "unicode_blockmap": {
      "Basic Latin": 2,
      "Latin Extended-B": 2,
      "IPA Extensions": 1,
      "Greek and Coptic": 1,
      "Latin Extended Additional": 2,
      "Greek Extended": 1,
      "Number Forms": 1,
      "Tifinagh": 1,
      "Mathematical Alphanumeric Symbols": 7
    }
  },
2025-07-14 18:41:04 +02:00
Bram Matthys d135e687c3 Add TextAnalysis on spamfilter hit in the JSON logs. 2025-07-14 18:11:59 +02:00
Bram Matthys e8b5a831e1 ** UnrealIRCd 6.2.0-beta1 **
(Possibly some Windows build fixes after this, but..)
2025-07-13 11:39:00 +02:00
Bram Matthys 76358d3f0b Some more release notes updates
[skip ci]
2025-07-13 11:07:23 +02:00
Bram Matthys f85f5899dc Update release notes a bit
[skip ci]
2025-07-13 11:03:08 +02:00
Bram Matthys 93720a9533 Fix OS JUPE still allowing server in.
Since UnrealIRCd 6.0.0 when a server connects, we like to drop the
existing link so they don't need to wait on "Ping timeout".
However, that goes against the JUPE stuff that Services tend to use,
it basically negates it.

We now check if the uplink is u-lined (like for services) and if that
is the case we deny the link with "Server Exists (Juped)". So just
like before U6, and with a slightly more helpful message even.

Reported by Jellis in https://bugs.unrealircd.org/view.php?id=6498
2025-07-13 10:53:46 +02:00
Bram Matthys 97a87bdca8 Fix reputation score not expiring after 30 days of inactivity.
We now expire after 30d if score is <12 (so 1 hour of being online)
and we expire after 90d regardless of score.

Note that for this to work, all servers would need to be running
UnrealIRCd 6.2.0+ because when a score for an IP is still present
on any of the servers on a network, and a user with that IP connects,
then the score will be broadcasted from the server that still has
the score and it will be re-added by all servers with that score.

But eventually it should be like this... :D

Reported by armyn in https://bugs.unrealircd.org/view.php?id=6536
2025-07-13 10:22:40 +02:00
Bram Matthys 369f55063a For bestpractices::trusted-cert add some crude heuristics so hubs and such
are not (always) affected by this. We now check if there is any client port
exposed (to non-localhost). So if you have a hub with no client ports or
only at localhost then you won't get this bestpractices advice.

And also fix compile error on OpenSSL < 1.1.0 (undeclared var, duh)
2025-07-13 09:46:23 +02:00
Bram Matthys 29ce0ce29a Best Practices: If zero SSL/TLS certs are issued by a trusted CA, complain and
suggest to use Let's Encrypt.

This can be turned off via set::best-practices::trusted-cert, see
https://www.unrealircd.org/docs/Set_block#set::best-practices

Oh yeah, and this only works at OpenSSL 1.1.0 and higher, i didn't bother
with people running ancient versions.
2025-07-13 09:26:54 +02:00
Bram Matthys cd2deeb1e7 Add spamreport::on-server-ban. If set to yes, then the spamreport
block runs when a user is *LINEd.

TODO: avoid double sending on spamfilter with action { report; gline; }
2025-07-12 18:14:40 +02:00
Bram Matthys 96a2ea5c02 Add HOOKTYPE_BANNED_CLIENT 2025-07-12 18:06:52 +02:00
Bram Matthys af9014dbd3 Update release notes
[skip ci]
2025-07-12 17:42:52 +02:00
Bram Matthys 301fb911e8 When submitting to Central Spamreport, include TextAnalysis and
bump sending of last commands from "last 10" to "last 20".
2025-07-12 17:21:56 +02:00
Val Lorentz 5aec83b444 Fix mismatched closing parenthesis (#314) 2025-07-06 14:53:00 +00:00
Bram Matthys ba8c587e44 Update to previous commit: disable by default, enable via set { send-isupport-updates yes; }
I totally agree with the goal to have this enabled, but let's do some more
testing with more clients first to see if they misbehave. Last thing I want
is a similar situation to when we were the first IRCd that sent "CAP DEL sasl"
and "CAP NEW sasl" when services went offline and online and it caused all
mIRC clients to reconnect. I don't expect this one to be so bad (also because
users would get the 005's when they typed /VERSION) but... let's test to be sure.

Should probably deploy this with enabled on irc.unrealircd.org and such :)
2025-07-06 09:28:38 +02:00
Valerie Liu eae5bccee1 Tell clients about CHANMODE, PREFIX and STATUSMSG changes at runtime (#311)
This re-sends these ISUPPORT tokens to let users know about important changes that may affect their display, most notably `PREFIX` can be problematic; for example if you have a server running and wish to load a module like ojoin or something else that relies on the client knowing the correlation between the mode and the prefix char, and without it the client just doesn't display the nicklist properly from then on until the client reconnects, which as we know can be a while until that happens.

The expected client reaction to duplicate ISUPPORT tokens according to the spec is to overwrite the current values. I have tested this in mIRC only and it works as expected.
2025-07-06 07:19:53 +00:00
Bram Matthys cb17d58db0 Some small changes to previous commit:
* Calling from source is now in a separate function: int can_use_nick(Client *client, const char *nick)
* For hooks: don't free the reject reason, must use static storage like all other hooks
  (TODO: clarify in all hooks?)
* Move it up a bit, right before find_qline

TODO (not necessarily me :D):
* Make it an efunc
* Also call it from some other places that do find_qline, like rpc/user.c
* You may want to prod 3rd party modules like SANICK
2025-07-06 09:19:04 +02:00
Valerie Liu 6a6dd66c84 Add HOOKTYPE_CAN_USE_NICK to allow modules to reject certain nicks (#313)
* Add `HOOKTYPE_CAN_USE_NICK` for modules to disallow certain "internal-use" nicks
* Run the hook on local NICK commands
2025-07-06 07:10:58 +00:00
Bram Matthys fc835a26f0 Make error shorter if TLS cert or key are missing (1 line instead of 4)
and also give some guidance if the default cert/key is missing (make pem).

(A word on Let's Encrypt will be handled later / differently)
2025-07-04 09:05:28 +02:00
Bram Matthys d81817622a Update doc/unrealircd_wiki.zim (current wiki) 2025-06-25 09:55:27 +02:00
Bram Matthys 45f35f9cd2 For ./unrealircd genlinkblock, for bind-ip detection, skip 127.0.0.1 and ::1. 2025-05-24 16:25:38 +02:00
Bram Matthys c836f394e5 Central Blocklist: make "error contacting CBL" error message more verbose
Show the actual error, like connection timed out, HTTP 500, etc.
2025-04-22 08:00:46 +02:00
Bram Matthys b04c402ce0 Update shipped Jansson to 2.14.1. 2025-04-16 14:18:10 +02:00
Bram Matthys a6d9288a77 Update shipped PCRE2 to 10.45. 2025-04-16 14:16:51 +02:00
Bram Matthys 85b9b4ddc1 Update shipped c-ares to 1.34.5 (8-apr-2025) 2025-04-16 14:00:55 +02:00
Valerie Liu 5d7feff725 Fix HOOKTYPE_PRE_CHANMSG refering to hooktype_can_send_to_user()
as an alternative. It should mention hooktype_can_send_to_channel() instead.
2025-04-14 15:30:51 +00:00
Rafael Grether 12927bca43 Update example.pt.conf to the latest changes (#309) 2025-04-14 15:29:18 +00:00
Bram Matthys f7fd5b013f Update some release notes (no code changes)
[skip ci]
2025-03-30 17:19:28 +02:00
Bram Matthys 30ff1bf09e Add a TODO item 2025-03-27 17:51:32 +01:00
Bram Matthys 641413cfa9 Update Unicode block lists with Unicode 16.0.0 from 2024-02-02.
And provide instructions on how to generate this thing.
2025-03-24 09:32:50 +01:00
Bram Matthys cc75840189 Add unicode_count() crule, e.g. unicode_count('Emoticons')
This will return the number of characters that are in the unicode block
with that name.

spamfilter {
	rule "unicode_count('Emoticons')>2";
	target { private; channel; private-notice; channel-notice; }
	action block;
	reason "Too much emotion";
}

In this commit we also make it so we pass the ClientContext (including
clictx->textanalysis) in crule_context.
2025-03-23 18:14:32 +01:00
Bram Matthys fafe16a673 AntiMixedUTF8: change emoticon transition score from 1 to 0
You will still get a score of +1 if afterwards changing back to Latin
or anything else, but at least the Latin/anything -> Emoticon
transition is free now (score 0). And if ending with an emoji it
also means a score 0 (as far as this is concerned).
2025-03-23 13:21:01 +01:00
Bram Matthys 74e17b7a26 Make SPAMINFO show the UTF8 block names a text uses.
Example output:
*** SPAMINFO ***
This will show the original text and the deconfused text which can be used in a spamfilter block with input-conversion deconfused;
Original spam text: ẔŽŽẐ𝞕ȤℤΖℨℨ𝒁𝓩ẒŹƵᏃŻẒŽℨŹ𝒵𝛧Ż𝝛𝛧ℨℤ𝜡Ƶ𝞕𝘡ŹẐ𝑍ẔẐẐΖ𝜡Ẕ𝜡Ẕ𝞕ꓜ𝚭ᏃẐẔ𝙕
Deconfused spam text: ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ
AntiMixedUTF8 points: 64
Number of Unicode characters in total: 50
Number of different Unicode blocks used: 8
Unicode Block breakdown (name: bytes [capped at 255]):
- Latin Extended-A: 8
- Latin Extended-B: 3
- Greek and Coptic: 2
- Cherokee: 2
- Latin Extended Additional: 12
- Letterlike Symbols: 6
- Lisu: 1
- Mathematical Alphanumeric Symbols: 16
2025-03-23 13:03:58 +01:00
Bram Matthys 6bd6e974d4 Add num_bytes and num_unicode_characters to TextAnalysis struct.
Also so you can easily put the unicode_blockmap[] in perspective
e.g. if you want to do percentages.
2025-03-23 12:43:01 +01:00
Bram Matthys 3142b57f77 Move text analysis to main command handler (parse2()).
In CommandAdd() the flag CMD_TEXTANALYSIS now means that the last
parameter of the command will run through the text analysis system.

This flag is set in PRIVMSG NOTICE PART QUIT AWAY SETNAME TOPIC
2025-03-23 12:28:43 +01:00
Bram Matthys 9b89166280 Add deconfused to TextAnalysis. Add ClientContext * to match_spamfilter().
Make match_spamfilter use the clictx->textanalysis->deconfused rather than
calculating its own. The latter will probably disappear altogether.

Unrelated but also fixed: properly set e->unicode_blocks.
2025-03-23 12:13:38 +01:00
Bram Matthys 9691a6d819 Create TextAnalysis framework (hook), this counts the unicode block
switches like antimixedutf8 did, and counts the number of characters
used per unicode block. Potentially more can be added later, this is
flexible and modules can add stuff (..well not yet.. the struct is
missing some members..).

Use it from antimixedutf8 so that it now uses the new code, which is
similar to what I made and then reverted in July 2023:
https://github.com/unrealircd/unrealircd/commit/3e2f668f10fccedfd035526d7b20d7ca6819a8ae
..except that it now calculated in src/modules/utf8functions.c.
But yeah, this needs more testing and possibly (default) score
adjustments to deal with false positives !! And a warning in release notes :D

Put the text analysis in ClientContext member textanalysis,
so typically accessed through clictx->textanalysis.
Note that this struct can (and often is) NULL, for example if it is
a remote client, if it is not a PRIVMSG/NOTICE (will improve later)
or if the utf8functions module is not loaded (to keep things optional).

BREAKING CHANGE is that ClientContext is now passed in the
HOOKTYPE_CAN_SEND_TO_CHANNEL and HOOKTYPE_CAN_SEND_TO_USER hooks.

So HOOKTYPE_CAN_SEND_TO_USER prototype changed from:
int hooktype_can_send_to_user(Client *client, Client *target, const char **text, const char **errmsg, SendType sendtype);
To:
int hooktype_can_send_to_user(Client *client, Client *target, const char **text, const char **errmsg, SendType sendtype, ClientContext *clictx);

And HOOKTYPE_CAN_SEND_TO_CHANNEL prototype changes from:
int hooktype_can_send_to_channel(Client *client, Channel *channel, Membership *member, const char **text, const char **errmsg, SendType sendtype);
To:
int hooktype_can_send_to_channel(Client *client, Channel *channel, Membership *member, const char **text, const char **errmsg, SendType sendtype, ClientContext *clictx);

A side-affect of this change for antimixedutf8 purposes is that,
while the analysis is only done once per line, the 'actions' are
performed for each target, so the action will run 4 times for
"PRIVMSG a,b,c,d :text" although that may not be important in
practice. Just mentioning.
2025-03-23 11:44:24 +01:00
Bram Matthys 6fd77ae572 Fix unreal_expand_string declaration 2025-03-23 08:12:40 +01:00
Bram Matthys 2c33103d28 Fix OOB read, write and NULL dereference code from yesterday. 2025-03-23 07:21:00 +01:00
Bram Matthys d137a95606 Update confusables. Generated with a python script from 2 different
generators/sources plus some manual tweaking.
This is not complete and not always correct. Sometimes there are
simple mistakes like ф -> f because that is a cyrillic f but it
should be seen as an o or something like that. Those still need to
be polished out. And some other things are just plain weird but
probably similar cases. In any case, with this commit things are
getting better. It will never be perfect or anything close to perfect
anyway!
2025-03-22 15:40:32 +01:00
Bram Matthys e1fac402d5 Add spamfilter { input-conversion confusables; ..... } for UTF8 conversion
of lookalike characters to simple latin characters.

Also add SPAMINFO command so you can see the result of the conversion.
2025-03-22 08:31:22 +01:00
Bram Matthys 9b3d219743 Add utf8functions with utf8_convert_confusables() from July 16 2023.
I started work on this back then but didn't finalize it. Now I
have to figure out what was left to be done :D. Other than the
obvious case of seeing some debugging code that prints out for
every converted character. Not yet visible / usable by end-users!
2025-03-22 07:56:11 +01:00
Bram Matthys 8c21472d03 Move allow::maxperip to its own module (maxperip), add HOOKTYPE_ALLOW_CLIENT.
Also fix documentation for ~10 hooks to mention the hook name.

Obviously, the maxperip module is loaded by default (in modules.default.conf)
but it is nice to have the 400+ lines contained in a separate module
rather than being in the nick module that does NICK/UID handling.
Will look at moving more later..
2025-03-22 07:42:00 +01:00
Bram Matthys b95c1570a9 Add CONFIG_ALLOW_BLOCK & CONFIG_CLASS in HOOKTYPE_CONFIGTEST and
HOOKTYPE_CONFIGRUN_EX. Allowing to modularize things (for us and
third party modules)
2025-03-22 06:39:44 +01:00
Bram Matthys d15c82346e Pass ClientContext in CMD_FUNC() and friends. So extra arg. Breaking change.
It now passes 'clictx' which at the moment only has clictx->cmd which
points to the command handler. So only useful in very few cases where
you have like a generic command handler and thus have no idea for which
command you are being called. In the future, with this new ClientContext
struct, we can simply add new fields to the struct without breaking
things in the core and in (third party) modules.

If you use the magic functions in your modules CMD_FUNC(cmd_mycmd),
OVERRIDE_FUNC(myoverride), CALL_NEXT_COMMAND_OVERRIDE() and such then
you shouldn't have any compile errors as these will use the correct
prototypes and variable names automatically. In a few cases you can't
use these, in which case you will need to update your modules.
2025-03-21 15:40:42 +01:00
Bram Matthys 5d733d50e5 Bump version to 6.2.0-git 2025-03-21 15:31:44 +01:00
Bram Matthys e9e63e4041 Allow calling mtags_to_string() with a NULL client, eg to store/serialize. 2025-03-14 10:29:24 +01:00
Bram Matthys 77ba83a49b There was still a reference to rc1 at the end of /INFO 2025-03-09 08:35:33 +01:00
Bram Matthys 53febc0faa ** UnrealIRCd 6.1.10 ** 2025-03-07 14:41:41 +01:00
Bram Matthys 47d479b1c9 Import from unrealircd-6.1.9.
[skip ci]
2025-02-16 09:28:35 +01:00
Bram Matthys 8028ca9c4a ** UnrealIRCd 6.1.10-rc1 ** 2025-02-16 09:24:43 +01:00
Bram Matthys e7ec191bf1 Fix crash by IRCOp upon SPAMREPORT <ip> when centralblocklist is loaded.
Reported by Balthazar in https://bugs.unrealircd.org/view.php?id=6497
2025-02-16 08:52:32 +01:00
Bram Matthys d06f797422 Update release notes on the two new spamfilter { } options.
[skip ci]
2025-02-15 12:38:49 +01:00
Bram Matthys 094efeee25 Add spamfilter::show-message-content-on-hit to override on a spamfilter basis.
This works the same as set::spamfilter::show-message-content-on-hit
https://www.unrealircd.org/docs/Set_block#set::spamfilter::show-message-content-on-hit
but per spamfilter { } in the conf.

Indirectly suggested in https://bugs.unrealircd.org/view.php?id=6437
2025-02-15 12:14:44 +01:00
Bram Matthys ae166bd99e Add spamfilter::input-conversion none; to not use StripControlChars()
for matching. Docs and release notes text will follow later.
2025-02-15 11:05:37 +01:00
Bram Matthys 83ddf0c79a TLS tests: don't use color
[skip ci]
2025-02-14 08:23:15 +01:00
Bram Matthys 76ba0495a1 testssl.sh: for some reason ECDSA+SHA1 is in signature algorithms,
even though this makes little sense and I doubt this is getting negotiated.

Depends on the OpenSSL version apparently, this is on Ubuntu 18.04
(and possibly 16.04) but not on Ubuntu 20.04/22.04/24.04.
Also not an issue on Debian 10/11/12.

Added to ignore at the moment.
2025-02-10 15:04:44 +01:00
Bram Matthys 8537b73253 Add new baseline for testssl.sh tests. 2025-02-10 13:47:12 +01:00
Bram Matthys 35bbba2b5b Attempt migration from cipherscan to testssl.sh for SSL/TLS tests.
[skip ci]
2025-02-10 13:18:11 +01:00
Bram Matthys 72af36d2a3 Fix problem with upcoming GCC 15 that assumes C23.
GCC 15 is not released yet and is scheduled for April/May 2025.

We now have a ./configure check. If a func() declaration is interpreted
as meaning 0 arguments, so C23 style, then we now add -std=gnu17 to
CFLAGS. If not, then we don't set an explicit C standard version.

Closes https://bugs.unrealircd.org/view.php?id=6495
2025-02-10 11:31:47 +01:00
Bram Matthys aa31afe388 Update release notes a bit, nothing exciting
[skip ci]
2025-02-08 09:16:03 +01:00
Bram Matthys 3cc06cecb9 Show the message type in target flood log messages (PRIVMSG/NOTICE/TAGMSG).
Changed the log/snomask message from, for example:
Flood blocked (target-flood-user) from evil!xyz@localhost [127.0.0.1] to victim
To:
Flood blocked (target-flood-user) from evil!xyz@localhost [127.0.0.1] to victim (TAGMSG)
2025-02-08 08:33:37 +01:00
Bram Matthys 53e2e9473e Code cleanup 'config_error_flag'.
Maybe a great idea but we use a different errors system.
This config_error_flag thing is unused so only confusing.
2025-01-26 18:12:00 +01:00
Bram Matthys 9aa83edd99 Remove useless \n in calls to config_error() and config_status().
Where did this come from? This isn't printf() or anything.
2025-01-26 17:31:12 +01:00
Bram Matthys 04370d72f9 Minor code cleanup 2025-01-26 17:28:47 +01:00
Bram Matthys d157dc2494 Remove some useless code that is flagged by Coverity.
The set_usermode() result is not used, so useless.

The if (themotd) motdline = ... makes no sense since themotd is
already dereferenced in the code above it (eg: themotd->last_modified.tm_year)
and consequently the motdline = NULL becomes useless too.
2025-01-26 17:14:55 +01:00
Bram Matthys 8d4e9ea9b8 Merge branch 'unreal60_dev' of github.com:unrealircd/unrealircd into unreal60_dev 2025-01-26 13:24:53 +01:00
Bram Matthys ce47440abd Make config_detect_duplicate() externally accessible. Fix some coverity warnings,
mostly with regards to memory leaks if duplicate config directives are used.
Eg using allow::password twice in the same allow block, or using
link::outgoing::tls-options twice in the same link block. Unusual stuff.
2025-01-26 13:23:32 +01:00
TehPeGaSuS 8b8520a183 Update help.conf (#306)
Because we can give access to users with [set::hide-idle-time](https://www.unrealircd.org/docs/Set_block#set::hide-idle-time), I think this wording is more correct.
2025-01-25 16:26:07 +00:00
Bram Matthys 80ac9eb888 Central Blocklist: include web/websocket handshake data 2025-01-12 12:31:35 +01:00
Bram Matthys 0887a5a4bd example conf: comment out link { } and ulines { } as well
These are optional after all. Not everyone links multiple servers
and not everyone uses Services. Fits with the rest that is //'ed
out now. Indirectly suggested by jwheare.
2025-01-03 17:56:30 +01:00
Bram Matthys 6464407a7f In the REMOTEINC ./Config question at least mention cURL when we ask to enable cURL. 2024-12-30 17:39:54 +01:00
Bram Matthys a2b42b081f Update example.tr.conf & help.tr.conf by Serkan Sepetçi
Co-authored-by: Serkan Sepetçi <diablo@unrealircd.org>
2024-12-23 08:46:58 +01:00
Bram Matthys f51e8c0005 Fix make_channel() not checking minimal validity of channel names.
Only an issue for (bad) remote server traffic, since we use
valid_channelname() in JOIN and SAJOIN.
2024-12-13 10:18:02 +01:00
Bram Matthys 42caa34b5c Fix small memory leak if running in DEBUGMODE (mostly for me :D). 2024-12-11 18:25:55 +01:00
Bram Matthys a09320886b Add JSON logging block to example.conf.
In addition to regular logging, also add a JSON log file.
This includes lots of information about every event so is great
for auditing purposes and is machine readable. It is, however
less readable for humans.
2024-12-04 18:54:19 +01:00
Bram Matthys 453729068e Add UnrealIRCd documentation wiki as doc/unrealircd_wiki.zim
This so there is an offline version of the documentation from
https://www.unrealircd.org/docs/.

I'm not 100% satisfied with the layout but it is workable.
The ZIM file can be opened with tools liki Kiwix.
https://en.wikipedia.org/wiki/ZIM_(file_format)
https://en.wikipedia.org/wiki/Kiwix

This does add 1.5 megabyte to the repository (and .tar.gz) but I
doubt anyone cares about that nowadays. The upside is that each
UnrealIRCd release will have the documentation of that time point
included, which can be used for historical purposes but also if
you don't have an internet connection or when for some other
reason the unrealircd wiki is unreachable.

The idea is that the .zim file is rebuild before each release,
i use mwoffliner (dev version) for that.
2024-12-04 13:18:37 +01:00
Bram Matthys ec489e48d2 Create $CONFDIR so ./Config question about copying example conf doesn't fail.
Reported by PeGaSuS on IRC.
2024-11-27 18:41:03 +01:00
Bram Matthys 1f57a606a4 Make binarytohex() from src/misc.c available and use it in certfp code. 2024-11-27 12:37:27 +01:00
Bram Matthys 6c98f7224a Always try to maintain chronological order in chat history, and optimize stuff.
Previously if a new history item was added (because someone sent a message)
we would always append at the end of chat history buffer of the channel.
Now we put the message at the position decided by the "time" message tag,
which could be at the end but also slightly before that.
* Upside: should result in a consistent chat history on all servers
* Downside: if your server time is off for several seconds then it
  could look a little weird. Then again, it would already have looked weird
  in real live chat with timestamps and when replaying chat history probably.

Also add some simple optimizations: in the log line object we now have direct
pointers to the msgid and time strings, so the code doesn't need to do a
find_mtag() all the time. This should lower CPU usage during log playback
and also makes things more simple in the source code.

I did some testing with various history injection variants but this needs
more extensive testing.
2024-11-27 10:34:07 +01:00
Bram Matthys d0173840a4 If conf/unrealircd.conf doesn't exist then propose copying the example conf.
Offering the list of languages, with English being the default.

Hopefully this is portable. I was conservative with my use of cmds anyway.
2024-11-25 17:01:40 +01:00
Bram Matthys 48a69151ef Update example.conf a little to indicate required changes with "CHANGE THIS".
People should preferrably go through the example conf line by line, but
if they are in a hurry or just want to get started quickly initially they
could CTRL+F on that.
2024-11-25 16:34:11 +01:00
Bram Matthys 6940272290 Prevent early UID cut-off. This doesn't happen with current unrealircd traffic
because we send 9 character uids. However, IDLEN is defined as 12 so it is
natural for other people (services and other pseudo server writers) to assume
you could send 12, which failed until now, as it only accepted 11 characters.

Just to be clear:
* We generate and send 9 character uids in UnrealIRCd ourselves, this
  works perfectly fine
* In 114d54ac61 in 2021 (UnrealIRCd 5.2.1) i
  enlarged the buffers to allow INCOMING ids of up to 12 characters.
  The reason for that is that I want the option to allow slightly larger
  uids and could start doing that several years later without causing
  desynchs and other problems.
* That didn't work properly, it only allowed up to 11 chars at this point.
* From now on it allows 12 chars. I do NOT recommend sending that though, if
  you want to send bigger ids from your services/pseudo server then use
  11, or... actually just use 9 like in normal unrealircd traffic at the
  moment.

Reported on IRC by craftxbox
2024-11-24 09:56:06 +01:00
Bram Matthys 47e81fe7d3 Set version to 6.1.10-git 2024-11-24 09:46:21 +01:00
Bram Matthys e782748b40 ** UnrealIRCd 6.1.9.1 ** 2024-11-21 19:30:01 +01:00
Bram Matthys f953c79be4 Update release notes 2024-11-21 19:28:22 +01:00
Bram Matthys 1b4560218a I think this is the correct fix for incorrect TLS ciphers in 6.1.9.
I was dumb: with an RSA cert you need ECDHE-RSA-* and i had
only included ECDHE-ECDSA-*. Long story short: TLSv1.2 didn't work
if you had an RSA certificate. Reported by BlackBishop, and in
hindsight also by Mi_92. Thanks for the quick reports, this should
be a quick fix :-)
2024-11-21 19:01:38 +01:00
Bram Matthys fb9aa72f78 Mention new UnrealIRCd PGP release signing key in release notes
[skip ci]
2024-11-20 11:45:01 +01:00
Bram Matthys 7b0228a2c8 ** UnrealIRCd 6.1.9 ** 2024-11-20 11:17:58 +01:00
Bram Matthys 3aa26ef1f1 Publish new UnrealIRCd release signing key for 2024-2030 (don't use it yet)
pub   rsa4096 2024-11-18 [SC] [expires: 2030-11-17]
      36E6F65706E36B0937280299101001DAF48BB56D
uid           UnrealIRCd releases and patches (for verification of software downloads only!) <releases@unrealircd.org>

The old key is still valid until 2025-06-29:
pub   rsa4096 2015-07-02 [SC] [expires: 2025-06-29]
      1D2D2B03A0B68ED11D68A24BA7A21B0A108FF4A9
uid           UnrealIRCd releases (for verification of software downloads only!) <releases@unrealircd.org>

The new key is signed by the old key and uploaded to keyserver.ubuntu.com.

The old key will still be used for signing releases for now. Somewhere around
the summer of 2025 i will switch to the new key.

Posted in https://forums.unrealircd.org/viewtopic.php?t=9397 for transparency
2024-11-18 13:04:49 +01:00
Bram Matthys 4ef7e4ea8d Read settings from unrealircd-6.1.8.1 2024-11-18 13:04:22 +01:00
Bram Matthys e0ec8dd720 More release notes updates
(also.. sigh.. have mentioned twice now that we 'disable TLSv1.2' when
 instead i meant to write 'require at least TLSv1.2'... ah well...)
[skip ci]
2024-11-17 13:52:02 +01:00
Bram Matthys 170a27e160 Update release notes. Let's call the SSL/TLS changes enhancements :D
[skip ci]
2024-11-17 13:39:42 +01:00
Bram Matthys b3559b5d2c Update release notes a bit
[skip ci]
2024-11-17 13:36:03 +01:00
Bram Matthys 492152f9ea Default TLS ciphers: drop support for AES in CBC mode, only allow AES w/GCM.
For reference, the established TLS connections at irc*.unrealircd.org
over the past 6 months were:
  14379 TLSv1.3-TLS_CHACHA20_POLY1305_SHA256
    368 TLSv1.2-ECDHE-ECDSA-AES256-GCM-SHA384
    160 TLSv1.2-ECDHE-ECDSA-CHACHA20-POLY1305
      3 TLSv1.3-TLS_AES_256_GCM_SHA384

There is nobody connecting with AES CBC in those statistics
(ECDHE-ECDSA-AES256-SHA256 and ECDHE-ECDSA-AES128-SHA384)
2024-11-17 13:08:46 +01:00
Bram Matthys 3317be3069 When using cURL for remote includes we now explicitly disable TLSv1.2
and set our default ciphers and ciphersuites. Note that by default in
UnrealIRCd 6 the built-in (non-cURL) implementation is used for remote
includes, which already uses the same defaults since 6.0.0. Also note
that most distros, like Ubuntu and Debian, already disabled TLSv1.2
in the default openssl conf and thus it was already disabled in cURL.
2024-11-17 12:32:35 +01:00
Bram Matthys cda2bcd930 Fix ecdh-curve X25519 missing when using the defaults.
In config.h we had a:
 #if OPENSSL_VERSION_NUMBER >= 0x10100000L
 #define UNREALIRCD_DEFAULT_ECDH_CURVES "X25519:secp521r1:secp384r1:prime256v1"
 #else
 #define UNREALIRCD_DEFAULT_ECDH_CURVES "secp521r1:secp384r1:prime256v1"
 #endif
...which is fine in theory, but openssl headers are not included at that point,
so OPENSSL_VERSION_NUMBER was not defined.

From now on, we have:
 #define UNREALIRCD_DEFAULT_ECDH_CURVES_PRIMARY "X25519:secp521r1:secp384r1:prime256v1"
 #define UNREALIRCD_DEFAULT_ECDH_CURVES_SECONDARY "secp521r1:secp384r1:prime256v1"
...and we try them in that order. If both fail, we exit with an error (like before).
This because X25519 is not available in OpenSSL before 1.1.0 (so really old)
and may also not be available when running in FIPS mode.
2024-11-17 12:08:23 +01:00
Bram Matthys 116e076f0d Add release notes for upcoming 6.1.9
[skip ci]
2024-11-17 10:22:48 +01:00
Bram Matthys 08435a5674 Bump version to 6.1.9-git 2024-11-17 09:55:05 +01:00
Bram Matthys bace42dd50 Update curl-ca-bundle.crt to Tue Sep 24 03:12:04 2024 GMT
https://curl.se/docs/caextract.html
[skip ci]
2024-11-17 08:54:21 +01:00
Bram Matthys e43b407886 Bump shipped c-ares library from 1.33.1 to 1.34.3
https://c-ares.org/changelog.html
2024-11-17 08:43:11 +01:00
Bram Matthys b49cb1e720 An additional dbuf_delete() in free_client() that should be unneeded.
In all my tests on real servers this was never a reported leak,
because the dbuf_delete() already happens at other places where the
client is marked dead.

However, with my (private) fuzzing patches I need this freeing because
of a slightly different code path.

I'm putting the patch in mainline just in case I'm wrong and it does
trigger in some kind of niche situation.
2024-11-17 08:11:55 +01:00
Bram Matthys 2c6cea2461 Fix problem with unsubscribing I/O, leading to 100% CPU in some cases.
The IRCd is still responsive (as the bad I/O is not prioritzed) but this
isn't good either. Only happens with some rare triggers.

This was previously reported over e-mail in an older UnrealIRCd version
but after 6-8 hours of debugging I was never able to trigger it.
Later it finally happened on one of my servers and I could debug it.
2024-11-17 08:09:50 +01:00
Bram Matthys 08fb2b46ac Fix crash with "STATS S" if having vhosts with autologin (no login).
This crash is only triggerable by IRCOps.

Also, it shouldn't lists vhosts with "STATS S", it should be "STATS V".
2024-11-17 08:03:32 +01:00
Bram Matthys 4e11d81d67 Fix IPv6 hosts not resolving in UnrealIRCd 6.1.8 / 6.1.8.1.
Reported by bss on IRC.

Changed:
r->ipv6 = IsIPV6(client);
To:
r->ipv6 = IsIPV6(client) ? 1 : 0;

The problem is that:
 #define IsIPV6(x)                      ((x)->flags & CLIENT_FLAG_IPV6)
(..so without ?1:0..)
made this effectively:
 r->ipv6 = CLIENT_FLAG_IPV6;

..which is..
 #define CLIENT_FLAG_IPV6                       0x800000000     /**< client is using IPv6 */
.. and 0x800000000 doesn't fit in r->ipv6, which is of size 'char' (so max is 0xff)
2024-11-16 13:17:06 +01:00
Bram Matthys 18b171a071 Some more missing include/windows/setup.h defines.
+#define HAS_ASN1_TIME_diff
+#define HAS_SSL_CTX_SET_MIN_PROTO_VERSION
+#define HAS_SSL_CTX_SET_SECURITY_LEVEL
+#define HAS_X509_check_host
+#define HAS_X509_get0_notAfter

In practice, this only adds that we now do certificate expiry checks
and give warnings, like on *NIX.

The HAS_X509_check_host is good because then OpenSSL/LibreSSL code is
used instead of the one we have from cURL and the ssl conservatory.
To be honest I wanted to rip out this fallback completely at first,
but let's do that in next major version of UnrealIRCd and not during
an existing series.

The HAS_SSL_CTX_SET_* would have given an admin the option to downgrade
to TLSv1.0 or TLSv1.1 but LibreSSL no longer builds with these since
LibreSSL 3.8.1, which is sensible, so... no actual change there.
I'll document the behavior in the docs (wiki), though.

Also the previous claim in b653c68df0 with
regards to what curves were actually enabled in our LibreSSL UnrealIRCd 6
builds was incorrect, an hour ago I claimed X448 would show up as an extra,
but that is not the case (that was with OpenSSL). The correct statement is:
"This also meant the default curves that were offered were up to LibreSSL,
 which meant the following list in practice:
  Elliptic curves offered:     prime256v1 secp384r1 X25519
 Instead of:
  Elliptic curves offered:     prime256v1 secp384r1 secp521r1 X25519"

So it was only missing secp521r1. Nothing major.
2024-11-09 12:55:15 +01:00
Bram Matthys b653c68df0 Fix error on Windows when trying to set set::tls::ecdh-curves.
"[error] ecdh-curves specified but your OpenSSL/LibreSSL library does not
 support setting curves manually by name. Either upgrade to a newer library
 version or remove the 'ecdh-curves' directive from your configuration file"

This also meant the default curves that were offered were up to LibreSSL,
which meant the following list in practice:
 Elliptic curves offered:     prime256v1 secp384r1 secp521r1 X25519 X448
Instead of:
 Elliptic curves offered:     prime256v1 secp384r1 secp521r1 X25519

Not that X448 is considered bad, it just didn't match what we claimed in
the docs at https://www.unrealircd.org/docs/TLS_Ciphers_and_protocols

Fixed by: #define HAS_SSL_CTX_SET1_CURVES_LIST
2024-11-09 12:01:47 +01:00
Bram Matthys 1f3c9b1dd2 Add /HELPOP EXTSERVERBANS and refer to it from GLINE/KLINE/ELINE.
Not from ZLINE/GZLINE since (almost?) extended server bans don't work
from there since it is so early in the connecting process.
2024-10-23 10:09:45 +02:00
Bram Matthys 30b9f66f71 ** UnrealIRCd 6.1.8.1 ** 2024-10-17 18:30:07 +02:00
Bram Matthys 6d60899007 Good idea to bump the vhost module version to 6.1.8.1
[skip ci]
2024-10-17 18:22:16 +02:00
Bram Matthys 019c327821 Fix crash with new auto-vhost code. 2024-10-17 17:44:50 +02:00
Bram Matthys 985a591df2 Previous commit broke "GLINE *@1.2.3.4 0 test" and had a memory leak.
The former was fixed by merging the 'if'. The latter by getting rid
of dynamic memory allocation, long live the stack!
2024-10-16 10:21:16 +02:00
Valerie Liu 8e47aff2cf Make *LINE behave smarter if missing reason or time value (#304)
Now this works like:
if the time param exists, even without a reason, it will be checked if it's a time param. if it's not a time param, it'll be considered to be the reason (or the first part of it anyway)

Reported by PeGaSuS in https://bugs.unrealircd.org/view.php?id=6105
2024-10-16 08:01:12 +00:00
Bram Matthys cf6718fdb2 Fix vhosts and blacklist reasons being lowercased
This was unintentional strtolower() in unreal_expand_string()
2024-10-14 18:56:21 +02:00
Bram Matthys a12ca25f50 Mention donation and shop in the release notes
[skip ci]
2024-10-11 09:24:45 +02:00
Bram Matthys 33276fb2ee ** UnrealIRCd 6.1.8 ** 2024-10-11 07:22:51 +02:00
TehPeGaSuS f7d2683569 Removed an extra { on the listen block syntax example (#303) 2024-09-28 17:33:22 +00:00
Bram Matthys e2400c0270 And some more rewording in release notes
[skip ci]
2024-09-27 10:23:15 +02:00
Bram Matthys 0a4f9af647 Add vhost block link in relnotes
[skip ci]
2024-09-27 10:21:25 +02:00
Bram Matthys 665dd8584a ** UnrealIRCd 6.1.8-rc1 ** 2024-09-27 10:19:18 +02:00
Bram Matthys c86b474ed8 Fix crash on crule "||"; in config file.
Reported by Valware in https://bugs.unrealircd.org/view.php?id=6438
2024-09-25 13:04:30 +02:00
Bram Matthys eae680c773 Update release notes a bit
... and make set::max-inherit-extended-bans::ban-exception default to 0
because that functionality is not implemented
The +e's are already checked when using +b ~inherit though..
2024-09-25 10:14:46 +02:00
Bram Matthys 2c77bc3723 Ok now make it 100% the same as pure IRC. There was still 1 char missing :D 2024-09-25 09:54:29 +02:00
Bram Matthys efbcf1f3b6 Actually test and fix the websocket cutoff bug from
7a43448674
2024-09-25 09:45:55 +02:00
Bram Matthys 918347af9e Fix config test for security-group
(in case of missing parameter for public or priority)
2024-09-25 09:21:44 +02:00
Valerie Liu fff76c4b29 Make authprompt work with recently new "sasl-from-a-module" hooks (#302) 2024-09-25 07:15:31 +00:00
Bram Matthys 7a43448674 Add unrl_utf8_make_valid() special option 2 to fix previous commit.
Without this, the IRC message could be far beyond >510 characters
(excluding message tags).

This code is untested!
2024-09-24 18:32:14 +02:00
Valerie Liu 713414e716 Websockets with type 'text': don't truncate lines to 510 chars when there are message tags (#301)
Allow full mtag messages to be sent over websockets
2024-09-24 16:30:02 +00:00
Bram Matthys 5860172780 Free previous GeoIP result upon IP change. Otherwise if the new geoip
lookup fails the old result stays there which is confusing.

Reported on IRC where 10.x.x.x was shown as "Poland" which was a
leftover from the "real IP" before WEBIRC spoofing was used to set
the IP to 10.x.x.x. Reported by Jellis.
2024-09-23 19:10:33 +02:00
Bram Matthys 7765f226be Detect operclass::parent loops.
Reported by craftxbox in https://bugs.unrealircd.org/view.php?id=6471
2024-09-23 17:25:17 +02:00
Bram Matthys 7d37795353 Don't list security groups by default, add 'public <yes|no>'
* [Security group blocks](https://www.unrealircd.org/docs/Security-group_block)
  are now hidden in lists by default. If you want the security group to be shown
  in things like `MODE #channel +b ~security-group:x` (which shows a list)
  then you need to use `public yes;`. The default security groups
  like known-users, webirc-users, etc. are public by default.
2024-09-23 13:11:24 +02:00
Bram Matthys e238eb7a4f Update release notes a bit
[skip ci]
2024-09-23 12:34:28 +02:00
Bram Matthys afbb0c283b Accept multiple masks in ban ip { } and ban nick { } such as:
ban ip {
	mask { 1.1.1.1; 2.2.2.2; 3.3.3.3; }
	reason "Go away";
}

Or the alternate form:

ban ip {
	mask 1.1.1.1;
	mask 2.2.2.2;
	mask 3.3.3.3;
	reason "Go away";
}

Suggested by magic000 in https://bugs.unrealircd.org/view.php?id=4599

Note that this is not a Mask item, these are special, hence the
special code.
2024-09-23 12:29:35 +02:00
Bram Matthys 403b055756 Fix duplicate_security_group() not inheriting 'ip' entries.
There was a typo where it was inheriting exclude-ip entries as
ip entries. This could have been very dangerous but fortunately
exclude-ip was broken so it was impossible to add exclude-ip
entries and that list was always empty / NULL.

This only affected proxy { } blocks with type forwarded/x-forwarded/
cloudflare. The proxy block worked fine, but we also tried to exempt
these IPs from blacklist checking and connect-flood and this was
NOT effective due to this bug... even though the entries were shown
in "STATS except" with these IPs (because 'printable_list' was
correctly duplicated).

Other than that very particular use-case, this function is not used
at the moment.
2024-09-20 19:28:15 +02:00
Bram Matthys 5ffcefe50a Update release notes on features added today.
[skip ci]
2024-09-20 18:10:39 +02:00
Bram Matthys 7dc3c230a7 Now that we support $variables, add set::oper-vhost so you can set a default
vhost for opers, such as: set { oper-vhost $operclass.admin.example.net; }

If the oper has an oper::vhost then that one will override.

https://www.unrealircd.org/docs/Set_block#set::oper-vhost
2024-09-20 17:54:39 +02:00
Bram Matthys 9a2d54cd01 Support $variables in oper::vhost (for variables see previous commit)
Eg: vhost "$operlogin@$operclass.example.net";

Also add potentially_valid_vhost() function which can be used in
config code to ignore invalid $vars. Then at runtime you use the
real valid_vhost() function after variable expansion by
unreal_expand_string().
2024-09-20 17:26:16 +02:00
Bram Matthys 4557036cd6 Move unreal_expand_string() to an efunc so all code can access it
and use it not only from vhost { } block code but also for like
blacklist::reason.

This so the same variables with the same names are available at
those places.

Supported are:
$nick, $username, $realname, $ip, $hostname, $server, $account,
$operlogin, $operclass, $country_code (xx for unknown),
$asn (0 for unknown).
2024-09-20 17:13:23 +02:00
Bram Matthys 60c0ab8da2 Make vhost::vhost support $variables. Currently supported are:
$nick, $username, $realname, $ip, $account, $operlogin, $operclass,
$country_code (xx for unknown), $asn (0 for unknown).

Note that if a $variable fails to expand, eg $operlogin but the
user is not oper, then the vhost will not be applied. A warning
is sent to the vhost snomask (+s +v) in such a case.

Examples:

/* Set authenticated users to $account.example.org */
vhost { auto-login yes; vhost $account.example.org; mask { identified yes; } }

/* Obviously not really a good idea, but.. to illustrate: */
vhost { auto-login yes; vhost $country_code.example.org; mask *; }

Also, when vhost { } blocks are read and need to be matched, they
are read top-down now, which is the most logical way. First match wins.

All this needs testing :)
2024-09-20 16:48:22 +02:00
Bram Matthys e9ffe5b5e7 Add vhost::auto-login: checks on-connect if user meets ::mask criteria
and if so, it sets the vhost on the user. Except when the user already
has a vhost (eg from anope during SASL).
If vhost::auto-login is 'yes' then you don't need ::login and ::password.

Suggested by PeGaSuS.

Support for variables like $account in vhost::vhost, more examples and
a release notes entry will follow in later commit(s).
2024-09-20 15:43:55 +02:00
Bram Matthys 55c04d9887 vhost: move struct as well, reorder and document. 2024-09-20 14:51:50 +02:00
Bram Matthys fe751fdc9d Move all vhost { } block handling to vhost module.
* Convert to use module-based config handling
* Split part of VHOST command into do_vhost() for later
* Use AppendListItem instead of AddListItem so they are in config-order.
  This is not really important atm but will matter later if we go auto.
* No other code changes at this point
2024-09-20 14:45:52 +02:00
Bram Matthys 51c055d4f0 Mention log.send in release notes
[skip ci]
2024-09-20 13:26:47 +02:00
Bram Matthys a5caf8d625 Update release notes a bit
[skip ci]
2024-09-20 13:20:49 +02:00
Bram Matthys 8e8384628b Fix decode_authenticate_plain() reading OOB.
This is a helper function for modules, it is not actually used by
UnrealIRCd itself.
2024-09-18 15:49:53 +02:00
Valerie Liu 71798963e0 rpc/log: Add ability to send log messages via RPC log.send (#299) 2024-09-17 15:40:03 +00:00
Bram Matthys 7396e6bd77 Fix crash when a server sends an invalid REHASH command.
(This can only be sent by linked trusted servers)

Reported by CaoS in https://bugs.unrealircd.org/view.php?id=6447
2024-09-16 16:42:53 +02:00
Bram Matthys 72c4b718f6 Move remove_dcc_references() to dccallow module. 2024-09-15 17:58:48 +02:00
Bram Matthys c39d763e00 Move 416 lines from src/misc.c to src/modules/quit.c: exit_client() etc.
This so if there is ever an issue, we can hot-patch it. This affects
exit_client(), exit_client_fmt(), exit_client_ex(), banned_client(),
and various (internal) help functions.

This also means you cannot call these functions during TEST/INIT (eg
during REHASH) since the 'quit' module which provides these modules
may not be loaded yet. I don't think that's a situation/problem but
this needs some more testing.
2024-09-15 17:45:25 +02:00
Bram Matthys a41ab32d16 maxperip: use siphash_raw(client->rawip.... 2024-09-14 20:33:57 +02:00
Bram Matthys 2ef39497c7 Similar to previous commit, move maxperip stuff from core to module.
This was in src/hash.c, src/list.c and src/modules/stats.c.
Now all in src/modules/nick.c... or should this go into a new module?

Again, this needs some more testing, like previous commit.
2024-09-14 20:18:22 +02:00
Bram Matthys 710afe7cc7 Move throttling code from src/hash.c to src/modules/connect-flood.c
Better to have this all in one place. Though, must admit, the
config checking is still in src/conf.c and a bit of a hassle to move.

Some testing may be wise to see if everything still works ;)
2024-09-14 19:55:43 +02:00
Bram Matthys fdfe5ba482 Remove raw_client_ip() since we now have client->rawip. 2024-09-14 19:19:21 +02:00
Bram Matthys ca7e4ab966 Prevent +b ~inherit:#chan in #chan. This didn't cause any problem but
doesn't make any sense either, so just reject it. Reported by alice.
2024-09-14 19:07:15 +02:00
Bram Matthys 4504adf149 Remove confusing comment in is_banned...
"Strange things could happen if this is called outside standard ban checking"
that was 15yrs ago when we had global vars like 'ban_ip' and such.
https://github.com/unrealircd/unrealircd/commit/7dee0cdcf17524a072236ff9d27c68c3da665c0a#diff-403251a2e50ed7323ab9c39abb604fd77db527cbb85c2c8ce360249e8ece4907R491-R497

It no longer applies to the current situation.
[skip ci]
2024-09-11 18:44:53 +02:00
Valerie Liu e0459943a3 Show port number in DEBUG_TLS_FATAL_ERROR (#298) 2024-09-10 14:40:33 +00:00
alice 255dfe6bf7 Fix redefinition of struct RPCClient within struct.h, which occurs if you have an old compiler. (#296)
Reported in https://bugs.unrealircd.org/view.php?id=6469 by hughmungus
2024-09-10 14:31:33 +00:00
Bram Matthys b6cdca5525 Fix b->ban_type not being set properly at all places (BanContext).
This probably didn't cause any issues earlier, or maybe it did
with some 3rd party mods, but is relevant now that we have ~inherit.
2024-09-09 16:44:57 +02:00
Bram Matthys 10ec67d163 Fix +I ~inherit:#chan (invite exceptions) 2024-09-09 16:28:22 +02:00
Bram Matthys 1a2d93778e Add small note on +e/+I not working yet for ~inherit. TODO item.
[skip ci]
2024-09-09 16:07:21 +02:00
Bram Matthys 554281d6eb Update curl-ca-bundle.crt to Tue Jul 2 03:12:04 2024 GMT
https://curl.se/docs/caextract.html
[skip ci]
2024-09-09 11:52:31 +02:00
Bram Matthys a9874bc51f Update shipped c-ares to 1.33.1 (Aug 23, 2024) 2024-09-09 11:46:39 +02:00
Bram Matthys bd5c5ca59e In some situations users would hang during the handshake due to forever
waiting DNS lookups. This had to do with c-ares query cache causing a
different (unexpected) code path in UnrealIRCd.
And, somewhat related, c-ares also didn't obey our DNS timeout, as that
value is a "hint" nowadays, so now we set the "max timeout" value.

Fun.
2024-09-08 19:42:11 +02:00
Valerie Liu 879e365ed5 extbans/partmsg.c: Actually check if there's a matching ban before removing the part message (#295) 2024-09-08 16:52:01 +00:00
Bram Matthys 7d62fe9548 Update HELPOP EXTBANS on ~inherit.
[skip ci]
2024-09-08 17:49:01 +02:00
Bram Matthys 8fa8476831 Typoooos in the release notes
[skip ci]
2024-09-08 17:39:42 +02:00
Bram Matthys 70a98d3af2 Update release notes a bit
[skip ci]
2024-09-08 17:36:48 +02:00
Bram Matthys 3c1ef65a00 Add set::max-inherit-extended-bans to configure limits for ~inherit extban:
Looks like this, with the current defaults:
set {
        max-inherit-extended-bans {
                ban 1;
                ban-exception 1;
                invite-exception 1;
        }
}
2024-09-08 17:15:26 +02:00
Bram Matthys decaeec484 HELPOP EXTBANS sorting and some whitespace changes
[skip ci]
2024-09-08 16:41:33 +02:00
Valerie Liu 4c46be691b Update help.conf: Add ~asn to extbans help output (#293) 2024-09-08 14:38:36 +00:00
Valerie Liu ae8b039831 Fix $nick log string in debug message re spamfilter tag (#294) 2024-09-08 14:37:26 +00:00
Bram Matthys c4c72ecaca Fix spamfilter.get unable to retrieve config-based spamfilters.
Reported in https://bugs.unrealircd.org/view.php?id=6467 by adator.
2024-09-08 10:16:15 +02:00
Bram Matthys ee1d6818b4 Add +b/+e/+I ~inherit:#channel to inherit channel bans from another channel
Several notes:
* This only checks on-JOIN (not on nick change, message, etc)
  for performance reasons
* If the #channel in ~inherit:#channel also contains ~inherit
  entries then those are not processed (no recursion and no looping)
* Only a limited number of ~inherit entries is permitted.
  This will be moved to set:: items in a future commit so you
  can set different amounts for +b/+e/+I ~inherit.
* This is work in progress, UnrealIRCd or the entire world could explode
* Documentation will follow later

Developers:
* Sadly, clean_ban_mask() needed to be changed to have two more
  parameters, 'ban_type' and 'channel' were added at different positions.
  This because the module needs the ban type (EXBTYPE_BAN, EXBTYPE_EXCEPT,
  EXBTYPE_INVEX) and channel because it rejects based on number of
  existing ~inherit entries in the channel... and while is_ok() is called
  for local clients and has all this information, for services clients
  is_ok() is not called so the only way to reject the +beI is through
  xxx_conv_param() which comes from clean_ban_mask().
2024-09-07 21:02:15 +02:00
Bram Matthys e17e11dd73 Make "MD" S2S command support BIGLINES. We don't need it now but maybe
in the future we will, or some third party module. And then it would
be nice if all servers on the IRC network support it, of course.
2024-09-05 20:06:58 +02:00
Bram Matthys 99bc061a74 Fix require authentication { } not allowing SASL users in.
It was behaving like a ban user { } block.

Reported by Jellis in https://bugs.unrealircd.org/view.php?id=6464
2024-08-30 20:01:20 +02:00
Bram Matthys bfb41612c8 Sync release notes with upcoming 6.1.7.2 dot release.
6.1.7.2 does not exist in git and will be:
* Version bumped from 6.1.7.1 to 6.1.7.2
* 5092fa985d (cbl-timeout-fix)
* 624d1d189c (remove curlinstall)

[skip ci]
2024-08-24 08:16:04 +02:00
Bram Matthys 21476d6896 Fix ./unrealircd hot-patch in case of zero byte patch file.
Such a file is served if the UnrealIRCd version is unaffected.
It printed "This UnrealIRCd version does not require that patch"
but then instead of stopping it continued.. which wasn't all
that bad before GPG/PGP but now it causes failures and scary
warnings.

(See also 035f487684 which
 introduced GPG/PGP)

[skip ci]
2024-08-20 13:46:36 +02:00
Bram Matthys 5092fa985d Central Blocklist: fix issue with clients being killed if too slow.
We already allow users in after 10 seconds if CBL is too slow, and
that part worked correctly. However 5 seconds later, when the URL
API 15 second timeout hits, it would try to allow the user in AGAIN.
This caused the user to be introduced twice, causing remote servers
to kill the user, and also screwing up user counts.

Reported by multiple people, including Jellis who actually filed
a report with logs, and alice providing logs as well, all when CBL
was temporarily down for a few hours in August 2024. In hindsight
this bug was already reported by k4be back in November 2023 but
was more rare at the time and mistaken for another very similar
bug that was fixed in 6.1.3.

With this patch, we check before we call cbl_allow(), but also
cbl_allow() itself checks the "user already allowed in?".

Oh yeah and this is hot patchable, within the hour I will make
this work: ./unrealircd hot-patch cbl-timeout-fix
2024-08-20 13:29:08 +02:00
Bram Matthys 035f487684 Add GPG/PGP signature verification for ./unrealircd hot-patch/cold-patch.
Similar to what we already do in './unrealircd upgrade' (in fact, code
stolen from that extras/unrealircd-upgrade-script.in file)
2024-08-10 15:58:35 +02:00
Bram Matthys 624d1d189c Remove curlinstall script. As https remote includes work without cURL,
most people don't need cURL support anymore anyway.
For those who do, they can install curl as a system library.

This also warns and unsets curl on ./unrealircd upgrade
and during ./Config when upgrading, but only for the 'curlinstall'
cases. Not for people who use system curl, since that is
totally fine to use :).
2024-08-10 14:54:03 +02:00
Bram Matthys a31394dd52 Shut up a warning related to unchecked set_client_ip() 2024-07-22 08:07:40 +02:00
Bram Matthys 4f3e524602 Add function set_client_ip() and call HOOKTYPE_IP_CHANGE there if needed.
This to replace the scattered IP setting. It is very important to always
use set_client_ip() from this point. Everywhere!

Also, in addition to client->ip, this adds client->rawip that contains
the IP in network byte order. In older UnrealIRCd versions we always had
the raw IP but not the IP as a string, so we moved to IP as a string,
but it can be useful to have both in terms of optimizations.
Of course, then the client->ip and client->rawip always need to 100% match,
hence the set_client_ip().

This also changes IsIPV6() to do A BUGFIX, it changes it from:
* if local user is the user connected over IPv6? Otherwise, does it have ':' in the IP?
To:
* check if the IPv6 flag is set (which is set if IP contains ':')
This may seem insignificant but it means that for spoofed IP addresses,
such as WEBIRC or transparant proxy, we use the correct transport.
Previously, if the proxy was IPv6 then even if the spoofed user was using
IPv4, the ident check would still be tried over IPv6. That sort of fun.
From now in, in such a situation client->local->socket_type will be
SOCKET_TYPE_IPV6 but since client->ip (and rawip) will contain IPv4
the IsIPV6() will actually return false, as it should be.

Also, in the HOOKTYPE_IP_CHANGE, enforce that if HOOK_DENY is returned,
the the user is killed by dead_link(). The user must be killed because
that is what we expect, and you cannot use exit_client() because from
some code paths that would be too much freed structures / hassle,
as a comment in src/modules/connect-flood.c correctly states:
/* There are two reasons why we can't use exit_client() here:
 * 1) Because the HOOKTYPE_IP_CHANGE call may be too deep.
 *    Eg: read_packet -> webserver_packet_in ->
 *    webserver_handle_request_header -> webserver_handle_request ->
 *    RunHook().... and then returning without touching anything
 *    after an exit_client() would not be feasible.
 * 2) Because in HOOKTYPE_ACCEPT we always need to use dead_socket
 *    if we want to print a friendly message to TLS users.
 */
2024-07-20 12:22:26 +02:00
Bram Matthys 191e6ac162 Bump version to 6.1.8-git 2024-07-20 11:53:47 +02:00
Bram Matthys 0030e7849c Mention anope 2.1.x (dev) and different protocol module name.
Reported by DeviL.
[skip ci]
2024-07-20 08:44:43 +02:00
Bram Matthys a686254540 ** UnrealIRCd 6.1.7.1 ** 2024-07-18 10:25:06 +02:00
Bram Matthys 0496c35fc6 Fix io.BUG_FD_SETSELECT_OUT_OF_RANGE [BUG] trying to modify fd -2 in fd table
Because c-ares is now caching request/responses, the DNS result may come in
immediately, causing some events to occur that were previously impossible.

And yeah, the warning was harmless, other than it being a possible nuisance
to IRCOps.
2024-07-18 10:04:56 +02:00
Bram Matthys b39b953b8e Add debugging code to trace source of io.BUG_FD_SETSELECT_OUT_OF_RANGE (fd=-2). 2024-07-18 08:10:49 +02:00
Bram Matthys 9232db12ae Remove an annoying BLACKLIST_RESOLVER_CALLBACK message in DEBUGMODE
[skip ci]
2024-07-18 08:00:06 +02:00
Bram Matthys 5ad5c4cfe2 JSON-RPC whowas.get: add geoip object with country_code, asn and asname.
(only if the information is available, of course)
2024-07-17 17:15:10 +02:00
Bram Matthys 5c810d0c63 In WHOWAS also show country and ASN information to IRCOps 2024-07-17 17:03:49 +02:00
TehPeGaSuS 3ffc54484b Add a mention on how to upgrade to the next RC on the ./unrealircd upgrade command (#291) 2024-07-17 12:22:39 +00:00
Bram Matthys 7fb7c7968a Relnotes: it is require authentication { } and not ban authentication { }
Reported by PeGaSuS
[skip ci]
2024-07-16 18:34:58 +02:00
Bram Matthys 4ab1a4d128 ** UnrealIRCd 6.1.7 ** 2024-07-16 12:36:53 +02:00
Bram Matthys cabd7c1ede Fix memory leak in rpc-user::rpc-class (at least this one is small) 2024-07-16 09:33:45 +02:00
Bram Matthys 34d23c8b5c Fix memory leak in ASN code
Contrary to retrieving country code / country name, the AS organisation
name that was returned needs to be freed by *US*. Makes sense, though
a bit inconsistent, heh.

[skip ci]
2024-07-16 09:32:25 +02:00
k4be e950bb53bc Add ASN support for geoip_maxmind 2024-07-15 19:22:48 +02:00
Bram Matthys 0b253306b3 Add extbans/asn to Windows makefile. (And rebuild 6.1.7-rc1 on Win)
[skip ci]
2024-07-13 10:30:47 +02:00
Bram Matthys 33e9b65ce4 ** UnrealIRCd 6.1.7-rc1 ** 2024-07-13 09:46:03 +02:00
Bram Matthys e5e000508e UNIX sockets: show in boot screen and properly when adding/removing listen block
Was previously shown as like :0 when removing/adding a listen block
with a UNIX socket. Now shows the file, as you would expect.

And in the boot screen it was like:
[info] IPv4: 127.0.0.1:6697(TLS), 127.0.0.1:6667
[info] IPv6: *:6667, *:6697(TLS)
And now also:
[info] Unix Sockets: /home/unrealircd/unrealircd/data/rpc.socket
2024-07-13 08:11:54 +02:00
Bram Matthys f6b448df2c Fix error with ASN lookups for IPv6
This line should not be here, it is for country lookups (also wasn't
there for IPv4, which actually does work)

[skip ci]
2024-07-13 07:48:34 +02:00
Bram Matthys 3efc62fc75 Allow +b ~operclass:xyz checking against remote users too.
Yeah not really important except for like SVSMODE -b nick, which
removes all bans that affect nick. That's the only type of code
that runs bans against external users.
2024-07-12 20:31:56 +02:00
Bram Matthys 3ccfc9ecf2 Rewrite release notes a bit
[skip ci]
2024-07-12 16:57:26 +02:00
Bram Matthys 1b4f987ab7 Move displaying of ASN in WHOIS to separate RPL_WHOISASN (569)
This is the numeric that the inspircd third party module uses
https://github.com/inspircd/inspircd-contrib/blob/master/4/m_asn.cpp
and it does not seem taken at
https://defs.ircdocs.horse/defs/numerics.html or
https://www.alien.net.au/irc/irc2numerics.html

This also means AS displaying is now separately configured via
set::whois-details::asn. By default only IRCOps can see it.
2024-07-12 12:17:39 +02:00
Bram Matthys da6cf4f6fa Add crule function match_asn(64496) 2024-07-12 11:37:18 +02:00
Bram Matthys 156e38f538 Update release notes a bit
[skip ci]
2024-07-12 11:30:21 +02:00
Bram Matthys 34b183c75a Update example in release notes to require authentication { mask { asn...
instead of ban user { }. Has a bit more use.
Also mention that +b/+e is possible but of little use in the
normal / default configuration. It can be if you don't do cloaking
though and change set::whois-details::geo.. eg everyone full;
[skip ci]
2024-07-12 11:21:58 +02:00
Bram Matthys 65c8a6e667 Some minor tweaks here and there
[skip ci]
2024-07-12 11:16:01 +02:00
Bram Matthys 0844f7243f Add ASN as extended server ban, mask item, secgroup. Eg: GLINE ~asn:64496 0 Bye!
This also automatically adds it as a security group and mask item:

ban user {
        mask { asn 64496; }
        reason "Testing ASN ban";
}

And yeah, it is a normal extban too (in +b and +I). Users usually
don't know the AS Number of other users, though, unless you change
the default configuration (at the cost of privacy).

Updated release notes a bit... more will follow.
2024-07-12 11:12:54 +02:00
Bram Matthys f33a0d2c1b Add initial ASN support:
* Including default download via unrealircd.org
* Shown in WHOIS - currently in RLP_WHOISCOUNTRY, not sure
  if that is correct.
* Shown in connect notices [asn: XYZ] [asname: BLAH BLAH]
* Shown in json user expansion (JSON logging and JSON-RPC)
* Only via geoip_classic at the moment
* Structs and serializing in geoip_base done
* Extbans not added yet
2024-07-12 10:31:52 +02:00
Bram Matthys 89e6c2c06f listen::port did not error on comma's.
Reported by PeGaSuS in https://bugs.unrealircd.org/view.php?id=6419

Related feature request to allow it - or some other style:
https://bugs.unrealircd.org/view.php?id=6281
2024-07-12 08:52:00 +02:00
Bram Matthys a9f4656971 Update release notes a bit
[skip ci]
2024-07-11 18:55:55 +02:00
Bram Matthys 1ac9d654b9 Fix crash when removing the websocket option on a websocket listener
To reproduce, boot with:

listen {
	ip *;
	port 6000;
	options { websocket { type text; } }
}

And after that, comment out the options and REHASH. You'll crash.

Reported anonymously through crash reporter.
2024-07-11 18:36:08 +02:00
Bram Matthys 8bb0a934c6 Fix three small memory leaks, together 1KB per REHASH.
The list is as follows with the number of bytes in the test leaked,
but this can vary depending on your configuration:
* charsys with multibyte ranges (112 bytes)
* set::whois-details (909 bytes)
* +F default profile (7 bytes)

The whois one is in the default configuration, so likely
affected everyone. It's nothing catastrophic, as you need a 1000
REHASHes in order to reach 1MB but.. we shouldn't leak, of course.
2024-07-11 18:22:31 +02:00
Bram Matthys 7157e1a578 Mention donation URL in boot screen. This used to be at 'make install'
but was removed several years ago. I think this is a better place.

This also removes doc/Donation which was out of date and probably
not many people knew about it at all.

[skip ci]
2024-07-06 16:14:20 +02:00
Bram Matthys 9cc2918d5f Make set::spamfilter::except a Mask item
* [set::spamfilter::except](https://www.unrealircd.org/docs/Set_block#set::spamfilter::except)
  is now a [Mask item](https://www.unrealircd.org/docs/Mask_item) instead of
  only a list of exempted targets. A warning is created to existing users
  along with a suggestion of how to use the new syntax. Technically, this is
  not really new functionality as all this was already possible via
  the [Except ban block](https://www.unrealircd.org/docs/Except_ban_block)
  with type spamfilter, but it is more visible/logical to have this also.
2024-07-06 10:09:35 +02:00
Bram Matthys e03a5dfd5f Support ::destination and ::exclude-destination in security groups / mask items
at selected places (there needs to be explicit code in place to handle this).
At the moment it is supported at two places only:
* For spamfilters (was already possible via crules via ::rule with
  a destination('xyz') but now non-crule destination "#xyz"; works as well, eg:
  spamfilter {
          ...
          except {
                  destination "#main";
          }
  }
  Note that if you want to exempt a destination in all spamfilters,
  we already have set::spamfilter::except for that!
* In restrict commands for like channel-message and such:
  set {
          restrict-commands {
                  channel-message {
                          except {
                                  connect-time 600;
                                  destination "#test";
                          }
                  }
           }
  }

Allow passing a crule_context via user_allowed_by_security_group_context()
and make user_allowed_by_security_group() call that.

Actually document spamfilter::except online in the docs (yeah you
won't see it in this commit, just mentioning...)

And yeah, by now i wonder if we should really call it crule_context
since it is more like a security group matching context, but.. whatever.
2024-07-06 09:16:53 +02:00
Bram Matthys a804b24150 Add set::hide-killed-by which shortens the quit to "Killed (Reason)".
* New option [set::hide-killed-by](https://www.unrealircd.org/docs/Set_block#set::hide-killed-by):
  We normally show the nickname of the oper who did the /KILL in the quit message.
  When set to `yes` the quit message becomes shortened to "Killed (Reason)".
  This can prevent oper harassment.

Suggested by PeGaSuS in https://bugs.unrealircd.org/view.php?id=6425
2024-07-06 08:12:11 +02:00
Bram Matthys 667eae41dd Add warning when rpc-user::rpc-class is missing. Add default 'full' and 'read-only'.
The reason for the warning is that in some future UnrealIRCd version I want the
rpc-user::rpc-class to become a required item.

This commit also adds rpc-class.default.conf which is by default
included from rpc.modules.default.conf.

This also completes the TODO list from b9de933378
(the rpc.add_timer was never a loophole and i kept rpc.info as-is)
2024-07-05 11:45:49 +02:00
Bram Matthys 0b7162f3cf Free old operclass blocks on REHASH (memory leak)
This wasn't caught by Address Sanitizer because we simply never removed
it from the linked list, and thus it was a reachable pointer.

Found this bug when adding the rpc-class { } stuff.
2024-07-05 11:11:13 +02:00
Bram Matthys b9de933378 Similar to oper and operclass, this adds an rpc-class block.
This so you can restrict the JSON Methods that can be called, eg:

rpc-class limited {
    privileges {
        server { list; get; }
        channel { list; get; }
        user { list; get; }
    }
}

rpc-user xyz {
    match { ip 127.0.0.1; }
    password "test";
    rpc-class limited;
}

NOTE: This is work in progress
1) Things are NOT yet fully contained, as i need to lock down
   rpc.add_timer still :)
2) Some more work, eg rpc.info would be nice to show some
   information about the restriction (??)
3) Need to fix a memory leak
4) Possibly more
2024-07-05 10:21:45 +02:00
Val Lorentz 2a3f5dc500 MODE: Reply with ERR_NOSUCHCHANNEL when the target is a channel (#287) 2024-07-05 07:28:12 +00:00
Bram Matthys 36b6e00701 Windows libs have been updated and libressl stopped using version numbers
so update buildbot vs2019.bat with the SSLLIB names.
[skip ci]
2024-07-03 09:15:22 +02:00
Bram Matthys 3bc1e0c932 Fix tkldb issue caused by making ban user::mask a mask item.
The build tests were failing for tkldb save & restore. Cause was this:

if (tkl->ptr.serverban->match)
^ this is wrong.. because it doesn't check if tkl is a server ban

So it could be tkl->ptr.spamfilter->whatever_is_at_that_memory_offset
which is non-NULL.

Could have updated the code to an if (IsServerBan... && tkl->..etc..)
but decided to ditch this needless code altogether.

As this wasn't needed at all since it already skips config-based.
And all mask items bans are config-based.

One of those rare cases where trying to be extra careful actually
causes a fuckup.
2024-07-01 18:56:29 +02:00
Bram Matthys ad485d1d1f Oh url_unreal.c needs this too, to get rid of the warning. 2024-07-01 16:46:11 +02:00
Bram Matthys 7415101bc3 Update shipped libsodium to 1.0.20. 2024-07-01 15:37:49 +02:00
Bram Matthys d307fef2d5 Update shipped PCRE2 to 10.44 2024-07-01 15:36:07 +02:00
Bram Matthys 25bed9ac1f Update the shipped c-ares to 1.31.0 and silence deprecation warnings for c-ares API.
Ignore these for entire src/dns.c.
Quoting https://github.com/c-ares/c-ares/pull/732#issuecomment-2028454381:
"Those deprecated functions will remain available until there is an ABI
 break, which honestly will likely never happen. It's more to encourage
 integrators to move to the more modern functions."
Also, keep in mind that several of these 'deprecations' happened in early 2024
while the new function was introduced in March 2020, like for ares_getaddrinfo().
That isn't all that long ago, only 4 years. So we would need compatibility code
for both the old and new function for a while.
So: we can look into that in some major new UnrealIRCd version, nothing urgent,
and perhaps by then it is long enough that we don't need the fallback to older
functions.
2024-07-01 15:05:01 +02:00
Bram Matthys c12864f81b Fix crash in server_ban.list JSON-RPC call as well.
Hmm... we should probably use json_expand_tkl() differently for match items
instead of returning "<match-item>" literally. Consider this a TODO item :D
This only happens for config-based bans that can't be removed anyway, so..
2024-06-30 19:59:41 +02:00
Bram Matthys 58d7a274f6 Fix crash in new ban user { } code, as predicted two commits ago. 2024-06-30 19:47:04 +02:00
Bram Matthys 53d97e020f Fix for last commit: except ban { } was not checked for ban user { } blocks 2024-06-30 19:26:02 +02:00
Bram Matthys bc7c69dd20 Make ban user::mask and require authentication::mask a Mask item. Finally.
As requested in
https://bugs.unrealircd.org/view.php?id=6159 by PeGaSuS
https://bugs.unrealircd.org/view.php?id=6319 by BlackBishop
https://bugs.unrealircd.org/view.php?id=6397 by Valware

The mask item https://www.unrealircd.org/docs/Mask_item
means you can use all the power of mask items and security groups and
multiple matching criteria.

This requires a bit more testing as username/hostname are NULL now
so some code paths may have to be adjusted. The function call to add
server bans has changed too. And, really need to check that soft bans
are not broken... because they might be ;D
2024-06-30 19:06:37 +02:00
Bram Matthys f6643f283c Support spamreport::url for type central-spamreport too.
This so you can get the same spamreport data to your own custom system.
It works similar to set::central-blocklist::url but then on a
spamreport { } basis which is better, since then you can still
submit to UnrealIRCd central spamreport too.

So you can have two blocks:
spamreport unrealircd { type central-spamreport; }
spamreport custom { type central-spamreport; url 'https://www.example.org/xyz'; }

And then a /SPAMREPORT or 'report;' action will report it to BOTH.

Requested by Chris
2024-06-26 14:01:13 +02:00
Valerie Liu 54a8fc140b restrict-commands: add option 'channel-create' (channel creation) (#285)
* restrict-commands: add option 'channel-create' for managing who may create new channels.
This has been a commonly requested feature with different requested options, I think it makes sense to do it properly from here
2024-06-14 13:05:34 +00:00
Bram Matthys 58646bafbb Reorder some if's and comment them to make sense.
[skip ci]
2024-06-14 14:36:34 +02:00
Bram Matthys 33c6eb0bcf Destroy channel if 0 users and can_join() rejects the user.
Reported by Valware. E.g. if HOOKTYPE_CAN_JOIN rejects the join
when it is a new channel.

( And yeah... +P channels are not destroyed... handled in
  sub1_from_channel() -> HOOKTYPE_CHANNEL_DESTROY already. )
2024-06-14 14:28:11 +02:00
Bram Matthys 57f93a1ffa Write some initial release notes
[skip ci]
2024-06-14 11:21:27 +02:00
Bram Matthys 9e1fa65a46 Make locop only able to REHASH local server and not remote ones.
As reported in https://bugs.unrealircd.org/view.php?id=6414
2024-06-14 11:15:23 +02:00
Bram Matthys 5897bc2282 Add ./Config -h / -help
Suggested by hnj in https://bugs.unrealircd.org/view.php?id=6417
[skip ci]
2024-06-14 10:50:00 +02:00
Bram Matthys c37dc9334b Attempt to fix KICK OperOverride message if you are not +o but have +h/+a/+q.
There was an incorrect OperOverride message if you were had +h, +a or +q
and was kicking someone that you should normally be able to (without override).

This requires quite a bit of further testing, though, it's so easy to get
this wrong. The FIXME still stands to fix this for good some day.

Reported by Valware in https://bugs.unrealircd.org/view.php?id=6423
2024-06-14 10:45:41 +02:00
Bram Matthys 5e46692bb2 Bump version to 6.1.7-git 2024-06-14 10:00:37 +02:00
Adrian Sandu 2c49668db8 Add option set::tls::certificate-expiry-notification (#286)
This way you can disable the check and notification about TLS certificate expiring. The check is (still) on by default.
2024-06-14 07:57:33 +00:00
henk84 214423564e comment optional, fictional example blocks (#282)
Co-authored-by: Hendrik Jäger <gitcommit@henk.geekmail.org>
2024-06-14 07:27:56 +00:00
henk84 575bbeefd8 remove nonexistant email address in badwords conf (#283)
Co-authored-by: Hendrik Jäger <gitcommit@henk.geekmail.org>
2024-06-14 07:25:32 +00:00
henk84 d98dc2fcc3 Fix comment in example.conf (#281)
fix plural
Co-authored-by: Hendrik Jäger <gitcommit@henk.geekmail.org>
2024-06-14 07:25:04 +00:00
henk84 4ad2a601ac fix comment in modules.optional.conf (#280)
fix repeated preposition
Co-authored-by: Hendrik Jäger <gitcommit@henk.geekmail.org>
2024-06-14 07:24:31 +00:00
alice a77ff1f2c8 Fix OPEROVERRIDE_VERIFY option. (#278)
Reported by hnj in https://bugs.unrealircd.org/view.php?id=6418

Appears to have been introduced as part of the 6.x refactor of secret/private channel modes in 8066c13876

Also adjust message for ERR_OPERSPVERIFY to include channel name.
This is to correspond closer to other similar numerics around this area, as well as agreeing with the definition within modern.
2024-06-14 07:22:19 +00:00
Bram Matthys dd2242b6a8 ** UnrealIRCd 6.1.6 **
The release will be published tomorrow (2024-06-14).
2024-06-13 19:14:28 +02:00
Bram Matthys 89b735f6f2 Update curl-ca-bundle to Mon Mar 11 15:25:27 2024 GMT
https://curl.se/docs/caextract.html
[skip ci]
2024-06-13 18:54:08 +02:00
Bram Matthys e89f3f444c ./Config: import settings from UnrealIRCd 6.1.5
[skip ci]
2024-06-07 18:38:49 +02:00
Bram Matthys f2c92ee4b0 ** UnrealIRCd 6.1.6-rc1 ** 2024-06-07 18:22:48 +02:00
henk84 fdc1cd1902 fix word repetition in operclass.conf (#279) 2024-06-02 14:14:19 +02:00
Bram Matthys 05c946579f Don't put insecure gatewayed/proxied connections in 'tls-users' security group.
For user--proxy--ircserv we don't set +z when user--proxy is not
using SSL/TLS and we should behave the same way with ::tls in
security groups / match items.

See also
https://www.unrealircd.org/docs/FAQ#Why_do_users_on_WEBIRC_gateways_not_get_user_mode_+z?

But also applies to other types in the proxy block.
2024-05-20 11:52:23 +02:00
Bram Matthys a11cfde6cd Fix crash if you first REHASH and have a parse error (failed rehash 1) and
then REHASH again but a remote include fails to load (failed rehash 2).

This was reported by multiple (anonymous) people via the crash reporter.
2024-05-20 10:28:33 +02:00
Bram Matthys 9d91f61206 Crule: forgot a context && context->client check. Just in case the
crule is used outside security groups / spamfilter, like in
deny link { }.

Also update the match_realname() since via the extban code it would
use match_esc() which is rather confusing if you have double (or
perhaps even triple) escaping when using this in the conf.
2024-05-20 09:31:29 +02:00
Bram Matthys 899955b47d Crule: forgot match_realname('*xyz*'). Now we should be at 100% :) 2024-05-20 09:11:25 +02:00
Bram Matthys 0e9280e731 Crule: add match_account(), match_country(), match_certfp(). 2024-05-20 09:06:11 +02:00
Bram Matthys 3c3d8a5605 Add user_matches_extended_server_ban() which works similar to
match_user_extended_server_ban except that it works by name/value.

This can then be used by crules or in other mods, like:
user_matches_extended_server_ban(client, "country", "NL");

If the performance impact isn't too bad (of the extra work) then
this prevents duplicate code in the handler for things like
that: account, country, certfp, and whatever we add in the future..
2024-05-20 08:54:53 +02:00
Bram Matthys dbbcba10e3 Let's get rid of this !strlen(arg)
[skip ci]
2024-05-20 08:29:56 +02:00
Bram Matthys 9d166eed26 Some minor tweaks so these can be used in pre-connect-stage.
Otherwise in pre-connect-stage is_identified(), is_webirc()
and is_websocket() will always return false due to the
IsUser() check.

One should always be careful with accessing things in pre-
connect-stage, but in this case the IsLoggedIn() and
moddata_client_get() are safe to use. The former checks
client->user and the latter does not access anything within
client->user at all.
2024-05-20 07:56:07 +02:00
Valerie Liu 14dd3a9038 Crule: add is_identified(), is_websocket() and is_webirc() (#277)
* Update crule.c: add is_identified(), is_websocket() and is_webirc()
* Update RELEASE-NOTES.md
2024-05-20 05:50:07 +00:00
Valerie Liu ca31150291 Update modules.c - Fix small spelling error (#276)
[skip ci]
2024-05-20 05:47:21 +00:00
Bram Matthys f8b435957f Update release notes a bit
[skip ci]
2024-05-19 18:54:03 +02:00
Bram Matthys b07f02fb11 Fix +b ~forward not taking into account +e (ban exemptions).
Reported by rafaelgrether in https://bugs.unrealircd.org/view.php?id=6410
2024-05-19 18:49:33 +02:00
Bram Matthys 229b3a7f1b Fix ~forward checking IsRegNick() instead of IsLoggedIn() 2024-05-19 18:31:38 +02:00
Bram Matthys f89fd3f8f6 Fix crash on Windows when using crules, central spamfilter or central spamreport.
This is the release notes update, the actual fix is in
c3a7ed2c99

[skip ci]
2024-05-15 17:18:12 +02:00
Bram Matthys c3a7ed2c99 These efuncs need to be MODVAR (dllimport) for Windows... 2024-05-15 17:15:32 +02:00
Bram Matthys 35bf78d105 Forgot to mention https://www.unrealircd.org/docs/Dev:Authentication_module
As said, this isn't a proper authentication framework atm, just something
quick for (third) party module coders so they have something that works.
2024-05-13 17:14:08 +02:00
Bram Matthys e12559ad78 Allow modules to provide SASL locally, by hooking into AUTHENTICATE.
Note that this is still a dumb interface and not a real proper
authentication framework.

This adds HOOKTYPE_SASL_AUTHENTICATE and HOOKTYPE_SASL_MECHS and
also provides 3 functions: sasl_succeeded(), sasl_failed() and
a helper function decode_authenticate_plain() for AUTHENTICATE PLAIN.
2024-05-13 13:23:59 +02:00
Bram Matthys 01a441de84 Add crule functions: is_tls(), in_security_group(), match_mask(), match_ip()
* Add more [Crule](https://www.unrealircd.org/docs/Crule) functions:
  * `is_tls()` returns true if the client is using SSL/TLS
  * `in_security_group('known-users')` returns true if the user is in the
    specified [security group](https://www.unrealircd.org/docs/Security-group_block).
  * `match_mask('*@*.example.org')` or `match_mask('*.example.org')`
    returns true if client matches mask.
  * `match_ip('192.168.*')` or with CIDR like `match_ip('192.168.0.0/16')`
    returns true if IP address of client matches.
2024-05-06 10:06:07 +02:00
Bram Matthys e59e8c99f4 Whoops. Accidentially committed a debug line.
[skip ci]
2024-05-06 10:01:14 +02:00
Bram Matthys e9da1a867b Using @if with a variable like @if $VAR == "something" was always false.
Reported by BlackBishop.

This rename free_config_defines() to init_config_defines and calls it from
config_read_start() so caller doesn't have to think about it.
2024-05-06 09:22:53 +02:00
Bram Matthys 45717d44f4 Fix typo in release notes
[skip ci]
2024-05-05 17:37:07 +02:00
Bram Matthys 576af06857 Remove default security group tls-and-known-users. 2024-05-05 17:34:23 +02:00
Bram Matthys f83967c582 Bump URL_MEMORY_BACKED_CHUNK_SIZE from 128 to 8192 as intended.
This to avoid doing too many realloc() calls (at theexpense of
some wasted bytes, but that should be acceptable nowadays).
2024-05-03 14:34:09 +02:00
Bram Matthys 1d3c5a49a9 Get rid of confusing "REHASH -all" as "REHASH" already does the same.
And this is easily mistaken with "REHASH -global" which rehashes all
the IRC servers on the network.

In fact, who knows some year(s) from now we may map "REHASH -all"
to "REHASH -global", but... not yet...
2024-05-03 14:10:27 +02:00
Bram Matthys fb2381b1ad Deal better with lack of an internet connection when booting the first time.
* When booting for the first time (without any cached files) the IRCd
  downloads GeoIP.dat. If that fails, e.g. due to lack of internet connectivity,
  we now show a warning and continue booting instead of it being a hard error.
  Note that we already dealt with this properly after the file has been cached
  (so after first download), see "What if your web server is down" in
  [Remote includes](https://www.unrealircd.org/docs/Remote_includes#What_if_your_web_server_is_down).
2024-05-03 13:04:16 +02:00
Bram Matthys a24e53c096 Move from -D_FORTIFY_SOURCE=2 to -D_FORTIFY_SOURCE=3
and use -O2 when compiling with ASan instead of -O1
(the near-last question in ./Config).
2024-05-02 09:02:42 +02:00
Bram Matthys 5a17e55120 Bump version to 6.1.6-git 2024-05-01 18:25:10 +02:00
Bram Matthys f2aaeb3215 Add sponsorship info to GitHub sidebar 2024-04-26 07:43:05 +02:00
Bram Matthys bed50dcced Fix bullet points on release notes
[skip ci]
2024-04-22 12:43:30 +02:00
Bram Matthys 728069879f ** UnrealIRCd 6.1.5 ** 2024-04-22 12:19:50 +02:00
Bram Matthys 74a9569b4e Fix two typos in example.es.conf that prevent it from working
[skip ci]
2024-04-12 18:21:32 +02:00
Bram Matthys cfff343d35 Make the check for unedited conf happen before password hashing.
Otherwise you get something like:
[info] /home/irc/unrealircd/conf/unrealircd.conf:166: oper::password: Advice: it is not recommended to use plaintext passwords in the config file. You can replace this password with the following password hash:
[info] password "$argon2id$v=19$m=6144,t=2,p=2$fIxnffmGpvcMkXaLcbttfw$b549yTafLVG27K4fPvre2DSacTm/px2hVMdI0KmQqZU";
[error] /home/irc/unrealircd/conf/unrealircd.conf:156: please change the the name and password of the default 'bobsmith' oper block
[error] 1 errors encountered

Which is a tad confusing, since you shouldn't hash that default dummy password at all :D. Now it is only:
[error] /home/syzop/unrealircd/conf/unrealircd.conf:156: please change the the name and password of the default 'bobsmith' oper block
[error] 1 errors encountered

[skip ci]
2024-04-07 08:44:21 +02:00
Bram Matthys a95825687c crule: has_umode->has_user_mode and add has_channel_mode as well.
And update release notes:

* Add more [Crule](https://www.unrealircd.org/docs/Crule) functions:
 * `is_away()` returns true if the client is currently away
 * `has_user_mode('x')` returns true if all the user modes are set on the
   client.
 * `has_channel_mode('x')` can be used for spamfilters with a destination
   channel, such as messages: it returns true if all specified channel modes
   are set on the channel.
2024-04-05 09:25:25 +02:00
Valerie Liu 4bbe55718a add two new crule functions: has_umode and is_away (#275)
This adds two new functions to Crule:
- `has_umode()` which expects a parameter of one or more mode chars, returns true (1) if all of them match, otherwise returns false (0)
- `is_away()` which expects no parameter which simply matches whether the user is set as away as a boolean
2024-04-05 06:55:41 +00:00
Bram Matthys 585b73158a Add extern void vsendto_one, requested by Valware.
[skip ci]
2024-04-05 08:53:22 +02:00
Bram Matthys 2b328374a5 Fix whowasdb module causing WHOWAS entries to vanish (way too soon) 2024-03-29 09:41:48 +01:00
Valerie Liu ede774f5eb Add ./unrealircd coffee (#274)
:>
2024-03-17 11:05:10 +00:00
Rafael Grether 5fd97ebcf8 example.pt.conf: add note about use of pt-br language (#273)
Co-authored-by: Rafael Grether <rafael.grether@abc71.com.br>
2024-03-13 13:37:59 +00:00
Bram Matthys 2a39a1bdff Rename and mention example.pt.conf - (Brazilian) Portuguese example configuration file. 2024-03-09 15:37:10 +01:00
alice aa453647fc Adjust config parser to log a warning when a block comment starts within another block comment. (#267) 2024-03-09 06:10:34 +00:00
Valerie Liu 222b4bacbf Fix spelling mistake on rehash (#271)
[skip ci]
2024-03-09 06:07:31 +00:00
Bram Matthys 6354445db6 Update README & release notes
[skip ci]
2024-03-09 07:01:54 +01:00
Bram Matthys 4cf06ddb71 Update release notes
[skip ci]
2024-02-11 10:55:47 +01:00
Bram Matthys 92504528c1 Update release notes
[skip ci]
2024-02-11 10:49:38 +01:00
Bram Matthys e098be6d28 Some more moving for previous commit aa9fdd352a 2024-02-11 10:34:14 +01:00
Valerie Liu aa9fdd352a Move giving of set::modes-on-connect to after SASL (#270)
This so account-based security groups work correctly with security-group based set xxxxx { modes-on-connect ....; } settings.
[skip ci]
2024-02-11 09:32:20 +00:00
Bram Matthys 1eb9f578ca Update help.tr.conf - by Serkan Sepetçi 2024-01-31 09:55:32 +01:00
k4bek4be 57d5ae0482 Add example.br.conf (Portuguese Brazilian)
UnrealIRCd Portuguese Brazilian translation
2024-01-24 15:39:32 +01:00
k4bek4be b89c527ffc Remove remnants of using PASS for NickServ identify
Get rid of old/unused PASS 2 NickServ hack, SASL exists now.
2024-01-24 15:37:17 +01:00
Valerie Liu 132ffa91b2 Get rid of old/unused PASS 2 NickServ hack, SASL exists now.
`NickServ` isn't anywhere in the codebase and doesn't do what it says it does re PASS 2 NickServ
2024-01-23 20:40:46 +00:00
Rafael Grether f9031e93b9 Created example.br.conf
Created Portuguese Brazilian example conf file
2024-01-19 15:29:16 -03:00
Bram Matthys 7837600308 Spamfilters with utf8 features in it where not always working and
could result in a crash if you ran the 'SPAMFILTER' command as IRCOp.

Apparently not widespread since nobody reported it and I found it
while debugging another issue. Not sure when it was introduced,
I'm pretty sure it was working before. Or maybe there is/was some
second factor involved.

Anyway, fixed now and previous commit also adds extra code for in
case i screw up again with this, so it is not silently ignored.
2024-01-17 09:56:11 +01:00
Bram Matthys 037889d7ac Add safety rollback of spamfilter if it doesn't compile. Should not be needed
but we (I) tend to screw up in other areas :D
[skip ci]
2024-01-17 09:48:47 +01:00
Bram Matthys b8a8863c19 Get rid of [BUG] message due to no-implicit-names patch if using DEBUGMODE.
main.BUG_CLIENTCAPABILITYBIT_UNKNOWN_TOKEN [warn] [BUG] ClientCapabilityBit() check for unknown token: no-implicit-names
2024-01-10 18:03:43 +01:00
Bram Matthys ae0206a92a Add oper::auto-join. This setting overrides set::oper-auto-join.
Suggested by Chris_dc in https://bugs.unrealircd.org/view.php?id=6255
2024-01-10 17:06:35 +01:00
Bram Matthys 9f3f9522cf Make operclass available in security-group & mask/match.
security-group netadmin { operclass { netadmin; netadmin-with-override; } }

Untested.
2024-01-10 14:14:14 +01:00
Bram Matthys 079e7babef Fix "Central blocklist too slow to respond" message when using softban
or require authentication { } block.

And the connecting user would get a message every second, which was
a bit floody ;D.

Repoerted by GHF in https://bugs.unrealircd.org/view.php?id=6375
2023-12-28 13:30:49 +01:00
Bram Matthys 64ea1d09d6 Move 'reserved clients' stuff to runtime, since 'ulimit -n' could be lower.
This fixes a bug where if you run ./Config with 'auto' file descriptors,
and then have an unusually low 'ulimit -n' of like 150, you would end up
with a negative amount of file descriptors available for use.

This fix moves it from compile-time setting of reserved fd's to runtime
setting.

All this is wrong, by the way, but that is for another major overhaul,
at least this bug is fixed now :D
2023-12-28 09:00:09 +01:00
Bram Matthys 88c2083df9 Fix no-implicit-names to set official flag. As all buildbots failed. 2023-12-26 15:41:06 +01:00
Bram Matthys 600185deba Add support for CAP draft/no-implicit-names
https://github.com/unrealircd/unrealircd/pull/265 by Valware
"This is an IRCv3 extension which lets clients opt-out of receiving /names on join.
 This is useful for bots on large channels who do not need to know who is in the channel.
 Specification: https://ircv3.net/specs/extensions/no-implicit-names"

+ module rename from 'no-implicit-names-cap' to 'no-implicit-names'
  (simply because no other modules has that -cap suffix)
+ update to Makefile.windows
2023-12-26 14:46:54 +01:00
Rafael Grether 1f81344691 removed password 'test'
removed password 'test' since the example password has been replaced with the argon2 hash.
2023-12-23 17:37:31 -03:00
Bram Matthys 48d3673a02 Only do slow spamfilter detection for regexes, not for 'simple' */?
Since it is pointless and this saves some CPU :)
2023-12-22 15:43:11 +01:00
Bram Matthys c5ed4ef9bb Don't call spamfilter for TAGMSG. If you are filtering that, look at 'T'.
Calling spamfilter for TAGMSG makes no sense as the text is "" (empty) :D

If you want to filter message tags, have a look at spamfilter type 'T',
which filters individual message-tags (not just the ones in TAGMSG but
also for PRIVMSG and NOTICE).

[skip ci]
2023-12-22 15:38:14 +01:00
Bram Matthys 5918d70943 Bump version to 6.1.5-git 2023-12-22 15:34:10 +01:00
Bram Matthys 70a59b8b1e central-api: add format check for api-key so people don't use a request-key there.
Reported by DeviL.
2023-12-18 09:37:18 +01:00
Bram Matthys 49e84436b4 Fix +I ~operclass requiring an operclass block name of >3 characters.
Reported by BlackBishop in https://bugs.unrealircd.org/view.php?id=6372

Was an old leftover check from old style extban API
2023-12-17 09:53:36 +01:00
Bram Matthys 5b5a5bca03 Wait longer for a REHASH when running with ASan 2023-12-17 09:41:58 +01:00
Bram Matthys 96be13d68d ** UnrealIRCd 6.1.4 ** 2023-12-16 16:33:15 +01:00
Bram Matthys 68c2114977 Make sure we never use this variable again ;)
[skip ci]
2023-12-15 12:34:25 +01:00
Bram Matthys b0e87dcafa Fix crash issue in websocket server (CVE-2023-50784) 2023-12-15 12:34:06 +01:00
Bram Matthys fa84174d22 Fix the fix for frame assembly in webserver. 2023-12-12 18:05:23 +01:00
Bram Matthys be1467d1a1 ** UnrealIRCd 6.1.3 ** 2023-12-09 09:02:12 +01:00
Bram Matthys 7b8c9e8d72 Fix memory leak due to change from yesterday (duh..)
Caused by 4178cb3f81
[skip ci]
2023-12-08 07:44:45 +01:00
Bram Matthys 4178cb3f81 Fix frame reassembly in webserver_handle_request_header()
Previously the same code caused no problem, but then
2fcb5b4669 changed the read buffer
size to 16384.
Since then (6.1.2.x) the webserver_handle_request_header() function
was sometimes cutting 1 byte off the packet due to sizeof(netbuf)-1
which was 16383 bytes. We now no longer use a fixed value and
allocate memory dynamically on the heap.

This fixes the bug that I was seeing but this change still needs
serious extra testing as it may affect websockets and RPC!
2023-12-06 18:19:17 +01:00
Bram Matthys 49614fc891 Thanks to Koragg for reporting previous issue :D
54ad2d1586
[skip ci]
2023-12-05 18:31:56 +01:00
Bram Matthys 54ad2d1586 Fix crash with 'crule', because it was being checked against Services bots 2023-12-05 18:22:25 +01:00
Bram Matthys 3428551e54 ** UnrealIRCd 6.1.3-rc1 ** 2023-12-01 09:03:13 +01:00
Bram Matthys 99fcf9adf6 Add unrealircd_version in CBL request, mostly for the future.
[skip ci]
2023-12-01 08:03:43 +01:00
Bram Matthys 0cbe6ad090 Makefile.windows: add src/api-apicallback.c to fix build
[skip ci]
2023-12-01 08:02:31 +01:00
Bram Matthys 96b18946ca Include oper name on /SPAMREPORT (for central spamreport) 2023-12-01 07:58:01 +01:00
Bram Matthys 9685d1e052 Fix module manager: if 1 upgrade failed, the remaining were not upgraded.
Reported by k4be in https://bugs.unrealircd.org/view.php?id=6352
2023-11-29 09:08:55 +01:00
PeGaSuS 3894f35b04 Update RELEASE-NOTES.md to fix reference to 6.1.2 (#264)
[skip ci]
2023-11-29 07:35:25 +00:00
Bram Matthys c9adae83fc Doxygen updates, mostly for https://www.unrealircd.org/docs/Dev:URL_API
Or actually: https://www.unrealircd.org/api/6/structOutgoingWebRequest.html

[skip ci]
2023-11-27 18:20:57 +01:00
Bram Matthys 15b2578620 Some minor release notes updates
[skip ci]
2023-11-27 18:06:02 +01:00
Bram Matthys 53f0f0cb94 Fix unitialized variable access caused by earlier commit of today
(only if you use a proxy block)
2023-11-27 17:59:37 +01:00
Bram Matthys cd1b79d3f7 Fetch Central Spamfilter rules with the API Key via alternate URL.
* The [Central Spamfilter](https://www.unrealircd.org/docs/Central_Spamfilter),
  which provides spamfilter { } blocks that are centrally managed, is
  now fetched from a different URL if you have an Central API key set.
  This way, we can later provide spamfilter { } blocks that build on
  central blocklist scoring functionality, and also don't have to reveal
  the central spamfilter blocks to 100% of the world.
2023-11-27 14:33:00 +01:00
Bram Matthys 3803759bf2 Release notes: mention central-api/-blocklist/-spamreport.
[skip ci]
2023-11-27 13:51:33 +01:00
Bram Matthys 628eb4b52e Update release notes a bit
[skip ci]
2023-11-27 12:55:41 +01:00
Bram Matthys 5f767a8fe8 Proxy block: rework and add support for X-Forwarded-For, Cloudflare, etc. 2023-11-27 12:10:17 +01:00
Bram Matthys f8bd45541d Disable some recent debugcode even with DEBUGMODE on ;D
(And yeah this will eventually be removed altogether)
2023-11-27 10:55:56 +01:00
Bram Matthys 026d5522a8 Remove WSU() items forwarded & secure, since these are in webserver nowadays. 2023-11-27 10:07:34 +01:00
Bram Matthys 02ac1fc0b3 Add an option to check websocket Origin header via
listen {
	websocket {
		allow-origin { *.example.net; }
	}
}

This allows you to limit websockets to a particular domain, IF the
user is using a normal browser.

Note that any non-browser (eg a websocket command line program) could
just spoof the Origin header, so for that case it doesn't really add
any security or real restriction.
2023-11-26 20:08:17 +01:00
Bram Matthys 98c264aabf Fix some more warnings, rather minor.
[skip ci]
2023-11-26 18:48:09 +01:00
Bram Matthys 0a7f1adc8b Add value check for blacklist config, well, fix it i mean.
And fix some compiler warning (remove a useless check).
[skip ci]
2023-11-26 16:36:11 +01:00
Bram Matthys 94bf58add9 Fix crash reporter to use SNI.
As for why BIO_set_conn_hostname() does not set and use it... good Q.
2023-11-26 15:52:47 +01:00
Bram Matthys 07cc8eaeaf central-*.c: remove old module manager stuff and bump version.
[skip ci]
2023-11-25 17:29:06 +01:00
Bram Matthys f1a5f5ab97 Remove accidental 'else' that caused modulemgr to freeze / make install to hang.
... when using url_unreal instead of url_curl.
2023-11-25 12:30:44 +01:00
Bram Matthys 4da58dde41 Update central spamreport, https://www.unrealircd.org/docs/Central_spamreport
set::central-blocklist::spamreport and ::spamreport-enabled are now GONE.
We now require a normal spamreport block, just like for other spamreport
functionality. So, if you want to enable this feature, use:
spamreport unrealircd { type central-spamreport; }

See https://www.unrealircd.org/docs/Central_spamreport for all info.

You can use CBL with central spamreport or central spamreport without CBL.
All explained at that URL.
2023-11-25 11:50:25 +01:00
Bram Matthys d08160baca Add option set::central-blocklist::blocklist-enabled yes/no (default yes).
This is mainly for the (less usual) case when someone wants to
use SPAMREPORT but does NOT want to use CBL:

set {
	central-blocklist {
		blocklist-enabled no;
		spamreport-enabled yes;
	}
}

Also documented at https://www.unrealircd.org/docs/Central_spamreport
under 'Configuration'
2023-11-25 10:26:56 +01:00
Bram Matthys bdfc3c97dd Add RegisterApiCallbackResolverHost() and make blacklist module non-PERM.
Hopefully this works OK... still need to test w/REHASH to see.
2023-11-25 09:39:50 +01:00
Bram Matthys 55d1398fca Move dns.h include to unrealircd.h and remove it elsewhere.
Because I need c-ares prototypes in modules.h, for next commit.
[skip ci]
2023-11-25 09:05:55 +01:00
Bram Matthys 6ce1958e1c Add URL API and use it at one place from central-blocklist. Docs at:
https://www.unrealircd.org/docs/Dev:URL_API
2023-11-25 08:31:12 +01:00
Bram Matthys 7d024f8086 URL API: add request->connect_timeout & request->transfer_timeout
... in case you want to do fine-tuning.

Defaults to DOWNLOAD_CONNECT_TIMEOUT (15 seconds) and
DOWNLOAD_TRANSFER_TIMEOUT (20 seconds).

For example, the module manager uses a shorter timeout of 7 and 20.
(that was already the case, but now it uses the generic api so
 it needed an option to set it to those values)
2023-11-24 14:38:20 +01:00
Bram Matthys 9d3af7f22a Fix Windows compile problem
[skip ci]
2023-11-24 14:26:26 +01:00
Bram Matthys 44203caea3 Fix modulemanager issue due to changes from an hour ago.
"./unrealircd module upgrade" is called by "make install" and now that
we use generic URL framework, the src/url_curl.c did not take into
account that at that stage ~/unrealircd/conf/tls/curl-ca-bundle.crt
may not exist yet, so fallback to <source>/doc/conf/tls/curl-ca-bundle.crt.
The src/url_unreal.c already did that. As did the old modulemanager
code that was removed an hour ago.
2023-11-24 14:12:53 +01:00
Bram Matthys 36323f4294 Replace modulemanager HTTPS code with the generic URL code.
We now have a synchronous_http_request() which can be used for that
(NOTE: that function is NOT for use in unrealircd modules)
2023-11-24 13:22:55 +01:00
Bram Matthys 2ae33225d0 In url_curl.c we properly did remove(tmpfile) but in url_unreal.c we did not.
Also add a flag to say not to remove the tmpfile -- not working yet.
[skip ci]
2023-11-24 13:17:21 +01:00
Bram Matthys 1282d2f2be URL API: Response callback is now two structs so we can easily extend.
callback(OutgoingWebRequest *request, OutgoingWebResponse *response)
2023-11-24 12:31:49 +01:00
Bram Matthys eed9d22e3b URL API: work towards callback w/struct -- actually this is an interim step 2023-11-24 12:04:28 +01:00
Bram Matthys 3548b7e2af New URL API (not really a unrealircd module api tho) - work in progress.
No longer url_start_async(a,b,c,d,e,f,g,...) but usings structs so
simply url_start_async(tehstruct);
makes it easy to add fields later without forcing all modules to
change the prototype.

Work in progress....
2023-11-24 11:27:39 +01:00
Bram Matthys c9abf0709a Provide a good error when trying to load third/centralblocklist and the like.
Since people should use the core modules from now on.

We now have a function to provide such migrations / errors / suggestions.
2023-11-24 09:42:32 +01:00
Bram Matthys 8d34987ad1 Bump UNREAL_VERSION_TIME
[skip ci]
2023-11-24 09:26:07 +01:00
Bram Matthys be586531bc Make get_central_api_key() an efunction rather than doing things by hooks.
An efunction with a default that returns NULL, so you don't need to
load the module if you don't want the functionality.
2023-11-24 09:24:10 +01:00
Bram Matthys d73c8b30d2 Fix compile problem with central-blocklist on FreeBSD. 2023-11-24 09:13:13 +01:00
Bram Matthys 6aae3e7a5d Update modules and Makefiles so central-api & central-blocklist compile. 2023-11-24 07:31:22 +01:00
Bram Matthys ebd39f4144 First import these as-is from third/ to track history properly (not compilable)
[skip ci]
2023-11-24 07:26:54 +01:00
Bram Matthys fe8e8e1274 Via JSON-RPC one could place a gzline on ident@host, which is invalid.
The effect it had was actually *@host, so ident@* became *@* -grin-.

Was caused by add=0 at the server_ban_parse_mask() causing a check
not to happen. Fixed now.

Reported by Jellis in https://bugs.unrealircd.org/view.php?id=6358
2023-11-24 07:14:23 +01:00
Bram Matthys d85ed7a51f For set::hide-ban-reason add a new option auto and make it the default.
This will hide the *LINE reason to other users if the *LINE contains the
IP of the user. This to protect the privacy of the user for cases such
as a KLINE due to a blacklist with a DroneBL URL.
Other possible settings are `no` (never hide, the previous default) and
`yes` to always hide the *LINE reason. In all cases the user affected by
the server ban can still see the reason and IRCOps too.

https://bugs.unrealircd.org/view.php?id=6362
2023-11-22 14:48:14 +01:00
Bram Matthys 83dd4bfbf5 Update release notes for 6.1.3-git
[skip ci]
2023-11-22 08:54:13 +01:00
Bram Matthys 36d12d2d82 Bump version to 6.1.3-git 2023-11-22 08:38:27 +01:00
Valerie Liu 7b9aacd609 Fix accidental truncation in SREPLY (#257) 2023-11-20 15:30:08 +00:00
Valerie Liu 8c0243182c Fix server notice about setting -Z, it was sent from the SID instead of server name (#263) 2023-11-20 15:28:23 +00:00
k4be fb6711c671 Improve MONITOR/WATCH extensibility.
The `watch-check` function now has a new argument which can be used to pass data to watch_notify callbacks.
New `watch_add` and `watch_del` hooks are called whenever new entries are created or removed.
New `monitor_notification` hook is called whenever a RPL_MONONLINE or RPL_MONOFFLINE is being sent, so a module can add its own notification besides it.
2023-11-19 14:01:16 +01:00
Bram Matthys 5b6617406e Actually completely fix #6365, replaces previous temporary fix.
Nevermind, the solution to that problem was easy, can just
compare with the 'ircd' binary and in that way, leverage the
Makefile system decisions :D
https://bugs.unrealircd.org/view.php?id=6365
2023-11-13 09:49:56 +01:00
Bram Matthys 8e450bb7fc Fix not recompiling third party modules when running git version 'git pull'
This is a quick fix for https://bugs.unrealircd.org/view.php?id=6365
The quick fix which causes 3rd party modules to be compiled always in
'make' and again in 'make install' (the latter is unintended).
Can look for something better later, I want to work on other stuff now ;D
2023-11-13 09:41:25 +01:00
Bram Matthys 2627d09044 Get rid of compiler check (core vs modules) and clean the modversion check too 2023-11-12 20:05:47 +01:00
Bram Matthys e84e2b30d2 Forward SPAMREPORT command to the server that the target user is on.
That is, if a nick is specified. For an IP address obviously we won't.

This is needed later for when unrealircd api SPAMREPORT becomes
available, since remote servers don't have all the info.

Side-effect is that, if you only configured one server to do
spamreporting, that won't work anymore. But that is an unusual
case anyway, and now unsupported :D.
2023-11-12 17:29:35 +01:00
Bram Matthys d2ccba80c5 Moddata fixes: LoadPersistent*()/SavePersistent*() and removing mdata.
The LoadPersistent*()/SavePersistent*() functions caused moddata to be
tagged with ->unloaded=1. Though it seems it caused no real issues this
is not good... we now properly tag them as 0 and the like. Also did a
code cleanup / overhaul on that system as well.

For other ModData we now handle the case where a module is loaded with
with a newer version and that newer version is no longer having certain
moddata, eg the name changed or it no longer needs it.
KNOWN ISSUE:
Unfortunately we cannot call the free function for the old moddata that
is no longer being handled by the newer version of the module, since the
module is already unloaded. So this will result in a memory leak, but
not in a crash.

KNOWN ISSUE:
Similarly, for SavePersistentPointer() there is a free function, again
this is called just fine if the module is permanently unloaded but NOT
if the module is reloaded with the same name and no longer is interested
in the persistent pointer object. Again, here too, that would result
in a memory leak but not in a crash.

Fortunately the "known issues" are rare. Fixing these is impossible
with the current module API because modules are unloaded after MOD_TEST
and before MOD_INIT, and only after MOD_INIT we know which moddata
is handled by the new version of the module. To change that we would
need to keep the old module around until after MOD_INIT of the new
module (so we can call free functions in the old module), but that
means delaying the MOD_UNLOAD for the old modules until after MOD_INIT
of the new modules, which changes the sequence too much that i don't
dare to do that. For example, it would mean a database save routine
in the old module would only be called after MOD_INIT finished in the
new module, which may be unexpected since right now MOD_UNLOAD is
called before MOD_INIT and maybe the db loading is done in MOD_INIT,
which would need to be moved to MOD_LOAD. That's just one example,
there may be others. I think such a change can only be done on a major
UnrealIRCd version change, so we will have to live this for now.
As said, fortunately it is a corner case.
2023-11-10 10:08:50 +01:00
Bram Matthys ffbf34fb15 Fix ModData bug when unloading a module for good: iterate unknown_list.
When a module was unloaded (for good) that used MODDATATYPE_CLIENT
or MODDATATYPE_LOCAL_CLIENT we walked the client_list/lclient_list
and freed the moddata entry for all these clients, but we did not
walk the unknown_list, so connections in process.
That's bad, because sometimes such moddata is allocated in
HOOKTYPE_HANDSHAKE or in other routines pre-connect and since
we skipped freeing them while the module was still loaded, it
means we leak memory since it is also not freed on user exit.

Since unloading modules permanently is not a common procedure,
combined with the timing of it happening during a handshake, it
took a while before this issue was found (and then easily fixed).

There's also another moddata issue, but that is for next commit.

[skip ci]
2023-11-10 08:09:36 +01:00
Bram Matthys ec4e1d95d8 Don't ask to generate TLS certificate if one already exists.
This is how it always was, but recent commit
f756b7bea6 caused prompting.
2023-11-04 09:38:00 +01:00
Bram Matthys 0e7ef37a5e Detect getsockopt TCP_INFO on FreeBSD and get rid of unnecessary other check
On FreeBSD one of the fields is slightly different, that's all it seems.

This improves 099e99504f
2023-11-01 17:00:46 +01:00
Bram Matthys 7468018a7d Make $client.details follow the ident rules in the handshake too.
Post-handshake this was working fine, but before register_user() it was
always using nick!user@host, never using the ident and never ~ prefixing.

Now it just uses the usual rules that we have, which are: prefixing
with a ~ if ident lookups are enabled and failed, and without a ~
prefix if ident lookup succeeded or set::options::identd-check is off.

Reported by k4be.
2023-10-29 07:05:12 +01:00
Bram Matthys 75a55de785 Make deny channel { } support escaped sequences like channel "#xyz\*";
This so you can match a literal * or ? via \* and \?

And do the same for allow channel { }.

This can break current configs if you have a deny channel for a channel
with a slash in it, since a \ which already sortof needed to be \\ in
the config file, now needs to be \\\\ (doesn't that look great?).
Fortunately slashes are not really common in channel names, let alone
deny channel { } configuration.
2023-10-25 19:49:34 +02:00
Bram Matthys f2f11a4637 Reserve more file descriptors. Eg when 10.000 are available, reserve 250.
Since 10k+ fd's available is the common situation, this means we then have
250 fd's reserved for non-clients, such as HTTPS callbacks and other things.

Previously:
<1024: reserve 4 fd's
1024+: reserve 8 fd's

Now:
<1024: reserve 8 fd's
1024-2047: reserve 16 fd's
2048-10000: reserve 32 fd's
10000+: reserve 250 fd's
2023-10-25 12:08:52 +02:00
Bram Matthys 7649520f63 Fix HOOKTYPE_IS_HANDSHAKE_FINISHED not called at two places where
register_user() is called.
2023-10-23 19:02:03 +02:00
Bram Matthys 099e99504f Make autoconf check for getsockopt TCP_INFO and define HAVE_TCP_INFO
At the moment only for third/centralblocklist

Also bump #define UNREAL_VERSION_TIME    202343
2023-10-23 10:35:15 +02:00
Bram Matthys 5b7e375213 Limit operclass name to a-zA-Z0-9_- and use the same validation in ~operclass extban.
This fixes the issue where +e/+I ~operclass:name gets cut off if the
name contains any digits.

Reported by BlackBishop in https://bugs.unrealircd.org/view.php?id=6353

Also, we previously allowed any characters in the operclass, which is not
a great idea.
2023-10-23 09:51:01 +02:00
Bram Matthys 2e9811ba47 Send central-blocklist hits globally 2023-10-21 16:02:06 +02:00
Bram Matthys a01e77c664 Fix a compile problem on 32-bit archs.
(well not really fix, but move it behind a DEBUGMODE ifdef)
2023-10-13 08:15:36 +02:00
Bram Matthys ac5ba1cfba Fix some markup in release notes
[skip ci]
2023-10-13 07:48:33 +02:00
Bram Matthys 1347ffad1d ** UnrealIRCd 6.1.2.3 ** 2023-10-13 07:45:13 +02:00
Bram Matthys b085da458a Fix ::exclude-security-group not working.
Reported by BlackBishop in https://bugs.unrealircd.org/view.php?id=6350
2023-10-12 18:46:18 +02:00
Val Lorentz a906131689 url_unreal: Fix build (#262)
Broken by 9a6a06b63f
2023-10-12 05:12:56 +00:00
Bram Matthys a04295c588 Add set::dns and increase DNS timeout for DNSBL (3000ms first, then on retry 6000ms).
This is quite a bit higher than client DNS lookups (1500ms first, on retry 3000ms)
and is because some DNSBL are reported to be quite a bit slower than ordinary DNS.
(Maybe just some, but.. the higher timeout does not hurt anyone anyway)

Note that all this has no effect on client handshake times, as DNSBL checks are
done in the background. Only side-effect is that if we do get a "late hit" then
you may now see a kill a few seconds after the client is online (which was actually
already possible before too for quick clients, but.. yeah...)

These settings can be overriden via set::dns, these are the defaults:

set {
        dns {
                client {
                        timeout 1500;
                        retry 2;
                }
                dnsbl {
                        timeout 3000;
                        retry 2;
                }
        }
}

When you REHASH we will check if the values are different than the current
c-ares settings and if so, reinitialize the resolver. Reinitializing the
resolver will destroy outstanding DNS requests, eg DNS lookups for clients
currently connecting, but so be it. Not a super-huge issue since changing
this is rare.

Requested by BlackBishop in https://bugs.unrealircd.org/view.php?id=6306
2023-10-11 19:04:06 +02:00
Bram Matthys 9a6a06b63f Split resolver channel into two: client & dnsbl 2023-10-11 18:08:26 +02:00
Bram Matthys b2030b1a6f Fix UTF8 not working in spamfilter { } blocks, only after the first REHASH.
With error messages about it possibly but also possibly not (silently failing).

This is actually quite bad because when the ircd is running, you could
happily add spamfilters with UTF8 like stuff, REHASH fine, but if you
then restart the IRCd would fail to boot due to a config error.

Reported by BlackBishop.
2023-10-08 18:33:27 +02:00
Bram Matthys c135b71fa3 Fix possible REHASH crash in some circumstances (also in 6.1.*)
If you make a parser mistake in the config file, like a missing semicolon,
then under some circumstances the server may crash. Not always, it seems,
which explains why this bug is not reported that much.
2023-10-07 18:39:49 +02:00
Bram Matthys 552d72cbaa ** UnrealIRCd 6.1.2.2 ** 2023-10-06 09:37:51 +02:00
Bram Matthys 59c11d8b23 Add support for "REHASH -centralspamfilter" (alias "REHASH -cs") to force
an immediate fetch+load of central spamfilter rules, so you don't have
to wait an hour (or whatever is configured).
2023-10-06 08:49:43 +02:00
Bram Matthys 25d1bdfbf5 Make central spamfilters show in STATS spamfilter as "-centralspamfilter-"
rather than "-config-". Suggested by Lord255.
[skip ci]
2023-10-06 08:29:19 +02:00
Bram Matthys 1741da6d2a Fix another instance of "STATS spamfilter" accidentally containing spaces
When using multi-targets like spamfilter { action { report; block; } }
it would output in stats like "report, block". Now changed to "report,block"
2023-10-06 07:44:24 +02:00
Bram Matthys 45002eeb6f Fix STATS output for config-based spamfilters with reasons with spaces.
For config-based spamfilters, the reason was not escaped, meaning that
spaces and underscores did not work as expected.
For example, in "STATS spamfilter" the spaces were displayed as-is
which means that the numeric output was not really parsable.

Apparently this bug exists since UnrealIRCd 5 already...
2023-10-06 07:36:26 +02:00
Bram Matthys 25d5a2ac64 Fix possible crash on SETNAME with spamfilter 'u'.
[skip ci]
2023-10-06 07:19:04 +02:00
Bram Matthys 3d9233baab Fix tkldb storing (and restoring) central spamfilters.
These should not be in tkldb, just like config-based spamfilters are not.
2023-10-06 07:08:22 +02:00
Bram Matthys 43240e4557 Don't allow central spamfilter without 'reason' 2023-10-06 07:00:44 +02:00
Bram Matthys 8398c8cd8d Don't crash when reading spamfilters from tkldb that don't compile (anymore).
For example, because of a different version of PCRE2, or because of the switch
from non-UTF8 to UTF8 (or vice versa) which disallows certain byte sequences.
2023-10-05 17:37:06 +02:00
alice 1d34753f18 Fix minor compiler warning on conflicting types for Auth_Hash (PR #261)
auth.c:569:13: error: conflicting types for 'Auth_Hash' due to enum/integer mismatch; have 'const char *(AuthenticationType,  const char *)' [-Werror=enum-int-mismatch]
  569 | const char *Auth_Hash(AuthenticationType type, const char *text)
In file included from include/unrealircd.h:32, from auth.c:21:
include/h.h:547:26: note: previous declaration of 'Auth_Hash' with type 'const char *(int,  const char *)'
  547 | extern const char       *Auth_Hash(int type, const char *para);
2023-10-05 05:43:17 +00:00
Bram Matthys 931eea475c ** UnrealIRCd 6.1.2.1 ** 2023-10-04 10:22:43 +02:00
Bram Matthys 088d2595d5 Fix crash on REHASH with crule (such as spamfilter::rule).
This happens when !, || or && are used, though the exact requirements
for the crash may also require a function with arguments.

Reported by BlackBishop.
2023-10-04 10:14:09 +02:00
Bram Matthys a780968dee ** UnrealIRCd 6.1.2 ** 2023-10-04 07:11:36 +02:00
Juest Zungo 1705baeb2f Add Windows .gitignore files (#260) 2023-10-04 05:11:12 +00:00
PeGaSuS b5687eb047 Update help.conf (#259)
Added missing action type "~flood"
2023-10-04 05:10:17 +00:00
Bram Matthys 87295deb67 Remove client->local->next_nick_allowed which is unused nowadays.
It was moved to the generic anti-flood framework which is
FloodCounter flood[MAXFLOODOPTIONS];
2023-10-02 14:26:01 +02:00
Bram Matthys f2216fc6c1 Call fd_unnotify() on SetDeadSocket(), since we don't care anymore. 2023-10-02 14:25:24 +02:00
Bram Matthys 9955e32781 Add small caveat for limited score bumping (running mixed net)
[skip ci]
2023-09-23 12:02:31 +02:00
Bram Matthys 31fa1340c7 Almost forgot version bump in setup.h
[skip ci]
2023-09-23 11:46:53 +02:00
Bram Matthys 64a8608a0f ** UnrealIRCd 6.1.2-rc2 ** 2023-09-23 11:40:31 +02:00
Bram Matthys 52d36943b5 Update release notes
[skip ci]
2023-09-23 10:52:29 +02:00
Bram Matthys 311f7397f5 Fix NULL pointer crash due to reputation code changes from yesterday 2023-09-18 09:19:53 +02:00
PeGaSuS 53c3ae6403 Update account extban in help.conf (#254)
Specify the use of `~account:*` and `~account:0` on the usage of ~account extban on the helpop output.
2023-09-17 10:14:32 +00:00
Bram Matthys b234e13358 Don't bump reputation scores anymore for users who are in no channels or
when they are only in channel(s) with very low member counts.

This because some typical bot/drone behavior is not to join any channels.
This kinda forces them to expose themselves a bit more (and if they don't,
they don't get more reputation).

The downside is for the unusual case where a legit chatter would be on
the network but not joining any channels, but that is rare. In any case,
this setting can be adjusted if that is typical or more normal behavior
on your network :D.

* The [reputation score](https://www.unrealircd.org/docs/Reputation_score)
  of connected users (actually IP's) is increased every 5 minutes. We still
  do this, but only for users who are at least in one channel that has 3
  or more members. This setting is tweakable via
  [set::reputation::score-bump-timer-minimum-channel-members](https://www.unrealircd.org/docs/Set_block#set::reputation).
  Setting this to 0 means to bump scores also for people who are in no
  channels at all, which was the behavior in previous UnrealIRCd versions.
2023-09-17 11:47:34 +02:00
Bram Matthys 4e070b8034 Use client:set:reputation oper privilege for latest change
[skip ci]
2023-09-17 09:58:21 +02:00
Bram Matthys f3538f07d9 Support setting of reputation via /REPUTATION <nick|ip> <value>
Useful for testing and.. well.. perhaps other things.
2023-09-17 09:55:59 +02:00
Bram Matthys 97630b4717 Allow setting reputation in https://www.unrealircd.org/docs/Actions via
action { set REPUTATION--; } and similar.

Also enhancement to reputation S2S traffic, to support decreasing:
  *
+ * Since UnrealIRCd 6.0.2+ there is now also asterisk-score-asterisk:
+ * :server REPUTATION 1.2.3.4 *2*
+ * The leading asterisk means no reply will be sent back, ever, and the
+ * trailing asterisk will mean it is a "FORCED SET", which means that
+ * servers should set the reputation to that value, even if it is lower.
+ * This way reputation can be reduced and the reducation can be synced
+ * across servers, which was not possible before 6.0.2.
+ *

So if you are actually decreasing reputation, you need all servers on
6.0.2 or higher for it to work properly, otherwise the other servers
don't decrease it, and next connect the highest wins again, etc.
2023-09-17 09:39:55 +02:00
Bram Matthys d862196d04 Update example.conf with Windows commands for mkpasswd/gencloak/spkifp
These work since UnrealIRCd 6.0.2.
2023-09-13 19:50:24 +02:00
Bram Matthys 55eaa7bbea Add set::blacklist::recheck-time 'never' to disable rechecking and document
this and blacklist::recheck.
2023-09-09 11:20:32 +02:00
Bram Matthys ddf6dea22d Add blacklist::recheck to skip a dnsbl from rechecks.
Suggested by BlackBishop in https://bugs.unrealircd.org/view.php?id=6307
2023-09-09 11:09:01 +02:00
Bram Matthys 35e5d99e32 './unrealircd module upgrade' only showed output for one module upgrade,
even when multiple modules were upgraded.

Actually not sure about the cause and how this is possible, but running
'make install' only once at the end is the solution, which is something
that should be done that way anyway.

Reported by westor in https://bugs.unrealircd.org/view.php?id=5919
2023-09-09 10:40:29 +02:00
Bram Matthys 942b8a604d Config file: when not using quotes, don't silently drop slashes in names/values.
In the config file, when not using quotes, a slash at the beginning of a
variable name or value was silently discarded (eg `file /tmp/xyz;` resulted
in a file `tmp/xyz`).

Reported by BlackBishop in https://bugs.unrealircd.org/view.php?id=6325
2023-09-09 09:41:47 +02:00
Bram Matthys 7ab80543e5 Forgot to mention set::blacklist::recheck-time in release notes.
[skip ci]
2023-09-08 18:22:53 +02:00
Bram Matthys 660a501617 ** UnrealIRCd 6.1.2-rc1 ** 2023-09-08 17:46:18 +02:00
Bram Matthys d909e86aef Update curl-ca-bundle to Tue Aug 22 03:12:04 2023 GMT
[skip ci]
2023-09-08 17:37:28 +02:00
Bram Matthys bcc07b1591 Integrate third/blacklistrecheck functionality (set::blacklist::recheck-time)
https://www.unrealircd.org/docs/Set_block#set::blacklist::recheck-time
2023-09-06 16:31:55 +02:00
Bram Matthys 89b2d91084 In HOOKTYPE_PRE_CHANMSG the mtags is now a MessageTag **,
so a pointer-to-a-pointer rather than a pointer, to allow stripping
message tags by modules. Needed for a module from Valware.
2023-08-19 17:26:14 +02:00
Bram Matthys d63a8cf2d5 Show who actually tried to use a banned nick.
Reported by Amiga600 in https://bugs.unrealircd.org/view.php?id=6300
Inspired by patch from Valware in https://github.com/unrealircd/unrealircd/pull/255
2023-08-19 12:17:00 +02:00
netjester f756b7bea6 Remember answer to "generate certificate" question in ./Config (#256) 2023-08-19 10:06:09 +00:00
Bram Matthys 2665cec73b Fix crash when ~security-group:securitygroup is used in conf (so old style
in eg ban user::mask).
Reported by BlackBishop in https://bugs.unrealircd.org/view.php?id=6319
2023-07-26 12:45:49 +02:00
Bram Matthys 50753b4678 Make central spamfilters require an 'id', and ignore for non-central.
At least for now...
2023-07-21 12:26:02 +02:00
Bram Matthys 89e5309326 Add set::central-spamfilter::feed and update the page at
https://www.unrealircd.org/docs/Central_Spamfilter
2023-07-21 12:03:43 +02:00
Bram Matthys cd19198e3b Spamfilter fixes: prevent actions that are currently config-only from
being added by other servers and being able to spread to areas of
which the code is currently not ready for ('set', 'report', 'stop').
2023-07-20 14:50:40 +02:00
Bram Matthys e54382fe95 Use (*errors)++ consistently.
This fixes one bug from yesterday in securitygroup.c:258,
fixes 2 (harmless) warnings and other than that just style.
2023-07-17 09:03:03 +02:00
Bram Matthys 62503aacae Update release notes a bit
[skip ci]
2023-07-16 19:56:19 +02:00
Bram Matthys 937236126f Add new spamfilter type 'raw' which matches against a raw command/protocol line.
SPAMFILTER add -simple R block - Hi_there! LIST*

Though it is more useful in complex spamfilter rules in the conf, presumably.
2023-07-16 19:47:43 +02:00
Bram Matthys f062d3f178 Fix memory leak if using sni blocks 2023-07-16 18:52:32 +02:00
Bram Matthys 8135a6fdfe Possibly fix Windows build. 2023-07-16 18:29:56 +02:00
Bram Matthys 4a25ce5cf2 Remove antimixedutf8 changes from release notes
[skip ci]
2023-07-16 17:47:08 +02:00
Bram Matthys 3e2f668f10 Revert antimixedutf8 changes from earlier, back to 6.1.1(.1) version again. 2023-07-16 17:27:47 +02:00
Bram Matthys 519af59705 Update release notes
[skip ci]
2023-07-16 12:32:02 +02:00
Bram Matthys 11bd657e8a Fix set unknown-users { } not working
Repoerted by BlackBishop in https://bugs.unrealircd.org/view.php?id=6292
2023-07-16 12:22:16 +02:00
Bram Matthys b272b6700a Add security-group::rule support, see https://www.unrealircd.org/docs/Crule 2023-07-16 12:09:01 +02:00
Bram Matthys 59c6c99ba3 spamfilter::rule: add destination('#xyz') support (supports wildcards) 2023-07-16 11:29:53 +02:00
Bram Matthys 13bb09aa4b crule: add inchannel('#xyz'), and inchannel('@#needopshere') works too 2023-07-16 11:22:02 +02:00
Bram Matthys b1d0a05638 Make 'channel' work in security groups. 2023-07-16 11:06:42 +02:00
Bram Matthys 9b11366a8e crule: code cleanups / conform a bit more to unrealircd style 2023-07-16 10:52:03 +02:00
Bram Matthys b325f88795 crule/spamfilter: pass text in crule context, not used yet, but could
be useful in some future crule function.
[skip ci]
2023-07-16 10:46:39 +02:00
Bram Matthys 2beefcd2ee crule: remove CR_DEBUG, bump some limits and remove collapse() call 2023-07-16 10:40:11 +02:00
Bram Matthys 08cb0fc05d Move crule to a module, so we can hot-patch if needed in the future.
This is a mandatory module to load, and included in modules.default.conf.

This also meant that the crule_test() etc efunctions are available
before running config test routines, so we now have a flag for
early efuncs. I guess we could consider doing that for all efuncs
though, so not sure if this flag is really needed.
2023-07-16 10:33:25 +02:00
Bram Matthys 36fc839022 Support single quotes in spamfilter::rule, for like xyz('bla/bla') 2023-07-16 09:31:02 +02:00
Bram Matthys d5e8e8f324 Add some more spamfilter::rule functions 2023-07-16 09:20:54 +02:00
Bram Matthys c6ae5b05c1 Update release notes a bit
[skip ci]
2023-07-16 09:07:57 +02:00
Bram Matthys cdc14569a9 Warn on plaintext oper::password in conf and even go as far as
generating the password hashes and suggesting using those.

This also starts the initial work on set::best-practices
https://www.unrealircd.org/docs/Set_block#set::best-practices
with hashed-passwords as the first setting there.
2023-07-15 19:02:31 +02:00
Bram Matthys 78c3766038 Showing this "Configuration test passed OK" makes no sense after
"Configuration loaded", i think it was meant for ./unrealircd configtest
only.

[skip ci]
2023-07-15 18:45:57 +02:00
Bram Matthys 202665ec87 For watch away notification, a user who is away could change their nick,
and that nick could be on someones watch list. In such a case we
should not only send RPL_LOGON but also a RPL_GONEAWAY.

Reported by Khaled and fix suggested by Khaled & Sadie.
2023-07-15 16:47:55 +02:00
Bram Matthys 934b0b1ea1 WATCH away notification: fix RPL_GONEAWAY and RPL_REAWAY not being sent
due to wrong event name being used. Noticed this bug in U6 (and
this bug does not exist in U5) after being pointed at watch away
notification again.
2023-07-15 16:41:21 +02:00
Bram Matthys 039dc566ec Lower argon2 parameters so the algorithm runs at a more reasonable speed. 2023-07-15 09:05:59 +02:00
Bram Matthys b3995f48ff Mention password hashing in the example.conf itself.
Suggested by rafaelgrether in https://bugs.unrealircd.org/view.php?id=6303
2023-07-15 09:04:07 +02:00
Bram Matthys 5688825ebd Default to argon2 library shipped with UnrealIRCd, the reason
for this is that system argon2 is often much slower (2x slower
on Ubuntu and Debian, for instance), which is not good.
You can still use the system library with the configure option:
--with-system-argon2
2023-07-15 08:49:11 +02:00
Bram Matthys ab71636390 Fix downloads_in_progress() always returning 0 if using cURL 2023-07-14 17:01:59 +02:00
Bram Matthys a153a2cce3 Change definition of parse_ban_action_config(), was too easy to leak memory.
Often you have default values for the config, and then a subsequent config
parsing run would overwrite the return value (= memory leak), merging/appending
would make no sense either, so it would force a free in all code before
calling us, well... let's just deal with it ourselves instead then ;)
2023-07-14 08:08:47 +02:00
Bram Matthys c2419e0f40 Implement spamreport::rate-limit 2023-07-11 20:19:00 +02:00
Bram Matthys e9716d3ce6 Fix compile problem on Windows
[skip ci]
2023-07-11 16:26:35 +02:00
Bram Matthys 9625a1221b Make Cmode_t an unsigned long long to have more chanmodes on 32 bit archs.
Reported by BlackBishop in https://bugs.unrealircd.org/view.php?id=6301
[skip ci]
2023-07-11 15:27:13 +02:00
Bram Matthys 767f5647cd Add some explicit cast to fix warning on 32 bit archs.
Yeah we could use %z here nowadays but we don't have strict C99 requirements(?),
well we have some :D

[skip ci]
2023-07-11 15:20:16 +02:00
Bram Matthys 22f8eb8729 Central spamfilter: fix memory leak (freeing ce/cfptr)
[skip ci]
2023-07-11 15:14:58 +02:00
Bram Matthys 2440714d13 Fix tkldb crash, had to do with stealing references. 2023-07-11 14:46:19 +02:00
Bram Matthys 4c3d2a6d6d Fix write bug in tkldb and add spamfilter::action stop.
The spamfilter::action stop ill prevent processing other spamfilters.
This would normally be a bit unusual, and potentially dangerous when you
do exclude things this way, but can be useful in some circumstances.

Stopping only affects the same type of spamfilters (general or central
spamfilters), so they don't interfere.

The tkldb write DB bug had to do with that it was processing
central spamfilters, which should be skipped just like config
based spamfilters were already skipped.
2023-07-11 14:32:11 +02:00
Bram Matthys 32701e6f99 Central spamfilter: don't stop processing on 1 bad spamfilter block. 2023-07-11 13:34:28 +02:00
Bram Matthys 018efd8366 Fix crash in spamfilter { } block handling due to unitialized variable 2023-07-11 12:15:01 +02:00
Bram Matthys f333aa0c09 New option set::spamfilter::show-message-content-on-hit:
you can now configure to hide the message content in spamfilter hit
messages. Generally it is very useful to see if a spamfilter hit is
correct or not, so the default is 'always', but it also has privacy
implications so there is now this option to disable it.

Suggested by alice, quite a while ago.

https://www.unrealircd.org/docs/Set_block#set::spamfilter::show-message-content-on-hit

Also as mentioned there:
UnrealIRCd has the following spying countermeasure (for many years) to help
that spamfilters are not abused for spying. When a spamfilter hit happens
that has an action like gline or blocking, it is visible to the user that an
action was taken. There is also the action 'warn', which means: take no
action and only warn IRCOps, that one would be easy to use as a spy tool, so
when this happens and message content was revealed, numeric 659
(RPL_SPAMCMDFWD) is sent to the client to indicate that the message is
allowed through but IRCOps were informed.
With this new set::spamfilter::show-message-content-on-hit feature, when
the message content was hidden due to this setting (eg due to 'never' or
'channel-only'), the warn message will not be sent as there is no need to
inform the user in such a case.
2023-07-11 12:11:26 +02:00
Bram Matthys 4df6ed7f9a Get rid of duplicate "spamfilter hit" code. 2023-07-11 11:42:06 +02:00
Bram Matthys f277880fb3 Add set::central-spamfilter::limit-ban-action and ::limit-ban-time
to limit actions to limit-ban-action as the highest, and limit
ban times to limit-ban-time the highest, see
https://www.unrealircd.org/docs/Central_Spamfilter

This also changes highest_spamfilter_action() to highest_ban_action().
2023-07-11 10:17:51 +02:00
Bram Matthys 95902979dc Central spamfilter: now every 1hr and a default set::central-spamfilter::except
policy is added. This may be tweaked later.
2023-07-10 20:18:07 +02:00
Bram Matthys 15b9255b0e Add spamfilter::except as an alternative for spamfilter::rule and upd rls notes 2023-07-10 12:12:25 +02:00
Bram Matthys c18c79e88b Add spamfilter hits and hits for exempted users.
* This means we always run spamfilters, even if users are exempts
* This way we can gather hits for exempted users on individual
  spamfilter entries, and possibly detect false positives
  (which relies on the assumption that those users are innocent)
* The hit counters are shown in in RPL_STATSSPAMF and also
  exposed via the JSON-RCP API.
* This commit also adds set::central-spamfilter::except but more
  on that later since i still want to set a default for that in
  a future commit.
* This also changes take_action() to take flags and adds the
  option TAKE_ACTION_SIMULATE_USER_ACTION which i intended to
  use but didn't in the end... not sure if i should keep it :D
2023-07-10 11:30:51 +02:00
Bram Matthys 0c622c0a73 Minor code cleanup and remove weird check for cep->name after a CheckNull()
[skip ci]
2023-07-10 09:59:49 +02:00
Bram Matthys 3fecb779a5 Fix double free in url_unreal.c if HTTPS write failed early.
Not sure if that could possibly get triggered, actually, as
it would mean the (async) SSL_connect() would have to succeed
instantly and then the SSL_write() would have to fail, but
better safe than sorry.
2023-07-10 09:48:58 +02:00
Bram Matthys 01893dbc55 Be nice to people using hybrid-like config syntax...... for now..... ;D 2023-07-09 21:18:41 +02:00
Bram Matthys 1073c6289f And some more crule reformatting/cleanups, could not resist 2023-07-09 17:00:43 +02:00
Bram Matthys c67488573a Some other reformating
[skip ci]
2023-07-09 16:52:34 +02:00
Bram Matthys 349e7a2e51 src/crule.c: re-indent this monster (whitespace changes only, except 1 line) 2023-07-09 16:50:31 +02:00
Bram Matthys d25fdeb950 Some more BanAction fixes/improvements:
* stats S one thingy (multi-actions)
* STATS spamfilter (multi-actions)
* warn w/user target ('u') if using multi-actions
* moving some code
2023-07-09 16:27:40 +02:00
Bram Matthys e26ff1e9cf Add antimixedutf8::action warn handling, and fix generic handling in git version. 2023-07-09 16:20:42 +02:00
Bram Matthys 51a97602ee Fix antirandom::action warn handling in current git.
Reported by Han`.
2023-07-09 16:12:19 +02:00
Bram Matthys 9e2232ef72 For DroneBL spam submissions use "Content-Type: text/xml".
This also bumps the request size limit a bit.
2023-07-09 14:03:35 +02:00
Bram Matthys 0618495962 No comment :D :D 2023-07-09 13:40:37 +02:00
Bram Matthys a68fa03ab5 Fix some small memory leaks on REHASH and fix compile warning w/gcc. 2023-07-09 13:39:00 +02:00
Bram Matthys 3250c7c0b4 Add some temporary safety mechanism if too many HTTP(S) requests in progress.
Will allow tweaking in config later. This is separate from rate-limit btw,
which also still needs to be done.
2023-07-09 13:21:16 +02:00
Bram Matthys 93ea44680f Oh yeah... typo reported by BlackBishop... :D
[skip ci]
2023-07-09 13:08:52 +02:00
Bram Matthys dec9aa0341 Reporting spam to DroneBL now works, see https://www.unrealircd.org/docs/Spamreport_block
This uses the RPC2 API. Tested with staging.

Note that there are likely some bugs here or there, like memory leaks,
but the functionality is there.

Also still need to implement various stuff, including spamreport::rate-limit
2023-07-09 13:07:29 +02:00
Bram Matthys 2b14ee3de5 Prepare for future spamfilter::match -> spamfilter::match-string
[skip ci]
2023-07-08 20:14:25 +02:00
Bram Matthys 5d65e4a400 Rename place_host_ban() to take_action() since it is not only about banning... 2023-07-08 19:54:40 +02:00
Bram Matthys 8f4a19978a Deal properly with multi actions in spamfilter (untested) 2023-07-08 19:48:15 +02:00
Bram Matthys 64f57ae243 Add spamfilter::action report (work in progress) 2023-07-08 19:24:15 +02:00
Bram Matthys bee2853ded Add spamreport::type dronebl, actually reports to unrealircd.org atm for testing 2023-07-08 18:13:14 +02:00
Bram Matthys 84786cc005 Add flags argument to buildvarstring_nvp, and add BUILDVARSTRING_URLENCODE
[skip ci]
2023-07-08 18:12:24 +02:00
Bram Matthys 28df14ad43 Add duplicate_nvplist_append()
[skip ci]
2023-07-08 18:10:41 +02:00
Bram Matthys 5f71adeb4d Add urlencode() 2023-07-08 18:10:16 +02:00
Bram Matthys 8b158d214c Fix for change earlier today to buildvarstring/buildvarstring_nvp,
it would stop writing the string after the first variable, not good.
[skip ci]
2023-07-08 17:44:31 +02:00
Bram Matthys 38771b6761 Spamreport: implement POST requests 2023-07-08 16:46:21 +02:00
Bram Matthys 7741065518 Probably helps if i add src/modules/spamreport.c as well 2023-07-08 15:36:10 +02:00
Bram Matthys def77c4d52 Initial work on spamreport { } block. Not really useful yet.
Early commit before i make it actually work and implement the rest
and hunting for memory leaks etc...
2023-07-08 15:35:08 +02:00
Bram Matthys 01dd042089 Add support for spamfilter::id (currently not used or displayed anywhere)
For config-file only atm.
2023-07-08 12:34:21 +02:00
Bram Matthys d1877ae100 Add conditional config defines:
UNREALIRCD_VERSION
UNREALIRCD_VERSION_GENERATION
UNREALIRCD_VERSION_MAJOR
UNREALIRCD_VERSION_MINOR
UNREALIRCD_VERSION_SUFFIX

https://www.unrealircd.org/docs/Defines_and_conditional_config
2023-07-07 21:05:38 +02:00
Bram Matthys a7ab8f7710 Update early release notes a bit (still work in progress)
[skip ci]
2023-07-07 20:28:46 +02:00
Bram Matthys 1006292681 Initial work on central spamfilter with auto refreshing URL / rules 2023-07-07 18:43:29 +02:00
Bram Matthys c6e83be412 Release notes: fix "turn off" to be set { spamfilter { utf8 no; } }
Reported by BlackBishop
[skip ci]
2023-07-07 16:47:45 +02:00
Bram Matthys caf4708597 Update early release notes a bit
[skip ci]
2023-07-07 16:46:56 +02:00
Bram Matthys 662acb2442 Bump UNREAL_VERSION_TIME
[skip ci]
2023-07-07 11:34:16 +02:00
Bram Matthys c8c2657904 Fix build problem with current git due to HOOKTYPE_PLACE_HOST_BAN mismatch 2023-07-07 10:58:06 +02:00
Bram Matthys d998846c64 Support setting tags via spamfilter { } blocks 2023-07-06 18:25:43 +02:00
Bram Matthys cafb180955 Change default of set::spamfilter::stop-on-first-match to 'no'
(Apparently an undocumented feature, by the way)
2023-07-06 18:24:32 +02:00
Bram Matthys c04c185c0b Hmm, why is '=' special in the conf? It isn't! 2023-07-06 18:24:00 +02:00
Bram Matthys 6bbcdfd1b3 Add spamfilter::rule (preconditions), add context to crule parser,
and add the first functions: online_time() and reputation().

The more interesting stuff will follow later...
2023-07-06 16:14:26 +02:00
Bram Matthys 1e572e25b9 Add comparisson operator support to crule (< > ==)
Should probably add >= and <= as well :D
2023-07-06 14:31:36 +02:00
Bram Matthys 656ea105da First go at multi actions... 2023-07-06 11:51:55 +02:00
Bram Matthys 0af88581d3 Add support for restricting config file blocks. 2023-07-06 08:47:02 +02:00
Bram Matthys 5b04177ad7 Update early release notes a bit
[skip ci]
2023-07-06 07:59:16 +02:00
Bram Matthys 41fcdb3264 Set set::spamfilter::utf8 to 'yes' by default. 2023-07-06 07:57:49 +02:00
Bram Matthys f636e114a8 Update antimixedutf8 with a complete list of UTF8 blocks, counter more spam. 2023-07-05 17:21:17 +02:00
Bram Matthys ecad4e32ec Fix rejected_deletes setting in history_delete()
The former didn't make much sense:
 if (!rejected_deletes && *rejected_deletes > max_rejected_deletes)
The most simple fix would have been removing the '!' there.

However, i chose to rewrite part of the function so we only set
*rejected_deletes once, and use normal integers (not pointer to integers)
in all the preceding code. Less room for error.
2023-07-02 10:18:26 +02:00
Bram Matthys f932c21751 Bump MODDATA_MAX_LOCAL_CLIENT from 12 to 24. 2023-06-30 20:34:10 +02:00
Bram Matthys 8d50efd29e Fix documentation confusing regarding rpc-user::match vs ::mask.
Only match was working earlier, and for now both are accepted,
like everywhere else. Reported by BlackBishop.

Also, added a missing check for unknown rpc-user items, so a
proper "Unknown directive" error is thrown.
(this missing check made the first issue worse)
2023-06-30 15:20:10 +02:00
Bram Matthys 3c82dd61e2 Remove UnrealIRCd 5 from supported versions 2023-06-27 20:00:14 +02:00
Bram Matthys 0cc800e736 Fix crash on invalid badword { } block in config file (one without type) 2023-06-27 18:31:53 +02:00
Bram Matthys 89f9659158 Fix doc\conf\aliases\* being twice in unrealinst.iss
[skip ci]
2023-06-25 16:43:57 +02:00
Bram Matthys a8695dfe0b Whoops, removed an important backslash, fix compile error :D 2023-06-17 18:26:42 +02:00
Val Lorentz d5ceb664bc Add 'history_delete' method to HistoryBackend (#253)
This will allow modules to implement deletion of specific messages
(unlike history_destroy, which removes the entire history of a channel)
2023-06-17 16:10:10 +00:00
Bram Matthys 280a1ddb1d Update this file too :D
[skip ci]
2023-06-17 18:09:38 +02:00
Bram Matthys 407bd84c11 Bump version to 6.1.2-git 2023-06-17 18:08:51 +02:00
Bram Matthys 7bce73a697 Some changes to HOOKTYPE_RECONFIGURE_WEB_LISTENER hack from earlier,
that was added late in 6.1.1 development to fix a crash with removing
websocket listeners. Now replaced with a generic HOOKTYPE_CONFIG_LISTENER
that is not only called for removed listeners, but for all listeners.
2023-06-17 18:04:12 +02:00
Bram Matthys 4b23596b4c Code cleanup: some strncmp -> str_starts_with* replaces (less chance of mistakes) 2023-06-17 17:50:37 +02:00
Bram Matthys 4c2bb2ff21 ** UnrealIRCd 6.1.1.1 ** 2023-06-16 18:06:44 +02:00
Bram Matthys cca19fa7f0 Fix maxperip bug when using a WEBIRC proxy/gateway with IPv4 vs IPv6 mismatch.
(more info to follow)

This also adds "/stats maxperip" for debugging purposes (ircop-only).

[skip ci]
2023-06-16 18:03:03 +02:00
Bram Matthys 65da3d7ccd Mention ./unrealircd upgrade
[skip ci]
2023-06-14 09:14:21 +02:00
Bram Matthys 6e2569a9b7 ** UnrealIRCd 6.1.1 ** 2023-06-14 08:53:07 +02:00
Bram Matthys fd7a715e17 Don't use slow socket closing (w/TLS handshake) for (G)ZLINE.
The whole point of (G)ZLINEs is that it rejects instantly upon
accept, that's what makes them different from KLINE/GLINE.

Commit 89075e532a made it
accidentally use the slow path for this as well.
2023-06-07 15:14:00 +02:00
Bram Matthys c315751c2e Fix crash with log destination 'syslog'. 2023-06-04 15:11:58 +02:00
Bram Matthys acbedd5938 Also trigger hi connection warning when near maxconnection limit 2023-06-04 10:06:12 +02:00
Val Lorentz a94884c6a9 Mention that hbm_return_after actually implements BETWEEN (#252) 2023-06-04 07:58:57 +00:00
Bram Matthys 635c4e22dc README: Sync "About UnrealIRCd" with the text on the site
[skip ci]
2023-05-31 18:20:46 +02:00
Bram Matthys 61cd88c710 Update market share percentage in README to match IRCStats Dec'2022 2023-05-31 16:09:56 +02:00
Bram Matthys f1a5e30e8a ** UnrealIRCd 6.1.1-rc1 ** 2023-05-31 08:16:57 +02:00
Bram Matthys 0816cf79bc TOPIC does not need CMD_BIGLINES anymore after commit
c32ff22a3e
[skip ci]
2023-05-31 07:33:08 +02:00
Bram Matthys e3bd914ad8 Add a link in release notes
[skip ci]
2023-05-29 19:18:33 +02:00
Bram Matthys c32ff22a3e Change the meaning of CMD_BIGLINES of yesterday.
Without CMD_BIGLINES: parameters to commands can be 510 bytes max
(but eg. strlen(parv[1])+strlen(parv[2]) can be >510, like 510*2,
 when received from servers with BIGLINES support).
If someone does set CMD_BIGLINES in their CommandAdd() then the
parameter(s) size is not limited an can be up to 16k.

This is a bit more risky than previous but i think most command
handlers can handle parameters of max BUFSIZE/512 just fine
and care less about the grand total. Also, the risk is only
from server traffic and not from user traffic. Still, we will
keep going through the source to check for issues.
2023-05-29 15:16:18 +02:00
Bram Matthys bb419b95d1 Remove set::maxbanlength as it is not useful and only confusing.
https://www.unrealircd.org/docs/Set_block#set::maxbanlength
2023-05-28 20:25:02 +02:00
Bram Matthys 23bddde416 Server w/o BIGLINES: fix line cutting at wrong place in parse2() 2023-05-28 18:37:13 +02:00
Bram Matthys 7820676616 SetDeadSocket() in close_connection()
to avoid a crash in todays code which was like:
1) exit_client gets called
2) close_connection() sets client->direction to NULL
3) a bit further it calls remove_dependents()
4) a sendto is attempted and the new code accesses
   client->direction which is unexpected to be NULL

Actually i should probably trace the cause of the sendto_one()
but that is another story ;)
2023-05-28 18:13:34 +02:00
Bram Matthys e3262c6bd8 Change default for set::topic-setter and set::ban-setter to 'nick-user-host',
previously it was set to 'nick'

Also allow the full topic length for the nick-user-host case, now that
we have BIGLINES support. For non-BIGLINES-servers this could mean a
potential cutoff of the last 20 characters of the topic, which is why we
restricted it to 340 instead of 360 for nick-user-host previously, but
that is really only in the corner case / worst case, like with max NICKLEN,
max USERLEN, max HOSTLEN, max CHANNELLEN, etc... i think we can live
with that small "problem" until all servers upgrade.
2023-05-28 17:54:44 +02:00
Bram Matthys 82dd83f7dc Use BIGLINES in RRPC when possible (and deal with splitting up again
when it is not possible, mixed server scenario).
Now a big RRPC response like server.module_list for a remote server
(44KB) fits in only 3 lines, instead of almost 100 lines.
2023-05-28 16:11:38 +02:00
Bram Matthys 2fcb5b4669 * Server to server lines can now be 16384 bytes in size when
`PROTOCTL BIGLINES` is set. This will allow us to do things more
  efficiently and possibly raise some other limits in the future.
  This 16k is the size of the complete line, including sender,
  message tags, content and \r\n. Also, in server-to-server traffic
  we now allow 30 parameters (MAXPARA*2).
  The original input size limits for non-servers remain the same: the
  complete line can be 4k+512, with the non-mtag portion limit set
  at 512 bytes (including \r\n), and MAXPARA is still 15 as well.
* I chose 16k because I don't want to first raise it to like 8k
  and then realize later that 16k would be better and raise it again.
* To receive BIGLINES in a command, you need to `CommandAdd()` with
  flags `CMD_BIGLINES`, without it you still get regular 512 max.
  This is so, because a lot of the code does not expect longer than
  512 bytes lines or in parameters, so we can gradually change that
  (where needed).
2023-05-28 15:06:32 +02:00
Bram Matthys 5e64991296 Fix CHATHISTORY BETWEEN accidentally including a message too much
Reported by progval in https://bugs.unrealircd.org/view.php?id=5952
2023-05-28 11:08:46 +02:00
Bram Matthys a4d7ca022e Update CHATHISTORY AROUND to include middle message
Reported by progval in https://bugs.unrealircd.org/view.php?id=5953
2023-05-28 10:15:51 +02:00
Val Lorentz f768b34050 chathistory: Advertize MSGREFTYPES ISUPPORT token (#251)
https://ircv3.net/specs/extensions/chathistory#isupport-tokens

The spec says they should be 'in order of decreasing preference'.
As currently the only backend is in-memory, this doesn't matter so I
picked `msgid` first (as it's less ambiguous); but this can be revisited
later if/when adding a backend which is more efficient with timestamps.
2023-05-28 05:57:36 +00:00
Bram Matthys b6179d87d0 Update release notes a bit
[skip ci]
2023-05-27 19:21:59 +02:00
Bram Matthys 1a8653de19 Fix require module not working on one side, sending SMOD too early.
Has to do with running HOOKTYPE_SERVER_CONNECT too soon, before
introducing ourselves to the other side. This bug was created in
commit ddf639836b so exists in
all UnrealIRCd 6 versions (-beta1 and up).

The hook call is now moved further down.
2023-05-27 19:14:27 +02:00
Bram Matthys 8e2527741b Update shipped libraries: c-ares to 1.19.1 2023-05-27 16:03:59 +02:00
Bram Matthys e0bce86445 Fix config check for old webirc { } block (if missing password) 2023-05-27 08:44:17 +02:00
Bram Matthys 55670c5865 Fix memory leak created today on REHASH (free the proxy blocks) 2023-05-26 16:41:02 +02:00
Bram Matthys 257ec35931 Require proxy blocks to have a name, like proxy nginx { }
Not sure yet where/when this will be used or displayed (WHOIS?
connect line?), but better require it straight from the start.
2023-05-26 16:32:23 +02:00
Bram Matthys 995d28cacb Add duplicate_security_group() function, and also:
unreal_duplicate_masks()
duplicate_nvplist()
duplicate_name_list()

And use this for when proxy::type is web, to duplicate the
exact criteria to the ban exception as mentioned in previous
commit.
2023-05-26 16:15:09 +02:00
Bram Matthys f241fef575 For proxy::type web, automatically add proxy::mask to exceptions
for blacklist, connect-flood, handshake-data-flood
(Well, unless mask::ip is used with a wildcard, due to current
 technical limitations, that will be resolved later)
2023-05-26 15:56:17 +02:00
Bram Matthys fa4b39d4aa Fix "function returns an aggregate" to make GCC happy.
Actually I don't think this was really wrong as this is an
enum, which is probably why clang does not complain...
but still... whatever....
2023-05-26 14:40:24 +02:00
Bram Matthys cf5808dc44 Error on listen::options::websocket::forward and tell to use proxy { } block.
[skip ci]
2023-05-26 14:36:20 +02:00
Bram Matthys a7cf24c45d Mention new https://www.unrealircd.org/docs/Proxy_block in release notes
and also for safety when redoing DNS and ident due to IP change,
we now:
ClearIdentLookupSent(client);
ClearIdentLookup(client);
ClearDNSLookup(client);
2023-05-26 14:26:26 +02:00
Bram Matthys fb54d4a2c6 Replace do_parse_forwarded_header() and set WEB(client)->forwarded
depending on what we get from the proxy, so it can be used later
in the websocket module for setting the user secure or not
(the latter similar to what k4be already did in the old code).
2023-05-26 13:31:01 +02:00
Bram Matthys d2f45fcaaf Move webserver proxy handling from the websocket to the webserver module.
This now requires a proxy { } block -- docs follow soon

This uses part of k4be's code still, to do the parsing,
so still only "Forwarded" and quick workaround for bug
when for=XXX is the final item.
2023-05-26 13:05:30 +02:00
Bram Matthys c537a72c10 Make proxy::mask and webirc::mask a generic mask item almost all
others in the config - https://www.unrealircd.org/docs/Mask_item
2023-05-26 12:39:11 +02:00
Bram Matthys 9aafdb7f9c Move handling of webirc { } block into new proxy { } block (allow the old name)
This is untested, as I'm first working on the rest...
2023-05-26 12:23:51 +02:00
Bram Matthys c2d465c5dd Move chunk of code from start_of_normal_client_handshake() to
a function called start_dns_and_ident_lookup(). This can then
be easily called from other places as well, like the code k4be
did in src/modules/websocket.c to handle proxies.

Side-effect is that ident lookups would now be done, if we are
configured to do so, for forwarded webirc stuff (not that I
think many people use that feature at the moment...).
2023-05-26 11:24:01 +02:00
Bram Matthys 52472a9a88 Add support for set unknown-users { } and the like:
It is now possible to override some set settings per-security group by
having a set block with a name, like `set unknown-users { }`
* You could use this to set more limitations for unknown-users:
  ```
  set unknown-users {
          max-channels-per-user 5;
          static-quit "Quit";
          static-part yes;
  }
  ```
* Or to set higher values (higher than the normal set block)
  for trusted users:
  ```
  security-group trusted-bots {
          account { BotOne; BotTwo; }
  }
  set trusted-bots {
          max-channels-per-user 25;
  }
  ```
* Currently the following settings can be used in a set xxx { } block:
  set::auto-join, set::modes-on-connect, set::restrict-usermodes,
  set::max-channels-per-user, set::static-quit, set::static-part.
2023-05-22 12:07:43 +02:00
Bram Matthys e575d0ea05 Update modules.default.conf with more examples of what can go wrong
if you decide to go with your own modules.custom.conf, and why
blacklist-module is a safer approach.
[skip ci]
2023-05-22 08:02:30 +02:00
Bram Matthys 58228e28b3 Prevent people from using an old modules.default.conf.
That file has such a clear warning in it but still people
manage to load old ones. That being said, usually it is not
deliberate, like an cp ../unrealircd.old/conf/* conf/
2023-05-22 07:52:06 +02:00
Bram Matthys 6bbb5dee37 Add str_starts_with* and str_ends_with* functions:
int str_starts_with_case_sensitive(const char *haystack, const char *needle);
int str_ends_with_case_sensitive(const char *haystack, const char *needle);
int str_starts_with_case_insensitive(const char *haystack, const char *needle);
int str_ends_with_case_insensitive(const char *haystack, const char *needle);
[skip ci]
2023-05-22 07:42:26 +02:00
Bram Matthys 3652940c2c Add set::anti-flood::<secgroup>::max-channels-per-user setting to override
the default set::max-channels-per-user (also called set::maxchannelsperuser).

This way you can give known-users a higher max-channels-per-user,
or even a special security group for trusted users (that you may
already have given a more lax flood setting and lower lag-penalty
etc. etc. so that fits in nicely)

And yeah this also:
* Makes it both in set and the anti-flood block accept both
  maxchannelsperuser and max-channels-per-user.
* Removes old MAXCHANNELS= in 005, as we already have CHANLIMIT=
This does not:
* Re-announce the 005 CHANLIMIT= if someone transitions from a security
  group with a different max-channels-per-user. We don't do that for
  IRCOps either, and I think no IRCd does that actually...
  To be honest i wonder if sending the limit in 005 is useful at all,
  do client really track this and limit their GUI based on it?? Doubt it!
2023-05-19 21:47:23 +02:00
Bram Matthys f2015ad865 Fix crash when removing a listen { } block with websocket or rpc
(or changing the port number). Reported by Nini.

Rather complex case: when the listen block is removed, obviously
the config hooks are not called for the (now non-existing) listen
block, and thus the websocket->request_handler and such are not
set to the new address of the websocket handler.
We now use a slightly silly workaround / new hook to fix this
corner case. Ideally there would be an extra layer in-between
like a handler lookup by name, or something like that.
(Or make the websocket module PERM but we don't want that!)
2023-05-19 19:29:46 +02:00
Bram Matthys 9ea1e0e99c Update release notes a bit
[skip ci]
2023-05-18 13:23:22 +02:00
Bram Matthys 815c97c81e Update release notes on the new functionality of today.
[skip ci]
2023-05-18 13:21:44 +02:00
Bram Matthys f804c5ed65 Add detection and set the high connect rate to 1000 per seconds.
https://www.unrealircd.org/docs/FAQ#hi-conn-rate
This finishes https://bugs.unrealircd.org/view.php?id=5532
2023-05-18 13:15:17 +02:00
Bram Matthys 82dbc4a297 Add except ban { } for IRCCloud for maxperip & connect-flood.
In both the release notes to illustrate and in example*.conf
because this is generally a good idea.
2023-05-18 12:01:29 +02:00
Bram Matthys 9b9434e442 Delay throttling check until IP is resolved or failed to resolve.
This so you can use throttling exceptions (eg in ELINE) on hostnames.

That is, the above is during normal circumstances. Similar to previous
commit we will turn this feature of during high connection rates.
That is a TODO item.
2023-05-18 11:51:22 +02:00
Bram Matthys 89075e532a Send throttling and some other error messages to SSL/TLS users (encrypted).
This is the start of "be more friendly to TLS users with disconnect
error messages" from https://bugs.unrealircd.org/view.php?id=5532

As that bug explains:
Consider doing the SSL/TLS handshake even for throttling errors and such
when the (reject) connection rate is below a certain amount per second.  If
it is higher than a certain rate, then fall back to the original behavior to
reject the user instantly without handshake or looking at any data.
Rationale: the current/original behavior is there so the ircd can handle
floods, both in terms of traffic and in terms of CPU usage (the SSL/TLS
handshake is quite costly after all).  The downside of the current behavior
is that TLS users don't see the error message, usually.  This feature
request tries to find a middle ground.

Still a TODO item:
* We don't detect high rates yet, so we only do this new behavior atm
  and not yet the old behavior during high connection rates.
* Verify that error messages/behavior hasn't changed (too) much,
  like the throttling and the banning disconnect messages.
2023-05-18 11:17:37 +02:00
Bram Matthys 40bdef6cd9 Make exceeds_maxperip() use a hash table (performance improvement) 2023-05-17 19:44:10 +02:00
Bram Matthys 63cfe56208 Use LineCache in sendto_local_common_channels() 2023-05-15 17:12:38 +02:00
Bram Matthys b19b70e876 Speed up invisibility checks for delayjoin mode (and when not used too).
This adds user_can_see_member_fast() which is used in at least 3 places
now, more places may follow later. It has extra paramters for membership
and membership modes that is very likely already looked up by the caller
(or if not, it is worth doing so by the caller).

This is work in progress so if everything crashes or people mysteriously
seem not present in channels (or the other way around) i would not be
surprised :D.
2023-05-15 16:58:51 +02:00
Bram Matthys 0874e376bc Add LineCache which is used when sending a message to a channel.
When sending to channel members this will cache full IRC protocol
lines, including message tags and \r\n, for similar clients.
This avoid the need for many mtags_to_string() calls and also
entire parts of sendbuf_to_one() can be skipped as well.
The "Similar clients" cache entries are defined as clients that:
1) Are of the same type: normal local client, ircop local client
   or remote client.
2) Have the same CAPs set, that is: we only look at CAPs that actually
   have anything to do with message tags ('clicaps_affecting_mtag')
3) Optionally there can be an explicit line_opts. It is not used yet
   but could be used when there are different type of lines sent
   depending on other criteria, such as chanop status or something
   else that doesn't fit in #1 and #2.
2023-05-15 15:27:52 +02:00
Bram Matthys 5b071d7bfd Change return value of add_listmode() / add_listmode_ex(). This fixes
a bug when two servers merge, you could see +beI items being set that
already exist, if the timestamp or setter differed between servers.
Now they are updated but no +beI is shown.
https://bugs.unrealircd.org/view.php?id=5681
2023-05-08 18:52:22 +02:00
Bram Matthys 2c73a37ac7 * New setting set::handshake-boot-delay
https://www.unrealircd.org/docs/Set_block#set%3A%3Ahandshake-boot-delay
  which allows server linking autoconnects to kick in (and incoming
  servers on serversonly ports), before allowing clients in. This
  potentially avoids part of the mess when initially linking on-boot.
  This option is not turned on by default, you have to set it explicitly.
  * This is not a useful feature on hubs, as they don't have clients.
  * It can be useful on client servers, if you `autoconnect` to your hub.
  * If you connect services to a server with clients this can be useful
    as well, especially in single-server setups. You would have to set
    a low `retrywait` in your anope conf (or similar services package)
    of like `5s` instead of the default `60s`.
    Then after an IRCd restart, your services link in before your clients
    and your IRC users have SASL available straight from the start.
2023-05-07 11:21:22 +02:00
Bram Matthys be7d1cbed9 Minor update of early release notes
[skip ci]
2023-05-07 10:09:39 +02:00
Bram Matthys a2324268da Update early release notes for 6.1.1-git
[skip ci]
2023-05-07 09:54:54 +02:00
Bram Matthys 8f3db7ba1b Fix crash on FreeBSD/NetBSD when using JSON-RPC interface. 2023-05-07 09:28:48 +02:00
Bram Matthys c352cc2d5f Fix missing 'issued-by-tag' module in windows build. Oops...
[skip ci]
2023-05-06 11:27:49 +02:00
Bram Matthys ef6ba9c0cc Bump max number of DNS cached entries from 241 to 4096.
This may help a little during mass connects.

Also clean up / doxygen the include/dns.h header a bit.
2023-05-06 11:15:38 +02:00
Bram Matthys 8cabbcb59b DNS: add negative caching of unresolved hosts (60 seconds)
Mostly to avoid repeated lookups for like clients that reconnect rapidly.
2023-05-06 10:34:26 +02:00
Bram Matthys e04bde003c DNS: don't use "search domains" to avoid silly lookups for like
4.3.2.1.dnsbl.dronebl.org.mydomain.org which is a waste (and is
compounded if you have multiple search domains and multiple DNSBL's)
2023-05-06 09:48:30 +02:00
Bram Matthys 16531e53db Performance tweak to dbufs: 512 bytes -> 4K
This results in less write calls (lower load) and more data per packet
(more efficient network traffic). It helps for the webserver (JSON-RPC)
but should also help IRC traffic when returning more than a line or so.

Previously the first TCP packet was not always filled fully, eg it was
close to 512 bytes instead of being close to 1500 bytes (MTU). Strange
that this happened in the first place, by the way, as we don't set
TCP_NODELAY. But whatever...
2023-05-06 09:25:49 +02:00
Bram Matthys 63c7fd604d Fourth attempt at fixing 3+ JSON-RPC connections causing the error
"Too many unknown connections from your IP".

Need to check 'c' in the loop, not 'client', duh!

If you have multiple tabs of the webpanel open and the panel is
not hosted on the same machine as the ircd (does not connect over
127.0.0.1) then you will experience this bug. Pages or content
will fail to load or will load very slowly.
2023-05-06 09:17:46 +02:00
Bram Matthys e66824b8a6 Fix some typo or massreplace error in Failed OPER attempt message.
[skip ci]
2023-05-06 09:02:38 +02:00
Bram Matthys 0444a192bb Don't show REMOTE_CLIENT_JOIN for users on a server that is syncing.
Was an overshight. We don't show REMOTE_CLIENT_CONNECT either in such a case.
2023-05-05 17:00:02 +02:00
Bram Matthys 2a70a35f13 Propagate blacklist hit message globally. For snomask 'B',
but also for remote logging and JSON-RPC logging purposes.
[skip ci]
2023-05-05 16:25:29 +02:00
Bram Matthys 4ec2815d0c JSON-RPC: log.list now has a sources argument which allows filtering.
Uses the same filter as log.subscribe.
2023-05-05 15:08:02 +02:00
Bram Matthys 45342c2d33 Don't log join/part/kick by default if memory log is on via
conf/rpc.modules.default.conf. This because:
1) It matches the default in example.conf for ircd.log
2) It is a more privacy-friendly setting
3) The log entries are spammy / fill the memory log buffer quickly
2023-05-05 14:53:29 +02:00
Bram Matthys 4f632125fb JSON-RPC: add log.list call to fetch old(er) log entries from memory. 2023-05-05 12:18:13 +02:00
Bram Matthys d48ccb1ec8 When rpc.modules.default.conf is loaded, remember last 1000 lines of log
entries for a maximum of 7 days, in memory.
[skip ci]
2023-05-05 12:16:54 +02:00
Bram Matthys 1dcef57970 Add safe_json_decref() which sets pointer to NULL after decref. 2023-05-05 09:51:09 +02:00
Bram Matthys 95074410a5 Set version to 6.1.1-git
[skip ci]
2023-05-05 09:50:48 +02:00
Bram Matthys 5d3319d662 Whoops.. fix windows compile issue :D. Let's not add a random x there. 2023-05-05 07:46:32 +02:00
Bram Matthys 1317784de1 ** UnrealIRCd 6.1.0 ** 2023-05-05 07:32:22 +02:00
Bram Matthys c400e9282e Remove CCM ciphers, which are likely unavailable anyway. 2023-04-27 13:16:15 +02:00
Bram Matthys af6d93f584 Fix small memory leak when using JSON-RPC timers. 2023-04-27 09:14:58 +02:00
Bram Matthys 215869b421 Fix memory leak in whowasdb
Caused by fix a01862bf05
which no longer assigns but duplicates string values.
2023-04-26 18:12:53 +02:00
Bram Matthys 9e80487270 JSON-RPC: server_ban.del: more fixes for previous two commits (done) 2023-04-25 15:41:40 +02:00
Bram Matthys 30ed59617e Additional fix for previous: deletion didn't work either, let's move this
fiddling up one layer. Though i should really check if .get works.
2023-04-25 15:28:38 +02:00
Bram Matthys 5ec2701e9d JSON-RPC: server_ban.add: fix softbans not working.
Actually two issues:
* passed the wrong 'type' so it rejected all softbans.
* and fix bans being added with %% instead of %.
2023-04-25 15:23:06 +02:00
Bram Matthys 2e6f3a50d2 Fix-for-fix of remote includes crash of yesterday
(2922a8ae5a)
2023-04-23 07:44:21 +02:00
Bram Matthys f467c031c1 Fix memory leak when an outgoing TLS_connect() fails.
Reported by immibis in https://bugs.unrealircd.org/view.php?id=6263
2023-04-22 14:41:10 +02:00
Bram Matthys 2922a8ae5a Fix crash if there is a parse error in an included file and there are
other remote included files still being downloaded.
This issue exists both with and without cURL, so in both url interfaces.

Was finally able to reproduce this on my own machine. This bug exists
since at least 6.0.0 and perhaps even before that. Just doesn't get
triggered that often due to needing an error and a certain timing
condition (well, and ASan catches it, but on some systems it may
go unnoticed).
2023-04-22 14:08:29 +02:00
Bram Matthys 17e2a17e81 Remove library before 'make install'. Possibly fix a bug.
Actually I presume 'make install' properly removes the file first
before installing a new one, but.. not entirely sure. Better safe
than sorry.

We have had new reports of someone who had the original UnrealIRCd
crash while building the new UnrealIRCd. Similar to what we had
a few years ago, which was caused by a 'cp' instead of an rm+cp.
This because with simple cp the existing file contents is changed
and the processes holding the .so file open (usually mmapped)
suddenly have the new .so file loaded in effect, which causes a
crash whenever next function is called in that library.
We now rm explicit before 'make install' so running processes
simply have that fd point to a deleted file, which is fine.
2023-04-19 18:52:59 +02:00
Bram Matthys 8ddc9bd69c More chgs to last commits: use listener->options & LISTENER_NO_CHECK_CONNECT_FLOOD
as that is the same method we use in connect-flood.

I don't think the client->local && client->local->listener checks
are needed, but since we are post last RC (I hope): better safe
than sorry...
2023-04-17 09:46:58 +02:00
Bram Matthys a01862bf05 whowasdb: fix double free issues 2023-04-17 08:34:30 +02:00
Bram Matthys 172554abd4 Make previous commit actually work 2023-04-17 08:19:22 +02:00
Bram Matthys 76b87ed880 Don't count RPC for set::max-unknown-connections-per-ip.
This fixes you no longer being able to get on to the IRC network if you
also run the webpanel from your same source IP (and other similarly
weird errors, of course)
2023-04-17 08:11:10 +02:00
Val Lorentz ebcfe6a6bc Add sendtaggednumeric/sendtaggednumericfmt (#250)
They are similar to sendnumeric/sendnumericfmt, but allow an array of message
tags are parameter.

sendnumeric/sendnumericfmt are now shorthands for sendtaggednumeric/sendtaggednumericfmt
which pass NULL as mtags.
2023-04-15 14:34:38 +00:00
Bram Matthys 50e5cb7cbe Bleh, fix a warning... 2023-04-15 14:52:06 +02:00
Bram Matthys 2b1fad89be ** UnrealIRCd 6.1.0-rc2 ** 2023-04-15 14:08:47 +02:00
Bram Matthys 4b448f2aaa New option listen::spoof-ip, only valid when using UNIX domain sockets
(so listen::file). This way you can override the IP address that users come
online with when they use the socket (default was and still is `127.0.0.1`).

Add a new guide https://www.unrealircd.org/docs/Running_Tor_hidden_service_with_UnrealIRCd
which uses the new listen::spoof-ip and optionally requires a services account.
2023-04-15 10:37:30 +02:00
Bram Matthys eca416fdc6 Update release notes a bit
[skip ci]
2023-04-15 10:13:12 +02:00
Bram Matthys f1e70fa06c whowasdb: work around -Waddress warning for W_SAFE_PROPERTY()
[skip ci]
2023-04-15 09:44:38 +02:00
Bram Matthys 88e028246e JSON-RPC and JSON Logging: expose client.creation_time for remote clients too
if the information is available (is communicated since UnrealIRCd 6.0.4 in
server to server traffic).
[skip ci]
2023-04-15 09:31:59 +02:00
Bram Matthys 0d2ca78ed8 JSON-RPC: whowas.get: name -> nick rename
[skip ci]
2023-04-15 09:28:09 +02:00
Bram Matthys 7ad160f57a JSON-RPC: WHOWAS fetching is now whowas.get, also expose not only
logon_time/logoff_time but also connected_since.

This also fixes the Makefile for the Windows build (i hope)
2023-04-15 09:24:57 +02:00
Bram Matthys 2184f38e7e Expose more WHOWAS fields in JSON-RPC and change add_history() to take a reason
for the add, like: nick-change, quit, server terminating. Add logon time.

I also think i will move from user.get_whowas to a whowas.XXX since the
returned object is not a user object and getting more different each commit :D.
2023-04-15 09:00:06 +02:00
Bram Matthys e2320cb506 Update release notes a bit
[skip ci]
2023-04-15 08:31:06 +02:00
Bram Matthys e7e2a5a275 whowasdb: write currently online users as well, as if they already
left. This so, if we die, there is still a history of them.
2023-04-15 08:17:54 +02:00
Bram Matthys f0cd1c59c5 JSON-RPC: initial work on user.get_whowas (work in progress) 2023-04-15 07:59:13 +02:00
Bram Matthys 45201fffe7 New module 'whowasdb': persistent WHOWAS history (preserved between reboots) 2023-04-14 19:29:45 +02:00
Bram Matthys 2fd7c9cfc4 Set loop.terminating for RESTART also (so channeldb etc write the db) 2023-04-14 19:22:22 +02:00
Bram Matthys 8aa004271f Ban exempt 127.0.0.1 instead of whole 127.*
* We now only exempt `127.0.0.1` and `::1` by default (hardcoded in the source).
  Previously we exempted whole `127.*` but that gets in the way if you want
  to allow Tor with a
  [require authentication](https://www.unrealircd.org/docs/Require_authentication_block)
  block or soft-ban. Now you can just tell Tor to bind to `127.0.0.2`
  so its not affected by the default exemption.

Reported on IRC and by PeGaSuS in
https://bugs.unrealircd.org/view.php?id=6258
2023-04-14 07:34:53 +02:00
Bram Matthys 66b8259234 JSON-RPC: don't do filtering on low ASCII like we do for JSON logging.
This way things like the TOPIC will keep their color codes if they have it.

Reported by armyn in https://bugs.unrealircd.org/view.php?id=6259

(And yeah i used a global to achieve this, otherwise it has too much
 of a cascading effect in XYZ functions)
2023-04-13 18:53:49 +02:00
Bram Matthys dec834c193 Fix for previous fix (unmasked packets) 2023-04-12 13:17:13 +02:00
Bram Matthys 68171b5582 Websocket: apparently PONG frames are sometimes unmasked, even though
RFC6455 clearly says:
      Defines whether the "Payload data" is masked.  If set to 1, a
      masking key is present in masking-key, and this is used to unmask
      the "Payload data" as per Section 5.3.  All frames sent from
      client to server have this bit set to 1.

But ok, we'll make an exception for PONG.

This caused the websocket connection to be dropped after a while from
the unrealircd-rpc-php library that uses textalk/websocket.
Probably a bug in textalk/websocket or one of its dependencies,
that should be reported...
2023-04-12 12:31:25 +02:00
Bram Matthys 57c90496e8 JSON-RPC: add rpc.add_timer and rpc.del_timer so you can run a command
every <xyz> msec (minimum: 250).
Can be useful to schedule an rpc.stats call every 1000msec for instance.
Of course timers are destroyed if the client exits.

https://www.unrealircd.org/docs/JSON-RPC:Rpc#rpc.add_timer and
https://www.unrealircd.org/docs/JSON-RPC:Rpc#rpc.del_timer
2023-04-12 10:22:33 +02:00
Bram Matthys 9f569078ed Fix bug where a REHASH would cause us to loose track of remote RPC's (RRPC).
Like REHASHing while a module.list is in progress.

This due to missing SavePersistentPointer() in MOD_UNLOAD
2023-04-12 09:08:18 +02:00
Bram Matthys cd3b3ec15d JSON-RPC: Change to previous, don't name it "top_countries" but "countries"
and sort descending so the country with the most users comes first.
(Using silly negative priority tricks, but you won't see that :D)
2023-04-12 08:25:32 +02:00
Bram Matthys 431d2b54c4 JSON-RPC: stats.get now returns "top_countries" (top geo country codes).
It also has an object_detail_level like some other calls.
The "top_countries" are included from object_detail_level 1 and above.
The default object_detail_level is actually 1, so it is included by
default. You can use object_detail_level if you don't want it.

Idea for this was from Valware.

https://www.unrealircd.org/docs/JSON-RPC:Stats#stats.get
will be updated in a minute...
2023-04-12 08:04:20 +02:00
Bram Matthys bea1bb6b94 Add some more warnings/explanations if specifying a custom SSLDIR.
Reported and suggested by Le_Coyote in
https://bugs.unrealircd.org/view.php?id=5980
2023-04-10 19:12:48 +02:00
Bram Matthys 3538b944de Fix missing client info from TLS handshake flood log message.
Reported by musk in https://bugs.unrealircd.org/view.php?id=6251
2023-04-10 18:51:19 +02:00
Bram Matthys 197fd0ca51 Update help.conf on +F and integrate +f/+F CHMODEF helpop docu.
Mentioned by Valware in https://github.com/unrealircd/unrealircd/pull/248
2023-04-09 16:08:33 +02:00
Valerie Pond 78e10e0128 /helpop chmodes: Show channelmode +d (#249)
[skip ci]
2023-04-09 13:53:53 +00:00
Bram Matthys 7c22f37a9f JSON-RPC: add log.subscribe and log.unsubscribe
https://www.unrealircd.org/docs/JSON-RPC:Log
2023-04-08 17:56:59 +02:00
Bram Matthys 4945ac9f7e Minor update of release notes
[skip ci]
2023-04-07 16:12:47 +02:00
Bram Matthys 447ce57009 +F: fixes for if you change the default-profile or unset it,
so these changes are set for all channels without +F.
2023-04-07 15:20:05 +02:00
Bram Matthys 93d825abe5 +F: set default profile if asked to do so via REHASH
[skip ci]
2023-04-07 15:02:40 +02:00
Bram Matthys ec7077f4a1 ** UnrealIRCd 6.1.0-rc1 ** 2023-04-07 14:54:43 +02:00
Bram Matthys f9b986f3c7 Windows build: now that they are compiled, actually install the RPC modules too..
[skip ci]
2023-04-07 14:49:15 +02:00
Bram Matthys a3efb70d31 Fixes for Windows build: add extbans/flood and all the RPC modules.
[skip ci]
2023-04-07 14:41:03 +02:00
Bram Matthys 290c5d4b72 Fix Windows makefile.
[skip ci]
2023-04-07 14:27:14 +02:00
Bram Matthys 854c5976d1 Chanmode +F: re-apply profiles on REHASH (in case anything changed)
TODO: ideally we would only do this if there was a change at all, but ah well.
2023-04-07 14:07:25 +02:00
Bram Matthys 3538ca9547 Fix bug in unrl_utf8_make_valid() where on invalid UTF8 it would use
the replacement character (good) but then stop processing the rest
of the string (bad).
This only happened if called with strict=0, which only happens in
the JSON and logging routines. So not in user-exposed stuff like
the websocket code.
2023-04-05 09:41:12 +02:00
Bram Matthys 4de91d49df Forgot 'git add' 2023-04-05 08:07:18 +02:00
Bram Matthys 254afbb9c6 Make set::hide-ban-reason not affect opers (eg. show full gline reason).
Suggested by Chris_dc in https://bugs.unrealircd.org/view.php?id=6252

This uses unrealircd.org/real-quit-reason internally, but is only
exposed to servers, never to users. It results in using that quit
reason for IRCOps, while using the regular quit reason for normal users.
2023-04-05 07:26:12 +02:00
Bram Matthys e8aef70f03 Fix crash on +f modes merging (SJOIN) due to the 6.1.0 +f/+F changes.
Reported by Valware.
2023-04-05 07:21:52 +02:00
Bram Matthys c5a763de06 mask vs match in webirc 2023-04-04 19:37:07 +02:00
Bram Matthys b07c739fa7 Add new +e ~flood:<floodtype(s)>:<mask> to exempt from +f/+F checks.
For example: +e ~flood:*:~account:TrustedBot

Suggested by PeGaSuS in https://bugs.unrealircd.org/view.php?id=6204

Will refine the checking and perhaps sorting of floodtype(s) later...
2023-04-02 19:23:26 +02:00
Bram Matthys a19b2aebf6 New cmode.flood_type_action which can be used to indicate a channel mode
can be used from +f/+F as an action. You need to specify for which
flood type your mode is, eg `cmode.flood_type_action = 'j';` for joinflood.

Currently a mode can only choose one flood type action due to +f/+F
timer fights that could otherwise occur, but that shouldn't be too
much of an issue since we can live with that in core as well.
2023-04-02 18:14:45 +02:00
Bram Matthys a9b71b58cb Add RPC 'issuer' logging in CHGIDENT, CHGHOST, CHGNAME, SVSMODE
for user.set_username, user.set_vhost, user.set_realname,
user.set_mode. And some early work for other stuff that doesn't
work yet.
2023-04-02 16:18:34 +02:00
Bram Matthys 1e315bb953 Add and use command_issued_by_rpc() helper function for internal logging
of commands issued by JSON-RPC.
2023-04-02 16:04:17 +02:00
Bram Matthys e67f5b6c39 Prepare all user.* with mtag_add_issued_by() for unrealircd.org/issued-by.
The code further up still needs to be changed, though.
2023-04-02 15:56:48 +02:00
Bram Matthys d25d2a23be Minor cleanup: use kick_user() from channel.kick call instead of
emulating an IRC command through do_cmd().
Function was added earlier in a8534a6063
2023-04-02 12:15:32 +02:00
Bram Matthys 9eac6797c6 Add unrealircd.org/issued-by for KICK from JSON-RPC 2023-04-02 12:12:16 +02:00
Bram Matthys 50c3ed2c24 Add unrealircd.org/issued-by if using RPC call channel.set_mode
This also changes the set_channel_mode() function to have
an extra arguments MessageTag *mtags (2nd parameter).
2023-04-02 12:06:52 +02:00
Bram Matthys 0b8f0deb05 SAPART: add unrealircd.org/issued-by, and add RPC-specific logging 2023-04-02 12:01:29 +02:00
Bram Matthys 6ee941fa4c SAJOIN: add unrealircd.org/issued-by, and add RPC-specific logging
(some code will probably be moved to a helper function later)
2023-04-02 11:52:24 +02:00
Bram Matthys f007933348 Document mtag_add_issued_by() and allow for some future case we don't use yet.
[skip ci]
2023-04-02 11:51:50 +02:00
Bram Matthys 4a5b8b3639 +F: the no-flood-limit profile is called "off" now (was: "none") 2023-04-02 11:06:14 +02:00
Bram Matthys cd3cf7e97c Chanmode +F: Lower nick change limit in profiles, now that only real
nick changes are counted and not forced ones like SVSNICK.
2023-04-02 10:59:52 +02:00
Bram Matthys fa4d86009c Move set::modef-boot-delay to set::anti-flood::channel::boot-delay
and the new set::modef-split-delay to set::anti-flood::channel::split-delay.
See https://www.unrealircd.org/docs/Channel_anti-flood_settings#config
2023-04-02 10:25:25 +02:00
Bram Matthys 22a632fb88 Fix memory leak in RPC module on server disconnect.
The "rrpc" moddata was not freed, which contained the list of RPC modules
on a remote server.
2023-04-02 08:36:10 +02:00
Bram Matthys b914997a1c Update cmode.free_param definition to fix memleak due to yesterdays commit.
And update release notes technical note so it actually refers to the
correct channel mode function :D
2023-04-02 08:24:00 +02:00
Bram Matthys 8ea50d38a3 Change a character and force rebuild 2023-04-01 18:55:08 +02:00
Bram Matthys 8776557b3d JSON-RPC: make server.list use a default max detailed level, the
same one as server.get. This list is likely to be small, anyway.
This is how it was with <6.0.8. Reported by Lord255.
2023-04-01 18:17:42 +02:00
Bram Matthys b093ba5375 Set version to 6.1.0-git. 2023-04-01 17:32:34 +02:00
Bram Matthys ce75ddd167 Bump UNREAL_VERSION_TIME (been a while)
[skip ci]
2023-04-01 17:05:33 +02:00
Bram Matthys 8f1dc52c20 Mention that cmode.put_param has an API change
[skip ci]
2023-04-01 17:04:43 +02:00
Bram Matthys 7b7d436bba Add support for set::anti-flood::channel::default-profile
https://www.unrealircd.org/docs/Channel_anti-flood_settings#Default_profile
2023-04-01 17:01:59 +02:00
Bram Matthys 2f7bb2e72d Some reformatting of release notes
[skip ci]
2023-04-01 13:37:50 +02:00
Bram Matthys 22691a458b Don't count forced nick changes in floodtype 'n' in chanmode +f/+F.
These were already not counted for set::anti-flood::xx::nick-flood
and it makes sense.
Benefit of this is that limits for floodtype 'n' can be set tighter,
as now it is really only about manual (voluntarily) nick changes.
2023-04-01 13:26:34 +02:00
Bram Matthys e4cdc4c0dd Update release notes a bit on JSON request logging and unrealircd.org/issued-by
[skip ci]
2023-04-01 13:20:24 +02:00
Bram Matthys a83cd474af Change RPC logging format for rpc.RPC_CALL:
From: [rpc] Client RPC:adminpanel (Syzop): RPC call channel.set_mode: channel='#test', modes='+b', parameters='some!silly@ban'
  To: [rpc] RPC call channel.set_mode by RPC:adminpanel (Syzop): channel='#test', modes='+b', parameters='some!silly@ban'

This so the most important information is shown first (generally a good principle :D)
2023-04-01 13:10:06 +02:00
Bram Matthys 1bf34ae01b Log parameters in rpc.RPC_CALL:
[rpc] Client RPC:adminpanel (Syzop): RPC call channel.set_mode: channel='#test', modes='+b', parameters='some!silly@ban'
2023-04-01 12:59:20 +02:00
Bram Matthys 2b39777815 Logging: Log the issuer in rpc.RPC_CALL, when it is available.
[rpc] Client RPC:adminpanel (Syzop): RPC call channel.set_mode

And move it into a rpc_call_log() function.
2023-04-01 12:41:01 +02:00
Bram Matthys 7d7974f800 Get rid of unneeded buffer copying, if Jansson library >= v2.1 2023-04-01 12:29:59 +02:00
Bram Matthys 275cb97cfc For JSON-RPC with UNIX Domain sockets, split on \n (newline).
This so multiple parallel requests can be handled properly.

JSON-RPC over websockets is unchanged, as every JSON-RPC
requests goes into its own websocket frame there (easy).
2023-04-01 12:25:16 +02:00
Bram Matthys 89f75bd6e7 Fix some warnings: change an int to time_t and vice-versa 2023-04-01 09:52:19 +02:00
Bram Matthys a6820b4a8d Fix weird +F values when two channels merge.
This was a forgotten TODO item for cmodef_dup_struct(),
more netsync tests are still to follow.
Bug reported by Lord255.
2023-04-01 09:06:37 +02:00
Bram Matthys 4e49323e88 Fix crash on rpc-user { } block without a name. 2023-04-01 08:58:17 +02:00
Bram Matthys 7a50f963f8 Make channel.set_topic use the issuer internally. No logging or
other changes yet, just unrealircd.org/issued-by testing.

Tag shows up correctly when setting topic from webpanel now :)
2023-03-31 14:29:14 +02:00
Bram Matthys a3c151a16a RPC: add rpc.set_issuer, eg set to logged in user on the admin panel.
This so UnrealIRCd knows who is issuing the commands.
This information is then passed on to unrealircd.org/issued-by and
is planned to be used by the logging system too.

https://www.unrealircd.org/docs/JSON-RPC:Rpc#rpc.set_issuer
2023-03-31 12:55:31 +02:00
Bram Matthys 5871bd9463 Initial work on unrealircd.org/issued-by message tag.
This will communicate the original issuer of a command.
For example an "SAMODE #test +s" results in a SAMODE coming from
:maintest.test.net MODE ....etc....
And with this feature, we will communicate the IRCOp who did it:
@unrealircd.org/issued-by=OPER:Syzop..etc....
This tag is only sent to servers and to IRCOps, not to ordinary users.

The plan is to support the following variants:
Services: unrealircd.org/issued-by=SERVICES:NickServ@services.test.net
IRCOp:    unrealircd.org/issued-by=OPER:Syzop@maintest.test.net:Operblock_name
JSON-RPC: unrealircd.org/issued-by=RPC:adminpanel@irc1.test.net:Adminpanel_Actual_User

This first commit only adds SERVICES and OPER in the handlers of the
SVSNICK and SAMODE commands. The JSON-RPC variant and all of the other
commands have not been done yet.
2023-03-31 12:17:54 +02:00
Bram Matthys 1ca0b76bb5 Validate value of rpc-user THISNAME { } 2023-03-31 11:54:36 +02:00
Bram Matthys 8c6c9b6206 Fix SAMODE showing tags for the person who executed the SAMODE
instead of the server executing the MODE. Eg unrealircd.org/userhost
was set. This occured because the client = &me; was done after
the message tag preparation, now moved up so it's done before.
2023-03-31 11:22:07 +02:00
Bram Matthys 9ab876133d Add wildcard support to blacklist-module.
This also removes the following warning as a side-effect:
"blacklist-module for '%s' but module does not exist anyway".
2023-03-30 17:42:39 +02:00
Bram Matthys b099033c1b Load RPC modules by default but don't enable webserver or RPC sockets.
See release notes:
+* The RPC modules are enabled by default now. This so remote RPC works
+  from other IRC servers for calls like `modules.list`. The default
+  configuration does not enable the webserver nor does it cause
+  listening on any socket for RPC, for that you need to follow the
+  [JSON-RPC](https://www.unrealircd.org/docs/JSON-RPC) instructions.

[skip ci]
2023-03-30 17:35:11 +02:00
Bram Matthys 553d826ab3 Update release notes
[skip ci]
2023-03-30 17:23:55 +02:00
Bram Matthys bfee61d52d Fix dereferencing the wrong variable in a config_error() 2023-03-30 16:58:44 +02:00
Bram Matthys b51c8315fd Add and use set::modef-split-delay which makes +f ignore join-flood
for this amount of seconds (default: 75) when a server splits.
This helps in case a server dies and the clients reconnect to the
other servers, causing a join-flood to be triggered needlessly.
Of course, OTOH disabling a flood protection temporarily is not
ideal, but after seeing it being triggered too often and requiring
manual intervention in many +f/+F channels, this is the best option
I think, if we want +f/+F to work as painless as possible.

If you have a large network (eg: >5 servers) with equal user
spreading then you could disable this by setting it to 0, since then
1 server dieing may not have enough impact on +f join floods
for this to be needed.

TODO: Documentation and release notes
2023-03-30 16:57:27 +02:00
Bram Matthys aae8306ef6 Do some sanity checking on extban names: max 32 characters and
a-z, 0-9, _, -
2023-03-29 16:39:16 +02:00
Bram Matthys f4755fe587 Do some sanity checks on flood profile names
max length 24, and every character is a-z, 0-9, -, _
2023-03-29 16:38:20 +02:00
Bram Matthys a5b6365ef0 Assume +f profile "normal" always exists, since that is the case.
Also fix some "NULL check but dereferenced before" warnings.
2023-03-29 16:25:33 +02:00
Bram Matthys 8ff5fb62fb Get rid of some shadow (bug in +f config profile handling) 2023-03-29 16:23:47 +02:00
Bram Matthys 55350fe3a3 Fix due to recent +f rewrite: add check for [ at start, fixes OOB read. 2023-03-29 09:50:10 +02:00
Bram Matthys 53aedf2b3f Update release notes
[skip ci]
2023-03-27 13:23:23 +02:00
Bram Matthys abb6fcfcb5 RPC: user.list and user.get now have optional object_detail_level.
This is an integer which decides the amount of details in the response object.

See https://www.unrealircd.org/docs/JSON-RPC:User#Structure_of_a_client_object

Especially for user.list it can be a good idea to ask for less detail if
you don't need all the information. It's up to you...

When 'object_detail_level' is not specified in the request, then:
* For user.list it defaults to 2, which is a "breaking change" in the sense
  that it leaves out the "channels" field. To see the "channels" field you
  would have to use level 4.
* For user.get it defaults to 4, which results in the same output as 6.0.7.
* This makes sense so user.list is shorter than user.get, just like we
  already did in channel.list and channel.get.

By the way, this is all documented in the API calls at
https://www.unrealircd.org/docs/JSON-RPC:User
and for channels at https://www.unrealircd.org/docs/JSON-RPC:Channel
2023-03-27 13:12:27 +02:00
Bram Matthys f9af852c43 Again a fix for JSON logging, so object_detail_level has same result as 6.0.6.
This also changes the Detail level (object_detail_level) for the channel.* calls.
See https://www.unrealircd.org/docs/JSON-RPC:Channel_Object for latest info.

In short: at level 5, we now still hide the members.user.channels because
in general that object is not useful. When you do a channel.* API call
you want a list of users in the channel, and don't really care about
what other channels the user is in, other than the channel you already know.
2023-03-27 12:34:55 +02:00
Bram Matthys 783bdfb741 Fix JSON logging using the correct object_detail_level (same result as 6.0.6) 2023-03-27 10:13:43 +02:00
Bram Matthys a18bb04f45 Bump rpc/channel module version to 1.0.5
[skip ci]
2023-03-27 09:57:07 +02:00
Bram Matthys 957af0909b RPC: channel.get and channel.list now have optional object_detail_level.
This is an integer which decides the amount of details in the response object.

For the channel.* calls the object_detail_level is one of:
0: only return the channel name, nothing else
1: basic channel information only
2: this adds bans, ban_exemptions, invite_exceptions
3: also show members, but only level/name/id
4: also show members, level/name/id/hostname/ip/details/geoip
5: also show members, level and full user details like user.get

When no object_detail_level is specified, the following defaults are used:
For channel.list the default is 1 (matches current 6.0.6 behavior)
For channel.get the default is 3 (matches current 6.0.6 behavior)

Using channel.list with object_detail_level=5 is forbidden because
it would cause way too much output (and processing time).
2023-03-27 09:56:03 +02:00
Bram Matthys 98868dbbe9 Some leftover changes for release notes
[skip ci]
2023-03-27 09:15:00 +02:00
Bram Matthys 5d25888c71 Update release notes
[skip ci]
2023-03-26 19:49:49 +02:00
Bram Matthys 5c84728a32 Update release notes
[skip ci]
2023-03-26 19:44:46 +02:00
Bram Matthys 8e6c38f09a Potentially fix +f 'r' 2023-03-26 18:55:40 +02:00
Bram Matthys ccd9fc4b25 Make MODE #channel +F show the combined effective view of +f and +F.
Actually it accepts the following variations for this query:
MODE #test f
MODE #test +f
MODE #test F
MODE #test +F
As long as it is like that (with no parameter) we will show details.
Details are shown for all of the four possible combinations of having
or not having +f and +F.

For example "+F normal" and "+f [1k,20t]:10" result in this output:

Channel '#test' uses flood profile 'normal', without action(s) 'k' as they are overridden by +f.
Effective flood setting via +F: '[7c#C15,30j#R10,40m#M10,10n#N15]:15'
Plus flood setting via +f: '[1k,20t]:10'
-
List of available flood profiles for +F:
         none: []:0
 very-relaxed: [7c#C15,60j#R10,10k#K15,90m#M10,10n#N15]:15
      relaxed: [7c#C15,45j#R10,10k#K15,60m#M10,10n#N15]:15
       normal: [7c#C15,30j#R10,10k#K15,40m#M10,10n#N15]:15
       strict: [7c#C15,15j#R10,10k#K15,40m#M10,10n#N15]:15
  very-strict: [7c#C15,10j#R10,10k#K15,30m#M10,10n#N15]:15
See also https://www.unrealircd.org/docs/Channel_anti-flood_settings
2023-03-26 17:19:13 +02:00
Bram Matthys 67f61e7444 Retain sorting order when when set_channel_flood_profile() overwrites
an existing +F profile.
2023-03-26 16:43:45 +02:00
Bram Matthys 4ebdc7cd5b Don't allow subtype 't' and 'r' in +F profiles for now due to technical
reasons. If you want those, then use +f. (See source)
2023-03-26 16:03:35 +02:00
Bram Matthys 7f84bf7a39 floodprot minor code cleanup (chp -> fld) 2023-03-26 15:58:02 +02:00
Bram Matthys aa48b4d9d8 Make +F and +f work together (+f subtypes override +F settings) 2023-03-26 15:56:52 +02:00
Bram Matthys 1590628488 Drop the alt-actions +m and +M for the CTCP floodtype.
When a channel CTCP flood happens and there is an +f with the 'c' floodtype,
we set channel mode +C by default. Alternative action possiblities
were +m and +M. I don't think anyone really used those alt actions for CTCP
because makes little sense to set the channel +m/+M on a CTCP flood when
there is +C which has far less impact.

More important, the fact that +m/+M could be set both upon CTCP flood
and upon message flood, this 'dual timer' thing, makes it rather
complex when we now have both +f and +F, so easiest solution is just
to scratch this possibility :)
2023-03-26 15:42:09 +02:00
Bram Matthys 972046448a Channelmode +f code cleanups: make a single parse_channel_mode_flood()
function that handles all of is_ok(), conv_param() and put_param().

Hopefully I merged all the logic correctly :D
2023-03-26 13:42:18 +02:00
Bram Matthys b03b122348 Initial work on set::anti-flood::channel likely with bugs and no validation 2023-03-26 09:34:51 +02:00
Bram Matthys 5db1ce00b1 Handle the HOOKTYPE_CONFIGRUN and TEST for CONFIG_SET_ANTI_FLOOD first. 2023-03-26 09:00:35 +02:00
Bram Matthys c9fddc51f9 Add channel mode +F <flood-profile> 2023-03-25 19:00:48 +01:00
Bram Matthys b9be185f0a Make channel mode +f ban "unknown-users" first on a join flood,
if the join flood is caused by >75% of "unknown-users". This
to see if that will take care of the flood without harming
the "known-users" group. And naturally, do something similar
for message floods and nick floods.

If the flood persists, because they are caused by known-users,
then the +i/+m/etc actions are still taken.

This is work in progress, and some things are set to useful-
for-testing values, such as an unsettime of 1 minute.
2023-03-25 13:31:55 +01:00
Bram Matthys 04ce8f8ed7 Add helper functions 2023-03-25 12:19:44 +01:00
Bram Matthys 748f381d81 Use X509_check_host() in OpenSSL 1.1.0 and later and don't use it
for OpenSSL 1.0.2 anymore, 1.0.2 will use the fallback version.
This changes the include file.

(OpenSSL 1.0.2 is out of support since Jan 1 2020 so one may wonder
 why care at all, but i'm trying not to break that during minor
 UnrealIRCd releases)
2023-03-25 12:18:44 +01:00
Bram Matthys 78ce692357 Move ban_exists() to the core (was a helper function in channeldb) 2023-03-25 10:38:05 +01:00
Bram Matthys 5f36221869 Add OpenSSL include to fix compile warning.
X509_check_host() requires openssl/x509.h -- well except on
newer OpenSSL's apparently :D
2023-03-25 10:32:12 +01:00
Bram Matthys bfd9650abf Don't use X509_CHECK_FLAG_NO_PARTIAL_WILDCARDS to fix compile problems.
I guess it's not that important so not doing #if defined() checks for it.
Compile problem reported by val.
2023-03-25 10:22:28 +01:00
Bram Matthys 24622144b1 Bump version to 6.0.8-git
[skip ci]
2023-03-25 09:19:41 +01:00
Bram Matthys 83d2498ec8 Add configure check for and use X509_check_host() instead of
always using our own implementation (that is not really ours,
by the way).
2023-03-25 08:31:25 +01:00
Bram Matthys d5aa0b61f1 Bump max length of log entries from 8k to 16k
(for example for logging a 8k+512 bytes line during debugging).
2023-03-25 07:39:44 +01:00
Bram Matthys b51a533ccf In WHOWAS show the normal host (vhost/cloakedhost) to IRCOps now that
the realhost/IP is communicated on a separate line. This so you now
can see both vhost/cloakedhost and realhost as an IRCOp in a single
WHOWAS request.
2023-03-25 07:32:43 +01:00
Bram Matthys 89611887cb Previous fix for big tags was insufficient. 4K+4K+512 rule should now be OK.
This also adds the MAXLINELENGTH define which is set to 4K+4K+512,
it can be used when you are dealing with complete lines (quite rare
in the code, mostly in socket code and labeled response).
And now also #define READBUFSIZE MAXLINELENGTH
but it is used beyond read buffers, als in write buffers of course.
2023-03-25 07:30:22 +01:00
Bram Matthys da3c1c6544 ** UnrealIRCd 6.0.7 ** 2023-03-24 13:26:29 +01:00
Bram Matthys 7194799f93 Fix valid_vhost() rejecting user@host.
Reported by Lord255.
2023-03-24 13:19:57 +01:00
Bram Matthys c4059a4b13 Update release notes
[skip ci]
2023-03-24 08:56:46 +01:00
Bram Matthys a743c5956d Buy a brain..
[skip ci]
2023-03-22 15:32:16 +01:00
Bram Matthys ed14d044e9 Fix crash in SVSO due to change from earlier today
[skip ci]
2023-03-22 15:31:21 +01:00
Bram Matthys 2d4c064c59 Makefile.windows: add missing standard-replies.dll
[skip ci]
2023-03-22 15:11:11 +01:00
Bram Matthys 2a719df7f0 Update release notes; mention windows libs
[skip ci]
2023-03-22 14:43:43 +01:00
Bram Matthys 9a171f2c79 Update release notes
[skip ci]
2023-03-22 10:59:22 +01:00
Bram Matthys e83c610b39 Add valid_vhost() and validate oper::vhost too just like vhost::vhost.
Actually make them both use this same function, even thought he original
vhost::vhost check was a bit more informational.

This also checks the vhost in other paths that lead to oper vhost setting.

Reported by ji in https://bugs.unrealircd.org/view.php?id=5910
2023-03-22 10:26:05 +01:00
Bram Matthys 1274e3d142 Update release notes
[skip ci]
2023-03-22 09:48:43 +01:00
Bram Matthys 23254a8b2b Fix for c-ares library bump (forgot to run ./autogen.sh) 2023-03-22 09:45:30 +01:00
Bram Matthys f24b708562 Update curl-ca-bundle to version of 10-jan-2023
from https://curl.se/ca/cacert.pem
2023-03-22 09:44:12 +01:00
Bram Matthys 62f79c3375 Update shipped c-ares library to 1.19.0 (28-jan-2023) 2023-03-22 09:41:24 +01:00
Bram Matthys 6b9cb96787 Update shipped Jansson library to 2.14 (9-sep-2021) 2023-03-22 09:39:42 +01:00
Bram Matthys ed2113e97c Update PCRE2 to 10.42 (12-dec-2022) 2023-03-22 09:38:01 +01:00
Bram Matthys 3d8905dd1c Fix "unknown connection(s)" in LUSERS being rather high.
This was a counting bug in src/socket.c. The socket itself was actually
freed though, so it's purely counting that was wrong.

There could still be counting bugs elsewhere, it's always hard to get
this right, for 20 years already :D
2023-03-22 09:31:26 +01:00
Bram Matthys 6f0757a2d0 Update release notes
[skip ci]
2023-03-22 09:13:50 +01:00
Bram Matthys 852169429d Update release notes
[skip ci]
2023-03-22 09:03:41 +01:00
Bram Matthys 4b4562516c Another attempt at UTF8-aware spamfilter.
This was previously tried at 19-apr-2020 in bc70882bd3
in UnrealIRCd 5.0.5. Sadly it had to be reverted immediately with a quick 5.0.5.1
release, all because of a PCRE2 100% CPU usage. Since then that bug has been fixed,
plus another bug. I'm now readding it "as an option" that is marked experimental.
Hopefully people test it out and can report back if it works well and then we can
make it the default someday.

This makes it a runtime setting so makes it much easier to switch back/forth if
there are any issues without recompiling anything. Had to use a bit more code now
though to handle the recompiling of spamfilters if the setting is changed.

Original issue was https://bugs.unrealircd.org/view.php?id=5187

* [Spamfilter](https://www.unrealircd.org/docs/Spamfilter) can be made UTF8-aware.
  * This is experimental, to enable: `set { spamfilter { utf8 yes; } }``
  * Case insensitive matches will then work better. For example, with extended
    Latin, a spamfilter on `ę` then also matches `Ę`.
  * Other PCRE2 features such as [\p](https://www.pcre.org/current/doc/html/pcre2syntax.html#SEC5)
    can then be used. For example you can then set a spamfilter with the regex
    `\p{Arabic}` to block all Arabic script.
    Please do use these new tools with care. Blocking an entire language
    or script is quite a drastic measure.
  * As a consequence of this we require PCRE2 10.36 or newer. If your system
    PCRE2 is older than this will mean the UnrealIRCd-shipped-library version
    will be compiled and `./Config` may take a little longer than usual.
2023-03-22 09:00:31 +01:00
Bram Matthys 768a08f83b Fixes for remote REHASH of a server: fix both missing and duplicate lines.
Duplicate line reported by Lord255 in https://bugs.unrealircd.org/view.php?id=6082
Missing line(s) may have been mentioned by someone but never reported
on the bug tracker.
2023-03-20 11:45:41 +01:00
Bram Matthys 8a48cfb664 Fix not sending CAP DEL on module unload.
Reported by westor in https://bugs.unrealircd.org/view.php?id=6104
The code was there but the order of which the checks were done was
wrong, so first it was checking which CAP's were unloaded and after
that it was unloading the CAP, instead of the other way around.

Also renamed the function to clicap_check_for_changes()
to be consistent with other runtime change detection functions
like extcmodes_check_for_changes(), umodes_check_for_changes()
and charsys_check_for_changes().
2023-03-20 10:55:22 +01:00
Bram Matthys a7c9ecb4e7 Add deny link::reason (optional) and display it in oper warnings
and to the other side of the link.
2023-03-20 09:18:05 +01:00
Bram Matthys a1e7e9f882 Move deny link { } handling to server module. 2023-03-20 09:09:03 +01:00
Bram Matthys 56478f04aa When an IRCOp uses user mode +H (hide oper) then only hide swhois
entries that have the tag "oper", IOTW: the ones that are added
through the oper { } block, and not the ones added through
different means like a vhost { } block.
Really minor thingy but suggested by JanisB in
https://bugs.unrealircd.org/view.php?id=4233 and actually
possible nowadays when swhois items are tagged.

Hint: if you use SVSO to make someone oper, and then add swhois
entries, be sure to tag them with a setby of "oper" too, that
way they are hidden in +H and also automatically removed from
the user when the user does "MODE nick -o" to de-oper.
2023-03-19 12:29:30 +01:00
Bram Matthys 5a95a19d2d Update release notes
[skip ci]
2023-03-19 12:06:55 +01:00
Bram Matthys 37b2f951fd Update release notes
[skip ci]
2023-03-19 12:03:37 +01:00
Bram Matthys fae628cbdf Fix "Missing snomask logging configuration" REHASH issue
if you do actually have 1 snomask configured (a single one).
Although this is rather rare and unusual, it should be possible.
Previously we required at least 2 snomasks and the counter
did not properly reset during rehashes. Not sure why we required
2 and not 1, and the counter reset was a bug.
Reported by westor in https://bugs.unrealircd.org/view.php?id=5994
2023-03-19 11:51:28 +01:00
Bram Matthys 5c108e0ec3 Don't fetch GeoIP.dat upon blacklist-module geoip_classic;
Reported in https://bugs.unrealircd.org/view.php?id=6100

Actually this only works if you have a:
blacklist-module geoip_classic;
in your conf and that conf is read before modules.default.conf
This is true if you have that blacklist-module line in your
unrealircd.conf, so should cover most cases.
2023-03-19 11:28:23 +01:00
Bram Matthys 15c8da2be8 Send ERR_INPUTTOOLONG (417) on oversized message-tags, as per
https://ircv3.net/specs/extensions/message-tags
Reported by progval in https://bugs.unrealircd.org/view.php?id=5949
2023-03-19 10:13:58 +01:00
Bram Matthys 951b913800 Update crule.c, re-porting it from ircu, to hopefully fix some bug(s).
Reported by 9pfs in https://bugs.unrealircd.org/view.php?id=6248

This is completely untested (other than ./unrealircd start), so
feedback from people who actually use crule like in deny link { }
is very much welcomed.
2023-03-19 08:38:54 +01:00
Bram Matthys 99c3f8688e When we blocked remote requests for CREDITS/INFO/LICENSE 10 years ago
due to flood attacks, back then we changed the argument silently to
point to our own server, eg 'INFO some.remote.server' ended up being
'INFO' (local server) when requested by non-IRCOps.
Now, we simply return "Permission denied" in such cases, which is
more clear and explicit.
Reported by progval in https://bugs.unrealircd.org/view.php?id=6004
2023-03-18 14:14:18 +01:00
Bram Matthys eccf108866 Forgot second part of the patch in previous commit. 2023-03-18 14:01:58 +01:00
Bram Matthys 3bccc63125 Fix +S stripping too much on incorrect color codes.
Reported by semioriginal in https://bugs.unrealircd.org/view.php?id=5908
with the patch also by semioriginal.
2023-03-18 13:58:59 +01:00
Bram Matthys 5cdcb95cdf Fix log message nick.BAD_NICK_REMOTE showing wrong server.
Reported by Valware in https://bugs.unrealircd.org/view.php?id=6060
2023-03-18 13:41:38 +01:00
Bram Matthys 3329cbcf18 Fix @if module-loaded() for modules that are about to be unloaded during REHASH.
Reported by westor in https://bugs.unrealircd.org/view.php?id=6122

This because is_module_loaded() returned the 'current state' rather than
the 'future state', as mentioned in is_module_loaded() in a comment there.
Fix was swappping two lines.
2023-03-18 13:36:15 +01:00
Bram Matthys 80d9b00de2 Possible fix for changes yesterday in moddata websocket_mdata_unserialize,
freeing of old websocket data (probably never called, but hey..)
2023-03-18 07:39:41 +01:00
Bram Matthys 6cb7a12baa Minor rls notes updates
[skip ci]
2023-03-17 19:10:09 +01:00
Bram Matthys 8ed633a452 Update release notes
[skip ci]
2023-03-17 19:05:39 +01:00
Bram Matthys 0428819c03 Add security group "websocket-users" and add security-group options
security-group::websocket and security-group::exclude-websocket,
all similar to how security-group::webirc works but for websocket.
Suggested by PeGaSuS in https://bugs.unrealircd.org/view.php?id=5598
and Nini in https://bugs.unrealircd.org/view.php?id=6222
2023-03-17 18:57:59 +01:00
Bram Matthys 3c64392a86 Sync websocket status over the network (needed for next commits) 2023-03-17 18:53:17 +01:00
Bram Matthys 7c98f10259 Update release notes
[skip ci]
2023-03-17 18:14:59 +01:00
Bram Matthys cdb36e7e30 WHOWAS: Show IP address and account to IRCOps.
Thanks to Noisytoot for https://github.com/unrealircd/unrealircd/pull/227
who suggested displaying account and provided a partial patch, and
armyn in https://bugs.unrealircd.org/view.php?id=6153 suggesting IP.

I chose to use the existing RPL_WHOIS* numerics that we also use for
returning WHOIS data. We already use RPL_WHOISSERVER in WHOWAS for
ages and the use of it is mentioned in RFC1459, so seems like that
was the idea right from the beginning of times. The only change I did
was from "is" to "was" in like "was logged in" and "was connecting from"
in the text of the numerics.
2023-03-17 18:10:46 +01:00
Bram Matthys fcdb059883 Fix whitespace and add some comments, before I go edit this file 2023-03-17 17:36:57 +01:00
Bram Matthys cc97589e47 Update release notes a bit
[skip ci]
2023-03-17 14:27:54 +01:00
Bram Matthys 96a6cf03a1 Probably helps if i add the .c file 2023-03-17 14:20:58 +01:00
Bram Matthys 45757da12e Add CAP standard-replies, and send ACCOUNT_REQUIRED_TO_CONNECT when
a user is soft-banned, from authprompt anyway.
2023-03-17 14:20:02 +01:00
Bram Matthys db23e7ba74 Update a module description (copy-paste error)
[skip ci]
2023-03-17 14:06:42 +01:00
Bram Matthys 4a9dcc6511 Fix mode +d (post delayed +D) not showing invisible users partially.
Or, "invisible_user_in_channel() function doesn't return 1 when channel has +d"
Reported by westor in https://bugs.unrealircd.org/view.php?id=6118
2023-03-17 12:12:20 +01:00
Bram Matthys 2a98802d09 Fix compile warning due to latest additions. 2023-03-17 11:06:12 +01:00
Bram Matthys 395a9dfc41 Update release notes
[skip ci]
2023-03-17 10:54:16 +01:00
Bram Matthys 9a08e39bca Fix modulemanager not working on FreeBSD (./unrealircd module install ...)
and other systems where 'make' was not GNU Make.
It now uses the same detection mechanism as in ./Config, which
should be known to work.

Reported by Valware and rj1 in https://bugs.unrealircd.org/view.php?id=6195
2023-03-17 10:44:10 +01:00
Bram Matthys 5e57228dfb In the FLOOD_BLOCKED log message, add the target of the flood.
Suggested by ComputerTech in https://bugs.unrealircd.org/view.php?id=6148
2023-03-17 09:56:56 +01:00
Bram Matthys 16d6c0efd6 Fix crash if unrealircd.org/json-log is used and a module calls config_warn()
during MOD_INIT, while an IRCOp is listening. Or any log call, really.
This causes the code path: config_warn() -> do_unreal_log_opers() -[..]->
sendto_one() -[..]-> client_accepts_tag() for a client tag handler that is
no longer loaded.

The fix is to unload very late and load very early, a trick
we did earlier with websockets as well (c3824ad47d).
2023-03-15 13:45:49 +01:00
Bram Matthys 96fe6d0fda Fix Windows compile problem with current git 2023-03-14 18:33:00 +01:00
Bram Matthys e767dc5e0e Silence warning on clang 15+ (such as in upcoming Ubuntu 23.04)
with regard to RunHook() and direct hook calls.
2023-03-13 13:56:56 +01:00
Bram Matthys 10b481f2c7 ./Config: don't use 'more doc/Config.header' but use 'cat', it's short enough. 2023-03-13 09:13:53 +01:00
Bram Matthys c43753cd4b Support NO_COLOR environment variable, as per https://no-color.org 2023-03-11 17:58:21 +01:00
Bram Matthys e4571a5bf7 Make the documentation of ulines { } in example.conf more explicit
about ulines for services needing to be added on every UnrealIRCd
server in a network.
[skip ci]
2023-02-08 18:07:28 +01:00
Bram Matthys b80d89dbb2 Update main docs link in example.*conf. Reported by DeviL.
[skip ci]
2023-02-08 17:56:14 +01:00
Bram Matthys c935c97963 Mention ulines { } verification in release notes
[skip ci]
2023-02-08 17:52:43 +01:00
Bram Matthys 2f5fa09187 Mention the last couple of changes in the release notes already.
[skip ci]
2023-02-08 10:52:07 +01:00
Bram Matthys 977c4b433a Make it so services can CHGHOST/CHGIDENT in the SASL / registration phase.
This so users can come online directly with the correct vhost set,
and not first with a standard (usually cloaked) host while auto-(re-)joining
followed by a CHGHOST later.

This is a long outstanding wish from users, I think.

Services can simply send a CHGHOST/CHGIDENT to the UID, for example
right before they send the SASL ... D S message (SASL succeeded)
they can send like: CHGHOST 002ABCDEF some.nice.host

Then UnrealIRCd 6.0.7-git and later will handle the CHGHOST even if
the user is not known yet. Technically, the server where the UID is
on will handle the message. And remote servers that don't know the
user with this UID yet will forward to the server with the SID-portion
of the UID. The CHGHOST will not be a broadcast but the vhost will
show up in the UID protocol message that introduces the user.
For CHGIDENT it is a similar story.

Light testing has been done but more extensive testing is welcomed.
2023-02-08 10:49:15 +01:00
Bram Matthys 47c8a9c1b8 Use find_server_by_uid() in SREPLY so it can deliver during pre-auth/unregistered stage 2023-02-08 10:11:54 +01:00
Bram Matthys c6c8bba311 Add find_server_by_uid() which hunts a server for the SID-portion of A UID.
Not sure if this is the best name, maybe I come up with a better one later.

The purpose of this function is so we can deliver certain messages to
pre-auth users, that is: users that are not fully registered yet.
This would mostly be used (perhaps exclusively) in SASL stage.
2023-02-08 10:10:27 +01:00
Bram Matthys 61970d12b2 Load 'sreply' module by default, fix a compile issue casused by myself
and some minor subjective style changes.
2023-02-08 09:57:20 +01:00
Valerie Pond 2cf6e9ef19 Add S2S command SREPLY for handling IRCv3 standard replies (#236)
This command allows servers to send Standard Replies (https://ircv3.net/specs/extensions/standard-replies) to clients.
2023-02-08 08:43:41 +00:00
Valerie Pond 14035d4dc0 Make qlines for channels work (#247)
This fixes a check which was backwards. A qline on a channel would only stop someone from joining if the person was an oper that had immunity.
2023-02-08 08:21:19 +00:00
Bram Matthys dd830261db Reject a link for anope or atheme if there is no ulines { } for it.
This is checked for both local and remote services linking in.

Naturally, the list can be expanded to include more services that
really need ulines { }, and not statistical services or some other
purpose non-unrealircd servers, which is the reason why cannot
blindly assume all non-unrealircd servers require ulines.

This should hopefully help users a lot with "mysterious" issues
with services that we see too often in the support channel.
Suggested in https://bugs.unrealircd.org/view.php?id=5742

Note that this does require services to communicate their software
version via EAUTH. Anope does this for years already, but atheme only
does so since 10 days ago (git only, presumably not released yet)
after Valware filed a PR.
2023-02-08 09:02:44 +01:00
Bram Matthys b370b89545 Bump version to 6.0.7-git 2023-02-08 08:08:11 +01:00
Bram Matthys cde37246ba Mention the magic ./unrealircd upgrade command, like last time :p
[skip ci]
2023-02-03 07:01:19 +01:00
Bram Matthys 01fd2da627 ** UnrealIRCd 6.0.6 ** 2023-02-03 06:56:16 +01:00
Bram Matthys 2417ed0a46 And my last rls note update of the day
[skip ci]
2023-01-18 19:18:16 +01:00
Bram Matthys b98fa77bbd Update release notes a bit more
[skip ci]
2023-01-18 19:14:55 +01:00
Bram Matthys ba49a130bb Update release notes a bit.
[skip ci]
2023-01-18 18:55:18 +01:00
Bram Matthys 3666d1d728 JSON-RPC: Add some more sanity checking on the 'id'
(Mainly because the id might be used in RRPC)
2023-01-16 11:10:47 +01:00
Bram Matthys b1139769e1 Do some basic filtering on the request by default.
This ensures that strings are of maximum 510 characters in length
and do not contain \n or \r.
Solves a lot of theoretical problems in many modules that .add
things or do other non-list/non-get actions.

This behavior can be turned off per-method (per handler) by setting
handler->flags = RPC_HANDLER_FLAGS_UNFILTERED;
This is currently not done in any of the modules.
2023-01-16 10:59:41 +01:00
Bram Matthys bdb5541def minor code cleanup (do things the libjansson way..) 2023-01-16 10:38:54 +01:00
Bram Matthys 9e887ea728 Add LoadPersistentLongLong() / SavePersistentLongLong() 2023-01-15 14:40:04 +01:00
Bram Matthys 1d1766a895 Send buildid in server version in EAUTH/SINFO and in server.* JSON-RPC.
This reveals the full git version.
2023-01-15 10:13:16 +01:00
Bram Matthys 497a19e7e2 Accept more connections in each listener run. 2023-01-14 20:49:12 +01:00
Bram Matthys 462ce7fcfa JSON-RPC: add stats.get call which can be used in "Network Overview" in
UnrealIRCd Admin panel and for other statistical purposes.
This can be expanded when needed.
2023-01-14 18:48:18 +01:00
Bram Matthys 2fcddd1655 JSON-RPC: Send 401 error response on invalid auth (instead of lingering the connection). 2023-01-14 17:18:00 +01:00
Bram Matthys 194a0b42f7 JSON-RPC: don't log the RPC calls if they are just for listing/getting,
since these are rather noisy and generally not very interesting to log.
Of course, DO log them if they are like add/delete/etc.

The way this works is a new property in the RPCHandler, eg:

        memset(&r, 0, sizeof(r));
        r.method = "server.list";
+       r.loglevel = ULOG_DEBUG;
        r.call = rpc_server_list;
        if (!RPCHandlerAdd(modinfo->handle, &r))

All of the .list and .get (and things like .module_list) now use
the debug facility, which is not logged by default.

You can still log ALL the JSON-RPC calls if you wish, for example
to a separate file, through something like:

log {
	source { rpc; }
	destination {
		file "rpc.log" { maxsize 100M; }
	}
}
2023-01-14 16:40:48 +01:00
Bram Matthys 58db5b0845 Fix crash in JSON-RPC. Reported by multiple people past few days,
including Lord255, armyn and others.
The issue was not there when running with ASan, which is why it
was non-reproducible for so long. Valgrind picked it up correctly.

The bug was that in rpc_response() and rpc_error() I do:
id = json_object_get(request, "id");
[..]
json_object_set_new(j, "id", id);

which is wrong, since json_object_get() "borrows the reference"
and json_object_set_new "steals the reference".
In this particular case it should be:
json_object_set(j, "id", id);

Fixed in both functions. Would have to audit the code if the mistake
is made elsewhere too though. On first sight, it seems not.
2023-01-14 10:36:54 +01:00
Bram Matthys 53150c0e68 Fix double-wrapping of JSON reply for remote RPC (RRPC) calls such as
server.module_list and server.rehash for remote servers.
Reported by Valware.
2023-01-14 09:10:32 +01:00
Bram Matthys 405b59eb07 JSON-RPC: server.list/server.add: new property server->features->rpc_modules
This is an array with name/version elements, eg server.list or.get look like:
      {
        "name": "testlink.test.net",
        "server": {
          "features": {
            "rpc_modules": [
              {
                "name": "rpc",
                "version": "1.0.2"
              },
              {
                "name": "user",
                "version": "1.0.5"
              },
etc. etc.
2023-01-13 19:42:20 +01:00
Bram Matthys a1800f01e9 JSON-RPC / RRPC: Announce all RPC modules and their versions over the wire via moddata.
Needed for rrpc_supported() at a later point, so one can require certain versions etc :p
2023-01-13 18:20:40 +01:00
Bram Matthys b9fcdcdb19 Make server.rehash for remote servers use two possible code paths:
* If the remote server (and all servers in-between) support RRPC
  then forward the RPC request as RRPC and let remote handle the
  response. The response will be the verbose rehash response.
* If not supported, then simply return boolean true as a response,
  and use oldskool :source_server REHASH dest_server over the wire
2023-01-13 18:09:12 +01:00
Bram Matthys c7f9dadb68 Add JSON_RPC_ERROR_REMOTE_SERVER_NO_RPC error which indicates that the
remote server does not have the JSON-RPC module(s) loaded.

Internally this uses the "rrpc" moddata property that each server will
now set on themselves if the rpc/rpc module is loaded.

Actually I am going to make this more verbose and better later...
2023-01-13 17:43:23 +01:00
Bram Matthys a3ed1eabd9 Make client->flags 64 bit on all platforms.
We just reached the 32th bit so it is not a problem yet,
but better bump it now since I will forget otherwise :D
2023-01-13 16:56:23 +01:00
Bram Matthys b8cbe63915 Support server.rehash for remote servers with full detailed response.
(Required RPC modules to be loaded on the remote server, tho)

This adds support for remote async RPC requests that take a little longer,
in such a case we don't call free_client() upon return of rpc_call().
2023-01-13 16:51:47 +01:00
Bram Matthys e2ef83bd6e Fix crash on REHASH 2023-01-13 15:57:45 +01:00
Bram Matthys cbdde31c1d Move client->local->rpc to client->rpc 2023-01-13 15:49:41 +01:00
Bram Matthys 16e4990f83 Fix memory leaks created in commit from 15 minutes ago 2023-01-13 15:45:12 +01:00
Bram Matthys bed40ccdab JSON-RPC: RPC-over-net: track requests and handle timeouts and SQUITs.
Inform the RPC client that the request timed out / server is gone.
The timeout is fixed at 15 seconds, which is fine, I think.

New rpc error codes:
JSON_RPC_ERROR_SERVER_GONE      = -32001, /**< The request was forwarded to a remote server, but this server went gone while processing the request */
JSON_RPC_ERROR_TIMEOUT          = -32002, /**< The request was forwarded to a remote server, but the request/response timed out (15 seconds) */

Unfortunately we cannot say for sure the action did not succeed at all.
It could be that the request never reached the server, but it could also
be that the request DID reach the server and we timed out during
retrieving the response. Nothing we can do about that.
2023-01-13 15:34:00 +01:00
Bram Matthys 6a4ae9d9ec Support RPC calls to remote servers, where the RPC request/response is
sent over the IRC network. This makes it possible to fetch information
from remote servers that is not known locally, and also it makes it
possible to do more things, or do it easier.

This does require the remote servers to enable RPC as well, though,
eg: include "rpc.modules.default.conf";
(They don't need any listener or rpc-user blocks)

Code-wise it looks nice, like from rpc_server_module_list it is a simple:
/* Forward to remote */
rpc_send_request_to_remote(client, targetserver, request);

This is work in progress. In particular, there is no handling yet of
timeouts (eg if the request to the remote server, or the response
from it takes ages). Nor does it handle the case where the server
quits half-way through the request/response... that is: it does free
the request and such, but does not notify the RPC client about it.
That will need to be added, of course, likely soon.

Over the IRC network this uses the new RRPC command:
:<server> RRPC <REQ|RES> <source> <destination> <requestid> [S|C|F] :<request data>
A request looks like this (assuming it is short):
:001 RRPC REQ 001ABCDEF 002 abc SF :..this is the json request...
And then the response (assuming it is long) is like:
:001 RRPC REQ 001ABCDEF 002 abc S :..this is the json response...
:001 RRPC REQ 001ABCDEF 002 abc C :..more...
:001 RRPC REQ 001ABCDEF 002 abc C :..more...
:001 RRPC REQ 001ABCDEF 002 abc F :..and that was it.
There is currently no request/response limit, it is limited by memory.

Right now the only call using this is server.module_list when called
with a param of "server":"some.remote.server"
2023-01-13 12:45:51 +01:00
Bram Matthys 07d2b6745b JSON-RPC: add server.module_list - only works for locally connected server atm 2023-01-13 09:46:02 +01:00
Bram Matthys 00e278c802 Add $tkl->set_in_config property, which is true for config-based TKL entries.
So, ones that cannot be deleted.
[skip ci]
2023-01-13 09:16:19 +01:00
Bram Matthys 6bde7475df JSON-RPC: add new $server->server->ulined property for u-lines (services)
[skip ci]
2023-01-13 09:05:29 +01:00
Bram Matthys a024a17e87 Add strtoken_noskip() and use it from the PROTOCTL EAUTH= code
so we can deal with empty fields that get sent f.e. by anope,
like EAUTH=services.test.net,,,Anope-2.0.11

Apparently this is similar to strsep(), or actually hypothetical
strsep_r(), a function which does not seem to exist.
2023-01-13 08:56:34 +01:00
Bram Matthys 73e1dbca05 JSON-RPC: Add missing client.server.features for &me 2023-01-11 17:42:02 +01:00
Bram Matthys aa2d3c026e JSON-RPC: add server.disconnect 2023-01-11 17:08:34 +01:00
Bram Matthys d6833ae298 JSON-RPC: add server.connect API call
(directly connected server only at the moment)
This also cleans up the linking procedure (now) at 3 places,
to use find_link() and check_deny_link() everywhere.
2023-01-11 16:54:22 +01:00
Bram Matthys 0578346b12 Make server.rehash work for remote servers too, just no real status atm. 2023-01-11 16:24:50 +01:00
Bram Matthys a5bdf317fb JSON-RPC: begin with a server.* API, also fill client->local->rpc for
RPC clients with the RPC user and such.

Most of this work is for server.rehash which causes the request to
be saved, then a rehash begins, and a few seconds later (or whenever)
the entire rehash log and success/failure is indicated in the
JSON-RPC response.

TODO: all documentation for this
2023-01-11 15:43:50 +01:00
Bram Matthys 1c87882d3e Add missing config.RELOAD logging when using ./unrealircd rehash
(via control socket)

Reported by darkex in https://bugs.unrealircd.org/view.php?id=6212
2023-01-11 14:01:21 +01:00
Bram Matthys c5d8bc5d9b Fix ~account:* matching both logged in and logged out users (so quite useless).
This bug exists since 5.2.1 already, so i guess the functionality is
not used much ;). Makes sense, since for simple ~account:* you have +R already,
so it is only useful in stacked bans such as +e ~nickchange:~account:*

We now have a test case so that this bug won't "ever" reoccur.

Reported by rafaelgrether in https://bugs.unrealircd.org/view.php?id=6211
2023-01-09 09:00:58 +01:00
Bram Matthys 5897ce3aad Version bump various modules.
[skip ci]
2023-01-08 15:50:25 +01:00
Bram Matthys 35c49108df JSON-RPC: Add optional "set_by" field when adding/removing TKL's,
so in name_ban, server_ban, server_ban_exception and spamfilter.

This could be used, for example, by an admin panel to tell which
end-user that authenticated to the panel (eg 'OperX') added/removed
the TKL, instead of showing up as 'RPC:xyz' in the logs and bans.
2023-01-08 15:43:00 +01:00
Bram Matthys ed8a3f0336 JSON-RPC add server_ban_exception.* API calls
Docs: https://www.unrealircd.org/docs/JSON-RPC:Server_ban_exception
2023-01-08 15:35:08 +01:00
Bram Matthys d0ad776e93 Minor code cleanup (move error out of params into local vars,
as it didn't belong there..)
[skip ci]
2023-01-08 15:03:18 +01:00
Bram Matthys 0244c31742 Split of some code from cmd_eline() into server_ban_exception_parse_mask(),
similar to how *LINE commands use server_ban_parse_mask().
Now used by ELINE and for JSON-RPC later...
2023-01-08 14:56:56 +01:00
Bram Matthys c95e3f249e JSON-RPC: add name_ban.list, name_ban.get, name_ban.add, name_ban.del 2023-01-08 09:56:41 +01:00
Bram Matthys 5db86cb442 Fix crash in server_ban.* when using non-serverban types such as
qlines and exceptions (for which no interface exists yet, btw :D).
2023-01-08 09:20:12 +01:00
Bram Matthys 9d04710e3a In DEBUGMODE allow for verbose rpc logging with request/responses.
(And also fix a logging statement that had the wrong category)

log {
        source {
                rpc.debug;
        }
        destination {
                file "rpc.log" { maxsize 100M; }
        }
}
2023-01-08 09:02:01 +01:00
Bram Matthys 20d1487922 JSON-RPC: add channel.kick, update struct initalization,
and use REQUIRE_PARAM_* and OPTIONAL_PARAM_* everywhere
in the channel.* API handlers.

For docs see:
https://www.unrealircd.org/docs/JSON-RPC:Channel
2023-01-07 19:05:05 +01:00
Bram Matthys 191553e403 Update early release notes a bit.
[skip ci]
2023-01-07 18:44:22 +01:00
Bram Matthys 998687bf13 Bump version to 6.0.6-git 2023-01-07 18:15:11 +01:00
Bram Matthys 243958f85a Add REQUIRE_PARAM_STRING(), REQUIRE_PARAM_BOOLEAN(),
OPTIONAL_PARAM_STRING, OPTIONAL_PARAM_BOOLEAN()
and use it everywhere in the user.* API calls.
Much cleaner now :)
2023-01-07 17:54:52 +01:00
Bram Matthys fb96e4581b JSON-RPC: add user.part and slightly change user.join
the option is now called 'force':true for consistency.

Docs updated:
https://www.unrealircd.org/docs/JSON-RPC:User#user.part
https://www.unrealircd.org/docs/JSON-RPC:User#user.join
2023-01-07 17:38:38 +01:00
Bram Matthys 046c8654c6 JSON-RPC: add user.join, which uses SVSJOIN (normal join) or SAJOIN (bypass
all channel restrictions).
See https://www.unrealircd.org/docs/JSON-RPC:User#user.join
2023-01-07 17:31:33 +01:00
Bram Matthys 884cc7f04d JSON-RPC: add user.quit. The difference between that and user.kill
is explained at https://www.unrealircd.org/docs/JSON-RPC:User
2023-01-07 16:57:48 +01:00
Bram Matthys 6a2a8e798b JSON-RPC: add user.kill 2023-01-07 16:48:41 +01:00
Bram Matthys 9d65b8a4ed Use better defaults in user.set_oper
Already documented at https://www.unrealircd.org/docs/JSON-RPC:User#user.set_oper
2023-01-07 16:41:52 +01:00
Bram Matthys aef8611f91 Change SVSO to use the prefix "remote:<name>" instead of "services:<name>"
because it can be used by JSON-RPC now and this fits for both :D.
2023-01-07 16:19:17 +01:00
Bram Matthys e7615210a7 JSON-RPC: add user.set_oper
[skip ci]
2023-01-07 16:18:47 +01:00
Bram Matthys 541eba0670 JSON-RPC: add user.set_mode & user.set_snomask 2023-01-07 15:59:52 +01:00
Bram Matthys 619282397e Add json_object_get_boolean():
int json_object_get_boolean(json_t *j, const char *name, int default_value)
[skip ci]
2023-01-07 15:54:49 +01:00
Bram Matthys 9898d332ab JSON-RPC: add user.set_vhost 2023-01-07 15:30:08 +01:00
Bram Matthys 318d183f23 JSON-RPC: add user.set_username and user.set_realname 2023-01-07 15:23:34 +01:00
Bram Matthys 18d7e98d35 Return true from ValidatePermissionsForPath() for &me. 2023-01-07 15:20:48 +01:00
Bram Matthys 4378979ad5 Add valid_username() so we can use it at multiple places.
This gets rid of duplicate code in SETIDENT, CHGIDENT, and soon
in the RPC call. It does not get rid of make_valid_username()
in src/modules/nick.c which does something slightly different.
2023-01-07 15:11:52 +01:00
Bram Matthys a9d0c6fd1a JSON-RPC: make channel.set_mode and channel.set_topic return just result:true.
I don't think it should return the whole channel struct here as if it
was a channel.get. Only thing is that, especially or only with set_mode,
it may actually be 100% success... eg if your mode line is wrong :D.

Also bump API versions on user.* and channel.*
2023-01-07 14:58:00 +01:00
Bram Matthys 5589a78255 JSON-RPC: add user.set_nick
This also makes the "forced nick change" message a bit more
generic, leaving out the "by services" or "due to Services",
since it is now possible to do it via JSON-RPC.
2023-01-07 14:53:01 +01:00
Bram Matthys 7d9dcb5e0a Allow SVS* commands to be sent by non-ulined servers by default,
this is needed by various future JSON-RPC calls.
See https://www.unrealircd.org/docs/Set_block#set::limit-svscmds
2023-01-07 14:21:31 +01:00
Bram Matthys 62d62c4e88 channel.set_mode: mode->modes, parameter->parameters 2023-01-07 10:24:26 +01:00
Bram Matthys b2a6f3cfee JSON-RPC: add channel.set_mode 2023-01-07 10:21:19 +01:00
Bram Matthys 14107d88be Add set_channel_topic() and use it from cmd_topic (TOPIC) 2023-01-07 10:16:18 +01:00
Bram Matthys 66d7fb804d JSON-RPC: add channel.set_mode 2023-01-07 09:41:01 +01:00
Bram Matthys 141c4bc64d Use consts in set_channel_mode()
[skip ci]
2023-01-07 09:39:44 +01:00
Bram Matthys 5a32333360 JSON-RPC: show +vhoaq in "channels" in user.* and in "members" in channel.*
as requested in https://bugs.unrealircd.org/view.php?id=6206
And also for channel.get, in "members", include the UID in "id".

This breaks the current format but we don't have many users yet anyway.
Something tells me that will happen more ;)

This also bumps the user and channel RPC modules from 1.0.0 to 1.0.1

In user.get (and currently user.list too) this shows as:

"channels": [
  {
    "name": "#test",
    "level": "o"
  }
]

And in channel.get (not .list) this shows as:
"members": [
  {
    "name": "abc",
    "id": "00129BP02",
    "level": "o"
  },
  {
    "name": "def",
    "id": "001LFMB05"
  }
]
2023-01-05 17:48:08 +01:00
Bram Matthys bef2f428f4 JSON-RPC: Really show *all* channels a user in.
This because for JSON-RPC you expect all accurate data, while in contrast
with JSON logging the channels are just there for convenience and only
show the first X channels, since otherwise the data gets too long
and gets truncated (JSON logging uses channel detail level 0).
2023-01-05 16:54:37 +01:00
Bram Matthys 143b7262cc JSON-RPC: add channel.get which also includes members and +beI lists.
Documented at https://www.unrealircd.org/docs/JSON-RPC:Channel
under "When using the channel.get API call, more details are available"
2023-01-05 16:39:59 +01:00
Bram Matthys ccbd320338 JSON-RPC over Websocket: don't close websocket connections after ~30s,
keep them open, but do a websocket ping/pong to check if the
connection is alive.
This is usually handled by browsers themselves, but if you are using
websockets from a non-browser then you may have to PONG back on
a PING, see https://www.rfc-editor.org/rfc/rfc6455#section-5.5.2
(note that PING-PONG is a requirement there)
2023-01-04 13:55:08 +01:00
Bram Matthys b33628b765 JSON-RPC over Websockets: Fix bug with >64Kb responses.
Eg if there are 10.000 users online and you do user.list.
The old websocket framing assumed no response was >64Kb.

This also creates a new function websocket_create_packet_ex()
2023-01-04 13:10:09 +01:00
Bram Matthys d6a3db4ad2 Add listener::mode so for file sockets you can specify the mode permissions.
Valid choices are 0700, 0770 and 0777, see the documentation at
https://www.unrealircd.org/docs/Listen_block

Unrelated: this also documents the ConfigItem_listen struct in struct.h.
2023-01-04 10:06:39 +01:00
Bram Matthys 8ca6341f38 When someone includes "rpc.modules.default.conf" create a *NIX
socket listening in data/rpc.socket, because why not... only the
ircd user has access to it by default (well, and root).

Don't add the external listener HTTP(S) port by default though,
because not everyone may want that exposed to the outside world.

The default creation of data/rpc.socket can be prevented by a
@define $NO_DEFAULT_RPC_SOCKET "1"
2023-01-03 19:34:04 +01:00
Bram Matthys dca5680665 Add snomask 'R' for RPC usage (JSON-RPC). 2023-01-03 17:44:29 +01:00
Bram Matthys b5c86981fa JSON-RPC server_ban.add: fix "duration_string" being interpreted totally wrong.
Something like "1h" was intepreted as unixtime 3600 (=expired long ago).
For absolute times there is already "expire_at" (JSON timestamp).

Now, "1h" is properly interpreted as meaning 1 hour from now, as intended.

This bumps the version of rpc/server_ban to 1.0.1.

Reported by armyn.
2023-01-03 10:03:15 +01:00
Bram Matthys 64e5de4c8c ExtBanAdd: Actually enforce conv_param as a required event.
This was documented as optional in include/modules.h but on
https://www.unrealircd.org/docs/Dev:Extended_Bans_API it
was always mentioned as required.
In practice, I know of no module that does not have this,
in UnrealIRCd or third party (doing zero filtering is
quite a bad idea).

Anyway, long story short: this also means we can remove some
(flawed) logic in src/api-extban.c in case conv_param was
NULL, which raised a compiler warning:

api-extban.c: In function ‘extban_conv_param_nuh_or_extban’:
cc1: error: function may return address of local variable [-Werror=return-local-addr]
api-extban.c:382:14: note: declared here
  382 |         char tmpbuf[USERLEN + NICKLEN + HOSTLEN + 32];
      |              ^~~~~~
2023-01-01 09:51:07 +01:00
Bram Matthys 6d81d04036 Re-add --enable-opt to sodium, and remove it from jansson.
This fixes the fix in 8d228f5dbe.

(--enable-opt in sodium enables additional CPU-specific optimization,
 --enable-opt in jansson does not exist and raised a warning)
2022-12-30 11:55:31 +01:00
Bram Matthys 3f197dee36 Fix several mistakes in example conf (all my bad, i think):
* A fatal parse error due to a } too much in Turkish example conf
* In all example*.conf except::connect-delay -> except::connect-time
2022-12-29 19:45:37 +01:00
Bram Matthys 75368e462a ** UnrealIRCd 6.0.5 ** 2022-12-29 10:07:19 +01:00
Bram Matthys 8952666c4f Update release notes
[skip ci]
2022-12-29 09:03:27 +01:00
Bram Matthys 6b7fa40443 Update release notes
[skip ci]
2022-12-29 08:52:32 +01:00
Valerie Pond eda57821ec Fix compile error due to previous commit (#246) 2022-12-26 18:04:37 +00:00
Bram Matthys 895bbd3a35 When authprompt kicks in and the session timeouts, show the original ban reason
from the *LINE (or other ban type).
Eg /GLINE %*@192.168.* 0 :Please authenticate using SASL
would now, if the user has authprompt enabled and the connection times
out, exit the client after ~30 secs with "Please authenticate using SASL",
instead of "Registration timeout" (pre 6.0.5-rc2) or
the generic "Account required to login" (6.0.5-rc2).
This to help clients and users who do not type or display anything.

This is an enhancement to https://bugs.unrealircd.org/view.php?id=6202

This also fixes a bug in 6.0.5-rc2 where "Registration timeout" was
always showing up as "Account required to connect", even if there
was no softban or authprompt intervention at all.
2022-12-26 10:21:59 +01:00
Bram Matthys 7897782747 *** UnrealIRCd 6.0.5-rc2 *** 2022-12-23 08:52:41 +01:00
Bram Matthys 4e171eca0d Update release notes
[skip ci]
2022-12-23 08:33:56 +01:00
Valerie Pond 58e83bbe58 Another fix for set::authentication-prompt::enabled 'no' being ignored (#245) 2022-12-21 16:21:30 +00:00
Bram Matthys eca0035e8d Actually fix previous-previous-commit cdd0e4116d 2022-12-21 10:09:23 +01:00
Bram Matthys eab827688d Fix RPC spamfilter.* (and tkl.*?) not going through fully net-wide
due to bogus sender.
[skip ci]
2022-12-21 10:06:23 +01:00
Bram Matthys cdd0e4116d RPC spamfilter.add: convert reason to underscores internally when adding 2022-12-21 09:57:53 +01:00
Bram Matthys 9b1c24c2fa When timing out on authprompt, error with "Account required to connect".
More ideally it would show the full *LINE reason but that is something
for a later release. Inspired by https://bugs.unrealircd.org/view.php?id=6202

This also fixes a silly typo that prevents compiling btw :D
2022-12-21 09:31:47 +01:00
Valerie Pond 7dedbf1a69 Fix set::authentication-prompt::enabled 'no' being ignored (#243) 2022-12-21 08:01:47 +00:00
Valerie Pond d4dbf62781 Fix link warning about moddata creationtime (#233)
This lets servers share their own creation time. See https://bugs.unrealircd.org/view.php?id=6193
2022-12-21 07:54:55 +00:00
Bram Matthys 2ff03be8a0 Log who actually initiated a /CONNECT (both local and remote).
Reported by Noisytoot in https://github.com/unrealircd/unrealircd/pull/244
2022-12-21 08:50:17 +01:00
Bram Matthys db30b3c7fc Rebuild ./configure due to previous commit 2022-12-18 08:50:14 +01:00
Sam James d9d423ad7a configure.ac: fix -Wimplicit-function-declaration (#242)
Clang 16 makes -Wimplicit-function-declaration error by default.
Unfortunately, this can lead to misconfiguration or miscompilation of software as configure
tests may then return the wrong result.
We also fix -Wstrict-prototypes while here as it's easy to do and it prepares us for C23.
2022-12-18 07:21:46 +00:00
Bram Matthys c31b4836c8 Reorder release notes a bit
[skip ci]
2022-12-14 19:52:35 +01:00
ZarTek @ CREOLE 06f1357698 Get rid of forgotten references to ./unrealircd upgrade-conf (#241) 2022-12-14 18:47:43 +00:00
ZarTek @ CREOLE b53f23416d Unrealircd to UnrealIRCd 2022-12-14 15:24:19 +00:00
ZarTek @ CREOLE 67ec21f4e9 unreal to unrealircd 2022-12-14 15:24:19 +00:00
ZarTek @ CREOLE 4e408d59de ./unreal to ./unrealircd 2022-12-14 14:58:11 +00:00
PeGaSuS 9f8dc9be40 Update help.conf
Adjust some examples to use the 'named' extended bans from UnrealIRCd 6
2022-12-14 14:56:33 +00:00
Bram Matthys 4992804f4e Enhance ./unrealircd start and ./unrealircd restart:
* The `./unrealircd start` command will now refuse to start if UnrealIRCd
  is already running.
* The `./unrealircd restart` command will validate the configuration file
  (it will call `./unrealircd configtest`). If there is a configuration
  error then the restart will not go through and the current UnrealIRCd
  process is kept running.
2022-12-12 14:58:20 +01:00
Bram Matthys 037f9d6dcf Add internal timeout to unrealircdctl, just in case UnrealIRCd hangs.
This because we will soon use that script for 'start' too...
[skip ci]
2022-12-12 14:54:07 +01:00
Bram Matthys b7f2ce9fd8 Show better error on ./unrealircd start when .so files are missing.
And refer to https://www.unrealircd.org/docs/FAQ#shared-library-error
2022-12-12 09:22:24 +01:00
Bram Matthys 165639a007 Fix ExtBanAdd() for bans that are registered in both MOD_TEST and MOD_INIT
leading to duplicates. The effect was that in the 005 EXTBAN= string some
letters showed up twice like EXTBAN=~,aacfjmnpqrrtCCGGOSST.
Reported by jesse in https://bugs.unrealircd.org/view.php?id=6199
2022-12-10 10:39:51 +01:00
Bram Matthys 6ae5c9d77f Fix leak of 1 file descriptor per /REHASH (the control socket).
In "/STATS P" one additional UNIX control socket appeared after
each "/REHASH". Reported by jesse.
2022-12-07 12:33:12 +01:00
Bram Matthys c56d0b7f18 Update release notes: fix browser reference, has to be <1.2 and not =1.2. 2022-12-07 12:26:12 +01:00
Bram Matthys 85537efdbd BuildBot on Windows: Updates for new libraries
[skip ci]
2022-12-07 11:03:17 +01:00
Bram Matthys e29b815c13 Update shipped argon2: change Makefile to use 'lib' directory instead of subdir
Otherwise things get installed in ~/unrealircd/lib/x86_64-linux-gnu/
which confuses the rest of the system and has no added value whatsoever
in our case.
2022-12-07 09:45:59 +01:00
Bram Matthys ac5c517774 *** UnrealIRCd 6.0.5-rc1 ***
Sorry the bb0a50d839 from 30min ago
should not have had that same/similar comment ;)
2022-12-07 09:11:22 +01:00
Bram Matthys 8d228f5dbe Remove unused --enable-opt argument to jansson ./configure 2022-12-07 09:06:42 +01:00
Bram Matthys 8f311bb975 Update shipped argon2 to 20190702 (latest release)
from https://github.com/P-H-C/phc-winner-argon2/releases
2022-12-07 09:00:42 +01:00
Bram Matthys efaba7f91e Rename argon2-20181209.tar.gz to argon2.tar.gz so name keeps consistent
like all the other shipped libs.
2022-12-07 08:57:59 +01:00
Bram Matthys bb0a50d839 ** UnrealIRCd 6.0.5-rc1 ** 2022-12-07 08:53:44 +01:00
Bram Matthys 36a8949d59 Fix "/STATS o" returning (null) items when advanced matching criteria
are being used. This also applies to similar use in some other /STATS
like tld blocks.

Reported by darkex in https://bugs.unrealircd.org/view.php?id=6189
2022-12-07 08:30:52 +01:00
Bram Matthys 7bab7144ed Send empty batch on CHATHISTORY request for a user (non-channel),
which makes it similar behavior to channels that are not +H.
2022-12-07 08:15:41 +01:00
Valentin Lorentz 7bacf25845 Add ACCOUNTEXTBAN ISUPPORT token
To support the draft IRCv3 spec: https://github.com/ircv3/ircv3-specifications/pull/464
2022-12-07 07:00:35 +00:00
Bram Matthys 36d9e8e720 RPC spamfilter.*: fix validations not working due to changes yesterday 2022-12-06 17:20:29 +01:00
Bram Matthys fe8661da3d RPC: implement spamfilter.del and spamfilter.get 2022-12-05 15:41:09 +01:00
Bram Matthys 61e68d65da Update a comment
[skip ci]
2022-12-05 14:51:22 +01:00
Bram Matthys d9ac4cac07 Add RPC 'rpc.info': returns list of RPC methods, RPC module name and version.
This can be useful for checking if a server supports something and what
format it expects or returns things, etc.
2022-12-05 14:48:14 +01:00
Bram Matthys 5b0899ac4f And more release notes updates...
[skip ci]
2022-12-05 09:48:30 +01:00
Bram Matthys 24b3532a83 Update release notes
[skip ci]
2022-12-05 09:24:37 +01:00
Bram Matthys 44306b597d Update release notes for 6.0.5 2022-12-05 09:10:50 +01:00
Bram Matthys 44394e2f35 Update README.md
Get rid of the basic instructions, as people should really follow the installation
guide on the wiki. Too often we see people using these half-instructions (since
they are not fully complete) and get themselves into trouble.
2022-12-01 17:17:11 +00:00
Bram Matthys 6fe5630b1c BuildBot: update cipherscan profiles (all new baseline now? makes it easy..) 2022-11-27 17:44:45 +01:00
Bram Matthys ee1f8d84a0 Require TLSv1.2 or later and require a modern cipher with forward secrecy.
This also fixes a bug with OpenSSL 3.x where, when the ircd was
configured to still allow old TLSv1.0 / TLSv1.1, it would still
only allow TLSv1.2+.

But, as said, allowing TLSv1.0/TLSv1.1 is now no longer the default.

See release notes for more information or the documentation at
https://www.unrealircd.org/docs/TLS_Ciphers_and_protocols
2022-11-27 17:04:22 +01:00
Bram Matthys cfea8b32f0 BuildBot: install modules after and not before 'make install',
and check exit status
2022-11-27 16:16:06 +01:00
Bram Matthys 5ee4c503a7 Update release notes 2022-11-18 18:39:51 +01:00
Bram Matthys 419fff13ec Mention that websocket users must now load the webserver module too.
Reported by PeGaSuS in https://github.com/unrealircd/unrealircd/pull/234
2022-11-18 18:37:37 +01:00
Bram Matthys c756c87be2 Update blacklist::reason changing the $variables there.
This changes the work of commit 2cf60f66a3.
    $ip: IP address of the banned user
    $server: name of the IRC server
    $blacklist: name of the blacklist block (eg. xyz for blacklist xyz { })
    $dnsname: the blacklist::dns::name
    $dnsreply: DNS reply code

Previously there was a $name which was ambigious in the sense that
it could mean blacklist name or dns name, now we simply avoid using
$name altogether and use $dnsname and (new) $blacklist.
2022-11-18 12:25:30 +01:00
Bram Matthys 475fe46d95 Add 6.0.4.2 release notes. 2022-11-18 10:34:52 +01:00
Ron Nazarov 4999ae408c Add TLINE command
Suggested by PeGaSuS in https://bugs.unrealircd.org/view.php?id=6174
2022-11-18 08:53:36 +00:00
Bram Matthys ea5c3922ad Update Makefile.windows for src/modules/svslogin.c
Related to previous commit 1a4b701776
2022-11-14 08:45:33 +01:00
Valerie Pond 1a4b701776 SVSLOGIN: Move to its own file
Moved SVSLOGIN command to its own file.
2022-11-14 07:43:43 +00:00
alice b3f0165773 Adjust tkl too broad ban detection to avoid banning too-wide IPv6 masks.
This adjusts the test to disallow a ban on *@*:*:*:*:*, to bring it into line with similar behaviour for IPv4.
2022-11-14 07:23:55 +00:00
westor 2cf60f66a3 Add on blacklist module two extra variables
Added the ability to specify `$name` and `$reply` variables on ban reason,

`$name` would be filled with blacklist dns name data
`$reply` would be filled with blacklist dns reply data.
2022-11-14 07:21:45 +00:00
Valentin Lorentz b01caa945f Use stable 'extended-monitor' capability name
https://ircv3.net/specs/extensions/extended-monitor was ratified
yesterday: https://github.com/ircv3/ircv3-specifications/pull/508
2022-11-14 07:19:43 +00:00
Valentin Lorentz a7716f8981 Add support for the stable 'bot' mtag
https://ircv3.net/specs/extensions/bot-mode was ratified a few months ago
(https://github.com/ircv3/ircv3-specifications/pull/495)

This commit keeps the draft mtag in addition to the stable one, for now.
2022-11-14 07:19:21 +00:00
Bram Matthys 2d61cded0d Show jansson library version in boot screen and elsewhere IF library version
is 2.13 or newer, as this requires jansson_version_str().

And no, we don't use macro's (eg JANSSON_MAJOR_VERSION). We never do that for
any of the displayed library versions (OpenSSL, libsodium, c-ares, curl, etc)
as macro's only reflect the compile-time library version and not runtime,
and thus are misleading... which can be especially problematic in case of a
security issue. So good that jansson added this function.
2022-11-04 14:16:50 +01:00
Bram Matthys 7a5f83e0b6 Make REHASH always asynchronous (done in the main loop).
This means it is safe to REHASH from modules now, which means
issuing a REHASH from a websocket connection is now possible.
2022-11-04 12:43:02 +01:00
Bram Matthys c3824ad47d Fix potentially sending invalid data over websockets on REHASH.
This makes websocket_common unload last (and near-last: rpc & websocket)
and makes us call Mod_Init for these three modules first.
This way, the period where the websocket handler is unavailable is kept
to a minimum.

This also renames the ModuleSetOptions option MOD_OPT_UNLOAD_PRIORITY
to MOD_OPT_PRIORITY since it dynamically changes the module priority
in the list. For 6.x compatibility, MOD_OPT_UNLOAD_PRIORITY can still
be used.
2022-11-04 10:54:53 +01:00
Bram Matthys 02285f468d Update Turkish example conf & help conf
Provided by Diablo - (Serkan Sepetçi)
2022-10-21 13:42:24 +02:00
Bram Matthys 3de3087c95 Fix read-after-free when linking in a server (that is fully authenticated)
when there is already another established link with a server with the same name.
For example, when there is a network issue and the "old server" is still
waiting to be timed out and the "new server" is already linking in.
2022-10-01 08:48:44 +02:00
Bram Matthys 8b0b3d70ff Fix crash on REHASH with server linked (6.0.5-git only, due to websocket split) 2022-09-26 15:17:27 +02:00
Bram Matthys 8bed87e369 Port 6.0.4.1 release notes which is basically cherry picking
commit 0e6fc07bd9 and
commit 0d139c6e7c from 6.0.5-git
2022-08-29 10:12:06 +02:00
Bram Matthys dc55c3ec9f Add CALL_CMD_FUNC(cmd_func_name) and use it.
This is only for calls within the same module, as otherwise you
should use do_cmd().

Benefit of this way is that it is short and you don't have to worry
about passing the right command parameters, which may change over time.
Example as used in src/modules/nick.c:
-               cmd_nick_remote(client, recv_mtags, parc, parv);
+               CALL_CMD_FUNC(cmd_nick_remote);
2022-08-28 09:04:12 +02:00
Bram Matthys 4e5598b6cf Create and use new CALL_NEXT_COMMAND_OVERRIDE() instead of CallCommandOverride().
This is an easier way to call the next command override handler from command
override functions. It passes the standard parameters so you don't have to
worry about which parameters a CMD_OVERRIDE_FUNC() contains.
This so it is easier to change command parameters in future UnrealIRCd versions,
should it be needed, then it may be possible without any source code changes
on the module developer side.

-       CallCommandOverride(ovr, client, recv_mtags, parc, parv);
+       CALL_NEXT_COMMAND_OVERRIDE();
2022-08-28 08:52:51 +02:00
Bram Matthys 24e3d39aea Update windows setup.h for last change.
[skip ci]
2022-08-20 14:06:54 +02:00
Bram Matthys 401ab6f5a1 Make strlncpy() and strlncat() use strlncat() instead of strlen().
This fixes a possible crash when using RPC with unix domain sockets,
reported by Valware.

This also adds a configure check so we use our own strlncat if the
C library does not have one, e.g. some non-Linux.
2022-08-20 13:50:19 +02:00
Bram Matthys 3ca99ddd52 Fix JSON-RPC response, should be in "result" and not in "response".
This breaks all the current script(s) that depend on it, of course,
but makes us correctly conform to the JSON-RPC specification.
Reported by Valware.
2022-08-17 16:56:33 +02:00
Bram Matthys 0d139c6e7c Make /INVITE bypass (nearly) all channel mode restrictions, as it used to be
and as it should be IMO. Both for invites by channel ops and for OperOverride.

This also fixes a bug where an IRCOp with OperOverride could not bypass +l
and other restrictions. Only +b and +i could be bypassed.

Module coders: HOOKTYPE_OPER_INVITE_BAN is now gone and HOOKTYPE_INVITE_BYPASS
is now new. The HOOKTYPE_INVITE_BYPASS is called when the user is joining
a channel to which they were invited to. If you return HOOK_DENY there then
the join is still blocked, otherwise it is allowed.
Using this hook would be sortof unusual since usually you would want users
to be able to bypass restrictions when they were invited by another user
or when they invited themselves using OperOverride.
The only example where we use it in UnrealIRCd is for +O channels so an
IRCOp cannot use OperOverride to join +O channels when they would otherwise
not be allowed to do so. Actually even that is a corner case that you could
debate about, but.. whatever.
2022-08-06 15:52:16 +02:00
Bram Matthys 55c52c3693 Log file (log::destination::file) now creates directory structure if needed.
You could already have something like:
log { source { !debug; all; } destination { file "ircd.%Y-%m-%d.log"; } }
But now you can also have:
log { source { !debug; all; } destination { file "%Y-%m-%d/ircd.log"; } }

This is especially useful if you output to multiple log files and then
want them grouped by date in a directory.
2022-08-05 13:02:19 +02:00
Bram Matthys 0e6fc07bd9 Update verify_link() to return rather than set the link block in a variable.
Hopefully this fixes a crash when linking (succesfully authenticated) servers,
something which only happens with GCC and only for some people in some cases.
2022-08-03 14:55:37 +02:00
Bram Matthys 7267d81278 RPC: add spamfilter.list and spamfilter.add calls. 2022-08-02 09:28:09 +02:00
Bram Matthys 574419a607 For JSON spamfilter output: add "ban_duration" and "ban_duration_string" 2022-08-02 09:21:36 +02:00
Bram Matthys eb9aff4c1c RPC: user.get: use JSON_RPC_ERROR_NOT_FOUND if user is not found. 2022-08-02 08:31:46 +02:00
Bram Matthys b079aa3498 RPC: Fix "id" not showing up in error responses.
rpc_error() and rpc_error_fmt() were called with a NULL request.
This also fixes logging of RPC errors to show the name of the RPC call.
2022-08-02 08:30:03 +02:00
Bram Matthys 6749ab4e0c RPC: server_ban: add handling of "expire_at".
Was previously always setting expiry to 5 seconds as a placeholder/TODO.
2022-08-02 08:22:28 +02:00
Bram Matthys 970cd60698 Use timestamp_iso8601() from server-time module (less duplicate code). 2022-08-02 08:13:49 +02:00
Bram Matthys 8fae1d9306 Show mode parameters when an IRCOp does MODE #channel, that is:
for a channel they are not in, if they have the channel:see:mode:remote
permission. This permission is included in all operclasses by default,
just like how this is already the case for channel:see:mode:remotebanlist
and other related permissions.

Reported by alice.
2022-07-03 09:07:45 +02:00
Bram Matthys bfcde12338 Fix internal function convert_regular_ban() to actually use the buffer
that it was provided. Duh!

(bug introduced 2 days ago in 7371498ffd)
2022-07-03 08:58:32 +02:00
Bram Matthys 514a1f6430 Clean up the listener code (code deduplication 3x -> 1x helper) and
also fix a small memory leak on rehash due to listener->webserver not
being freed.

Hopefully this doesn't break anything ;)
2022-07-02 08:27:00 +02:00
Bram Matthys 7371498ffd Make auto-expansion work for IPv6 bans as well: +b A:B:C:IP -> *!*@A:B:C:IP.
Reported by armyn in https://bugs.unrealircd.org/view.php?id=6147

This also adds a new function convert_regular_ban() which is now
used by both clean_ban_mask() and extban_conv_param_nuh().
2022-07-01 10:13:57 +02:00
Bram Matthys 8703d883dd Fix crash with ip change vs 'connect-flood' module. 2022-06-28 17:28:44 +02:00
Bram Matthys a3fb6bc07b Remove leftover of a copypaste in json_expand_tkl() causing a memory leak. 2022-06-27 10:51:15 +02:00
Bram Matthys c85f666fed Fix server_ban_parse_mask() returning with variables set to local storage.
More precise, for extended server bans, usermask/hostmask was set to
a local variable that was not defined as static char[]. This would lead
to corrupt data and/or crashes.

Bug introduced a few days ago with 3d9b7e4b70
2022-06-27 10:49:46 +02:00
Bram Matthys 1d701cb7d4 Remove old "TODO" item in conf file.
[skip ci]
2022-06-25 09:52:15 +02:00
Bram Matthys 29dc2e1e47 Fix REMOTE_CLIENT_JOIN not showing up for remote joins.
There was log code for "JOIN" but not for "SJOIN". Added now.
Reported by ComputerTech in https://bugs.unrealircd.org/view.php?id=6141
2022-06-25 09:17:07 +02:00
Bram Matthys c60fdad7eb RPC: add server_ban.add
This also moves some of the adding code (sending notice, broadcasting to
other servers, etc) to a function tkl_added().

We should probably do the same for deletion and not use the tkllayer
anymore for that?
2022-06-24 19:49:32 +02:00
Bram Matthys 2c1457ae6b RPC: add server_ban.del 2022-06-24 19:18:39 +02:00
Bram Matthys 3d9b7e4b70 RPC: remove tkl, split this up.. starting with server_ban.
Currently available:
* server_ban.list
* server_ban.get with params: name="*@1.2.3.4", type="kline"

This also adds server_ban_parse_mask() which is now used by both GLINE/etc
and the RPC API to parse the same way and convey the same error messages.
2022-06-24 18:53:10 +02:00
Bram Matthys 6596741638 Add rpc.modules.default.conf, loads all required modules for JSON-RPC. 2022-06-24 13:44:41 +02:00
Bram Matthys d3697b8684 RPC: add tkl.list 2022-06-24 13:33:20 +02:00
Bram Matthys 36946c6c51 Move JSON stuff from log.c to json.c now that it is more universal. 2022-06-24 13:21:27 +02:00
Bram Matthys 14215e1837 Fix two memory leaks in RPC:
* on REHASH rpc-user block name was not freed
* temporary construct was not freed (if params was missing)
2022-06-22 14:54:51 +02:00
Bram Matthys fdf0d545d7 Split rpc_client_handshake() into rpc_client_handshake_unix_socket()
and rpc_client_handshake_web().

Makes the code easier to follow / less chance of mistakes.
2022-06-22 13:53:56 +02:00
Bram Matthys 25d5ae93e6 Do some sanity checking in webserver (fixes crash) 2022-06-22 13:45:54 +02:00
Bram Matthys faffe7c9a8 Fix crash in webserver 2022-06-21 17:56:25 +02:00
Bram Matthys 7c8918e22d Update rpc_error() to use JsonRpcError (enum) and add more error values. 2022-06-20 19:02:52 +02:00
Bram Matthys b38b0f5086 Set loop.config_state to one of CONFIG_STATE_* so modules (and core)
can track at what step we are during configuration file and module
processing.
2022-06-20 12:54:22 +02:00
Bram Matthys 0a4c6e877d Fix crash if 'websocket' is loaded without 'websocket_common'.
Previously we did show a warning but we could crash a millisecond
later so that wasn't particularly helpful.
Now, is_module_loaded() can be used from HOOKTYPE_CONFIGPOSTTEST
to detect if a module is loaded or not, contrary to us having to
do it in MOD_LOAD when it is too late. So now the requirement is
really enforced and also works for hot-loading as well as
unloading of required modules is now prevented.
2022-06-20 08:54:53 +02:00
Bram Matthys a14609f493 Fix small memory leak in webserver. 2022-06-20 08:25:46 +02:00
Bram Matthys 26ab79132b Fix memory leak in webserver for HTTPS POST. 2022-06-19 20:47:48 +02:00
Bram Matthys bbf9600504 Mention JSON-RPC documentation in early release notes.
https://www.unrealircd.org/docs/JSON-RPC
[skip ci]
2022-06-19 20:28:51 +02:00
Bram Matthys 1fe6119026 Make tld::motd and tld::rules optional.
Suggested by Jellis in https://bugs.unrealircd.org/view.php?id=6072
2022-06-19 20:15:00 +02:00
Bram Matthys 55387a8aa4 RPC: Fix strchr() on non-nul-terminated string (leading to OOB read) 2022-06-19 17:59:05 +02:00
Bram Matthys 85784e8118 Bump version to 6.0.5-git 2022-06-19 16:30:50 +02:00
Bram Matthys 8b2caf5501 Make listen::options::rpc implicitly enable TLS, so nobody
accidentally allows JSON-RPC over insecure HTTP.
2022-06-19 16:17:15 +02:00
Bram Matthys 5301ab5be8 Add some TODO items 2022-06-19 13:13:33 +00:00
Bram Matthys 941439a710 Use RPC_CALL_FUNC() just like how we have CMD_FUNC() 2022-06-19 13:13:33 +00:00
Bram Matthys c24a8e43e3 Fix outdated doxygen information on CMD_FUNC() 2022-06-19 13:13:33 +00:00
Bram Matthys f99085fc03 RPC: add user.get() 2022-06-19 13:13:33 +00:00
Bram Matthys 0e60b8bbfb RPC: Add ?username=xyz&password=zzz authentication as well
FIXME: move URI parsing to 'webserver' and deal with unescaping %xx
2022-06-19 13:13:33 +00:00
Bram Matthys c611f18d56 RPC: Add rpc-user { } block and do authentication 2022-06-19 13:13:33 +00:00
Bram Matthys ab999659fc Remove some FIXME's and cleanup code a little bit. 2022-06-19 13:13:33 +00:00
Bram Matthys feb2c9c418 Don't print "Link to server [..] closed" for RPC and control sockets. 2022-06-19 13:13:33 +00:00
Bram Matthys e718d2021f Make websocket work over RPC 2022-06-19 13:13:33 +00:00
Bram Matthys 853f0685ed Split off big chunk of websocket module into websocket_common module.
And load the websocket_common module by default (which is just an API).
2022-06-19 13:13:33 +00:00
Bram Matthys 7679ec7920 Get rid of cast, do things properly. 2022-06-19 13:13:33 +00:00
Bram Matthys 0eb42155dd Limit request body to 4k by default. 2022-06-19 13:13:33 +00:00
Bram Matthys 3e35b8e96a Small code cleanup 2022-06-19 13:13:33 +00:00
Bram Matthys 467e3d847a Handle chunked encoding in webserver (mostly meant for RPC). 2022-06-19 13:13:33 +00:00
Bram Matthys 4a68008b81 Rename some more:
* WEB() now has handle_request() and handle_body(), makes more sense.
* webserver_handle_body_data() -> webserver_handle_body()
* and similar cases
2022-06-19 13:13:33 +00:00
Bram Matthys 12f2cd8555 Rename webserver_handle_body_data() -> webserver_handle_request_body() 2022-06-19 13:13:33 +00:00
Bram Matthys 9afdcb7ff0 Add request body handler in webserver -- only a beginning, the
chunked encoding stuff is copied from the modulemanager and #if'd out.
The non-chunked is not OK yet either, as it must check the Content-Length,
while we currently assume a single packet == the complete request.
2022-06-19 13:13:33 +00:00
Bram Matthys cf60b22b31 Close RPC web connection immediately when all has been sent. 2022-06-19 13:13:33 +00:00
Bram Matthys f9794c7ed5 Make RPC API work over HTTP(S). Well, first steps, anyway.
* No ACL checking yet
* No chunked encoding support
* No multi-frame support
etc...
2022-06-19 13:13:33 +00:00
Bram Matthys b710fb188b Add get_nvplist() function.
Requested by westor in https://bugs.unrealircd.org/view.php?id=6125
2022-06-19 13:13:33 +00:00
Bram Matthys 5e81a6ee67 Add listener->start_handshake function pointer.
This is start_of_normal_client_handshake() by default, but is
start_of_control_client_handshake() for the control channel
(for './unrealircd rehash' and such). Previously that was hardcoded.

It is also used by the RPC code now.
2022-06-19 13:13:33 +00:00
Bram Matthys 2bf41a47d2 Don't check for connect-flood on RPC connections.
Same for control channel, even though it was harmless to check,
still... can now skip it so why not?
2022-06-19 13:13:33 +00:00
Bram Matthys 46588db89a Fix rehash crash since adding RPC code. 2022-06-19 13:13:33 +00:00
Bram Matthys 2c8fc5e641 Move special handling of control socket to procio_server.c.
Things like setting the client->status to CLIENT_STATUS_CONTROL
and list_add(&client->lclient_node, &control_list);

This does mean that we now add clients earlier to the unknown list,
even ones that are going to be control sockets and clients that are
going to be z-lined etc, but it should be a minimal performance hit
since it are just 1-4 insertions in a circular list.
At the same time it makes the code more cleaner and more maintainable
especially with all the "special cases" and such that are there now
and will only become more and more...
2022-06-19 13:13:33 +00:00
Bram Matthys df8c5cfd76 Add ability to skip connect-flood and zlined checks via listener->options
with LISTENER_NO_CHECK_CONNECT_FLOOD and LISTENER_NO_CHECK_ZLINED.
2022-06-19 13:13:33 +00:00
Bram Matthys 29eb89a528 Attach client->local->listener to a client very early, now that it is safe.
This makes other code safer as well since they can assume that if the
client is local (client->local) that the listener (client->local->listener)
is non-NULL and safe to access until the client is completely destroyed.
2022-06-19 13:13:33 +00:00
Bram Matthys 1d613a592c Remove freeing of client->local->listener and refdec from exit_client()
to free_client().
2022-06-19 13:13:33 +00:00
Bram Matthys 60c83b4ba1 Move connect-flood and max-unknown-connections-per-ip into their own module.
These deal with set::anti-flood::everyone::connect-flood and
set::max-unknown-connections-per-ip respectively.

This adds a new hook HOOKTYPE_ACCEPT, that is mostly meant for internal
usage by UnrealIRCd. Most module coders will want to use the existing
hook HOOKTYPE_HANDSHAKE instead.

This also gets of check_banned() which is now spread over the individual
modules (eg: checking banned is done in tkl on HOOKTYPE_ACCEPT and
HOOKTYPE_IP_CHANGE).
2022-06-19 13:13:33 +00:00
Bram Matthys a09d4a7e88 Add CLIENT_STATUS_RPC and add SetRPC() and IsRPC(). 2022-06-19 13:13:33 +00:00
Bram Matthys 6b30482c04 Don't apply registration timeout to *NIX domain socket connections.
May want to reconsider this but.. for now..
2022-06-19 13:13:33 +00:00
Bram Matthys 1830f3e53f Add RPC channel.list call to show list of channels (with all details) 2022-06-19 13:13:33 +00:00
Bram Matthys 61ba3727df JSON-RPC: Use proper error response with error codes according to
the official specification (one of JSON_RPC_ERROR_*).

Add proper rpc_error() and rpc_error_fmt()

Don't steal reference in rpc_response().
2022-06-19 13:13:33 +00:00
Bram Matthys 4cd520d327 Make user.list() RPC API return a list of all users with details.
This is the 1st RPC API call that actually works :D
2022-06-19 13:13:33 +00:00
Bram Matthys 31fc2843a2 Add "rpc" module. Supports parsing from *NIX domain sockets for starters. 2022-06-19 13:13:33 +00:00
Bram Matthys 53732e0f78 Warn if 'websocket' module is loaded without 'webserver' (= won't work). 2022-06-19 13:13:33 +00:00
Bram Matthys b9d1af8fa0 Call config run hooks for CONFIG_LISTEN and CONFIG_LISTEN_OPTIONS also
for unix domain sockets.
2022-06-19 13:13:33 +00:00
Bram Matthys 0134c435d5 Don't apply handshake-delay to any *NIX domain socket connections,
instead of only exempting *NIX domain socket control channels.
2022-06-19 13:13:33 +00:00
Bram Matthys cbfcfa1428 Create src/modules/rpc directory 2022-06-19 13:13:33 +00:00
Bram Matthys 97c8274695 Add RPC API (the beginning..) 2022-06-19 13:13:33 +00:00
Bram Matthys 2397fb8a49 Split 'websocket' module up in 'webserver' and 'websocket' 2022-06-19 13:13:33 +00:00
Bram Matthys 0c32151be1 Sort modes returned by "MODE #channel" (request) 2022-06-18 15:08:45 +02:00
alice 4b72f375f8 Update help.conf to include ~security-group extban (#220) 2022-06-17 15:06:01 +00:00
Bram Matthys 3a354c3410 Fix some typos in markdown of release notes.
[skip ci]
2022-06-17 13:59:39 +02:00
Bram Matthys 88190d08c4 ** UnrealIRCd 6.0.4 ** 2022-06-17 13:33:13 +02:00
Bram Matthys 8ea7fcfc9f Fix tld::mask not working with the new form.
Reported by musk.
2022-06-08 08:22:14 +02:00
Bram Matthys b5f35dfff5 Fix regular users being able to -o a service bot (that has umode +S).
Reported by ComputerTech in https://bugs.unrealircd.org/view.php?id=6126

HOOKTYPE_MODE_DEOP wasn't called.
2022-06-08 07:37:03 +02:00
Bram Matthys 8fe7b1bc41 Fix wrong security-group example in release notes for auto oper up.
This should be:
security-group Syzop { certfp "1234etc."; }
As this is wrong:
security-group Syzop { mask { certfp "1234etc."; } }

Reported by Han`.

This also makes us throw a config error on the wrong case.
2022-06-05 08:42:05 +02:00
Bram Matthys 28d3875aa9 Make variables in set::reject-message and other buildvarstring() usage
no longer expand shorter versions of a variable. It previously had some
unintended form of magic autocomplete where $serv was handled the same
way as if it was $server. This could cause issues in the long run when
variables are added and the meaning of the short form changes.

Reported by westor in https://bugs.unrealircd.org/view.php?id=6123
2022-06-05 08:17:06 +02:00
Bram Matthys 020c3d1fa3 ** UnrealIRCd 6.0.4-rc2 ** 2022-06-03 18:48:52 +02:00
Bram Matthys 1311c8a963 Fix connthrottle message when throttling (bug introduced in 6.0.4-rc1).
Reported by westor in https://bugs.unrealircd.org/view.php?id=6121
2022-06-01 08:49:35 +02:00
Bram Matthys d5989695e8 Remove last global 'buf' variables. This was already done a lot in time
but it seems there were still a couple left. These are now gone as well.
There seem to be no issues with the ones that were left, but it is just
too easy to get it wrong. Declaring buf in function now. This should be
faster anyway, since it is located on nearby memory (stack).

Inspired by previous find from westor (c708a99955c034e842f913479cc597d87b311394).
2022-06-01 08:34:48 +02:00
Bram Matthys d3f655cb63 Fix space stripping at end of connect and disconnect message, in the
"extended_client_info". Was a typo, 'buf' vs 'retbuf'.
Reported by westor in https://github.com/unrealircd/unrealircd/pull/217
2022-06-01 08:21:03 +02:00
Bram Matthys 731adb308d set::restrict-commands: better error message if you use the same command twice (or more) 2022-05-30 13:05:04 +02:00
Bram Matthys 6ef1a6a708 Update set::antirandom example in modules.optional.conf.
Use the new options in the new ::except block, fix broken English
and trim down the text a bit.
This also lowers the threshold from 7 to 6. It was already 5 in
the example block on the wiki, now the wiki and this are the same
again.
2022-05-30 12:59:44 +02:00
Bram Matthys b4f6c83821 Fix multiline log messages not working, they showed up as single lines
with their content added together.
2022-05-30 08:59:44 +02:00
Bram Matthys c8ef9b2740 Fix set::restrict-commands::except not working. Reported by Rain. 2022-05-29 15:13:12 +02:00
musk cb9ffd9e17 Update example.fr.conf (#216) 2022-05-29 12:27:29 +00:00
musk dc5a7326cd Update example.es.conf (#215)
Add translation of channel history block.
2022-05-29 06:23:34 +00:00
Bram Matthys b183a3ea7a Add -Wno-format-overflow as unfortunately this option is too dumb.
Eg it warns on sprintf() usage even if there is a strlen() check right above it.

Fixes compile warning on Ubuntu 22.04 / GCC 11.
2022-05-28 18:13:35 +02:00
Bram Matthys 965bfa441b Crash reporter: use fclose() and not pclose() since this particular
file descriptor was opened by fopen() and not popen().
Fixes compile warning on Ubuntu 22.04 / GCC 11.
[skip ci]
2022-05-28 18:00:24 +02:00
Bram Matthys 2f31a8800b Add missing blacklist { } blocks to example.fr.conf
copy-paste from the English one, pending translation by... someone.
[skip ci]
2022-05-28 08:06:26 +02:00
Bram Matthys 0495953f55 Update example.tr.conf with 6.0.4 example.conf.
Note that set::conthrottle::except needs a new translation,
and CHANNEL HISTORY needs translation too.
[skip ci]
2022-05-28 08:01:14 +02:00
Bram Matthys 54a2645f21 Update example.fr.conf with 6.0.4 example.conf.
Note that various parts are now in English, pending translation to French.
[skip ci]
2022-05-28 07:59:15 +02:00
Bram Matthys a18316a737 Update example.es.conf with 6.0.4 example.conf.
Note that set::conthrottle::except needs a new translation,
and CHANNEL HISTORY needs translation too.
2022-05-28 07:58:19 +02:00
Bram Matthys 25e7142716 Re-indent this monster (example.es.conf)
[skip ci]
2022-05-28 07:47:43 +02:00
ZarTek @ CREOLE bd7b90354d Remove .asc file after ./unrealircd upgrade (#212) 2022-05-27 14:35:10 +00:00
Bram Matthys 9c8cd52057 Add the oper auto-login example to release notes
[skip ci]
2022-05-26 21:15:56 +02:00
Bram Matthys d47fdbede4 Add oper::auto-login. When set to yes, opers are automatically logged in
if the oper block permits, the user does not have to send "OPER xyz".

Eg:
security-group Syzop { certfp "xyz"; }
oper Syzop {
	auto-login yes;
        mask { security-group Syzop; }
        operclass netadmin-with-override;
        class opers;
}

Then, if you connect with SSL with that certificate fingerprint,
you become IRCOp automatically.
2022-05-26 21:01:13 +02:00
Bram Matthys c183c06d06 Move HOOKTYPE_LOCAL_CONNECT slightly further down.
[skip ci]
2022-05-26 20:56:36 +02:00
Bram Matthys 96897289e0 Allow oper block without password, now that you can use security-group
and other selectors in 'mask'. This allows for things like:

security-group Syzop { certfp "xyz"; }

oper Syzop {
	mask { security-group Syzop; }
	operclass netadmin-with-override;
	class opers;
}

except ban {
	mask { security-group Syzop; }
	type all;
}

allow {
	mask { security-group Syzop; }
	class special;
	maxperip 32;
}

etc...

We do error on the obvious case of mask * and mask *@* when no password
is set, but otherwise try not to stop all cases of user stupidity
(there are just too many...).
2022-05-26 20:31:28 +02:00
Bram Matthys a4902e121c Fix crash when using 'account' in 'except ban'. 2022-05-26 17:31:45 +02:00
Bram Matthys 960c3cc1c1 And a similar fix for multi account, eg security-group xyz { account { a; b; c; } } 2022-05-26 17:21:30 +02:00
Bram Matthys fba0249ec3 Fix for when using security-group xyz { security-group { a; b; c; } } 2022-05-26 17:11:47 +02:00
Bram Matthys c9f8c42281 Fix CIDR not working in match { ip ....; } 2022-05-26 17:03:17 +02:00
Bram Matthys 6802156c02 Document channel history in example.conf as persistent history is likely
something people would want to enable, and perhaps the limits tweaked too.
Suggested by ZarTek-Creole in https://github.com/unrealircd/unrealircd/pull/211
2022-05-26 08:25:34 +02:00
Bram Matthys 82063a48ec Use single quotes in set::webredir::url example.
Suggested by ZarTek-Creole in https://github.com/unrealircd/unrealircd/pull/208
2022-05-26 07:36:11 +02:00
Bram Matthys fe11f77be6 Fix +H not working in set::modes-on-join.
Reported by ZarTek-Creole in https://bugs.unrealircd.org/view.php?id=6114

We now call HOOKTYPE_LOCAL_CHANMODE on the modes we set in modes-on-join,
where 'client' is '&me'. Should be fine, as we already did the same for
+P modes (indirectly) in channeldb.
2022-05-26 07:14:12 +02:00
Bram Matthys 1548137e31 Document SVSO being back again :) 2022-05-25 20:29:09 +02:00
Bram Matthys d1311a124b Make ./Config import settings from 6.0.3 2022-05-25 18:27:10 +02:00
Bram Matthys 3936059768 ** UnrealIRCd 6.0.4-rc1 ** 2022-05-25 17:14:32 +02:00
Bram Matthys c86e5a3c2d Fix memory leak on REHASH when using parameter modes in set::modes-on-join 2022-05-25 16:52:41 +02:00
Bram Matthys 4deeec015b Fix small memory leak in extban API (when unloading module) 2022-05-25 16:46:34 +02:00
Bram Matthys ce6be5df61 Reputation was synced correctly on IP basis (and thus the databases)
across servers if they differed, however the individual IP of users
was not updated until next add_scores() run. So, there would be an
up to 5 minute delay during which scores for individual users were
possibly too low, with all the effects that it could possibly have
nowadays such as restrict-commands, more stringent flood limits, etc.

If your servers are all linked all the time then you would not have
noticed this issue. It mostly matters if you are linking in a new
server or if the server has been delinked or out of order for days
or weeks.
2022-05-25 16:40:06 +02:00
Bram Matthys 9ed38c437a Fix crash on Windows when using the "Rehash" GUI option.
Reported by CaoS in https://bugs.unrealircd.org/view.php?id=6087
[skip ci]
2022-05-25 16:00:58 +02:00
Bram Matthys b28d8aecd7 Add "ip" to mask item and security-group for easy matching on IP.
So you can just use mask { ip { 127.*; 192.168.*; } } without
having to worry about hostnames like 127.example.net.
(Of course you could also have used CIDR notation)

Another benefit is that, since we are dealing with IP's only,
the matching is faster than going through the more universal
match_user() routine.
2022-05-25 08:34:22 +02:00
Bram Matthys 7ff4a3e897 Add the promised support of security group functionality in except ban { }
So now the example in the release notes actually works:
except ban {
    mask { security-group irccloud; }
    type { blacklist; connect-flood; handshake-data-flood; }
}
2022-05-25 08:01:05 +02:00
Bram Matthys d8ff86e739 Fix for compiling on Windows
[skip ci]
2022-05-23 18:48:10 +02:00
Bram Matthys 3ee199fb6f Makefile.windows: add securitygroup.obj
[skip ci]
2022-05-23 17:42:43 +02:00
Bram Matthys b6843488a9 Update release notes
[skip ci]
2022-05-23 14:29:49 +02:00
Bram Matthys b4ac25fba6 Update release notes with all the work that has been done.
[skip ci]
2022-05-23 14:25:40 +02:00
Bram Matthys e8fbe461f0 Document JSON logging changes of today
[skip ci]
2022-05-23 12:56:21 +02:00
Bram Matthys 35b2579dcb Fix compiler warning 2022-05-23 12:55:48 +02:00
Bram Matthys 60eba7c501 Add to JSON logging output, for users: "channels"
The list of channels (which is an array) is limited to a total
of 384 characters after JSON expansion. If it is limited then
the last item will be "...".
2022-05-23 12:45:27 +02:00
Bram Matthys 7280ffdc57 Add to JSON logging output, for users: "idle_since".
Suggested by westor in https://bugs.unrealircd.org/view.php?id=6083

For technical reasons this field is only available for local users.
2022-05-23 11:53:58 +02:00
Bram Matthys af8418fb3e Add to JSON logging output, for users: "vhost" and "cloakedhost"
Suggested by westor in https://bugs.unrealircd.org/view.php?id=6083

The "vhost" field is added if the visible host of the user differs
from the real hostname, such as +x with cloaking or +xt with a vhost.

The "cloakedhost" is always included, even if the user does not
currently have a cloaked host at all (eg is -x or using a vhost).

Both make it easier to search log files based on user reports.
Eg a user mentions a vhost or cloaked host from their user logs
and then a server admin searches the UnrealIRCd logs on this to
retrieve the real host / ip / user based on that.
2022-05-23 11:31:56 +02:00
Bram Matthys c04ad96357 Add to JSON logging output: "geoip" with subitem "country_code".
Suggested by westor in https://bugs.unrealircd.org/view.php?id=6083

(It is not under "user" because the info can be useful before someone
 is considered a user, eg when flooding/rejected/etc)
2022-05-23 11:20:59 +02:00
Bram Matthys 0f7555e4c5 Add to JSON logging output: "tls" with subitems "cipher" and "certfp".
Suggested by westor in https://bugs.unrealircd.org/view.php?id=6083

(It is not under "user" because it is for servers too)
2022-05-23 11:07:08 +02:00
Bram Matthys 16264e944f Add HOOKTYPE_JSON_EXPAND_CLIENT etc. so modules can add more fields when
clients etc. are expanded in the logging routines.

HOOKTYPE_JSON_EXPAND_CLIENT - for all clients
HOOKTYPE_JSON_EXPAND_CLIENT_USER - for clients that are users
HOOKTYPE_JSON_EXPAND_CLIENT_SERVER - for clients that are servers
HOOKTYPE_JSON_EXPAND_CHANNEL - for channels
2022-05-23 11:02:05 +02:00
Bram Matthys 7740d64042 Limit individual JSON strings to 512 bytes and call StripControlCodes()
on each string. Note that the entire JSON dump may still be much larger,
this is just about each individual string item within an object.

This commit also adds a more flexible StripControlCodesEx() function
to the core (which is used by the logging system), the existing
StripControlCodes() function is unchanged and can still be used.

+/** Strip color, bold, underline, and reverse codes from a string.
+ * @param text                 The input text
+ * @param output               The buffer for the output text
+ * @param outputlen            The length of the output buffer
+ * @param strip_all_low_ascii  If set to 1 then all ASCII < 32 is stripped
+ *                             (the ASCII control codes), otherwise we only
+ *                             strip the IRC control- and color codes.
+ * @returns The new string, which will be 'output', or in unusual cases (outputlen==0) will be NULL.
+ */
+const char *StripControlCodesEx(const char *text, char *output, size_t outputlen, int strip_all_low_ascii)
 {
2022-05-23 10:35:52 +02:00
Bram Matthys 3fbdb7fd4b Move StripControlCodes() from message.c to misc.c.
Because I need in the core (again) due to early calls / calls during
rehashes / etc...
2022-05-23 10:10:47 +02:00
Bram Matthys 8c1a858d2e Fix crash on empty set::default-ipv6-clone-mask in config file.
set { default-ipv6-clone-mask; }
2022-05-23 08:36:25 +02:00
westor 111ab9fada Show [shunned] in connect oper notice (#206)
When someone is trying to connect and he/she is shunned , it will be displayed on connection server notice, yeah sometimes it might be helpful, why not..

Suggested by armyn https://bugs.unrealircd.org/view.php?id=6106
2022-05-23 08:18:49 +02:00
Bram Matthys 9075e2fa70 Move all the security group and mask code to src/securitygroup.c 2022-05-16 13:54:52 +02:00
Bram Matthys 5d9a201df8 Don't show security-groups of ulines like NickServ (since it is irrelevant anyway).
Reported by Lord255.
2022-05-16 11:22:57 +02:00
Bram Matthys 5443dff327 Clarify in release notes that the country value is a country code
Reported by westor
[skip ci]
2022-05-16 10:46:54 +02:00
Bram Matthys c09d2e40a3 Update release notes a bit: better markdown, improve TLD example,
mention the 5 modules that now have an ::except which is also a mask item.
[skip ci]
2022-05-16 10:37:22 +02:00
Bram Matthys 2108bb48fa Run labeled-response through the quick path. 2022-05-16 09:53:23 +02:00
Bram Matthys 519d027a62 Fix geoip_base_unserialize() check being the wrong way around.
Could have caused a memory leak but likely did not happen at all
in practice.
2022-05-15 19:34:46 +02:00
Bram Matthys c037486263 Add blacklist::except for exempting users from individual blacklists,
this is a https://www.unrealircd.org/docs/Mask_item so very flexible.

Note that most people would want to use except ban { } instead to
simply exempt from ALL blacklists. (that one does not yet have the
flexible mask capability though.. but it wil have it soon..)
2022-05-15 15:13:19 +02:00
Bram Matthys fc79cbb3f0 Fix memory leak in new security group code from past 48hrs 2022-05-15 07:50:40 +02:00
Bram Matthys 0b45e34e62 Simplifly RPL_HOSTHIDDEN notification.
Pretty much everywhere we had:
0001 userhost_changed(client);
0002 if (MyUser(client))
0003         sendnumeric(client, RPL_HOSTHIDDEN, client->user->virthost);

Lines 2-3 are now integrated in userhost_changed().

Also fix two issues with CHGHOST in make_oper():
* if user was -x, modes had +x and a vhost, it would send the cloaked
  host in the original vhost, while it should have been the real host
* if user was -x and went +x without vhost (so only uncloaked to cloaked)
  then no CHGHOST message was sent at all
2022-05-15 07:45:00 +02:00
Bram Matthys b52c6406de ExtbanAdd(): remove remaining NULL checks for 'module'. It is never NULL. 2022-05-15 06:52:44 +02:00
Bram Matthys a1c8292a1d Fix incorrect sizeof() in commit from yesterday. 2022-05-15 06:49:58 +02:00
Bram Matthys c25582bff2 Mention that this is work in progress
[skip ci]
2022-05-14 19:11:53 +02:00
Bram Matthys 9e0340d4c1 Change restrict-commands to use ::except which is a
https://www.unrealircd.org/docs/Mask_item so has more functionality.

The old style config still works and UnrealIRCd won't complain
about it for now.
2022-05-14 18:50:24 +02:00
Bram Matthys 517d93bea8 Fix crash / support NULL secgroup in user_allowed_by_security_group() 2022-05-14 16:29:38 +02:00
Bram Matthys 5f3931b08d Update modules.optional.conf so it actually loads.
Also fix ::mask style II.
2022-05-14 15:40:09 +02:00
Bram Matthys 3241338cf3 Add set::connthrottle::except, which is a mask item.
Automatically convert the old options ::sasl-bypass, ::webirc-bypass
and ::minimum-reputation-score, so nobody needs to update their config.

The example.conf has been updated.
2022-05-14 15:31:30 +02:00
Bram Matthys 915b603a6a Add set::antirandom::except, which is a mask item.
Automatically convert the old style ::except-hosts and ::except-webirc
so nobody needs to update their config.
2022-05-14 15:17:29 +02:00
Bram Matthys f0ddbdaa44 Add set::antimixedutf8::except, which is a mask item too. 2022-05-14 15:07:33 +02:00
Bram Matthys 1626fda1ef Fix extbans on IRC not working due to latest changes. 2022-05-14 09:21:11 +02:00
Bram Matthys caabfe14e1 Document and give examples in release notes for new mask and security-group functionality. 2022-05-14 09:03:34 +02:00
Bram Matthys 4de3d512b8 Integrate security-group functionality in allow channel::mask and
deny channel::mask.
2022-05-14 08:36:19 +02:00
Bram Matthys e09470b0bd Integrate security-group functionality in link::incoming::mask. 2022-05-14 08:28:26 +02:00
Bram Matthys 67fdd63bc3 Integrate security-group functionality in vhost::mask. 2022-05-14 08:19:05 +02:00
Bram Matthys 8dff79ece2 Fix small memory leak on REHASH when tld block is used, ::mask was not freed.
(this leak was already there, it is unrelated to the activity of last 24hrs)
2022-05-14 08:13:53 +02:00
Bram Matthys ec4df2da7d Integrate security-group functionality in tld::mask. 2022-05-14 08:10:20 +02:00
Bram Matthys 759908ba3a Integrate security-group functionality in oper::mask. 2022-05-14 08:03:12 +02:00
Bram Matthys 510b4b5505 Integrate security-group functionality in allow::mask.
(Also call it allow::match in the future, but accept allow::mask still)

This is the first of several commits to convert all ::mask items.
See https://www.unrealircd.org/docs/Mask_item for the consequences.
In short, you can now use all of the security-group items directly
in a mask, eg:
allow {
    mask { account TrustedUser; }
    class clients;
    maxperip 10;
}
2022-05-14 07:51:51 +02:00
Bram Matthys 10bddc1232 Extended server bans are now more clearly exposed in security-group { }.
The extban module API is used behind the scenes. To the server admin
the functionality appears in a more natural way:
        account { <list>; };
        country { <list>; };
        realname { <list>; };
        certfp { <list>; };
In the same way, they appear as exclude-xxx options too:
        exclude-account { <list>; };
        exclude-country { <list>; };
        exclude-realname { <list>; };
        exclude-certfp { <list>; };

Modules can add additional fields (3rd party modules too!).

Module coders:
See src/modules/extbans/realname.c for a simple example. In short:
1) You need to register your extban in both MOD_TEST and MOD_INIT
2) Other than that, the existing rules for extended server bans apply:
   a) Your req.is_banned_events needs to include BANCHK_TKL
   b) Your req.options needs to include EXTBOPT_TKL
Be advised that for modules that are called in extended server bans
the client may be missing several fields, for example client->user could
be NULL, so be careful with accessing everything in your module.
2022-05-13 20:13:34 +02:00
Bram Matthys 378f1f0044 Split up security-group code for later code re-use. 2022-05-13 14:37:56 +02:00
Bram Matthys efa7fea88e Rename security-group::include-mask to ::mask. Both will work though for
a long long time. Change done to make it consistent with the rest.
2022-05-13 14:11:00 +02:00
Bram Matthys a544001eeb Add security-group::security-group, this as a shorthand for
security-group { mask ~security-group:xyz; }

Module coders (again, slightly unrelated):
Added unreal_add_names() function which can be used to transform
a list of names in the config to a linked list (NameList).
2022-05-13 14:07:05 +02:00
Bram Matthys 6751b066ab Prevent infinite loop (crash due to out of stack) when processing a
security group that references another (or itself), eg:
security-group abc {
	include-mask ~security-group:abc;
}
We now give up after a recursion depth of >8 and log a warning.
2022-05-13 13:37:48 +02:00
Bram Matthys de61fc4b50 Add connect-time to security-group, so you can match on how long a client has
been connected to IRC. See https://www.unrealircd.org/docs/Security-group_block

Slightly unrelated, for modules coders: new function get_connected_time(),
to see how long a client has been online. This works for local clients, in
which case it would just return TStime()-client->local->creationtime.
It also works for remote clients, for which it will use the newly added
"creationtime" moddata (commit f1a18ce37e),
so the info is only available for remote clients on newer servers.
If the info cannot be found it will return 0 (zero).
2022-05-13 13:23:02 +02:00
Bram Matthys 085490d780 Show in WHOIS in which security-group a user is in (to IRCOps only)
The set::whois-details name for this is: security-groups.
https://www.unrealircd.org/docs/Set_block#set::whois-details
By default it is shown ONLY to IRCOps, not even to 'self' for normal users.

If you want to hide it for everyone, even to IRCOps, eg because you
feel it is useless information, then you can use:
set {
        whois-details {
		security-groups { everyone none; self none; oper none; }
	}
}
2022-05-13 13:14:46 +02:00
Bram Matthys f1a18ce37e Communicate "creationtime" of users. Right now this info is only known
locally, as the only timestamp regarding users that is communicated across
the network is about the "last nick change" ("has this nick since...").
2022-05-13 12:27:21 +02:00
Bram Matthys 788c230bdc Support exclusion criteria in security groups.
Suggested by Jobe in https://bugs.unrealircd.org/view.php?id=6096

Also add support for matching a reputation below a value ("<10").

See https://www.unrealircd.org/docs/Security-group_block for info
on all of these.
2022-05-13 11:33:57 +02:00
Bram Matthys 4a03943996 Fix antirandom log message when user is denied (only showed nick).
Reported by PeGaSuS in https://bugs.unrealircd.org/view.php?id=6093
2022-05-13 08:09:46 +02:00
Bram Matthys 06c6eb164e Only validate for local users sending the tag 2022-05-13 07:56:30 +02:00
Valerie Pond 61f7dd746e Add IRCv3 +draft/channel-context (#205)
https://github.com/delthas/ircv3-specifications/blob/feature-channel/client-tags/channel-context.md
2022-05-13 07:39:41 +02:00
Bram Matthys cd48fec826 The /LICENSE command confusingly said that the UnrealIRCd license is GPLv1
or later. This updates the include/license.h file, which is used for the
/LICENSE command, to say "GPLv2 or later".

The 'LICENSE' file shipped with UnrealIRCd since at least the year 2000
has always been the GPLv2.

In the copyright headers of individual .c and .h files we have a mix of
"GPLv1 or later" and "GPLv2 or later", so "GPLv2 or later" is the common
denominator.
2022-05-11 09:23:53 +02:00
Bram Matthys b154591a58 Some source files indicated the license was "GPLv2", which was meant to
be (and is now clarified to be) "GPLv2 or later".
Reported by libsys in https://bugs.unrealircd.org/view.php?id=6099
2022-05-11 06:41:11 +02:00
Bram Matthys 537f5d050e Update HELPOP SVSO documentation, due to previous commit. 2022-05-07 19:03:25 +02:00
Bram Matthys 50e5d91c79 Add SVSO command which services can use to make someone IRCOp.
This existed in UnrealIRCd 3.2.x but was later removed when
switching to the new operclass system.
Requested by Valware in https://bugs.unrealircd.org/view.php?id=6041

Syntax: SVSO <uid|nick> <oper account> <operclass> <class> <modes> <snomask> <vhost>
All these parameters need to be set, you cannot leave any of them out,
HOWEVER some can be set to "-" to skip setting them, this is true for:
<class>, <modes>, <snomask>, <vhost>

In UnrealIRCd the <operclass> will be prefixed by "services:" if not already
present. It is up to you to include or omit it.

If you want to set any swhoises you need to use the SWHOIS s2s command,
other than that this command basically does everything for you,
in fact it uses the same code as the OPER command does.
Most of the "user is now ircop" code has been moved out of cmd_oper() to
a new function make_oper() that is called by both cmd_oper() and cmd_svso().

This function also changes the hook HOOKTYPE_LOCAL_OPER:
It no longer passes a ConfigItem_oper struct, since we can't do that for
remote opers. Instead it passes oper name and oper class.
The complete definition is now:
int hooktype_local_oper(Client *client, int add, const char *oper_block, const char *operclass);
2022-05-07 18:53:59 +02:00
Bram Matthys 84f3efc105 Fix issue with modes-on-join and +f: 3t#b1 would be converted to 3t#b,
thus the 'unset time' would be stripped.
This was because the timedban module was seen as 'unavailable' when
checking the +f syntax so early in the booting process.
We now assume timedban is available during config testing, if it later
turns out it is not available the 'unset time' is still stripped
when setting the mode on JOIN.

Reported by ctcp.
2022-05-07 08:18:05 +02:00
Bram Matthys fea7995a02 Fix crash when using ~security-group in except ban { }
This makes us no longer call the .is_ok() function for extbans
that are added through except ban { }. This because normally
the is_ok() function communicates to 'client', which is NULL
when it is called from the config code.
The alternative would have been to update all the extban modules
to check for a NULL client and deal with that but that would
need stupid amounts of code and it would not be of much value
as the error would not end up displaying on the console.
So, we now only on the .conv_param() function, which was already
only used for cases such as remote bans and such, and is already
known to have a NULL 'client' in TKL cases. Note that conv_param()
could still reject the ban, but it does it generally only in
the more extreme cases.

Reported by musk / PeGaSuS.
2022-05-07 08:06:05 +02:00
Bram Matthys 03c0f24be8 Make autoconnect work with last commit (link::outgoing::file). 2022-05-06 17:17:02 +02:00
Ron Nnn 64e411aa34 Add support for linking servers via UNIX domain sockets (#202) 2022-05-06 17:05:54 +02:00
Bram Matthys 7c988e04e0 Make self-test of "./unrealircd module" check if ./Config has been ran.
That is: it checks if the Makefile is there to avoid a mysterious
"No rule to make target 'custommodule'" error message.
2022-05-04 19:19:11 +02:00
Bram Matthys 71da780490 Module manager: stop on compile failure (fix return value) and also fix
some text (coming from a too broad mass replace).
2022-05-04 18:27:54 +02:00
Bram Matthys 96413cb9f2 Update README
1) Give an exact link to https://www.unrealircd.org/docs/UnrealIRCd_releases
which describes the supported versions and EOL stuff in more detail.
2) Make clear that we have better instructions on the wiki with regards to installation
and that users should use that one instead (the ones in the README are really meant as fall-back)
3) Some nicer formatting here and there (minor)
2022-05-03 09:38:34 +02:00
Bram Matthys 889bcd99dc Actually build and load module for unrealircd.org/geoip-tag by default. 2022-05-01 14:11:24 +02:00
westor a346b4a3e9 Add geoip-tag module (#197)
This module will work the same way as `userip-tag` or `userhost-tag` modules work now, the 90% of this code is part from these modules.
It will help especially the irc bots (AdiIRC/mIRC) to detect the geoip country code directly and easy when someone is talking on a channel and take actions, i hope this will help on most people.

Thanks @Valware for testing it out.

Short Example: `@unrealircd.org/geoip=GR;account=tester;msgid=tPTHDgymv9pgdGdYkI3WBd;time=2022-03-30T16:34:26.780Z :tester!Username@3765DB68:3AE9CB6C:B0540131:IP PRIVMSG #Test :test message`
2022-05-01 14:05:34 +02:00
alicetries 2018502e74 Fix various log messages which had missing $expansions (#198) 2022-05-01 13:52:45 +02:00
musk fcc580017f Update help.es.conf (#199)
Add new snomasks for U6.
2022-05-01 13:48:05 +02:00
musk 153a01ec60 Add example.es.conf (#200) 2022-05-01 13:45:40 +02:00
Bram Matthys b1daf5b832 Fix crash when hideserver module is loaded but LINKS is not blocked. 2022-05-01 13:36:37 +02:00
Bram Matthys 3451919b06 Fix issue with duplicate entries in the +b/+e/+I list of +P channels.
This was caused by the transition from letter extbans (eg ~a) to
named extbans (eg ~account) and a combination of the bug fix in 6.0.2
(60a70acd86) and the 'channeldb' module
not checking for duplicates while reading the database.

Reported by PeGaSuS in https://bugs.unrealircd.org/view.php?id=6091
2022-04-18 08:51:23 +02:00
Bram Matthys a9de2696d4 Allocated too much memory for the watchTable in the 6.0.3 change.
Now back to 256K (sizeof Watch *) instead of 1024K (sizeof Watch).
2022-04-08 08:53:23 +02:00
Bram Matthys c8b8177728 Update example conf to put kline-address value in single quotes.
Indirectly suggested in https://bugs.unrealircd.org/view.php?id=6086
reported by Balthazar.
2022-04-08 08:43:24 +02:00
Bram Matthys 1327fe9bfe Bump version to 6.0.4-git 2022-04-08 08:42:22 +02:00
Bram Matthys cedd23ae9c ** UnrealIRCd 6.0.3 ** 2022-04-01 16:27:18 +02:00
Bram Matthys 707510c1ce Fix crash in WATCH backend after doing /REHASH.
It often takes a while for the actual crash to occur but eventually an
attempt would be made to access inaccessible memory of the previously
freed .so module.

Reported by and traced with the help of both Wick and Krstarica.
2022-04-01 09:39:22 +02:00
Bram Matthys 479e9213ae Fix warning about "sending text to self" reading unitialized memory from
the stack and putting it in the log message.

Bug found internally, was not reported by anyone.
2022-04-01 09:18:14 +02:00
Bram Matthys aba8eb7a2b Fix OOB write in packet sending routine.
Bug found internally, was not reported by anyone.
2022-04-01 09:17:11 +02:00
Bram Matthys 28c1b9cef9 Show operclass in "/STATS o".
Suggested by fo (w/patch) in https://bugs.unrealircd.org/view.php?id=6003
2022-03-23 12:54:27 +01:00
Bram Matthys 640abd9df2 Update relnotes
[skip ci]
2022-03-23 09:11:10 +01:00
Bram Matthys 955d5addb5 Update release notes a bit
[skip ci]
2022-03-23 09:03:32 +01:00
Bram Matthys 488b3e3a6f Fix "unrealircdctl spkifp" usage info on Windows.
On Linux we still show the usage info as for "unrealircd" (not unrealircdctl)
since on Linux we have the "unrealircd" script that manages all this and
"unrealircdctl" is not really meant to be called directly by end-users.
2022-03-23 08:53:20 +01:00
Bram Matthys 89fe8e9227 SVSMOTD lines are now shown in the MOTD-on-connect, unless a shortmotd is used.
What is a SVSMOTD? The SVSMOTD are MOTD lines that are shown at the end of
an existing MOTD. These lines are added remotely through services.

Previously the SVSMOTD lines were never shown in the MOTD-on-connect, which
was a bug. We were only supposed to hide it if a short motd is in use.

Reported by Valware in https://bugs.unrealircd.org/view.php?id=6070
2022-03-23 08:06:23 +01:00
Bram Matthys ba1a88124a Re-indent src/modules/list.c 2022-03-23 07:24:29 +01:00
Bram Matthys da84223217 Make LIST option T<xx and T>xx always available, IOTW remove the need for
defining LIST_USE_T which was never done anywhere.

Reported by progval in https://github.com/unrealircd/unrealircd/pull/193
2022-03-23 07:15:40 +01:00
Val Lorentz f6ecbc6e63 Flip semantics of <xx and >xx in ELIST C and ELIST T (#194)
The spec <https://datatracker.ietf.org/doc/html/draft-hardy-irc-isupport-00#section-4.8>
is a little unclear on the semantics, and Unreal interprets 'C<val' as
a request for all chans created before <val> minutes ago, ditto.

This is a legitimate interpretation, but I think the other on makes more
sense (ie. that 'C<val' means all chans created less than <val> minutes
ago).

Additionally, the documentation for T did not match the implementation
before this commit.

Before this commit, Unreal was consistent with Hybrid/Plexus4 on ELIST C.

After this commit, Unreal will be consistent with Charybdis/Solanum,
InspIRCd, and ircu2 (and Hybrid/Plexus4 on ELIST T).
2022-03-23 07:09:37 +01:00
Robert Scheck a38c2ba491 Require PCRE2 >= 10.00 again (because of commit 329fd07f3a) (#196) 2022-03-22 06:44:02 +01:00
Robert Scheck 28a11a9121 Add missing options to unrealircdctl usage (#195) 2022-03-22 06:42:32 +01:00
Bram Matthys daa0c11f28 Update release notes a bit
[skip ci]
2022-03-18 07:56:57 +01:00
Bram Matthys f169a3cf77 Fix channel ops unable to -h someone, even though they could +h.
Reported by Jaka in https://bugs.unrealircd.org/view.php?id=6077 and
Valware and buayadarat in https://bugs.unrealircd.org/view.php?id=6078

This commit also makes the halfop rules for +h/-h match the ones in U5:

Previously in 6.0.0 - 6.0.2 it was:
* halfops can set +h on others
* halfops cannot set -h on others
* halfops can set -h on themselves

Now in 6.0.3+ it matches 5.x behavior again:
* halfops cannot set -h or +h on others
* halfops can set -h on themselves
2022-03-18 07:26:53 +01:00
Bram Matthys 95549220dd Update wording in release notes a bit
[skip ci]
2022-01-31 11:24:40 +01:00
Bram Matthys ef6ea6ee32 When using "RESTART" the newly started IRCd could possibly not log or been
missing other functionality.
Reported by DarthGandalf in https://bugs.unrealircd.org/view.php?id=5918

The cause was that all fd's were closed, including 0/1/2. We now reopen
those and map them to /dev/null, like we do later again.
2022-01-31 10:24:13 +01:00
Bram Matthys 155b38374a Update release notes
[skip ci]
2022-01-31 09:43:07 +01:00
Bram Matthys 09351beae7 Change default logging format on disk (text, non-json) to include
the server name. Nowadays we receive and log lines from remote servers
so without this extra information it can be unclear where events
(eg: problems) are happening which can be rather confusing.
2022-01-31 09:39:00 +01:00
Bram Matthys 252b856afe Bump version to 6.0.3-git as this is git / work in progress. 2022-01-31 09:36:48 +01:00
Bram Matthys e0cfbe5821 When using remote includes with certain setups, one could get weird
rehash errors such as error: set::geoip-classic::ipv6-database:
cannot open file "/home/xxxx/unrealircd/data/https://www.unrealircd...
and possibly even a crash.
The initial boot of UnrealIRCd, however, was always fine, this only
happened when rehashing.
It also seemed to occur more with ftp:// includes or at least with
multiple parallel includes, that may or may not have different or
more latency. In any case it seemed to affect some remote includes
setups semi-consistently, and others not at all.

The root cause was a complex code path causing a read-after-free.
We now use a simplified code path which can no longer cause this.
The only downside is that rehashing may be delayed up to an extra
250ms (quarter of a second), but that should hardly be noticeable,
if at all.

Issue reported by Bun-Bun.
2022-01-31 08:30:05 +01:00
Bram Matthys 8fe44698df When using the "let unrealircd compile cURL" option, now no longer use c-ares,
as it complicates things too much. The c-ares build options that we use in
UnrealIRCd cause curl not to recongize c-ares, and the other way around is not
good either. Also, self-compiled ("unrealircd shipped") c-ares may not be
used/required by main unrealircd (thus rm'd) while it is still needed by
self-compiled curled. Blehh, what a mess.

Now we simply don't compile curl with c-ares and rely on cURL to enable async
DNS support via system c-ares or via the another way, with the use of threads,
which is standard in curl now for many years and should work on most, if not
all platforms.
If this is somehow problematic for you then install libcurl/libcurl-dev(el)
on your system itself, via your package manager or other means.
2022-01-30 08:01:38 +01:00
Bram Matthys fa15ea2567 ./unrealircd hot-patch: now that we have rehash output and status codes
in 6.0.2+ we can inform the user whether the rehash actually succeeded
or not. This was already shown in the output, but we now also change
the last few lines of output to make very clear if the rehash failed
that the currently running UnrealIRCd is not patched.
2022-01-29 14:57:09 +01:00
Bram Matthys 752ab1abf8 Fix case where people don't use ./unrealircd hot-patch but use something
like /home/xyz/unrealircd/unrealircd hot-patch instead. In other words,
if the current working directory is not the location of the unrealircd
script. Then calling ./unrealircd rehash, so the last step in the patching
process, would fail. Reported by k4be.
[skip ci]
2022-01-29 14:50:01 +01:00
Bram Matthys 17913151ed Fix ./unrealircd hot-patch: if a patch does not cleanly apply then
don't apply it. The dry-run code was missing the most obvious case..
2022-01-29 14:40:32 +01:00
Bram Matthys 6a521e24f7 Strip trailing slash if present in paths since it can confuse some
parts of the code later on, in particular the upgrade code.
Eg: a base path of "/home/xyz/unrealircd/"

Side note: this also assumes no path is / (root), which seems a
reasonable assumption.
2022-01-29 14:29:23 +01:00
Bram Matthys 0877a5dbbe Make ./curlinstall use the same options when building c-ares as the
./configure script from us. That is, using the correct private lib dir
and using --disable-tests and so on.

Should fix a bug on CentOS where c-ares could not be built due to
the test suite requirements from c-ares, reported by Bun-Bun.
2022-01-29 14:14:50 +01:00
Bram Matthys 29fd2e772a ** UnrealIRCd 6.0.2 ** 2022-01-28 17:02:19 +01:00
Bram Matthys cd3b50d2f8 Update ./unrealircd usage info. 2022-01-28 08:57:47 +01:00
Bram Matthys f650239b4f Add "./unrealircd module-status" to show currently loaded modules,
including version, description, author, flags. The output is
pretty much identical to "MODULE -all" on IRC as IRCOp.

Useful for the future if you want to verify a module has been
upgraded from the command line.
2022-01-28 08:45:20 +01:00
Bram Matthys a07db0fffd BuildBot: Give all the build tests a bit more time 2022-01-17 10:43:02 +01:00
Bram Matthys 82bb7567da Update release notes 2022-01-17 09:07:57 +01:00
Bram Matthys 83e74893da Relookup reputation and geo information when client IP changes due to WEBIRC
or another type of proxy request.
This fixes a problem where ban user { } or except ban { } is not working
for ~country:XX when the request comes via a WEBIRC or other proxy.
Reported by CaoS in https://bugs.unrealircd.org/view.php?id=6058
It should also fix security-group being incorrect for ~security-group bans
or exempts.
2022-01-17 08:09:15 +01:00
Bram Matthys d4f09f8fed HOOKTYPE_*_CHANGED -> HOOKTYPE_*_CHANGE to be a bit more consistent with
the rest of the hooks, most of which do not use the past tense.
Only affects HOOKTYPE_USERHOST_CHANGE / HOOKTYPE_REALNAME_CHANGE.

This does, however, make it inconsistent with the userhost_changed()
call, though :D.
2022-01-17 08:02:18 +01:00
Bram Matthys f3d827c577 Add HOOKTYPE_IP_CHANGE and call it when the IP address changes.
Eg for WEBIRC or other proxy.

This does not yet fix any problem, it just changes the way things are
called. More to follow.
2022-01-17 07:55:45 +01:00
i c1ec164a65 fix flat-map display 2022-01-08 03:46:09 +03:00
Bram Matthys 35c3c87dc4 ** UnrealIRCd 6.0.2-rc1 ** 2022-01-07 14:07:36 +01:00
Bram Matthys 7678bc38ed Update shipped c-ares from 1.17.2 to 1.18.1 (27-oct-2021) 2022-01-07 14:03:01 +01:00
Bram Matthys 8536778bcc Don't mention action 'd' in HELPOP CHMODEF for floodtype 'm', as this
is not supported at the moment.
Reported by Valware in https://bugs.unrealircd.org/view.php?id=6034
[skip ci]
2022-01-07 12:37:26 +01:00
Bram Matthys 9e4d6571e5 Update release notes a bit
[skip ci]
2022-01-07 12:13:58 +01:00
Bram Matthys 60a70acd86 channeldb: convert letter extbans to named extbans (.db for +P channels) 2022-01-07 12:10:10 +01:00
Bram Matthys b1e475e0ca Update release notes a bit
[skip ci]
2022-01-06 18:04:36 +01:00
Bram Matthys 329fd07f3a Revert set::spamfilter::utf8-support from yesterday.
This will be for a later release, needs more thought and work.
2022-01-06 18:03:26 +01:00
Bram Matthys 17a4ed1ea9 Update release notes:
Make clear that set::spamfilter::utf8-support is experimental
and the possible side effects/issues, or the ones in the past, anyway.
[skip ci]
2022-01-06 16:08:07 +01:00
Bram Matthys bd05cdf779 Don't do GeoIP lookups for remote users. These are already looked up and
synced by the server the user is on, and this way the country will be
consistently the same on all servers (and not BE on one, and NL on another,
which would be confusing for the ban matching code, giving different
results on each server).
2022-01-06 15:31:54 +01:00
Bram Matthys 7f794aa7d7 Fix log message on vhost-flood 2022-01-06 08:44:59 +01:00
Bram Matthys 856f29ae54 Update release notes a bit
[skip ci]
2022-01-05 18:21:22 +01:00
Bram Matthys dedff543b5 Add option set::spamfilter::utf8-support which defaults to 'no' for now.
When you set this to 'yes' you get more options...
See next (modified) copy-paste from April 2020, which had to be reverted
because PCRE2 was broken. Now it's an opt-in and hopefully matured a bit.

This means:
* Case insensitive matches work better in UTF8 now, such as extended Latin.
  For example, a spamfilter on "ę" now also matches "Ę", while previously
  it did not catch this.
* Other PCRE2 features such as https://www.pcre.org/current/doc/html/pcre2syntax.html#SEC5
  are now available. For example you can now set a spamfilter with the regex
  \p{Arabic} to block all Arabic script, or
  \p{Cyrillic} to block all Cyrillic script (such as Russian)
  Use these new tools with care, of course. Blocking an entire language,
  or script, is quite a drastic measure.

All of this was possible because of the new PCRE2_MATCH_INVALID_UTF
compile time option which was introduced in PCRE2 10.34. Now, that
version turned out to be buggy. As recent as PCRE 10.36 some major bugs
were fixed. This also means we now require at least PCRE2 10.36 version
so everyone can benefit from this new spamfilter UTF8 feature, IF they
enable set::spamfilter::utf8-support, that is.

Many systems come with older PCRE2 versions so this means we will
fall back to the shipped PCRE2 version in UnrealIRCd. This means
./Config will take a little longer to compile things.

For packagers (rpm/deb/ports): if you choose to patch configure to
not require such a recent PCRE2, then please do not allow enabling
of set::spamfilter::utf8-support since it will likely cause crashes
and misbehavior. Check PCRE2 changelog, CTRL+F at PCRE2_MATCH_INVALID_UTF
2022-01-05 18:08:52 +01:00
Bram Matthys b821aa419f Ship with PCRE2 10.39 (29-October-2021) 2022-01-05 17:59:40 +01:00
Bram Matthys ab8fab79e3 Drop --disable-unicode from PCRE2 and require 10.34 for
PCRE2_MATCH_INVALID_UTF support. More commits to follow.
2022-01-05 17:55:33 +01:00
Bram Matthys dd74e1e63d Update release notes
[skip ci]
2022-01-05 17:30:50 +01:00
Bram Matthys fa1493b930 Add 'WHO <300 t' example and information to HELPOP WHO 2022-01-05 17:30:17 +01:00
Bram Matthys d156a18aba Set defaults for vhost-flood
https://www.unrealircd.org/docs/Anti-flood_settings#vhost-flood
2022-01-05 17:26:32 +01:00
Bram Matthys df0884981e Handle empty strings in config_checkval() 2022-01-05 11:36:46 +01:00
Bram Matthys 1e0bddfbab And some more text improvements in ./Config 2022-01-05 09:32:17 +01:00
Bram Matthys 27bfdef1ca Update wording a bit for geoip 'none'. Indirectly suggested by DeviL. 2022-01-05 09:27:40 +01:00
i 6996c7a485 update RPL_MAP numeric 2022-01-05 00:07:22 +03:00
i 66355370e1 fix RPL_MAPUSERS numeric error 2022-01-04 23:56:29 +03:00
i 1c4da04346 add WHO parameter for searching by connect time 2022-01-04 21:25:36 +03:00
i 7430d3718a add support for rate limiting -x/-t (set::anti-flood::<groupname>::vhost-flood) 2022-01-04 21:23:57 +03:00
i d8f440e9e7 add map percentages 2022-01-04 21:21:38 +03:00
i f4239abc5d update help.ru.conf 2022-01-04 21:17:54 +03:00
Bram Matthys b4d92bf232 Typo typo
[skip ci]
2022-01-04 11:24:04 +01:00
Bram Matthys 8dedffa6c0 Update release notes a bit
[skip ci]
2022-01-04 11:16:38 +01:00
Bram Matthys 33dac730c7 When a remote server forgets to send the TS in a MODE message with the
sender being a server, then we now spread it on with a zero TS so we
avoid a potential desync elsewhere, or at least try to limit it.
2022-01-04 11:10:40 +01:00
Bram Matthys 55969d1ff3 Update relnotes a bit more
[skip ci]
2022-01-03 19:28:48 +01:00
Bram Matthys 1ff5c0c51a Update relnotes a bit
[skip ci]
2022-01-03 18:39:17 +01:00
Bram Matthys ca6a3efdb2 Fix for location of unrealircd.ctl when not in ~/unrealircd/
Reported by Han`
2022-01-03 18:24:29 +01:00
Bram Matthys c4126a2d1e Update preliminary release notes
[skip ci]
2022-01-03 17:58:13 +01:00
Bram Matthys 3818b9eb45 Make unrealircdctl spkifp actually work on Windows 2022-01-03 17:49:29 +01:00
Bram Matthys 4d2cefdbed Fix for Windows build (old srandom call). 2022-01-03 17:05:57 +01:00
Bram Matthys 34fda671f8 And some more config priorities (not important yet) 2022-01-03 17:01:56 +01:00
Bram Matthys 8e7eacadfe Swap order of config_run_blocks() and config_test_blocks() since that
makes more sense when reading the source code.
2022-01-03 16:56:25 +01:00
Bram Matthys 9fef375d0a Make reading priority of config blocks a simple array. 2022-01-03 16:55:47 +01:00
Bram Matthys 92c81b194f Move "spkifp" to unrealircdctl, so it is available for Windows users.
For *NIX users no visible change.
2022-01-03 14:48:00 +01:00
Bram Matthys 3dd7c19c77 Move "gencloak" to unrealircdctl, so it is available for Windows users.
For *NIX users no visible change.
2022-01-03 14:28:10 +01:00
Bram Matthys e35c29f3d5 Move mkpasswd operation to unrealircdctl. For *NIX users no change as this
is done behind-the-scenes (the command is still ./unrealircd mkpasswd).
For Windows users it finally means they can generate passwords via the CLI
using: unrealircdctl mkpasswd pwdhere
2022-01-03 14:14:12 +01:00
Bram Matthys 243c6635da Update /STATS P output a little (since it shows the control channel). 2022-01-03 13:51:46 +01:00
Bram Matthys df0a9e4f37 BuildBot: build unrealircdctl.exe 2022-01-03 13:51:32 +01:00
Bram Matthys 5425c8fbb6 Don't fail on versions older than Windows 10 version 1803.
And be a bit more informative on why unrealircdctl fails on those.
2022-01-03 13:31:24 +01:00
Bram Matthys c02eb3f16c Windows code cleanup: WSAStartup() -> init_winsock() 2022-01-03 13:19:22 +01:00
Bram Matthys 98c0e786b5 Make UnrealIRCd compile on Windows again.
Updated the makefile to build unrealircdctl.exe etc.
2022-01-03 13:10:53 +01:00
Bram Matthys c0c265baee Fix some (totally unimportant) resource leaks and fix a case where,
if UnrealIRCd hung up on client communication without saying goodbye,
we would return a 0 exit code (success).
2022-01-03 09:03:23 +01:00
Bram Matthys a4af100ca8 Memory isn't initialized to zero by dbuf_queue_init(), causing
dbuf->length to be unitialized.
This wasn't an actual problem until yesterday in UnrealIRCd code,
since the whole client struct was initialized to zero, including
client->local->sendQ(->length) etc.
However, now we use the dbuf code elsewhere too (on the stack) and
3rd party modules can use it too, so fix this bug.
2022-01-03 09:02:54 +01:00
Bram Matthys 75a2fde672 Merge branch 'unreal60_dev' of github.com:unrealircd/unrealircd into unreal60_dev 2022-01-02 20:19:21 +01:00
Bram Matthys 39688517b0 Make "./unrealircd rehash" show output on the terminal, same for
"./unrealircd reloadtls" and there is now also a "./unrealircd status"

The output is colorized if the terminal supports it (just like on the
boot screen) and also the exit status is 0 for success and non-0 for
failure. The purpose of all this is that you can easily detect rehash
errors on the command line.

These three commands communicate to UnrealIRCd via the new control
UNIX socket, which is in ~/data/unrealircd.ctl.
This also does a lot of other stuff because we now have an internal
tool called bin/unrealircdctl which is called by ./unrealircd for
some of the commands to communicate to the unrealircd.ctl socket.
Later on more of the existing functionality may be moved to that
tool and we may also provide it on Windows in CLI mode so people
have more of the same functionality as on *NIX.
2022-01-02 20:17:36 +01:00
k4be d8bb78677f Add TS to s2s MODE messages generated by SVS(2)MODE
(if the source is a server).
2022-01-02 20:09:57 +01:00
Bram Matthys 834736070e Make "SVS(2)MODE -b user" work properly for extended bans.
It was missing for a lot of extbans (removing too little) and
for ~t it was removing too much (eg quiet bans).
Bug reported and changes suggested by k4be.

Coders:
Setting extban.options to EXTBOPT_CHSVSMODE has no effect anymore,
just didn't want to remove it so modules would still compile.
We now purely match based on .is_banned_events including BANCHK_JOIN.
2022-01-02 13:12:33 +01:00
Bram Matthys 46bdc1c5e1 Print message about outdated release if automatically rejected by crash handler. 2022-01-02 09:32:33 +01:00
Bram Matthys dbef19cd7a Add initial implementation of UNIX domain sockets (listen::file).
Various things still need to be done: a lot more testing, ability to
set permissions on the file, #ifdef's because of lack of support
on Windows (currently won't compile), etc.

One thing that I don't intend to change is that I chose not to display
the socket in the host but have clients show up as 'localhost' (and
ip '127.0.0.1'). Doing it this way keeps things easy, otherwise we risk
a lot of breakage for nearly nothing gained, really.

Things can be tested via:
listen {
        file "/tmp/listen";
}

and then with netcat:
nc -U /tmp/listen
USER x x x x
NICK hai
etc...
2022-01-01 18:48:17 +01:00
Bram Matthys 40c528acde Add missing space in spamfilter log message.
This is a fix-for-fix b98d02817a.

Reported by armyn in https://bugs.unrealircd.org/view.php?id=6049
2021-12-30 16:42:29 +01:00
Bram Matthys 4e209968fe Fix hang on "Loading IRCd configuration" if DNS is not working correctly.
For example if the 1st DNS resolver is refusing or ignoring requests.
We forgot to call unrealdns_timeout() in the waiting loop, so DNS requests
never timed out and c-ares didn't try the 2nd/3rd server either.

Issue reported by Elodie.
2021-12-30 14:49:29 +01:00
Bram Matthys c5c17f2ccf Include "client_port" (eg 6697) and "server_port" (eg 55123) in JSON
output for local clients.
2021-12-30 13:20:37 +01:00
Bram Matthys 4ca9e9b3c2 Also support show-event in log::destination::channel. 2021-12-30 11:39:51 +01:00
Bram Matthys d677ce04de New option set::server-notice-show-event which, if set to 'no', can be used
to hide the event information (eg. connect.LOCAL_CLIENT_CONNECT) in
server notices. This can be overriden in oper::server-notice-show-event.

See https://www.unrealircd.org/docs/Set_block#set::server-notice-show-event
2021-12-30 11:29:30 +01:00
Bram Matthys 0f52ff76e8 Add link to https://www.unrealircd.org/docs/Log_block#Logging_to_a_channel
in the release notes.
Also add the sub-options: color, json-message-tag and oper-only.
2021-12-30 10:40:01 +01:00
Bram Matthys eaded2d12f Use spamfilter::match with single quotes in example spamfilter.conf
and give a hint to do that so they are not misinterpreted by an URL
since that may happen for other spamfilters (not the one included
in this file though). Suggested by Lord255.
2021-12-30 09:57:57 +01:00
Bram Matthys 4cb708117a Initial version of snomask logging to channels (more to follow) 2021-12-30 08:59:00 +01:00
Bram Matthys a35e9f7af9 Bump version to 6.0.2-git (start of dev for next version) 2021-12-30 08:58:08 +01:00
Bram Matthys 34c7727eb1 Error on unknown items in log block, eg a leftover log::flags or log::maxsize
from UnrealIRCd 5, or just some incorrect item that does not exist.
2021-12-30 08:16:01 +01:00
Bram Matthys cdc433f8c0 ** UnrealIRCd 6.0.1.1 ** 2021-12-29 19:30:49 +01:00
Bram Matthys 0242b509b8 Fix compatibility between U5 and U6 for named extended bans in SJOIN
when SJSBY is enabled. This caused named bans not to show up properly
(or not at all) on the U5 side when syncing servers.
2021-12-29 19:21:02 +01:00
Bram Matthys 73dc1a08db ** UnrealIRCd 6.0.1 ** 2021-12-29 15:27:31 +01:00
Bram Matthys faab128472 Bump version to 6.0.1 and create draft release notes (unreleased yet!) 2021-12-29 12:02:57 +01:00
Bram Matthys c5cb19dc5d Fix "./unrealircd upgrade" (and ./Config -quick) problem with local-curl.
First, what we call local-curl is a situation where the system does not have
the cURL library installed and UnrealIRCd offers to compile and use it.

The problem is that CURLDIR in config.settings may refer to an old directory
such as /home/xyz/unrealircd-5.2.1/extras/curl and UnrealIRCd 6 would try to
use it. That would be problematic as it would result in: 1) no cURL updates
anymore since it is only half-detected as local-curl, and 2) once you remove
the unrealircd-5.2.1 directory (since you are on U6) it breaks as well.

So, we now check for this situation and in case of something that looks like
a local-curl situation, change the path to <currentunreal>/extras/curl and
download and compile cURL fresh, as expected.

All this is only for the like 1% users that uses local-curl, which then
used ./unrealircd upgrade or ./Config -quick.

Reported by CrazyCat on the forums.
2021-12-29 10:59:58 +01:00
Bram Matthys 73be662db2 Make "./unrealircd upgrade" return exit codes from stage 2 as well.
Exit status is now documented at https://www.unrealircd.org/docs/Upgrading
and can be used to see the difference between:
* upgrade+configtest OK,
* upgrade OK but configtest failed
* some other failure
* no newer version available
Handy for scripting...
2021-12-29 10:04:00 +01:00
Bram Matthys 607d2bcd62 Make "./unrealircd upgrade" work on FreeBSD.
Suggested by and patches from rafaelgrether in
https://bugs.unrealircd.org/view.php?id=6016

This also cleans up a tiny bit, part of it suggested by Lord255 in
https://bugs.unrealircd.org/view.php?id=5963
2021-12-29 09:31:03 +01:00
Bram Matthys 58551c2d43 When unloading any of the vhoaq channel modes it would cause a crash
later on, because unload_extcmode_commit() would call extcmode_para_delslot()
even though member modes don't use a parameter slot, and hence it
would NULLify a wrong slot, usually for the +H parameter mode. Fun.

We now no longer crash and mass-unset the modes on everyone in the
channel when such a mode is unloaded, just like we do when unloading
any of the other channel modes. It is not done in an efficient way
(one mode per line) but this should be an extremely rare event anyway.

Crash reported by CrazyCat.
2021-12-29 08:41:37 +01:00
Bram Matthys fa5526a44b Add a warning to ./unrealircd spkifp about it using the default certificate
locations, and inform the user that they can specify a file.

This doesn't solve https://bugs.unrealircd.org/view.php?id=6021 completely
but at least makes the user aware of this.

Reported by arcanefeenix and crazycat.
2021-12-28 18:31:38 +01:00
Valerie Pond f4bf9986af Fix some typos in CHGIDENT and CHGNAME log messages (#189) 2021-12-28 18:09:08 +01:00
Bram Matthys 3859c2f477 Error when an invalid (unknown) snomask is encountered in the config file.
This should help users who are upgrading to UnrealIRCd 6 spot silly mistakes
which would cause them to miss server notices.

It now errors and refers to
https://www.unrealircd.org/docs/Upgrading_from_5.x#Update_your_snomasks
2021-12-28 18:04:23 +01:00
Bram Matthys f7719d2de2 Make TKL add/remove/expire oper messages show a [duration: 60m] instead of
the [expires: ZZZZZZZZZZZZZZZZZZZZ GMT] string.

This because most people are interested in the length of the ban (so
relative time) and the exact time a TKL expires is less interesting
(the absolute time) and due to GMT/UTC requires calculating to the
local timezone too.

This also makes the tkl expiry messages be more like the add message,
with []'s, while previous it used more free text at the end of the line.
2021-12-26 09:00:39 +01:00
Bram Matthys d687e310bd Add function pretty_time_val_r(), for which you can specify a buf. 2021-12-26 08:59:44 +01:00
Bram Matthys 7f9c7a0eb4 Remove high cpu load warning, since it is confusing and may very well
not be caused by UnrealIRCd.
Reported by armyn in https://bugs.unrealircd.org/view.php?id=6029
2021-12-25 08:58:46 +01:00
Bram Matthys b98d02817a In SPAMFILTER_MATCH log message, remove leading space in 'destination' JSON.
Reported by armyn in https://bugs.unrealircd.org/view.php?id=6027
2021-12-22 17:11:44 +01:00
Bram Matthys c586c14b9f Fix ~T / ~text ban not working (was not censoring or blocking) 2021-12-22 09:25:59 +01:00
Bram Matthys 8dd1864cee Channel mode +f (flood) could place a timed extban with ~t instead of ~time.
This was only a visual issue, and coincidently these bans were still being
removed after the appropriate time, even without the fix for
0b6a70368c.
2021-12-22 09:10:51 +01:00
Bram Matthys 0b6a70368c Fix timed bans (~t/~time) not expiring if all servers on the net are U6.
Reported by armyn in https://bugs.unrealircd.org/view.php?id=6032
2021-12-22 09:10:05 +01:00
kpcyrd c1732581f8 Add SOURCE_DATE_EPOCH support for build date (#188)
For reproducible builds.
2021-12-19 18:56:37 +01:00
Bram Matthys 3059f3289a Channel is not +H? Send empty response/batch (as per IRCv3 discussion)
Backport of https://github.com/unrealircd/unrealircd/pull/156
(simplified)
2021-12-19 10:45:52 +01:00
alicetries b3c191fc23 Update short_date function to avoid crash if year > 9999 (#174) 2021-12-19 10:29:20 +01:00
crazycatdevs 9e7d4b0122 Small simplification (#185) 2021-12-19 10:24:36 +01:00
Bram Matthys d77f42e4be This one should be the other way around...
Not that anything is this particular code path should trigger it (OK,
maybe if some 3rd party module kills the user from HOOKTYPE_SECURE_CONNECT)
better safe than sorry.
2021-12-17 14:20:39 +01:00
Bram Matthys 35ab4407be Mention U5/U6 series and dates in the README as well 2021-12-17 08:23:14 +01:00
Bram Matthys 893bf864f6 ** UnrealIRCd 6.0.0 ** 2021-12-16 18:18:38 +01:00
Bram Matthys 359f7b4675 Get UnrealIRCd 6.0.0 ready, but don't release *yet*. 2021-12-15 16:54:37 +01:00
Bram Matthys 9ed5638dde SECURITY.md: mention U5 EOL date explicitly in this document as well.
Even though it already contain a reference to the EOL dates.
2021-12-14 17:58:07 +01:00
k4be 26929bedb5 Update help.pl.conf to match help.conf 2021-12-13 20:08:49 +01:00
Bram Matthys fdb7bf68b3 Update release notes a bit
[skip ci]
2021-12-13 19:23:07 +01:00
Bram Matthys 2c73912080 Fix limit for channel modes kicking in too soon. 2021-12-11 10:33:47 +01:00
Bram Matthys 2a574120f5 Rename function to avoid clashes 2021-12-11 10:25:15 +01:00
Bram Matthys bf1860bba8 Send nick!user@host in WALLOPS message from self.
Fix-for-fix 9f56fb4aa7
2021-12-10 19:41:36 +01:00
Bram Matthys 02547610fe Update log block in example.fr.conf.
Reported by armyn in https://bugs.unrealircd.org/view.php?id=6022
2021-12-10 18:53:07 +01:00
Bram Matthys 4bc2848b9e Fix a prototype and change a largely unused log category to avoid clashes. 2021-12-10 10:28:35 +01:00
Bram Matthys cc5f318d27 Add include for snomasks.default.conf in example.*conf
Reported by arcanefeenix in https://bugs.unrealircd.org/view.php?id=6020
2021-12-08 07:17:40 +01:00
Bram Matthys 07c2345af5 Fix throttling only cleaning up old entries every 2 minutes.
That is, until the first REHASH happened, after that all is good.

This was caused by update_throttling_timer_settings() being
called before init_throttling().
2021-12-06 17:40:11 +01:00
Bram Matthys 177f7ef8c0 Add a CONTRIBUTING.md.
Suggested by progval in https://bugs.unrealircd.org/view.php?id=6012
2021-12-06 13:36:12 +01:00
Bram Matthys 7169523d05 Update installer on Windows (.ISS): do signing during the Inno Setup stage
rather than afterwards as a separate step.
Also clean/group the files in the [Files] section a bit.
2021-12-06 09:24:36 +01:00
Bram Matthys 4702185315 Fix authprompt module: was sending trailing NUL byte in SASL, causing
all authentication attempts to fail via the module (/AUTH user:pass).
2021-12-05 10:19:33 +01:00
Bram Matthys c604a3a70e Make soft extended server bans actually work (GLINE %~country:XX)
Reported by musk in https://bugs.unrealircd.org/view.php?id=6019
2021-12-05 09:45:13 +01:00
Bram Matthys dc53818b29 ** UnrealIRCd 6.0.0-rc2 ** 2021-12-04 10:26:57 +01:00
Bram Matthys adc8d5802f Fix +s/+p during netmerge (was on todo) 2021-12-04 10:17:34 +01:00
Bram Matthys b25da63d27 Allow SVSLOGIN also if set::sasl-server is not set.
Because yeah... why not.
2021-12-04 09:42:51 +01:00
Bram Matthys 40723bbce8 Make shipped c-ares version match the one in U5 (1.17.2) 2021-12-04 09:31:35 +01:00
Bram Matthys 09fea29734 Update curl-ca-bundle.crt to version of Tue Oct 26 03:12:05 2021 GMT
[skip ci]
2021-12-04 09:25:50 +01:00
Bram Matthys e78df2461f Fix wrong mode being mentioned in ERR_NOTFORHALFOPS for +L 2021-12-04 09:15:58 +01:00
Bram Matthys b363b2e804 Fix wrong +q vs +a KICK access check. 2021-12-03 18:11:54 +01:00
Bram Matthys 5a80696f62 Remove some confusing examples about extended server bans in (G)ZLINE.
And also remove some references to old oper privilege flags.
Reported by progval.
2021-12-03 16:06:13 +01:00
Bram Matthys 861e761c24 Update HELOPOP SNOMASKS 2021-12-01 10:56:04 +01:00
Bram Matthys bde57af8c5 Update HELPOP EXTBANS: named extbans and some style changes,
reformatting, adding headings, etc.
2021-12-01 10:12:27 +01:00
Bram Matthys d77a5be834 Don't use slashes at start and end in SPAMFILTER example in HELPOP.
Reported by srhuston in https://bugs.unrealircd.org/view.php?id=6002
[skip ci]
2021-12-01 09:00:21 +01:00
Bram Matthys 8c8b4279b8 Ignore case-changes in nicks, even though not clear yet if it should be,
https://bugs.unrealircd.org/view.php?id=6013 reported by progval.
2021-12-01 08:49:41 +01:00
Bram Matthys 4af7a541f8 Add 'oldnick' to HOOKTYPE_POST_LOCAL_NICKCHANGE and HOOKTYPE_POST_REMOTE_NICKCHANGE 2021-12-01 08:40:02 +01:00
Bram Matthys 92820fc2e8 Fix uninitialized memory read on snomask change (oper-only) 2021-11-30 06:34:54 +01:00
Bram Matthys d59537391a Cut off channel for KICK at first comma, as we did in U3.2/U4/U5.
Reported by progval in https://bugs.unrealircd.org/view.php?id=6015
2021-11-29 17:23:45 +01:00
Bram Matthys a71e205185 Lower library version requirement if you choose to use libmaxminddb,
from 1.6.0 to 1.4.3. Suggested by robert-scheck in
https://github.com/unrealircd/unrealircd/pull/183
2021-11-28 08:03:10 +01:00
Bram Matthys 18e3d37b33 Probably a good idea to call the version 6.0.0-rc1 too (thanks Han`) :D 2021-11-27 17:08:10 +01:00
Bram Matthys f85fb7561e Clean up the release notes a bit
[skip ci]
2021-11-27 15:27:19 +01:00
Bram Matthys eb216a6778 Refer to upgrading 5.x to 6.x wiki article.
[skip ci]
2021-11-27 15:26:19 +01:00
Bram Matthys a985b88c52 ** UnrealIRCd 6.0.0-rc1 ** 2021-11-27 14:41:14 +01:00
Bram Matthys 0b7d8f5ebc BuildBot: Update config.settings for latest 2021-11-27 13:56:26 +01:00
Bram Matthys 001c1e7843 Turn AddressSanitizer off by default and ask in ./Config 2021-11-27 13:51:19 +01:00
Bram Matthys 1cd79e381a Fix expansion issue in log message on invalid SJOIN SJSBY (rare)
'$client' was shown as-is instead of expanded, since it was missing.
2021-11-27 10:46:53 +01:00
Bram Matthys cb55931c6e Fix crash on incorrect S2S traffic: "HISTORY" request from remote user.
(This cannot be triggered by clients under normal conditions, only with
deliberate wrong S2S traffic, such as OS RAW, modified source, etc)
2021-11-26 17:06:27 +01:00
Bram Matthys 46d0b4d6bb Actually let's fix this one in -beta4 as well. 2021-11-21 17:34:00 +01:00
Bram Matthys 3320dce301 ** UnrealIRCd 6.0.0-beta4 ** 2021-11-21 17:00:30 +01:00
Bram Matthys 0408c10533 Fix permission check for MODE. Reported by Valware.
This check was accidentally cut out when removing support for bounce
modes in a5b86fcc11.
2021-11-21 16:41:03 +01:00
Bram Matthys d3c98413c1 Websocket module: fix memory leak and also two issues in new forwarder
code (OOB write and a NULL pointer dereference), those last two only
happen for trusted forwarders though.
2021-11-21 16:38:12 +01:00
Bram Matthys e817606ead More of the same. 2021-11-21 10:11:56 +01:00
Bram Matthys dfb7e403e3 Fix issue where an UnrealIRCd 5 server sends one mode line and an
UnrealIRCd 6 server would expand it into two different mode lines
with IDENTICAL msgid values. Obviously message ids must be different
for different events.
Introduced by b078a9c8b5.
2021-11-21 09:35:37 +01:00
Bram Matthys 86b7284e37 Fix another memory leak in SJOIN, similar to the one of an hour ago.
Introduced by b078a9c8b5.
2021-11-21 09:28:13 +01:00
Bram Matthys 75ef181d97 Fix memory leak in SJOIN.
Introduced by b078a9c8b5.
2021-11-21 08:19:40 +01:00
Bram Matthys 11507b3fbb Move export ASAN_OPTIONS to beginning of script so it is used not
only for "./unrealircd start" but also for configtest, genlinkblock, etc.
2021-11-20 17:18:47 +01:00
Bram Matthys c4848250e1 Update ./Config question on "remote includes", now that https:// support
is always available even if you answer "No" here.
2021-11-20 11:52:56 +01:00
Bram Matthys ff5262f1bc Update Turkish example conf & help
Provided by Diablo - (Serkan Sepetçi)
2021-11-20 08:41:13 +01:00
Bram Matthys 8b58218d29 ** UnrealIRCd 6.0.0-beta3 ** 2021-11-19 19:10:39 +01:00
Bram Matthys b42953868b Update parameters of other RunHook()s, other than in mode.c,
for HOOKTYPE_REMOTE_CHANMODE and HOOKTYPE_LOCAL_CHANMODE.
2021-11-19 19:04:48 +01:00
Bram Matthys b078a9c8b5 Fix cut-off and expansion issues with MODE, which is a possible problem when
using mixed UnrealIRCd 5 and UnrealIRCd 6 networks.

This is a slightly complex rewrite of make_mode_str() and do_mode(),
as we nog go from single mode lines to potentially multiple mode lines.

In short: whenever we would be near buffer cut-off point (the famous
512 byte limit) then previously we would prevent the mode, though not
succesfully in all cases where a network consists of mixed 5.x and 6.x.
From this point onward we no longer do that. Instead we convert one
MODE command to two MODE lines if that is needed.
The benefit of this is that we no longer prevent it BEFORE processing
the MODE, which is a flawed method and could be wrong (causing desyncs).
And also, we no longer partially ignore MODE lines from clients when
they would cause the limit to be exceeded, as we replace them with
two MODE lines instead.

These are more changes than I wanted at such a late point but.. they seem
to be necessary to prevent U5-U6 compatibility issues.
2021-11-19 13:53:21 +01:00
Bram Matthys 1857f8cb72 Update ./Config to check for -beta2 (so i don't forget later) 2021-11-13 13:48:27 +01:00
Bram Matthys 36274f7242 Fix nick-flood message appearing even though the user was not changing nicks. 2021-11-13 13:45:39 +01:00
k4be 0cb599be09 extjwt: enable valid "vfy" url checking and update related documentation 2021-11-11 07:55:22 +01:00
k4bek4be 07f98af390 Merge pull request #181 from simplexish/patch-2
Fix a typo in SERVER_LINKED_REMOTE log message
2021-11-11 07:46:58 +01:00
simplexish ec9104a3e1 Fix a typo in SERVER_LINKED_REMOTE log message
Removing ) which doesn't seem to belong
2021-11-11 02:53:16 +03:00
Bram Matthys f9c46f9f10 Add escaping option for URLs.
In the config file if you have a value that is 100% an URL (eg no
spaces and all that) then it is seen as a remote include and will
be fetched. Eg: file "https://something/"
We already had that.

Now we add a new option to make it NOT interpret this as an URL.
Probably only used in rare cases, but, it is needed for modules
like extjwt where you configure an URL.
The solution is simple: use single quotes instead of double:
Eg: url 'https://something/'

Note that single quotes are only supported in this version onwards,
they were not supported in earlier UnrealIRCd versions.

It is also only supported in values at the moment (not names),
since that is the only place where URLs are actually fetched for.
2021-11-10 18:41:22 +01:00
Bram Matthys 717f190336 Fix crash with non-matching link block. 2021-11-10 16:13:02 +01:00
Bram Matthys b3b40e62c5 Fix failed expansion in link.LINK_ERROR_CONNECT. Reported by fo in
https://bugs.unrealircd.org/view.php?id=5992
2021-11-10 16:10:59 +01:00
Bram Matthys 6b87bd1b34 Only allow setting of snomasks that actually exist in the log { } blocks.
Otherwise probably too confusing. Suggested by westor in
https://bugs.unrealircd.org/view.php?id=5995
2021-11-10 15:59:10 +01:00
Bram Matthys 36a06b0011 A few changes to server linking notices:
1) Don't forward link.SERVER_LINKED since we already generate
   link.SERVER_LINKED_REMOTE ourselves.
2) Fix using wrong server name(s) in link.SERVER_LINKED_REMOTE
   reported by flo in https://bugs.unrealircd.org/view.php?id=5988
3) Don't show link.SERVER_LINKED_REMOTE messages when we
   are syncing to a network, otherwise you would get eg 50 of
   such messages for 50 servers when you link in 1 server.
2021-11-10 15:42:10 +01:00
Bram Matthys 9a9b318bfb Add a way to filter in ./unrealircd module generate-repository
so we can generate modules.list better.
2021-11-10 11:36:21 +01:00
Bram Matthys d74ab4cfb1 Add set::server-notice-colors and oper::server-notice-colors so one
can turn colors in snomask server notices on or off.
2021-11-10 08:22:00 +01:00
Bram Matthys 9f56fb4aa7 Make /WALLOPS send the text also back to the person who issued it
reported by PeGaSuS in https://bugs.unrealircd.org/view.php?id=5764
2021-11-10 07:27:47 +01:00
Bram Matthys 585ee5c63f Fix error when using the poll() i/o engine. Reported by Jobe in
https://bugs.unrealircd.org/view.php?id=5999
2021-11-10 07:09:01 +01:00
Bram Matthys eba7e99509 Mention "./unrealircd upgrade" in the release notes.
[skip ci]
2021-11-07 16:58:35 +01:00
Bram Matthys ca2d15360b Make @endif work on Windows.
This is due to \r being replaced with a space in config_parse_with_offset().
Didn't even know that.. yeah.. ugly ugly... but first time i see it
causing a problem in 20 years.
2021-11-07 15:06:17 +01:00
Bram Matthys 4c9a83365c Fix read-after-free due to commit from a few minutes ago.
An URL that did not need to be fetched (due to url-refresh time) could
cause a download complete message ending up in a call to rehash_internal().
This was too soon, as we were still adding and processing other config
files.
2021-11-07 14:23:00 +01:00
Bram Matthys ed1b334f90 Add ::url-refresh <time> option and don't bother downloading GeoIP DB
from unrealircd.org if it is less than 14 days old.

If the file was up to date then it already never fully downloaded it,
thanks to hashing and receiving the "304 Not Modified" HTTP header.
But with this url-refresh it won't even do the HTTP(S) request at all.
2021-11-07 13:25:06 +01:00
k4be d0ccc67881 Merge remote-tracking branch 'origin/unreal60_dev' into unreal60_dev 2021-11-06 19:13:29 +01:00
k4be f665206c4f Don't build libmaxminddb by default, and fail when it's enabled but not present 2021-11-06 19:11:57 +01:00
Bram Matthys f757280a8b Update automatic import of settings from older versions. 2021-11-06 19:11:21 +01:00
Bram Matthys c4a64f4aab ** UnrealIRCd 6.0.0-beta2 ** 2021-11-06 19:05:14 +01:00
Bram Matthys d18f8115f1 Let's bump UnrealProtocol from 5002 to 6000 2021-11-06 18:57:35 +01:00
k4be 48d5af8936 Fix possible null pointer dereferencing 2021-11-06 14:53:08 +01:00
Bram Matthys 761cc8514a Whatever, not important (poison vs unitialized) 2021-11-06 14:17:21 +01:00
Bram Matthys 08f3561ce6 Fix-for-fix from a couple of minutes ago. Duh.. 2021-11-06 14:16:47 +01:00
Bram Matthys 25419700ee Cleanup: remove useless function call to set_usermode()
Probably was still there as a leftover, unfortunately cannot use it
at that moment since modules (and thus user modes) are not fully
initialized yet.
2021-11-06 13:47:08 +01:00
Bram Matthys 2abef3cdfb Don't check for NULL client in match_user() since it cannot or should not be.
(raises false expectations)
[skip ci]
2021-11-06 13:33:37 +01:00
Bram Matthys 700c579ee7 Fix possible crash in set::part-instead-of-quit-on-comment-change. 2021-11-06 13:27:45 +01:00
Bram Matthys c35174db32 Cleanup: don't check for NULL if they can't be NULL (variables
already dereferenced before)
[skip ci]
2021-11-06 13:26:57 +01:00
Bram Matthys 75b213c0db Fix theoretical bug in case a 3rd party module CommandOverride's "CYCLE" and
reads parv[1] after calling the command.
(Then it would have pointed to local storage which is wrong)
2021-11-06 13:10:17 +01:00
Bram Matthys 50b14305cf Get rid of if (module) in HistoryBackendAdd() as it is never NULL.
[skip ci]
2021-11-06 13:04:32 +01:00
Bram Matthys 4cf2940605 Fix-for-fix from a few minutes ago:
Ah okay, the `continue` in the switch was used as a `break 2`.
Changed to a `return` now as no memory is allocated anyway and
nothing further needs to be done. Also makes it immediately clear
(if you read the code) that processing ends there.
2021-11-06 13:01:12 +01:00
Bram Matthys 01c9891757 Fix some more memory leaks (all config related, and a debug one)
[skip ci]
2021-11-06 12:55:45 +01:00
Bram Matthys ff967957f4 Fix two small memory leaks in extjwt (sfilename, b64sig) and change another
one (extjwt_hash_val) to just a simply safe_free() as well which is less
error prone (just needs the value to be initialized to NULL at the beginning
but that is already done).
2021-11-06 12:45:07 +01:00
Bram Matthys 10d2701bfe fclose() before return in geoip_csv.c 2021-11-06 12:39:18 +01:00
Bram Matthys 3c977a4a73 Fix issue when using an URL multiple times in the config.
Was using AddListItem() with the two arguments swapped.
2021-11-06 12:36:32 +01:00
Bram Matthys cae44de110 Fix memory leak if no log { } block that logs to disk and we default
to creating one, also missed a filter.
2021-11-06 12:34:27 +01:00
Bram Matthys 5ae33809de Fix read-after-free in SVSNICK and remote NICK if there is any module
checking 'mtags' in HOOKTYPE_POST_LOCAL_NICKCHANGE.
[skip ci]
2021-11-06 11:31:40 +01:00
Bram Matthys 1e3f6e0128 Need to use ARRAY_SIZEOF() here, of course. (Not that it this bug
will be triggered realisticly)
[skip ci]
2021-11-06 11:28:33 +01:00
Bram Matthys dccab58090 Code cleanup: this just looks too weird otherwise.
[skip ci]
2021-11-06 11:19:51 +01:00
Bram Matthys 509b96b5f7 Clean up: some unimportant control flow issues, eg using 'continue'
instead of 'break' in a while(0) loop.
2021-11-06 11:10:17 +01:00
Bram Matthys abb575bdb6 S2S traffic: Fix using wrong variable in a loop, causing an OOB read. 2021-11-06 10:16:37 +01:00
Bram Matthys e0b9118efe Don't show empty 'via' for link.LINK_DENIED_DUPLICATE_SID_LINKED.
Reported by fo in https://bugs.unrealircd.org/view.php?id=5989
2021-11-05 14:54:10 +01:00
Bram Matthys a52a7304a2 Check for SID collision in SID command as well. We already checked in
PROTOCTL SERVERS=xxx which all servers send, so if these are all
UnrealIRCd servers then we should not reach this, BUT.. you never know
and non-unreal servers don't send this, so it matters for eg services.
2021-11-05 14:47:02 +01:00
Bram Matthys 4ef341769d Don't forward (spam) link.SERVER_LINKED_REMOTE.
Otherwise you get 1 from each server, which can be quite a pain
on a large network.
Reported by fo in https://bugs.unrealircd.org/view.php?id=5988
2021-11-05 14:31:10 +01:00
Bram Matthys 714461b655 Fix TLS debug error missing IP.
Reported in https://bugs.unrealircd.org/view.php?id=5993
2021-11-05 14:02:28 +01:00
westor 0698b04057 Update extban names in modules.default.conf (#175) 2021-11-03 08:54:42 +01:00
westor 888eb40273 Update modules.optional.conf to only use settings for loaded modules (#176)
This so you can just load the whole file but still use blacklist-module to not use some of it. Not sure if that is always a great idea, but it is now an option.
2021-11-03 08:53:57 +01:00
simplexish 2e30b40d9c Fix incorrect SAPART server notice / log message (#177) 2021-11-03 08:52:23 +01:00
Bram Matthys edb33baa22 Make it so set::level-on-join can also specify a mode letter such
as 'v' instead of like 'voice'. This is needed because third party
modules can now add access levels as well (eg: X).
2021-11-03 08:44:39 +01:00
Valerie Pond 571451b1e8 Fix set::level-on-join "none" no longer working 2021-11-03 08:22:35 +01:00
Bram Matthys 1b308c7ca0 Remove seemingly needless looping on SQUITs, as suggested by
Polsaker in https://github.com/unrealircd/unrealircd/pull/158

Have not tested this thoroughly on a larg(er) network, but if
there is any time to apply this patch, then it is now during
6.0.0 beta.
2021-11-01 17:32:58 +01:00
Bram Matthys e08627ead2 Update 'Server protocol' section in release notes.
[skip ci]
2021-11-01 11:08:35 +01:00
Bram Matthys 01815adfba Fix about 8 log messages that were incomplete (due to invalid var expansion) 2021-11-01 10:11:46 +01:00
Bram Matthys 99436ee83c Fix memory leak in /WHOIS 2021-11-01 09:23:45 +01:00
Bram Matthys 9b842140fc Fix missing comma 2021-11-01 07:31:05 +01:00
Bram Matthys d128510ee4 More fixes for $client.detail -> $client.details 2021-11-01 07:11:56 +01:00
Bram Matthys a70eac3293 Fix referencing wrong file in a comment in snomasks.default.conf.
Reported by DeviL.
[skip ci]
2021-11-01 07:11:43 +01:00
Valerie Pond f3db0d5971 Correct chgcmd snotice behaviour (#173)
Fix CHG commands snomask messages ($target.detail -> $target.details)
2021-11-01 07:09:49 +01:00
Bram Matthys 7dd40614dd Fix showing wrong oper login name and operclass in WHOIS (to opers). 2021-10-31 17:34:10 +01:00
Bram Matthys 8f3ef69fae Updates for Windows BuildBot
[skip ci]
2021-10-31 17:33:53 +01:00
Bram Matthys 44e420dc58 Add GeoIP / geoip_classic to Windows build.
Also fix an issue with convert_to_absolute_path() and remotely fetched files.
2021-10-31 14:16:39 +01:00
Bram Matthys 3653de5dfb Move debug notices to debug and suggest not to log them by default.
Also, add a note about AddressSanitizer in the release notes.
(this will be in 6.0.0-beta1)
2021-10-31 09:04:17 +01:00
Bram Matthys b29a9be288 ** UnrealIRCd 6.0.0-beta1 ** 2021-10-31 08:40:09 +01:00
Bram Matthys c196e31c60 Fix using wrong numeric for certfp in /WHOIS 2021-10-31 07:35:02 +01:00
Bram Matthys ca36a5256c Some text updates UnrealIRCd 5 -> UnrealIRCd 6 2021-10-31 07:20:57 +01:00
Bram Matthys 9fcb4ddbe9 Fix some log messages, reported by delta. 2021-10-30 18:41:09 +02:00
Bram Matthys ca238cd76b Make valid_server_name() use valid_host() to accept more characters.
And use the same function when testing the me { } block.
Reported by gerard.
2021-10-30 18:18:07 +02:00
Bram Matthys 57cb9ebc20 Consistently use $existing_client instead of $other_client.
Fixes some expansion issues (too), as reported by delta.
2021-10-30 17:41:15 +02:00
Bram Matthys e3b7ad8fc4 Fix crash in SENDSNO 2021-10-30 17:25:58 +02:00
Bram Matthys e3023cc926 Update release notes
[skip ci]
2021-10-30 12:36:15 +02:00
Bram Matthys 58c3e2940b Add link to JSON logging wiki article with screenshot
[skip ci]
2021-10-30 12:11:08 +02:00
Bram Matthys 5e47073eba Use sections in release notes (convert the remaining ones)
[skip ci]
2021-10-30 11:32:56 +02:00
Bram Matthys aba5817cc0 More release notes updates
[skip ci]
2021-10-30 11:29:00 +02:00
Bram Matthys bfe97a4bde Re-order items in release notes
[skip ci]
2021-10-30 11:17:39 +02:00
Bram Matthys 4be62698c2 Update release notes
[skip ci]
2021-10-30 11:15:05 +02:00
Bram Matthys ccf691e2e1 Update release notes
[skip ci]
2021-10-30 11:00:58 +02:00
Bram Matthys c47d64605a Refer to FAQ entry on log block change, and some other relnotes updates.
[skip ci]
2021-10-30 10:43:29 +02:00
Bram Matthys a6fa68f14a Update release notes (markup)
[skip ci]
2021-10-30 10:24:39 +02:00
Bram Matthys 08287d5740 Update release notes a bit (breaking changes section)
[skip ci]
2021-10-30 10:23:17 +02:00
Bram Matthys 041b169fa6 Use -rpath for geoip modules as well, when needed.
And yeah, should probably not use @VAR@ here directly but pass
it all the way up from other makefiles. Lazy.
2021-10-30 10:11:31 +02:00
Bram Matthys 4ea6c82a5d Move loading of geoip_classic to modules.default.conf
You can still use blacklist-module if you don't want to load it.

In future versions the exact config stuff will likely be different, but
this is just to get more test expore / make things Just work for now (tm)
2021-10-30 10:04:10 +02:00
Bram Matthys ed9f7cfb57 Add /GEOIP command so it's a bit easier to debug these things.
Load geoip_classic with correct settings (for now) in modules.optional.conf.
2021-10-30 09:57:27 +02:00
Bram Matthys 2adbb42ec7 Fix missing symbols in GeoIP modules, move -lXYZ to the end. 2021-10-30 08:51:15 +02:00
Bram Matthys 6918bd4422 Update test repo URL (duh, use https, not ssh) 2021-10-30 08:30:23 +02:00
Bram Matthys 0d468f0950 Update test repo URL
[skip ci]
2021-10-30 08:04:16 +02:00
Bram Matthys b41db3ccb7 Handle NULL in delletterfromstring(). Fixes crash via set_snomask() from SVSSNO. 2021-10-27 16:07:11 +02:00
Bram Matthys 32aa4dc625 Metadata can stay a 3rd party module for now. 2021-10-10 09:39:55 +02:00
Bram Matthys 1d94dc0e71 Some release note update
[skip ci]
2021-10-08 08:40:39 +02:00
Bram Matthys 3b4ed32d71 Use more enums instead of defines 2021-10-08 08:40:16 +02:00
Bram Matthys 53d21a0e56 Update release notes
[skip ci]
2021-10-01 12:04:59 +02:00
Bram Matthys fb08f3c109 Update release notes
[skip ci]
2021-10-01 11:25:24 +02:00
Bram Matthys 93a943e7b9 Update release notes
[skip ci]
2021-10-01 11:15:20 +02:00
Bram Matthys 8057b5755f Add operinfo to Windows Makefile
[skip ci]
2021-09-29 14:55:02 +02:00
Bram Matthys 74a5dbebe2 Update Windows makefile with new cloaking modules and vhoaq chanmodes
[skip ci]
2021-09-29 09:55:54 +02:00
Bram Matthys 520804edc2 Add set::whois-detail which allows you to configure which items
to expose to which users and in what detail.

The default configuration is as follows:

set {
	whois-details {
		basic		{ everyone full; }
		modes		{ everyone none;	self full;	oper full; }
		realhost	{ everyone none;	self full;	oper full; }
		registered-nick	{ everyone full; }
		channels	{ everyone limited;	self full;	oper full; }
		server		{ everyone full; }
		away		{ everyone full; }
		oper		{ everyone limited;	self full;	oper full; }
		secure		{ everyone limited;	self full;	oper full; }
		bot		{ everyone full; }
		services	{ everyone full; }
		reputation	{ everyone none;	self none;	oper full; }
		geo		{ everyone none;	self none;	oper full; }
		certfp		{ everyone full; }
		shunned		{ everyone none;	self none;	oper full; }
		account		{ everyone full; }
		swhois		{ everyone full; }
		idle		{ everyone limited;	self full;	oper full; }
	}
}

Oh, yeah, and for "secure" this also adds displaying of the TLS cipher
in /WHOIS for ircops and self by default. For all others it is limited
to just "is using a Secure Connection".

This also removes the newly added set::geoip::whois-for-anyone since
it is now configured via set::whois-details::geo.

Module coders: HOOKTYPE_WHOIS changed and you may no longer send
directly to the client from this hook. Instead, you should use
add to the NameValuePrioList, usually via the functions
add_nvplist_numeric() and add_nvplist_numeric_fmt().
For inspiration see bot_whois in src/modules/usermodes/bot.c
and reputation_whois in src/modules/reputation.c
2021-09-27 17:27:26 +02:00
Bram Matthys c06f423643 Get rid of ExtBan_Table[] and use a linked list called extbans.
Just like already done for Usermode_Table[] and Channelmode_Table[].

This also adds support for ->unloading=1 and re-use etc etc,
something that seemed to be missing before (but also wasn't
an issue apparently...).
2021-09-26 13:11:21 +02:00
Bram Matthys d6b67bc0a3 Update some unimportant comment(s)
[skip ci]
2021-09-26 12:49:50 +02:00
Bram Matthys ee8cc0e8e2 Get rid of Usermode_Table[] and use a linked list called usermodes.
Just like already done for Channelmode_Table[] -> channelmodes.
2021-09-26 12:46:34 +02:00
Bram Matthys 05f2694685 Add cloak_none module. Also improve warning when loading multiple cloak
modules a bit.
2021-09-26 08:57:40 +02:00
Bram Matthys ab7a56cfbb Add a note about cloaking
[skip ci]
2021-09-26 08:45:16 +02:00
Bram Matthys 1af3f23b9f Default config no longer loads a default cloaking module, since the
admin needs to make a choice.
Also update example conf to load the new cloaking module (cloak_sha256)
and update the text there to require at a key of 80 characters.
2021-09-26 08:36:01 +02:00
Bram Matthys fae7c0fef7 cloak_sha256: require cloaking key to be at least 80 characters.
This may also help with people accidentally loading cloak_sha256
when they previously had cloak keys for cloak_md5.

[skip ci]
2021-09-26 08:32:27 +02:00
Bram Matthys 08723e0e56 Error when no cloaking module is loaded. 2021-09-25 20:46:06 +02:00
Bram Matthys 97ccf29573 Make "./unrealircd gencloak" print the generated keys in a way
so the user can easily copy-paste them to their config file.
Also bump the key length from 50-60 to 80 characters.
2021-09-25 20:25:03 +02:00
Bram Matthys 72fd878664 Add "cloak_sha256" module.
This is based on the old MD5 module, it uses SHA256 instead.
Some re-indenting, replacing hardcoded values with a define,
and some other small changes due to the different hash size.
2021-09-25 20:13:57 +02:00
Bram Matthys e4b449adf8 Add set_channel_mode() which can be used to issue a server mode.
It's usage would be rare, but this is f.e. used from channeldb.
Other uses may be in some 3rd party module.
Example: set_channel_mode(channel, "+k", "key")
2021-09-25 17:42:21 +02:00
Bram Matthys 0e9d7a669f Update HOOKTYPE_LOG to work with new logging system (lots of different args) 2021-09-25 17:33:02 +02:00
Bram Matthys 892a639272 Get rid of big chunk in postconf_defaults() that is unneeded / much
easier now, now that we process the set { } block before all other
blocks (since a few years already).
2021-09-25 17:27:53 +02:00
Bram Matthys 35ae1bcc42 Update a comment about a hook
[skip ci]
2021-09-25 17:23:52 +02:00
Bram Matthys c6ef13b258 Remove HOOKTYPE_REQUIRE_SASL which was never called.
Apparently the other hooks were sufficient after all for authprompt ;D
2021-09-25 17:15:49 +02:00
Bram Matthys 834d38e904 Update HOOKTYPE_PRE_KNOCK to include reason (not used, though) 2021-09-25 17:08:53 +02:00
Bram Matthys 707575bc32 Resolve a number of todo items, most by simply removing them :D 2021-09-25 16:54:29 +02:00
Bram Matthys 38e47b9b62 Rename find_person() to find_user() to be consistent in the naming that
we use since UnrealIRCd 5: we have users (IsUser) and servers (IsServer).
2021-09-25 16:44:11 +02:00
Bram Matthys f2863656ea Remove a number of todo items in conf.c, some by resolving them and
others that can be removed since they are no longer relevant or
deemed not to be an issue.
2021-09-25 16:42:07 +02:00
Bram Matthys 3033fd9b6d Fix some todo items such as validating extban letter and names in ExtbanAdd() 2021-09-25 16:38:15 +02:00
Bram Matthys 73b908e413 Changes to BanContext struct (extended ban API):
* Now ban_check_types (previously checktype):
  this is one or more of BANCHK_* OR'd together, eg BANCHK_JOIN, BANCHK_MSG..
* Now ban_type (previously what2):
  this is the type of the ban, eg EXBTYPE_BAN, EXBTYPE_EXCEPT, etc.
* Now is_ok_check (previously is_ok_checktype)
  this is one of EXBCHK_* for is_ok, eg EXBCHK_PARAM to check parameter.
2021-09-25 16:28:10 +02:00
Bram Matthys b37b190fdd Add enums ExtbanCheck and ExtbanType for use in BanContext. 2021-09-25 16:16:42 +02:00
Bram Matthys fa95735f29 Merge branch 'unreal60_dev' of github.com:syzop/unrealircd-next into unreal60_dev 2021-09-25 16:10:39 +02:00
Bram Matthys e18bea2a89 Re-add STATUSMSG in 005 and change the make_prefix() since it now
creates two buffers.
Also remove the placeholder for STATUSMSG and PREFIX in src/api-isupport.c
2021-09-25 16:09:50 +02:00
k4be 063bdc1f5b Merge branch 'unreal60_dev' of github.com:syzop/unrealircd-next into unreal60_dev 2021-09-25 16:02:16 +02:00
k4be 11fb778e9d Move METADATA isupport to a correct place 2021-09-25 16:01:27 +02:00
Bram Matthys 3f5d9bf865 member modes / prefix modes (vhoaq) should not show up in CHANMODES= 2021-09-25 16:00:44 +02:00
Bram Matthys bf6d47716e An extra -Wformat-nonliteral fix for clang 3.x (ubuntu 16.04 / debian 8). 2021-09-25 15:55:49 +02:00
k4be ae08cbfb3b Fix isupport PREFIX token generation 2021-09-25 15:40:54 +02:00
Bram Matthys 49e1a8a565 Merge branch 'unreal60_dev' of github.com:syzop/unrealircd-next into unreal60_dev 2021-09-25 15:25:00 +02:00
k4be a07f7f2567 extjwt cmodes: generate array of mode characters 2021-09-25 15:23:04 +02:00
Bram Matthys 174459587c Fix crash on CAP-capable TLS client connect.
Crash was introduced couple of weeks ago by proxy stuff.
2021-09-25 15:22:17 +02:00
Bram Matthys 4a4d069f11 Get rid of ignore for -Wformat-nonliteral in two entire files,
now it is only in 5 functions in entire UnrealIRCd. Acceptable.
2021-09-25 15:16:45 +02:00
Bram Matthys 8603c2eb71 Update hunt_server() so command is really the command (eg "LUSERS") and
not a format string (eg ":%s LUSERS %s"). It now simply concats all parv[]'s.
That is, up to parc count. And it automatically does the :stuff for the
last parameter if it contains spaces or starts with a : etc.

This gets rid of a bit sketchy code with an arbitrary maximum etc.

Now it's just:
if (hunt_server(client, NULL, "REHASH", 1, parc, parv) != HUNTED_ISME)
	return;

This has one side effect, though:
Previously we used the format string, so it may be possible for S2S
traffic to now have more arguments then before here and there.
Eg:
* It could be that the caller was using a format string to
  intentionally cut off an extra parameter at the end.
  You can still do that if you call with eg parc-1 instead of parc.
  I don't think there were any such cases though, but hard to rule out.
* Extranous parameters may show up in S2S traffic where it was
  previously unexpected.
2021-09-25 14:49:19 +02:00
Bram Matthys b5375de52d Move some reputation log msgs to ULOG_DEBUG (they already required DEBUGMODE) 2021-09-25 14:24:15 +02:00
Bram Matthys 299c885802 More room for log buffer 2021-09-25 14:23:20 +02:00
Bram Matthys 10ec3c164a Rename the old cloaking module to "cloak_md5" (UnrealIRCd 3.2.1 - 5.2.X)
It was used from July 2004 and served us well it seems.
2021-09-25 11:23:14 +02:00
Bram Matthys ec8f54ec26 Update cloaking key mismatch error and rename some stuff. 2021-09-25 11:19:15 +02:00
Bram Matthys 5100d4863c Guard against multiple log blocks logging to the same file. 2021-09-25 11:12:00 +02:00
Bram Matthys 47279108e4 Use get_operclass() in extbans/operclass as well. 2021-09-25 11:02:39 +02:00
Bram Matthys cac8c34bcc JSON logging: expand operlogin and operclass for users who are ircop.
This uses the new get_operlogin() / get_operclass() functions.
Also updated whois code to use them too.
2021-09-25 10:58:39 +02:00
Bram Matthys b95eb0b3b7 Add get_operlogin() and get_operclass() functions to make things easy.
This retrieves the oper login (/OPER thislogin ...) and operclass of
local and remote users.
2021-09-25 10:57:00 +02:00
Bram Matthys c1378abc32 Initialize variables to NULL (duh) 2021-09-25 10:33:47 +02:00
Bram Matthys 677fcf6b71 Move the HOOKTYPE_LOCAL_OPER back out of remove_oper_privileges().
Can't have it in that function as it may be called even when the
user was not oper before (as a safety precaution). Pitty.
2021-09-25 10:32:25 +02:00
Bram Matthys ce5917e0d9 Expose operlogin and operclass via moddata so they can be seen in WHOIS
and used for auditting purposes across servers (assuming the servers
itself can be trusted).
This is done via the 'operlogin' module which is loaded by default.
Obviously for opers of U5 and below this information is not available.

This also changes the HOOKTYPE_LOCAL_OPER hook to include oper block info:
-int hooktype_local_oper(Client *client, int add);
+int hooktype_local_oper(Client *client, int add, ConfigItem_oper *oper_block);
2021-09-25 10:28:36 +02:00
Bram Matthys b00743fa79 Bump moddata slots
[skip ci]
2021-09-25 10:24:32 +02:00
Bram Matthys edbfaaf95d JSON logging: expand user modes, snomasks, and oper login (if available)
This also adds a function get_usermode_string_r(), which requires
you to specify the buffer (and buffer length) for building the
umode string.
2021-09-25 09:45:30 +02:00
Bram Matthys 6e74cd133b Expand channel modes in JSON logging messages of 'channel' 2021-09-25 09:28:00 +02:00
Bram Matthys 135c5f0747 Use strlcpy()/strlcat()/strlcat_letter() in channel_modes() instead
of pointer calculations. We don't need the speed improvement anymore.
2021-09-25 09:21:31 +02:00
Bram Matthys bf7a72a850 Usermode_Table[].flag -> Usermode_Table[].letter
just like how it is now in U6 in channel modes and extended bans
2021-09-25 09:13:34 +02:00
Bram Matthys fbf3a51517 Add HOOKTYPE_CAN_SET_TOPIC, which works similar to HOOKTYPE_CAN_KICK.
Move checking of +t restrictions to chanmodes/topiclimit.
Move checking for +m restrictions to chanmodes/moderated.
Now the only check remaining in topic is for +b (banned users)
which is fine I think.
2021-09-25 09:04:19 +02:00
Bram Matthys 618049fca1 Add buildnumeric() function, which will only be used sporadically as you
would normally use sendnumeric() instead.

The buildnumeric() function prepares a buffer but does not send it.
It is used in eg CAN_KICK / CAN_SET_TOPIC, where you need to set an
'errbuf' with a full IRC protocol line to reject the request (which
then may or may not be sent depending on operoverride privileges).
2021-09-25 09:03:48 +02:00
Bram Matthys 847f2fc384 Remove is_ip_valid() as we already have is_valid_ip(), and update
the doxygen docs a bit for that function.
2021-09-25 08:17:47 +02:00
Bram Matthys c582a29f09 Update doxygen docs a bit (minimal) for channel access functions. 2021-09-25 08:13:18 +02:00
Bram Matthys fabe16a95c Get rid of has_voice(), is_half_op(), is_skochanop(), is_chan_op(), is_chanadmin(),
is_chanowner(). Using check_channel_access() instead now.
2021-09-25 08:00:57 +02:00
Bram Matthys 0b6336c5f9 Update config.guess and config.sub from 2015-03-04 to 2021-06-03 2021-09-24 18:20:13 +02:00
Bram Matthys ca9132b345 Update geoip-classic.tar.gz. Changes:
In configure remove AC_FUNC_MALLOC and AC_FUNC_REALLOC.
These don't do anything, except they cause a build failure on
Ubuntu 21 and later (together with openssl 3.0.0 anyway).
2021-09-24 18:11:43 +02:00
Bram Matthys 39ead41fae Update notes about release notes a bit
[skip ci]
2021-09-24 17:50:39 +02:00
Bram Matthys 8acd17b0ef Make the error a bit more clear (that the two lines are related)
[skip ci]
2021-09-24 17:46:57 +02:00
Bram Matthys efb16159f3 Add check for missing include "snomasks.default.conf";
Well, not literally, but indirectly :D
2021-09-24 17:44:57 +02:00
Bram Matthys f85732a7e0 When unreal_log() was called incorrectly and wanted to print a BUG
error message about this it crashed. Can't use NULL va and the
null_va trick didn't work either, so.. don't use va stuff at all..
2021-09-24 17:33:30 +02:00
Bram Matthys fa9957ac6b Add GeoIP engine prompt to ./Config 2021-09-24 17:19:02 +02:00
Bram Matthys 3fda96448d Fix crash due to invalid subsystem use in tls.c
[skip ci]
2021-09-24 17:17:03 +02:00
Bram Matthys 4397450bd0 Revert LD_LIBRARY_PATH= in unrealircd script, as we use -rpath for that. 2021-09-24 16:57:52 +02:00
Bram Matthys baa07b179f Get rid of some other old upgrade conf stuff as well. Remove some,
but keep some other errors, since they may still be helpful,
or at least for now.
2021-09-24 16:47:23 +02:00
Bram Matthys a2a9eebf98 Get rid of ./unrealircd upgrade-conf (was for 3.2.x to 4.x) 2021-09-24 16:40:42 +02:00
Bram Matthys 864aef89da LOG_DEST_OTHER => LOG_DEST_DISK 2021-09-24 16:37:24 +02:00
Bram Matthys f29e0fcfe1 Make sure nobody uses a subsystem of like "info" or "debug" etc,
which are reserved for log levels, and would otherwise clash in
the log::sources configuration.
2021-09-24 16:15:05 +02:00
Bram Matthys 4b079dbd1b Add JOIN/PART/KICK logging (snomask 'j').
This also changes the remove_user_from_channel() function to have an
extra parameter to hide it from logs. This is used for KICK (already
logged) and QUIT (which would be stupid to generate 10 part log lines for).
2021-09-24 16:08:41 +02:00
Bram Matthys 4e511da9fb Update default logging conf
[skip ci]
2021-09-24 15:52:41 +02:00
Bram Matthys 8de1adc1c0 Update SECURITY.md to include U6
[skip ci]
2021-09-24 11:33:26 +02:00
Bram Matthys 56c3b4ced6 Automatically add default log block that logs everything if no log
block to disk is present.
Also update the English example.conf.

Both may need some default filtering (or not)...
2021-09-24 11:30:04 +02:00
Bram Matthys 9852ec9991 No longer log everything, so apply source { } on log blocks for disk files.
This also adds the option "all" to log everything (after which you can
use exclusion if you wish, eg "!whatever".
2021-09-24 11:15:52 +02:00
Bram Matthys d3dfa5f40c Make negative matching work in log sources, update default snomasks.
No longer log to all ircops if no matching snomasks.
So yeah, if you don't load snomask.default.conf you will see nothing
(TODO: some warning / error for this)
2021-09-24 11:07:25 +02:00
Bram Matthys 1d73db560c Get rid of modules/snomasks directory, since the snomask module API is gone.
(IRCOps can set any snomask dynamically now)
2021-09-24 10:10:27 +02:00
Bram Matthys b41311ddaf Update default snomask to +bBcdfkqsSoO 2021-09-24 10:03:18 +02:00
Bram Matthys e14b463b60 Major update to default snomask configuration 2021-09-24 09:41:32 +02:00
Bram Matthys bcfe43788d Some unimportant unreal_log() updates.
[skip ci]
2021-09-24 09:41:21 +02:00
Bram Matthys be6bbbcc6b Convert all remaining sendto_umode()/sendto_umode_global() to unreal_log().
Except, of course, the ones that actually need to send to a user mode,
which is only LOCOPS and GLOBOPS.
2021-09-24 08:28:37 +02:00
Bram Matthys 52667445f2 Fix warning on vsendto_prefix_one (my mistake...) 2021-09-23 20:03:33 +02:00
Bram Matthys 43e4c5444f We already got rid of sendto_ops(), now get rid of sendto_realops().
Use the new logging instead.
2021-09-23 19:57:05 +02:00
Bram Matthys 2a7da65574 Fix header: wallops -> usermodes/wallops 2021-09-23 19:31:28 +02:00
Bram Matthys 0439e4f89d Move wallops module from "wallops" to "usermodes/wallops"
(which includes the command)
2021-09-23 19:25:38 +02:00
Bram Matthys 20c4ac2cd1 Move all wallops code out of the core. 2021-09-23 19:21:19 +02:00
Bram Matthys b94707a51b Change (or delete) old sendto_ops() calls. Function is now gone. 2021-09-23 19:14:10 +02:00
Bram Matthys e36c85e4ce I don't understand much from this old code, but.. whatever. 2021-09-23 19:13:55 +02:00
Bram Matthys 6abd74b121 Get rid of REHASH flag handling for staff, just rehash ffs...
And this module is not perm so we can ditch all this code.
2021-09-23 18:55:17 +02:00
Bram Matthys cb31ec97a3 JSON log: expand a bit more for IsMe(), like filling in some client.server
stuff. Also add client.server.info for both IsServer() and IsMe().
2021-09-23 18:50:08 +02:00
Bram Matthys 720f597ad6 Get rid of current snomask system and allow ircops to set any snomask
(that is: a-z A-Z) so to use the dynamic system with the new logging.
Largely untested.
2021-09-22 15:49:20 +02:00
Bram Matthys 7fdd14de95 Remove sendto_snomask() and sendto_snomask_global() as this is no longer
the way we do things with the new logging stuff.

And converted the last few calls to these functions to unreal_log().
2021-09-22 14:27:50 +02:00
Bram Matthys e6bc040402 Update coders in ./Config as well (and restyle a little bit) 2021-09-22 12:46:38 +02:00
Bram Matthys 5175afb598 Update ircd coders 2021-09-22 12:02:46 +02:00
Bram Matthys 8d5ccee2d1 Put arabic-utf8 in the correct group and #if out the hard errror
when mixing UTF8 groups, make it a general warning again as it
may or may not be an issue.
2021-09-22 09:42:42 +02:00
Bram Matthys bcf5b2d4b8 Add support for arabic-utf8 in set::allowed-nickchars. Supplied by Sensiva
in https://bugs.unrealircd.org/view.php?id=3734
2021-09-22 09:42:08 +02:00
Bram Matthys 215677d785 Fix hooks, so gcc compiles again after last few commits. 2021-09-20 18:32:32 +02:00
Bram Matthys 381454bd1d 1) Change from .prefix_priority to .rank.
2) Make higher value = higher ranking
3) Ship with defines for these:
 #define RANK_CHANOWNER  4000
 #define RANK_CHANADMIN  3000
 #define RANK_CHANOP     2000
 #define RANK_HALFOP     1000
 #define RANK_VOICE        -1
2021-09-20 16:09:14 +02:00
Bram Matthys 139098919b Get rid of PREFIX_* in sendto_channel(), message.c and in chanmsg hook.
We use char *member_modes like we now have at all the other places,
which contains eg "o".

TODO: fix prefix sending rules or remove some if 0'd out code

And not sure if we want to do it entirely this way :D
2021-09-20 15:54:57 +02:00
Bram Matthys 6277efd85e Make SAJOIN code use generic prefix framework. Also fix multi-channel
joins in such a case, code was wrong (things being done in the wrong
scope).

This also fixes a bug where an OperOverride message was generated
for SAJOIN nick @#test
2021-09-20 14:19:04 +02:00
Bram Matthys 83f4619e78 Get rid of the choice for/aginst PREFIX_AQ for three reasons:
1) All IRC clients support prefixes nowadays
2) People generally misunderstand the question and think this
   disabled +q (channel owner) and +a (channel admin), when
   in fact it does not. It only enables/disables the showing
   of prefixes, and it changes some of the rules eg requiring
   +qo / +ao for actions that normally only require +q / +a.
3) We now have the modularized +q and +a, so you can actually
   disable channel owner and channel admin, which is what most
   users want(ed) that previously disabled PREFIX_AQ.

For all users (95%+) that enable PREFIX_AQ there is no effective
change. For the other 5% it is likely only for the better.
2021-09-20 13:19:51 +02:00
Bram Matthys 067fb5c830 Fix last detected REHASH memory leak for now (couple of bytes) 2021-09-20 10:06:24 +02:00
Bram Matthys 1e6cce798b Fix memory leak on rehash: free log->sources 2021-09-20 10:04:43 +02:00
Bram Matthys 1631f35e18 Actually free memory of the channel mode, now that we use a linked
list instead of a fixed array.
(since 783cc3ff5b from 1 month ago)
2021-09-20 09:51:26 +02:00
Bram Matthys 3513806e66 Make PREFIX= dynamic by writing it based on the loaded modes. 2021-09-19 18:30:54 +02:00
Bram Matthys dd9f65f585 Add the new modules for vhoaq handling :D 2021-09-13 18:55:06 +02:00
Bram Matthys 187157b5be Fix compiler warnings 2021-09-13 18:50:40 +02:00
Bram Matthys 4cea88645c Modularize member modes (vhoaq).
Still need to clean up a bit after this, but it passes all tests :)
2021-09-13 18:44:18 +02:00
Bram Matthys 6586fe8acd Remove all unused numerics from include/numeric.h. 2021-09-12 16:46:25 +02:00
Bram Matthys cf936078d4 Get rid of the legacy numeric stuff. The file src/numeric.c is removed
as all the numerics are in include/numeric.h now, so we can have
format string checks with a few macro tricks.
(See also previous commits)
2021-09-12 16:31:26 +02:00
Bram Matthys 6237bf5f5f Convert watch code to use new sendnumeric(), getting rid of the temporary
sendnumeric_legacy() calls.

This also fixes some small format string bugs (eg: argument too much and
some time_t fun, like the previous commits elsewhere... nothing fancy).
2021-09-12 16:28:04 +02:00
Bram Matthys 4392468c3e Update HOOKTYPE_CAN_JOIN and HOOKTYPE_CAN_JOIN_LIMITEXCEEDED to take
an extra char **errmsg argument. Upon failure (non zero return value)
this should contain a format string to be sent to the client
(with the return value denoting the number of the numeric).

This gets rid of sendnumeric_legacy() in join.c
2021-09-12 16:09:36 +02:00
Bram Matthys e27749f556 Use long long casts due to time_t difference on Windows vs Linux.
Should now compile without errors on both.
2021-09-12 15:29:26 +02:00
Bram Matthys e046ec7244 Regenerate and mention actual number of the numeric in STR_ERR_*/STR_RPL_*. 2021-09-12 14:46:43 +02:00
Bram Matthys fc9bf5d607 Change sendnumeric() so it can check for format string problems.
This already found a few issues.

As a side-effect, this also means you can only use RPL_xxx and
ERR_xxx in the 2nd argument from now on. You can no longer use
a dynamic integer (eg 'reply') at runtime, since then the format
string cannot be checked.

More to follow, after making sure it works on Windows too.
2021-09-12 14:30:34 +02:00
Bram Matthys 6577721089 Get rid of the option to show modes in /LIST. Always do this.
I don't think there were more than a handful of people who disabled
this, and it clutters the source badly (not to mention that this
should not be a compile time option at all).
2021-09-12 11:28:07 +02:00
Bram Matthys 3543617834 Get rid of some useless #ifdef'd numeric stuff. 2021-09-12 11:25:34 +02:00
Bram Matthys 22bae6ec98 .................
[skip ci]
2021-09-12 11:15:20 +02:00
Bram Matthys 1f8add8868 Some clang 3 specific fixes
[skip ci]
2021-09-12 10:58:37 +02:00
Bram Matthys 58ebadf06b Forgot to run ./autogen.sh... duh. 2021-09-12 10:37:37 +02:00
Bram Matthys da8b70d78c no-no-no... something was not right here ;D 2021-09-12 10:31:14 +02:00
Bram Matthys d35a1baeb2 Can't use -Wno-unknown-pragmas on older compilers, have to resort to
-Wno-pragmas. Well, whatever. We compile with recent compilers in
BuildBot and dev environment so we will not use it there.
2021-09-12 10:26:19 +02:00
Bram Matthys 8e2640683b Compile with -Wparentheses by default. I think most of these are
already enabled by default but some were not.
2021-09-12 10:13:43 +02:00
Bram Matthys a55f2e0c03 Updates for last 2 commits: use a better tactic to deal when
trying to disable warnings in pragma's that are unknown to the
compiler.

We prefer -Wno-unknown-warning-option, which does exactly what
we want. If not available then fallback to -Wno-unknown-pragmas.
That way on recent clang/gcc's we keep the useful pragma warnings,
while still being able to compile on older compiler versions.
2021-09-12 10:10:02 +02:00
Bram Matthys f8811c1f4a Older gcc/clangs need -Wno-unknown-pragmas it seems. 2021-09-12 10:01:17 +02:00
Bram Matthys 3b5b2b5c2f Get rid of -Wno-cast-function-type (well, mostly) and also check for
the existence of -Wno-unknown-warning-option so we can add these since
we use pragma's occasionally to suppress compiler warnings and some
of these may exist in gcc but not in clang or vice versions (and..
versions of course), which would otherwise yield an error.
2021-09-12 09:34:52 +02:00
Bram Matthys 6ce95c3d79 Fixes for previous commit now that we use -Waddress (well, implicitly
through -Wall/-Wextra)
2021-09-12 09:19:46 +02:00
Bram Matthys 62a56b041a Get rid of -Wno-address 2021-09-12 09:06:31 +02:00
Bram Matthys 3517c7a10b Fix a stupid strlcpy mistake where i used sizeof(src) instead of sizeof(dst)
Woah...... caught by -Wstrlcpy-strlcat-size on FreeBSD, nice.
2021-09-11 18:18:29 +02:00
Bram Matthys 7b53af40a1 Temporarily ignore deprecation warnings with OpenSSL 3 in extjwt module.
Obviously these must be fixed at a later point in time, but we don't
want BuildBot to keep failing for now.
2021-09-11 18:16:35 +02:00
Bram Matthys cbe14b0404 Fix SJOIN not working well with channels that don't exist on the other
side. This was due to channel->creationtime being set to TStime() but
then not adjusted/set later, (also) resulting in some adding/removing
action of modes as well.
It *seems* the other few cases were OK though: equal TS, lower TS,
higher TS, just not the "channel only exists on one side"-case.

Guess we need more test coverage!

This also removes the "TS for #channel changed" message that was sent
to channel members. I doubt regular users understand these messages.
I did add a message (unreal_log) to IRCOps, which may or may not be
useful or too noisy... unsure about this one :)
2021-09-11 18:10:25 +02:00
Bram Matthys 0bde5b7070 Randomly getting rid of some strcpy and strcat 2021-09-11 17:43:15 +02:00
Bram Matthys f6c66e5428 Fix windows warning regarding size mismatch (%ld / timestamp)
Due to one of the last commits.
2021-09-11 17:30:33 +02:00
Bram Matthys 4de8456697 Fix compiler warning on Windows 2021-09-11 16:30:23 +02:00
Bram Matthys a4d5341b41 Fix non-debugmode build 2021-09-11 16:12:43 +02:00
Bram Matthys 8353a9e17b Change char *parv[] to const char *parv[] everywhere. This is a BIG change.
It means you can no longer modify eg parv[1] in-place with strtoken and such.

The main reason for this is that as a command handler you have no idea
where the arguments may come from. It could be from a do_cmd() with
read-only storage (eg a string literal) and so on.

It started with an experiment of how far I could get and how annoying the
side-effects would be, but they seem to be quite managable, so I'm
committing this stuff.

Hopefully this catches/solves some stupid bugs somewhere :)
2021-09-11 16:02:44 +02:00
Bram Matthys 39edbd643d Get rid of proto.h and integrate the 20 lines into h.h. 2021-09-11 10:26:18 +02:00
Bram Matthys 5dc6411419 Const const const. This completes the work in h.h. 2021-09-11 10:21:54 +02:00
Bram Matthys 439376b334 Fix compile error when not using cURL, due to recent changes. 2021-09-11 10:04:01 +02:00
Bram Matthys fcf020b99e It's raining consts... 2021-09-11 09:56:22 +02:00
Bram Matthys 9a350169b9 Fix test suite failing occasionally due to cached time in JOINs. 2021-09-11 08:22:22 +02:00
Bram Matthys 7cabd4b79e Const const const 2021-09-11 08:17:12 +02:00
Bram Matthys ac84d4f207 Const const const... modules.c and elsewhere. 2021-09-11 07:53:30 +02:00
Bram Matthys 6f91b2854a Add extra logging for build tests to trace issues. 2021-09-11 07:02:17 +02:00
Bram Matthys 5bc244c1f3 Add a lot more consts. This finishes the work for all hooktypes. 2021-09-10 20:36:38 +02:00
Bram Matthys 74d1481dcb Do the same for RunHookReturn() and RunHookReturnInt().
NOTE: The arguments are swapped, it is now eg:
RunHookReturn(HOOKTYPE_SOMETHING, !=0, a, b, c);
2021-09-10 19:32:17 +02:00
Bram Matthys 7dac12e31e Get rid of RunHook2/3/4/5/6/etc and just have RunHook with __VA_ARGS__ 2021-09-10 19:27:18 +02:00
Bram Matthys cb9b24686b Module API changes:
- For HOOKTYPE_LOCAL_JOIN and HOOKTYPE_REMOTE_JOIN: drop parv[] argument
  as it was useless anyway, it only contained the channel name in parv[1]
  but never the key, sometimes was entirely NULL even.
- For HOOKTYPE_PRE_LOCAL_JOIN instead of char *parv[] we now pass
  const char *key. As predicted more than a year ago when fixing
  0902ed7a99
2021-09-10 19:22:47 +02:00
Bram Matthys 5b091975f5 Get rid of parv[] in HOOKTYPE_CAN_JOIN and HOOKTYPE_CAN_JOIN_LIMITEXCEEDED
as it already has a 'key' argument too.
2021-09-10 19:11:37 +02:00
k4be b2718379d7 Workaround compiler warning with openssl version below 1.1.0-pre3, 2021-09-10 17:02:19 +02:00
k4be e13815b604 Add extjwt module 2021-09-10 16:19:07 +02:00
Bram Matthys c5e0ba7780 Fix build with cURL due to the latest changes. 2021-09-10 15:50:01 +02:00
Bram Matthys 86fa29aaee Add consts in support.c 2021-09-10 15:48:58 +02:00
Bram Matthys 9438ddfd93 Add consts in user.c 2021-09-10 15:40:50 +02:00
Bram Matthys 09a412782d Const stuff for misc.c 2021-09-10 15:25:21 +02:00
Bram Matthys 447555e044 More consts in stats.c 2021-09-10 15:07:17 +02:00
Bram Matthys f085173d46 More const char * stuff... mostly in conf.c but also elsewhere. 2021-09-10 15:01:23 +02:00
Bram Matthys 2e82ab0eca Make CommandOverrideAddEx() the new CommandOverrideAdd():
IOTW, change CommandOverrideAdd() to require a priority argument:
-       CommandOverrideAdd(modinfo->handle, "TEST", override_test);
+       CommandOverrideAdd(modinfo->handle, "TEST", 0, override_test);
2021-09-10 14:13:07 +02:00
Bram Matthys bba0124bd3 Drop the Ex... CallbackAdd*Ex() -> CallbackAdd*() 2021-09-10 14:09:22 +02:00
Bram Matthys 6ebddc8817 Update channel mode API to use more consts 2021-09-10 14:06:57 +02:00
Bram Matthys 08a32429ff Update extban API to use more consts 2021-09-10 13:39:26 +02:00
Bram Matthys d4d4da6a8d Add another const to ValidatePermissionsForPath. Fix Windows build, maybe? 2021-09-10 12:58:15 +02:00
Bram Matthys 66a51fb659 Massive conversions from 'char *' to 'const char *' and 'char **' to 'const char **' 2021-09-10 12:46:31 +02:00
Bram Matthys edfdfe4a03 Add HookAddConstString() and friends.
Also EfunctionAddPChar() -> EfunctionAddString(), and callbacks etc.
2021-09-10 11:59:14 +02:00
Bram Matthys a3bfa210e9 HookAddPChar() -> HookAddString()
and .pcharfunc -> .stringfunc
2021-09-10 11:49:06 +02:00
Bram Matthys fe3907f153 Use more const char * 2021-09-10 11:39:04 +02:00
Bram Matthys d648cd0729 Use strlncpy() everywhere where we previously used strlncat() with a empty
buffer (due to the lack of strlncpy before...).
2021-09-10 11:26:36 +02:00
Bram Matthys c550d95619 Add strlncpy(): works just like strlcpy except that it has an extra
argument which specifies how many characters to copy max.

strlncpy(dest, src, sizeof(dest), maxcopybytes);
vs
strlcpy(dest, src, MIN(sizeof(dest),maxcopybytes+1));

We already had a strlncat() vs strlcat()
2021-09-10 11:19:57 +02:00
Bram Matthys cd88e02f3d Use more const char * 2021-09-10 11:11:54 +02:00
Bram Matthys 463c7d4ddf Spoof remote connecting/disconnecting notices with sender being the
server where the client is (or was) on. Just like we did in UnrealIRCd 5.

Not sure if API-wise and variable-name-wise I want to do it this way,
but whatever...
2021-09-10 08:54:29 +02:00
k4be 59888af8db Fix crash on failed file download while rehashing 2021-09-05 19:56:41 +02:00
Bram Matthys 43f77b8211 BuildBot: log server commands for tracing 2021-09-04 10:55:11 +02:00
Bram Matthys 2951c94ccd Use $MAKE instead of make in extras/build-tests/nix/build too 2021-09-04 09:37:45 +02:00
Bram Matthys 01ec8696d0 FreeBSD hangs with ASan enabled, in OPENSSL_init_ssl(), so disable it in
the build tests (wtf?)
[skip ci]
2021-09-04 09:36:59 +02:00
Bram Matthys 4ef3b9f000 Add BSDmakefile with a note to run 'gmake' for BSD users.
Also, check for GNU make (which can be either 'make' or 'gmake')
early in ./Config and print out an error to install prerequisites
from https://www.unrealircd.org/docs/Installing_from_source

This also replaces 'make' with ${MAKE} (and such) everywhere.
2021-09-04 09:31:30 +02:00
Bram Matthys 894b7e5461 Makefiles: switch from suffix rules to pattern rules. As suffix rules
can't have dependencies, so if you change a .h file, it fails to
recompile the other dependencies. Grmpf!
This does mean that we require GNU Make (gmake) from now on.
2021-09-04 08:25:18 +02:00
Bram Matthys 9ef1d06afd Remove more unused stuff in dynconf.h, and drop set::dns which did
nothing since 3.2 or so.
2021-09-03 21:17:51 +02:00
Bram Matthys 13dc17f5dc Code cleanup: remove unused structs and variables. 2021-09-03 21:07:38 +02:00
Bram Matthys 617288991e Remove find_except(), conf_except and struct ConfigItem_except.
These are all unused since the addition of ELINE.
2021-09-03 20:46:06 +02:00
k4be 8c6f94ffef metadata debug: remove command logging and replace last sendto_snomask with unreal_log.
Also get rid of unused trylater variable.
2021-09-03 18:54:19 +02:00
Bram Matthys 4a82b89793 Code cleanup in tkl.c: get rid of confusing 'whattodo' and use 'add'
which is 1/0 so that the meaning is straightforward.
2021-09-03 11:05:19 +02:00
Bram Matthys 16179b9c00 Don't log add_config_resource() debug code by default. 2021-09-03 10:37:51 +02:00
Bram Matthys a9833ebedf Fix crash on empty remote METADATA (bad S2S traffic). 2021-09-03 08:50:16 +02:00
Bram Matthys c4a4867ca5 More goto's make the world a better place.
Oh and also fix a memory leak in parse_extended_server_ban().
2021-09-03 08:06:03 +02:00
Bram Matthys 7d75b38c26 OpenSSL: Check for lib64
Mostly due to openssl 3 beta if you custom build to a specific dir.
2021-09-03 07:54:25 +02:00
Bram Matthys 1f2e79b64c Fix missing return after exit_client() in PROTOCTL.
This caused client->server to be NULL and then when processing
another PROTOCTL parameter this would cause a crash.
2021-09-02 18:15:12 +02:00
Bram Matthys 725e03e1e9 Simplify identical_ban(), it was never perfect anyway. 2021-09-02 17:20:54 +02:00
Bram Matthys 9cdd90e848 Ignore remote MONITOR requests.
(Fixes crash with faulty S2S traffic)
2021-09-02 17:08:10 +02:00
Bram Matthys 5b9c419041 Add parse_extended_server_ban(). This makes named extended server bans
working now (eg ELINE ~certfp:xyz etc).
Also fixes a crash due to an OOB read.
2021-09-02 17:01:20 +02:00
Bram Matthys 9952a8e98f Be more careful in json_expand_client() when called for a server that is
only partially a server yet: IsServer() is true but client->server is NULL.
Fixes a crash when called from PROTOCTL.
Actually not entirely sure if this happens in practice, but better safe
than sorry.
2021-09-02 15:59:43 +02:00
Bram Matthys fa5c9039a2 Put the same extban rule checks in extban_is_ok_nuh_extban() as they
already were in extban_conv_param_nuh_or_extban().
The recursion check was already there, but not the "rule 2 violation"
if ((extban->options & EXTBOPT_ACTMODIFIER) || (extban->options & EXTBOPT_NOSTACKCHILD))

This also backs out the temporary fix 5df1b1b889.
2021-09-02 15:51:11 +02:00
k4be 459deb3084 Actually, ignore all s2s PROTOCTL from users 2021-08-31 16:35:59 +02:00
k4be 45775d1929 Fix crash on bad s2s INVITE command 2021-08-31 15:18:21 +02:00
k4be f4ad2416a7 Make server name check a bit more strict
(% characters made sendnumeric generate invalid format strings)
2021-08-31 13:38:14 +02:00
k4be 5df1b1b889 Workaround crash with stacked multiple ~f bans
This should probably be fixed properly later.
2021-08-31 13:00:47 +02:00
k4be 7f958b7dad Fix crash for setting channel metadata by unregistered connections 2021-08-31 12:59:46 +02:00
k4be c711bc6dfb Fix named extban name comparison
(was accepting names with extra stuff after a valid name)
2021-08-30 18:35:58 +02:00
k4be 228f6f05af Ignore PROTOCTL EAUTH from users 2021-08-30 09:29:32 +02:00
Bram Matthys 8caeae6f82 Fix crash on PROTOCTL EAUTH= 2021-08-29 14:08:12 +02:00
k4be 420ebd7900 Get rid of NULL va_list compiler error 2021-08-29 12:35:29 +02:00
Bram Matthys f3c7b8c456 Windows: fix an external variable not being MODVAR, causing a funny
"no more connections available" error. Oh Windows.... such a joy!!!
[skip ci]
2021-08-29 12:19:15 +02:00
Bram Matthys 07390d093f Remove modules/mdex which is an example that shouldn't be used/built
(with UnrealIRCd anyway)
[skip ci]
2021-08-29 12:04:54 +02:00
Bram Matthys 340e6016da Windows makefile: update the DLL_FILES list as well.
This is just autogenerated so let's hope there is no mistake :D
At least it is nicely sorted alphabetically now.
[skip ci]
2021-08-29 12:00:18 +02:00
Bram Matthys d0968628c4 More Windows BuildBot updates
[skip ci]
2021-08-29 11:42:46 +02:00
Bram Matthys 36481b1f8e Windows BuildBot: parallel build with JOM, should be 4-5 times faster now.
[skip ci]
2021-08-29 11:28:54 +02:00
Bram Matthys 8476523888 Fix permissions
[skip ci]
2021-08-29 11:24:57 +02:00
Bram Matthys 6b8e51f9b9 Merge branch 'unreal60_dev' of github.com:syzop/unrealircd-next into unreal60_dev 2021-08-29 11:23:18 +02:00
Bram Matthys e9738b32f5 Update Windows makefile, incomplete yet.
I wanted to use pattern rules in Makefiles, which worked great, but..
i also want to be able to use parallel builds, and JOM does not seem
to support it. So....
Listing all the objects again, all the module rules are autogenerated
(yeah need to store those scripts somewhere..), though the list itself
needs updating in a later commit.

Using /FS /MP1 when creating the object files for UnrealIRCd.exe,
as due to the parallel JOM build it accesses the intermediate vs140.pdb.

Then, for all the modules, we can do without /FS because we now
explicitly set /Fdsrc/modules/xxxxx.pdb and thus don't have this
file access contention to vs140.pdb.

[skip ci]
2021-08-29 11:21:02 +02:00
k4be 84527768ce Add missing libmaxminddb remark in configure output 2021-08-29 11:20:33 +02:00
Bram Matthys 6a781e782f Windows BuildBot: reorder unrealircd-tests repo so we can use
fakereputation.c from in there while we build.
[skip ci]
2021-08-28 20:53:15 +02:00
Bram Matthys c28239dd68 Set User-Agent in url_curl as well (already done in url_unreal). 2021-08-28 20:37:09 +02:00
Bram Matthys 8b64f44400 Fix Windows BuildBot
[skip ci]
2021-08-28 19:47:27 +02:00
Bram Matthys 3b5caea331 *sigh*
[skip ci]
2021-08-28 18:34:17 +02:00
Bram Matthys a15666d287 Windows build: Ah, shouldn't have quotes at all, otherwise
a mysterious error appears. Great.
[skip ci]
2021-08-28 18:17:58 +02:00
Bram Matthys 9f729b1438 Windows: url.obj -> url_curl.obj
[skip ci]
2021-08-28 18:08:06 +02:00
Bram Matthys cdde22d338 Windows: fix missing quote in vs2019.bat causing make custommodule to fail.
[skip ci]
2021-08-28 17:44:41 +02:00
Bram Matthys be67bdc342 Update Windows installer to include Jansson
[skip ci]
2021-08-28 17:30:38 +02:00
Bram Matthys feb60f7bc6 Windows: fix path in vs2019.bat
[skip ci]
2021-08-28 17:28:06 +02:00
Bram Matthys c455c1ae52 unrealircd-5-libs -> unrealircd-6-libs
[skip ci]
2021-08-28 17:26:15 +02:00
Bram Matthys 880c29e006 Make BuildBot test UnrealIRCd 6 on Windows
[skip ci]
2021-08-28 17:18:12 +02:00
Bram Matthys 4c2aeab75e Windows compile fixes 2021-08-28 16:35:37 +02:00
Bram Matthys 3a9a746577 Update Windows makefile for Jansson library
[skip ci]
2021-08-28 15:22:15 +02:00
Bram Matthys 75d427ea2f Skip tests on Debian 8. It's LTS is EOL and fails at running tests.
We may want to scratch the build tests altogether for it actually..
2021-08-28 10:25:36 +02:00
Bram Matthys 58711d5e5f Test BuildBot again 2021-08-27 20:16:32 +02:00
Bram Matthys 6ab77f30c8 Test BuildBot 2021-08-27 20:05:33 +02:00
Bram Matthys 4cee60840a Compile oldcloak.so now that it was moved from R_MODULES to MODULES
in the src/modules/Makefile
2021-08-27 19:43:18 +02:00
Bram Matthys 1b096b5146 Use good ol suffix rules in Makefile so we can get rid of writing out
every .o and .so rule. Writing each of them out manually is useless
for all except 3 of the ~250 objects.
2021-08-27 19:36:07 +02:00
k4be 23e3d02d01 Document geoip modules 2021-08-27 15:13:04 +02:00
k4be 211995f703 geoip_maxmind: fix indentations 2021-08-27 15:00:20 +02:00
k4be 9c3d5dffb0 Add libmaxminddb support 2021-08-27 14:49:13 +02:00
k4be b67e2e4fb0 Check for duplicate callbacks earlier 2021-08-27 12:20:54 +02:00
k4be ca3bbfeadf Improve handling of missing files 2021-08-27 12:20:36 +02:00
k4be 1f72396442 Initial version of geoip_csv 2021-08-26 20:50:02 +02:00
k4be 5a83c3cd4d geoip_classic: use more efficient calls 2021-08-26 18:57:48 +02:00
k4be da497f0a7a Delete CheckNull defines from modules now that it's defined in h.h 2021-08-26 18:12:56 +02:00
k4be bebeeac0db geoip_base: add configuration, check all users on load
geoip_classic: change config format
2021-08-26 18:08:56 +02:00
k4be 52904ded83 geoip_classic: add configuration 2021-08-26 14:14:52 +02:00
k4be d5f69982eb geoip_classic: ipv6 support 2021-08-26 13:33:40 +02:00
k4be 326c1f5e4a Mention extended-monitor in release notes 2021-08-26 11:48:09 +02:00
k4be 48604b6bd0 geoip_base: support WEBIRC and remote users 2021-08-26 11:47:01 +02:00
k4be b15ddd760a Fix geoip library build and geoip_classic loading 2021-08-26 11:25:26 +02:00
k4be a6643fcd38 Rename efunction handlers to match the convention 2021-08-25 09:06:11 +02:00
k4be f1bc9f37e1 Change watch notification hook to callback.
This fixes duplicate AWAY message with extended-monitor.
2021-08-25 09:02:24 +02:00
k4be 184e7083ea Move client capability code to corresponding modules 2021-08-24 22:34:39 +02:00
k4be a03677023c Change WATCH numerics to valid ones 2021-08-24 20:39:36 +02:00
k4be e7e82ad493 Move host-change-related code to chghost.c 2021-08-24 20:37:02 +02:00
k4be f4a915bbb7 Update watch_notification argument name
Fix WATCH crash caused by that argument
2021-08-24 20:19:50 +02:00
k4be fe51aaf357 Add wATCH_EVENT defines 2021-08-24 19:58:05 +02:00
k4be 502def9401 Add extended-monitor (work in progress) 2021-08-24 19:42:38 +02:00
k4be 3b54cd35b6 metadata: some code cleanup, normalize names 2021-08-24 15:19:57 +02:00
Bram Matthys fd02a662ec Fix compile error when not using DEBUGMODE 2021-08-23 16:25:24 +02:00
k4be 83e6dafc96 metadata: change logging to unreal_log 2021-08-23 16:03:12 +02:00
k4be d8067594be Fix DNS lookup for proxy-forwarded IPs 2021-08-23 12:41:21 +02:00
k4be fb0f5ecab3 Fix hang on METADATA SUB 2021-08-22 23:26:16 +02:00
k4be d69b4394e7 Fix queuing notifications 2021-08-22 21:30:36 +02:00
k4be 9a8889f161 Remove a static variable that was never read 2021-08-22 21:25:06 +02:00
k4be d40853b71c Add basic metadata module (no moderation) 2021-08-22 21:17:19 +02:00
Bram Matthys 58cd2d8bfd Add some comments and add a redundant check for parameter writing.
Better to be safe than to accidentally write OOB.
2021-08-22 19:43:36 +02:00
Bram Matthys 49955670d9 Use do_mode_char_write() at two more places. 2021-08-22 19:38:18 +02:00
Bram Matthys 6f62a967fa More code cleanups in mode.c: this splits do_mode_char() up between
do_mode_char_list_mode() and do_mode_char_member_mode(), which are
two quite different things.
And rewrite do_mode_char_member_mode() to get rid of switch/case
style and the goto.

Also add do_mode_char_write() which is used at 5 places (could be
expanded, probably).
2021-08-22 19:33:33 +02:00
Bram Matthys 52b4a44e94 Massively rename Cmode.flag to Cmode.letter.
(similar to 5a387f9c0b)
2021-08-22 18:45:13 +02:00
Bram Matthys 9838378550 Massive rename of:
* channel->mode.extmode to channel->mode.mode
* channel->mode.extmodeparams to channel->mode.mode_params

This because all channel modes that are set there are extended channel
modes, only lists are still in core atm and they never get set here.
2021-08-22 18:36:00 +02:00
Bram Matthys e0504b2e52 Remove Mode.mode, it now only contains Mode.extmode and Mode.extmodeparams
Also make MODES_ON_JOIN point to iConf.modes_on_join.extmodes instead
of iConf.modes_on_join.mode

Actually in next commit I may reorder again...
2021-08-22 18:33:25 +02:00
Bram Matthys fafa58f8c8 Make gcc happy, even though this is a false positive. 2021-08-22 18:24:31 +02:00
Bram Matthys 7e4399a2ef Some do_mode_char() cleanups, now that it only deals with members/lists. 2021-08-22 18:23:37 +02:00
Bram Matthys 783cc3ff5b Cmode API: change from Channelmode_Table[<num>] to channelmodes linked list.
And now we can easily sort the channel modes too, makes it easier for
our test cases.
2021-08-22 17:57:14 +02:00
k4be b3fce25955 Documentation update 2021-08-22 17:00:59 +02:00
k4be 50ae1ca2df Proxy validation by IP address.
TODO: add optional password too.
2021-08-22 16:46:52 +02:00
Bram Matthys 96b290536e Rename Channelmode_Table.slot to .param_slot since this is only
about parameter slot mapping.
2021-08-22 16:37:18 +02:00
k4be e205e14279 Query DNS for hostname of forwarded users (seems to work) 2021-08-22 15:05:22 +02:00
k4be 7ed45c5921 Make websocket_parse_forwarded_header return a pointer 2021-08-22 14:20:36 +02:00
Bram Matthys d35a90c80f Fix various channel modes showing up as duplicate in 004 and 005.
Yeah I forgot we hardcoded these somewhere, now they are gone.. poof!
2021-08-22 14:06:51 +02:00
Bram Matthys 39ed0520cc Fix compiler warning/crash 2021-08-22 13:50:02 +02:00
Bram Matthys aac3c407bf I forgot a forward declaration.. 2021-08-22 13:45:32 +02:00
Bram Matthys 3a464e34ff Some minor reordering 2021-08-22 13:36:46 +02:00
k4be a2cdb8ff89 Merge branch 'unreal60_dev' of github.com:syzop/unrealircd-next into unreal60_dev 2021-08-22 13:36:06 +02:00
k4be be78ecebfc Parse "Forwarded:" header from proxy.
Not (yet) checking source address nor getting a hostname.
2021-08-22 13:34:54 +02:00
Bram Matthys 85d7a2556a Move list mode requests like "MODE #channel b" to list_mode_request()
which uses send_list_mode() and send_user_list_mode() for
+beI and +aq respectively.
2021-08-22 13:32:37 +02:00
Bram Matthys 5c114d0069 Cleanup old channel mode stuff, now that all non-list-modes are gone.
Eg no longer need to walk through the corechannelmodetable for
single param channel modes...

Also fix sjoin comments about "their" and "our" modes. In the merge
case this was not correct, it was "our old" and "merged modes".
2021-08-22 13:15:08 +02:00
Bram Matthys 8a5a0723e9 Fix the default set::modes-on-join (+nt) not working anymore, since
at the time of setting the default settings the channel mode modules
are not fully initialized yet.
2021-08-22 13:12:55 +02:00
Bram Matthys 1a19de2de9 Move channel mode +r to module chanmodes/isregistered 2021-08-22 12:19:07 +02:00
Bram Matthys 57ec565051 Move channel mode +t to module chanmodes/topiclimit
TODO: move code from "topic" module to here, some hook call.
2021-08-22 12:09:53 +02:00
Bram Matthys 6dd539d760 Move channel mode +m to module chanmodes/moderated
(and nearly all the code related to it)
2021-08-22 12:01:54 +02:00
Bram Matthys 24f73c28e4 Move channel mode +l to module chanmodes/limit
(and all the code related to it)
2021-08-22 11:45:08 +02:00
Bram Matthys 1533c6431e Move channel mode +n to module chanmodes/noexternalmsgs
(and all the code related to it)
2021-08-22 11:22:33 +02:00
Bram Matthys 8066c13876 Move +s/+p to chanmodes/secret and chanmodes/private.
To be honest, the modules don't do much other than handling the
mode stuff, but.. we can look at that again later.
2021-08-22 11:11:26 +02:00
Bram Matthys 374069914e Fix memory leak in find_invex() due to extban recode from a few
weeks ago.
2021-08-22 10:44:29 +02:00
Bram Matthys 295b3505ef Move channel mode +i to module chanmodes/inviteonly 2021-08-22 10:37:37 +02:00
Bram Matthys c403a47daf Move channel mode +k to module chanmodes/key 2021-08-22 10:06:51 +02:00
Bram Matthys 1e8c5da6aa Add ERR_INVALIDMODEPARAM which is a bit more informative than
ERR_CANNOTCHANGECHANMODE since it makes clear the problem is the
parameter and not a permissions issue..
2021-08-22 10:05:49 +02:00
Bram Matthys 021ba807bd Fix memory leaks in built-in https client and only build SSL_CTX once. 2021-08-21 20:29:38 +02:00
Bram Matthys ec5f9ee6c3 Add check for missing HTTP/1.X response. Shouldn't happen, but,
otherwise the error would be confusing wrt redirects, this is better.
2021-08-21 18:33:14 +02:00
Bram Matthys 8344327cb4 HTTPS client: support Basic authorization 2021-08-21 16:57:38 +02:00
Bram Matthys 6f087093df Create some more notes regarding the release notes 2021-08-21 16:36:33 +02:00
Bram Matthys ccc0b3397e For a remote include, use the URL[*] in any error messages instead
of the temporary file. That is, ce->file->name contains the URL.

[*] Any user:pass is censored from the URL via displayurl()
2021-08-21 16:15:41 +02:00
Bram Matthys ecc3ffe1e2 Parse error in remote include must be a fatal error. It is now (again). 2021-08-21 16:04:55 +02:00
Bram Matthys 24dec75576 Rename the current cloaking module to 'oldcloak' 2021-08-21 14:32:49 +02:00
Bram Matthys 8dc316bd8d Use SHA256 instead of MD5 in add_entropy_configfile() 2021-08-21 14:28:01 +02:00
Bram Matthys c821efa477 Get rid of old remote include stuff in windows gui.c, we don't
track this anymore.
[skip ci]
2021-08-21 14:14:03 +02:00
Bram Matthys 5b90fd0c0d Get rid of old MOTD downloading code and several USE_LIBCURL defines
that are no longer needed.
2021-08-21 14:13:24 +02:00
Bram Matthys 89b9c2ec32 Deal with HTTP redirects, and add DOWNLOAD_MAX_REDIRECTS to include/config.h
which defaults to 2. Make it use this value for both curl and non-curl.
Previously (with curl) it was set to 1, and nobody complained...
2021-08-21 14:05:43 +02:00
Bram Matthys e28cbb6041 Differentiate between DNS/connect timeout (15s) and transfer timeout (45s).
Already done in curl code, now also in non-curl-code.
2021-08-21 13:36:03 +02:00
Bram Matthys fe08d58dbc Add SNI support. Verify TLS certificate belongs to the host.
(Those were items 7 and 8 on the previously mentioned TODO list)
2021-08-21 13:30:36 +02:00
Bram Matthys 6a6f4120ee Built-in https client: Deal with Transfer-Encoding: chunked
(and also fix a crash if using non-https url)
2021-08-21 13:23:33 +02:00
Bram Matthys c9c2106bb9 Use SHA256 hash for cache/<object> instead of old MD5 2021-08-21 09:45:44 +02:00
Bram Matthys 090fe76739 URL: Make the curl and non-curl implementation use the same timeouts.
These are set in include/config.h to what they already were before:
15 seconds for the connect timeout, 45 for the complete transfer.
2021-08-21 09:37:14 +02:00
Bram Matthys c9e98137a4 Get rid of url.h and stuff the 6 functions there (which were not even
declared as extern) in include/h.h like the rest.
2021-08-21 09:32:17 +02:00
Bram Matthys 182cc7eab4 HTTPS client: add support for timeouts 2021-08-21 09:19:29 +02:00
Bram Matthys 9fe3b3f4d5 Use https_cancel() and get rid of goto's. 2021-08-21 09:09:10 +02:00
Bram Matthys 2a762ee68b Use handle->errorbuf instead of local errorbuf everywhere. 2021-08-21 08:52:47 +02:00
Bram Matthys 2c7d2c8f86 Split url.c into url_curl.c (curl implementation) and url_unreal
(the new fallback https-only implementation).

./configure will set URL= to either url_curl.o or url_unreal.o
depending on whether curl is enabled or not.

The 3 functions that both implementations had in common are now in
src/misc.c: url_is_valid(), displayurl() and url_getfilename().
2021-08-21 08:47:38 +02:00
Bram Matthys 00f3f300f0 Put downloads in a list. 2021-08-21 08:31:30 +02:00
Bram Matthys 1752844824 Built in HTTPS support: support http caching (If-Modified-Since, 304) 2021-08-21 08:24:52 +02:00
Bram Matthys dcfe0885a6 Add functions to conver to/from RFC2616 timestamps, as used in HTTP
in last modified headers.
2021-08-21 08:24:22 +02:00
Bram Matthys d6a074aa34 Support for remote includes without cURL (https only).
This is work in progress. It current lacks a number of features
that we would like to have, but most of them are relatively easy
now that most of the work has been done:
1) Support for caching based on timestamps, like curl ("not modified")
2) IPv6 support
3) HTTP redirects (with limit)
4) Timeouts for connect and reads (15 / 45 for curl atm)
5) HTTP downgrades
6) Chunked transfer encoding
7) Verify openssl hostname check
8) SNI
9) Ideally some progressbar for large transfers such as the geoip db
   (for cURL too by the way)

And.. finally we should use this stuff from the modulemanager so we
don't have duplicate code.
2021-08-20 19:19:04 +02:00
Bram Matthys f95e799397 For failed downloads, where we have a cached copy present, i forgot
to read the (cached) remote include file so it did not check if it
included another remote include.
2021-08-19 09:57:08 +02:00
Bram Matthys 5321dcb81b ConfigResource: get rid of rs->flag.type stuff and just use rs->type.
Also replace local variables 'inc' with 'rs'.
2021-08-19 09:37:28 +02:00
Bram Matthys ae6222e329 Get rid of errorbuf in ConfigResource as this is not used. 2021-08-19 09:34:33 +02:00
Bram Matthys 4e53bf874a Make remote includes caching work again. Both on-boot and on-rehash. 2021-08-19 09:33:46 +02:00
Bram Matthys 7b3c1165f8 Make tld::mask use the generic masks that we use everywhere
(and hence support multiple masks and server bans matching etc)
2021-08-18 18:45:23 +02:00
Bram Matthys e503ad4fd5 Reorder members in ConfigEntry struct a bit (optimize for L1/L2 cache)
Obviously name, value and next should be at the top.
2021-08-18 18:32:05 +02:00
Bram Matthys cdff69db7a Allow people to include the same file multiple times. This will no
longer raise an error and we will simply load the include only once.

I left some tracing code in case we have a bug in the code that
handles this, but testing shows it works well both for files and
URLs.
2021-08-18 17:04:45 +02:00
Bram Matthys a60b9f3176 Handle duplicate URLs/downloads (only download once) 2021-08-18 16:43:42 +02:00
Bram Matthys ce3e23a5d2 Get rid of unnecessary included_from and included_from_line
members in ConfigResource (previously ConfigItem_include).
2021-08-18 16:31:48 +02:00
Bram Matthys 0b5fab1617 Some cleanups in src/url.c and added error message for the very unusual
case where curl may fail to create a handle.
2021-08-18 15:19:51 +02:00
Bram Matthys d8c3da7698 Get rid of download_file(), the synchronous version, is no longer used. 2021-08-18 15:14:14 +02:00
Bram Matthys 6d56145f60 Remove URL support from staff module now that main conf.c already does this.
And re-enable the module, as it was #if'd out.
2021-08-18 15:11:37 +02:00
Bram Matthys e296464b97 Get rid of update_config_resource() and just set the appropriate
values at the four places that used it.
2021-08-18 15:02:18 +02:00
Bram Matthys 756fee58cb Rename ConfigItem_include to ConfigResource and also use it for non-includes
such as other items in the configuration file that are URLs.
2021-08-18 14:54:41 +02:00
Bram Matthys d897ecbc86 Get rid of some if (need_34_upgrade) upgrade_conf_to_34(); stuff
We probably want to get rid of that at all?
Maybe defer until we know whether we want/need it for U5->U6...
2021-08-18 13:36:55 +02:00
Bram Matthys b74d15595b Change int rehash() to void request_rehash(), which is a better name
as it REQUESTS to rehash the server, but it may not be done immediately.
And making it void makes sure nobody relies on some sort of return
value which will differ between with vs without remote includes.

Also get rid of sig and loop.rehash_save_sig, as a NULL client
already indicates the same (or at least does so now).
2021-08-18 13:28:56 +02:00
Bram Matthys 675c1cab55 Rename loop struct members:
* loop.ircd_rehashing -> loop.rehashing
* loop.ircd_terminating -> loop.terminating
* loop.ircd_booted -> loop.booted
* loop.ircd_forked -> loop.forked
2021-08-18 13:08:42 +02:00
Bram Matthys f184472781 Get rid of argument to config_test(), as we have loop.ircd_rehashing for that. 2021-08-18 13:03:31 +02:00
Bram Matthys fe2c834080 Rename lots of config functions (internally used ones, most likely
not used by 3rd party authors):
* conf_start() -> config_read_start()
* conf_check_complete() -> is_config_read_finished()
* load_conf() -> config_read_file()
* config_test() -> config_test_blocks()
* config_run() -> config_run_blocks()
* init_conf() -> config_test()
* run_configuration() -> config_run()

This so things look like:

if (config_read_start() < 0)
        exit(-1);
while (!is_config_read_finished())
	; // do something
if (config_test(1) == 0)
        config_run();
2021-08-18 12:57:38 +02:00
Bram Matthys 7321a66196 Make failed include loading fatal again. And fix a crash related to that. 2021-08-18 12:46:11 +02:00
Bram Matthys 685e0ee073 In ConfigItem_include include->url now always exists, and src/url.c is now
always compiled in, both regardless of cURL support or not.
Obviously the cURL functions are not available without cURL and there
are now some #ifdef USE_LIBCURL in url.c

This also fixes the current build to work without cURL
2021-08-18 12:27:13 +02:00
Bram Matthys f85615518e Make rehashing work again 2021-08-18 12:05:15 +02:00
Bram Matthys 03423a2eb7 Get rid of INCLUDE_NOTLOADED and INCLUDE_USED which AFAICT are
unnecessary. Get rid of load_includes() which did the marking
and unload_notloaded_includes() and unload_loaded_includes()
accordingly. There's now one single free_all_includes().
2021-08-18 11:52:53 +02:00
Bram Matthys 9e887ea4e9 Start with remote includes makeover. First objective is making them
asynchronous on start, which is achieved by this 1st commit.

For this to work, the init_conf() stuff has been split to an
earlier call to conf_start() and then a loop where you can
check for conf_check_complete().
This means init_conf() no longer calls load_conf, as that
is moved to conf_start() and conf_check_complete().
Thus, init_conf() is now only called when all includes are in the
linked list 'conf_include'.

This is work in progress and breaks:
1) rehashes
2) compiling without curl
3) possibly cached remote includes
2021-08-18 11:31:46 +02:00
Bram Matthys 5154038d59 Code cleanup: replace "if(" with "if (" 2021-08-18 09:54:43 +02:00
Bram Matthys 6058090435 Use GeoIPResult * everywhere. Any modules who want to fetch it for
a client can use geoip_client(client).
2021-08-17 17:16:14 +02:00
Bram Matthys 58abc0da5b Add moddata_client_get_raw() to get the ModData *.
This probably should not be used much as normally you
should not rely on structures created by modules in
other modules / other code.
2021-08-17 17:03:00 +02:00
Bram Matthys 796cac7a63 geoip: migrate from simple string to returning a GeoIPResult struct.
(work in progress, 1/2)

This also add supports for callbacks which return pointers (pvoidfunc),
we already had that for efuncs but not in callbacks.
2021-08-17 16:39:39 +02:00
Bram Matthys fe3c86b128 Support ~country:* for unknown country (fix) 2021-08-17 16:14:59 +02:00
Bram Matthys fc6c52db93 Add extbans/country: +b ~country:UK 2021-08-17 16:12:06 +02:00
Bram Matthys a9434d13c7 Add RPL_WHOISCOUNTRY info in /WHOIS requests from IRCOps 2021-08-17 15:53:17 +02:00
Bram Matthys d7561d6b23 Show [country: XX] in connect notice and sync geoip info with other servers. 2021-08-17 15:35:14 +02:00
Bram Matthys 2ea75dfbdb Add geoip_base module, which sets "geo_country" if a geo provider
module is able to lookup the IP and return a country.

Also consistently use geoip_ and GEOIP_ prefixes.
2021-08-17 15:26:29 +02:00
Bram Matthys 0bbad85f84 Add geo_lookup() function. Make geoip_classic do something useful.
NOTE: everything hardcoded atm, just temporarily.
Add CALLBACKTYPE_GEO_LOOKUP which is called from geo_lookup().
2021-08-17 15:11:40 +02:00
Bram Matthys 8cdbc3ae86 Don't build geoip_classic without --enable-geoip-classic=yes.
([I... hate... M4!])
2021-08-17 14:37:48 +02:00
Bram Matthys ed7bf1daf5 Bundle with GeoIP classic library and add geoip_classic placeholder.
This library we can safely bundle because it is GPLv2.
2021-08-17 14:11:36 +02:00
Bram Matthys 9ff56089ad Show TLS cipher in [secure: xyz] in far connects too (+s +F).
This requires both servers to be using UnrealIRCd 6 and there
should be no UnrealIRCd 5 server in-between (eg an old hub).

This also changes tls_cipher() to expect a Client * argument.
And tls_get_cipher() can now safely be called on any client,
including remote clients, and it will return the cipherstring
if it is known via moddata.
2021-08-16 14:30:21 +02:00
Bram Matthys 76da8714a7 Fix using the wrong variable in moddata_extract_s2s_mtags() 2021-08-16 14:26:49 +02:00
Bram Matthys 11167924df Add tls_cipher module which stores/retrieves the TLS cipher of all users. 2021-08-16 14:16:13 +02:00
Bram Matthys f75a9c8544 Sync ModData in UID command if mdata.sync = MODDATA_SYNC_EARLY.
This way we should be able to show certfp and webirc status
in far connect notices, and later various other details too.
2021-08-16 14:01:45 +02:00
Bram Matthys 7500de1060 Permit unknown message tags from trusted servers. 2021-08-16 13:48:09 +02:00
Bram Matthys 48e3901f27 It's probably a good idea to send the channel name in SJOIN
(fix for commit from yesterday, 99d2870870)
2021-08-15 08:59:32 +02:00
Bram Matthys 6134452b82 Fix crash on connect due to wrong reputation logging
(accessing e->ip when e is NULL) in DEBUGMODE.
2021-08-14 21:08:25 +02:00
Bram Matthys 99d2870870 For SJOIN, send the shorter nomode&nopara version when possible.
We used to always send the long version:
SJOIN ts #channel +sntkl key 999 :xxx
From now on we only send that for the first SJOIN for a channel
when syncing. For any subsequent SJOINs (so for larger channels or
with lots of bans/exempts/invexes) we will use the short version:
SJOIN ts #channel :xxx

We now do it that way because the remote side already received
all the modes the first time, so they are redundant in the
subsequent SJOINs for the same channel.
Especially if you have a channel with a large mode string, such as
+lLfH 99 #redirectchan [30j#i10,40m#m10,7c#C15,10n#N15,30k#K10]:15 100:1d
it was previously 1) wasting bandwidth and 2) unnecessary CPU
trying to merge channel modes that were already the same.
2021-08-14 21:03:49 +02:00
Bram Matthys 428c301a94 unreal_server_compat: convert named extbans in SJOIN as well. 2021-08-14 20:05:00 +02:00
Bram Matthys eac417d66a Fix memory leak on +beI 2021-08-14 18:36:01 +02:00
Bram Matthys a43637d55d Add extban->is_banned_events which you need to set to indicate to
which BANCHK_* events you want to listen, eg BANCHK_JOIN, BANCHK_MSG.
You can use BANCHK_ALL to watch on all events.
Only BANCHK_TKL is not included there and needs an explicit
BANCHK_ALL|BANCHK_TKL.

The caller will now take care of BANCHK_* filtering so we won't
waste any CPU on calling an is_banned() function that isn't
interested at all in the event that we have.

Also, no longer require an extban->is_banned function, since some
extbans don't use it. This too saves useless calls.
2021-08-14 18:25:36 +02:00
Bram Matthys 03d78bf95d Fix looking up the wrong extban in some cases.
~T => ~text => starts with ~t => ~time... fun.
2021-08-14 17:57:22 +02:00
Bram Matthys 75dbd99614 I think the code already handles all these "can't stack these" cases.
If I'm wrong we have a regression :D
2021-08-14 17:46:44 +02:00
Bram Matthys 0acc9eef49 Add parameter to clean_ban_mask() that will be put in b->conv_options.
Currently only supported option is:
BCTX_CONV_OPTION_WRITE_LETTER_BANS: always write letter bans

This removes the NULL pointer magic that i was not happy about.
2021-08-14 17:36:49 +02:00
Bram Matthys ca4f4c2575 Add PROTOCTL NEXTBANS. This indicates support for named extended bans.
If you don't indicate NEXTBANS support then we will send old fashioned
extended bans to you.
Note that eventually we will likely require named extended bans support,
but that will be UnrealIRCd 7 / 8.... ;)
2021-08-14 17:28:15 +02:00
Bram Matthys 5f31f7a5cc Add unreal_server_compat module which rewrites named extbans in
server to server traffic to be letter extbans.
Yeah this is a tad ugly, but the alternative was worse, see
header of the file for the full story.

Module is loaded by default (obviously).

Still to do: only do this for non-U6 servers (add some PROTOCTL)

And probably alter clean_ban_mask because I don't like the
magic on NULL client at the moment.
2021-08-14 16:45:18 +02:00
Bram Matthys f6704cfd1c Add empty_mode(modebuf) to check for "", "+" or "-" modes, that is:
modes that are empty/useless. Previously this check was done at
several places in their own way. Ugly and duplicate code.
2021-08-14 15:18:34 +02:00
Bram Matthys c0d31130f8 channel->creationtime is always set, so assume this is always set.
In U5 channel->creationtime could be 0 momentarily, eg for a new
channel, but nowadays we set channel->creationtime to TStime()
if the channel gets created in make_channel() [*]
[*] which was previously called get_channel() by the way

Also update some comments in mode.c to make things more clear.
2021-08-14 15:10:32 +02:00
Bram Matthys 9e0357ad71 Get rid of all the bounce stuff in MODE.
The only stuff we still have is if a bounce servermode is detected
(incoming) then we just ignore it.

All this bounce stuff wasn't used much, and didn't even work
(was always sending empty bounce string). It was only complicating
the code everywhere with stupid stuff like:
*x++ = bounce ? '+' : '-';
what = MODE_DEL;
2021-08-14 14:56:53 +02:00
Bram Matthys ec6062bc53 Slightly change the log message for the other case which previous
caused a bounce, or was supposed to (never really worked either).
We now ignore the mode (which was de-facto what we did anyway)
and also log it in that way.
2021-08-14 14:41:39 +02:00
Bram Matthys a5b86fcc11 Don't try to fix op-desyncs anymore. The bounce code didn't work anyway
(but the -oh did work)
2021-08-14 14:29:32 +02:00
Bram Matthys c7345f41b6 Fix hardcoded ~f: and ~m: to also deal with named bans.
(Actually only made it worse by more hardcoding for now...)
2021-08-14 10:35:15 +02:00
Bram Matthys b80a9adef9 Set extended ban names instead of using module name placeholders. 2021-08-14 10:28:26 +02:00
Bram Matthys a70580cc86 Enable sending of named extended bans. This can be changed via the
configuration file via set::named-extended-bans <yes|no>; and now
defaults to yes.
Still to do:
* explicitly set names instead of using stupid module names
* update test suite to check for these new names (other git tree)
* backwards compatible sending to U5 and lower using ugly shit
2021-08-14 10:12:43 +02:00
Bram Matthys 34bf0d7ec6 Grin... 2021-08-14 09:50:58 +02:00
Bram Matthys a6b5587666 Use prefix_with_extban() at the 3 places, needed for next... 2021-08-14 09:49:22 +02:00
Bram Matthys 34b034ab36 Add named extban support. This only deals with the incoming parsing,
it is not visible outgoing yet. So: ~account:name becomes ~a:name.
2021-08-14 09:27:39 +02:00
Bram Matthys d41e3e0f6e src/modules/extbans/*.c: memset(&req, 0, sizeof(req)); before ExtbanAdd() 2021-08-14 09:27:01 +02:00
Bram Matthys 5a387f9c0b Rename extban.flag to extban.letter.
TODO: Should probably do this for umode/cmode as well ;)
2021-08-14 09:07:22 +02:00
Bram Matthys f23546b27c More conv_param() changes, the +3 rule changed, and matches the rest.
The .conv_param() now receives the ban minus the ~own-extban.
And it should also return the part minus the ~own-extban.

Changes to findmod_by_bantype():
1) Takes a string now, rather than a single char value,
   so it is ready for named extbans.
2) Second parameter added so you can easily jump to the remainder.
   Eg:
   extban = findmod_by_bantype(b->banstr, &nextbanstr);
   [..check if extban is non-NULL and then..]
   b->banstr = nextbanstr;
2021-08-14 08:57:33 +02:00
Bram Matthys 5269b647d5 Round three of extban API overhaul, this changes extban->conv_param().
More changes will follow related to that...
2021-08-13 17:59:45 +02:00
Bram Matthys 163eaa432c ExtBans API: Now we can get rid of the +3 everywhere in is_ok().
When extban->is_ok() is called the banstr now no longer points
to "~x:something" but to "something".
Just like we did for extban->is_banned().
Again, need this for later too...
2021-08-13 16:39:03 +02:00
Bram Matthys b5d948c09c Round two of extban API overhaul, this changes extban->is_ok()
Also cleanup big blob op duplicate code in +beI handling in MODE.
2021-08-13 16:03:15 +02:00
Bram Matthys 98291c9f69 ExtBans API: Now we can get rid of the +3 everywhere in is_banned().
When extban->is_banned() is called the banstr now no longer points
to "~x:something" but to "something". This will be more useful later...
2021-08-13 14:39:34 +02:00
Bram Matthys bff6fdde6f Start of extban API recode. I created the current API in 2003 and..
well.. let's hope I have gained some good insights since then.. :D
2021-08-13 14:17:07 +02:00
Bram Matthys bdef6a2af2 Move stuff from AllowClient() to register_user(), since it deals with
setting hostname and such, which does not belong there (well, mostly)
2021-08-13 13:10:23 +02:00
Bram Matthys a0a95f6cee Get rid of unnecessary check_init() stuff (and the hook) 2021-08-13 13:06:35 +02:00
Bram Matthys da3bdc0437 AllowClient() doesn't need nor use the 2nd argument. 2021-08-13 12:27:23 +02:00
Bram Matthys 68b6f62d88 Convert DNS names to lowercase 2021-08-13 12:23:44 +02:00
Bram Matthys eb171c8e22 Add strtolower(). Note: we already hade strtolower_safe(). 2021-08-13 12:22:49 +02:00
Bram Matthys 9310fd3b4b Move check for valid hostname out of register_user(), we already
have that in dns.c. Also remove verify_hostname() from dns.c and
integrate it in valid_host() which now takes a second argument
named 'strict'. Call valid_host() with strict set to 1 if the
hostname should be checked to be a valid DNS hostname, eg the
host may not contain stuff like ':' or '/'. Use 0 otherwise
for the loose check, eg if you are not sure if the passed host
is an IP address or a host, or if it is for a vhost.
2021-08-13 12:17:24 +02:00
Bram Matthys 7c250188a5 Some moving around 2021-08-13 12:05:37 +02:00
Bram Matthys 72d4973840 Cleanup code that sets client->user->username based on ident config and result 2021-08-13 11:59:54 +02:00
Bram Matthys 1b3376d091 More cleanups in register_user(): Move the username checks to valid_username() 2021-08-13 11:54:43 +02:00
Bram Matthys 3a9976ef53 Get rid of ERR_HOSTILENAME which clutters the code too much
and no other IRCd seems to be using it.
2021-08-13 11:33:34 +02:00
Bram Matthys 3f8538f767 Split off part of register_user() to new function welcome_user() 2021-08-13 11:30:53 +02:00
Bram Matthys 199d7d8e65 cmd_uid: fix setting IP on the wrong client (server instead of user, oops...) 2021-08-13 11:11:05 +02:00
Bram Matthys fa875d6fd4 Cleanup: register_user() now takes only 1 argument (client) instead of 5 arguments.
The last 3 were always NULL after the remote/local split from a few commits ago.
And nick and username were useless as well as client->name and
client->user->username were always already set.
2021-08-13 11:06:30 +02:00
Bram Matthys 77a7b3aca2 More cleanups in nick.c: integrate register_user_remote() in cmd_uid() 2021-08-13 10:57:54 +02:00
Bram Matthys 33db820355 More nick.c (register user) cleanups.. 2021-08-13 10:49:45 +02:00
Bram Matthys 75a7d171b9 Test buildbot 2021-08-13 10:40:53 +02:00
Bram Matthys 8ca735a217 Split remote register_user() off into register_user_remote(),
which may or may not disappear in a future cleanup.
2021-08-13 10:23:50 +02:00
Bram Matthys f90c7a7991 Move IP validation from register_user() to cmd_uid().
This also makes it so the decoded IP is passed to register_user(),
eg "1.2.3.4" instead of binary base64'd stuff.
2021-08-12 20:09:24 +02:00
Bram Matthys 5eb2ac7624 Fix OperOverride message 2021-08-12 17:56:23 +02:00
Bram Matthys 9a2e8613ae For remotely received log messages (via SLOG) show the original server name
as sender in the NOTICE, just like we used to do in the past.
2021-08-12 17:07:12 +02:00
Bram Matthys 0e5f5f7374 Add conf/snomasks.default.conf 2021-08-12 16:58:54 +02:00
Bram Matthys 9f54c9b0d3 Don't send SAPART in SAJOIN (:D) 2021-08-12 16:51:18 +02:00
Bram Matthys 152d24bd73 Don't check for "chathistory" capability yet (only "draft/chathistory")
as this casuses BUG_CLIENTCAPABILITYBIT_UNKNOWN_TOKEN to be triggered.
2021-08-12 16:33:31 +02:00
Bram Matthys 60d970d9af And another fix for previous case. 2021-08-12 16:16:09 +02:00
Bram Matthys 5cc2ef7fba Newlog: free arguments, even if unreal_log_recursion_trap is hit
This was triggered for example when sending logs to remote servers.
2021-08-12 16:11:02 +02:00
Bram Matthys 16527eb6a4 Back out previous change, bad idea :D 2021-08-12 16:03:20 +02:00
Bram Matthys 507f43fc74 Set me.uplink to &me. Not entirely sure if this is what we want.
Without this, I think otherwise we need too many checks everywhere
for the IsMe() case. And this behavior matches me.direction which
also points to &me.
Then again, will doing it this way cause issues? We will see...
2021-08-12 15:57:58 +02:00
Bram Matthys bb4d77b5d0 Fix crash in link-security unreal_log() call..
Interesting... this mistake is easy to make with multiline.
2021-08-12 15:43:26 +02:00
Bram Matthys cc6d1eaf36 Don't crash on bad loglevel/subsystem/event_id but log it instead. 2021-08-12 15:43:03 +02:00
Bram Matthys 689c089a41 Allow dashes in subsystem (eg "link-security") 2021-08-12 15:30:50 +02:00
Bram Matthys 445b47391f Do an #undef on LOG_DEBUG, LOG_INFO, etc.. so they cannot be confused
anymore with the ULOG_DEBUG, ULOG_INFO, etc levels.
2021-08-12 15:27:27 +02:00
Bram Matthys 579988e07e ULOG_INFO, not LOG_INFO, strikes again! 2021-08-12 15:23:07 +02:00
Bram Matthys b48d7f8003 Fix for vhost checking code in cmd_uid, which didn't take into account '*' (no vhost set) 2021-08-12 15:20:14 +02:00
Bram Matthys 7f55159f77 Fix memory leak in new log code 2021-08-12 15:18:18 +02:00
Bram Matthys 8d72aaa0ad Checkout branch 'unreal60' from unrealircd-tests 2021-08-12 15:16:37 +02:00
Bram Matthys 562ed345be Update unrealircd-tests repo URL, temporarily used during early U6 development. 2021-08-12 15:08:19 +02:00
Bram Matthys 01753c67cd Validate hostname and vhost in UID command. And some very minor cleanups. 2021-08-12 09:13:02 +02:00
Bram Matthys 3a752a60fa Fix a remaining instance where client->local->fake_lag was touched
directly, should use add_fake_lag(client, msec) instead.
2021-08-12 08:56:46 +02:00
Bram Matthys be6928df78 Some cleanups in nick.c 2021-08-12 08:55:46 +02:00
Bram Matthys d9c940f65d Update client->flags inheritance code in register_user().
Hopefully correct... if this or ulines inheritance break you know
who did it ;)
2021-08-12 08:38:14 +02:00
Bram Matthys f9086f700e Newlog: nick.c 2021-08-12 08:37:54 +02:00
Bram Matthys f84dd51172 Newlog: link-security, mkpasswd, mode 2021-08-11 21:08:49 +02:00
Bram Matthys 7a4509b289 Newlog: "New record on this server: $num_users connections"
And also make this print the number of users and not (both) users+servers
which is generally a metric nobody is interested in and only causes
confusion when you get a message about a record of 30 and there are only
28 clients connected.
2021-08-11 20:55:42 +02:00
Bram Matthys 2c374395aa Newlog: Use _DENIED instead of _REJECTED everywhere to be consistent,
eg LINK_REJECTED_SID_COLLISION -> LINK_DENIED_SID_COLLISION
since 15+ other ones also start with LINK_DENIED...
Expand it to other areas as well eg antirandom.
2021-08-11 20:48:50 +02:00
Bram Matthys 720cd84ab2 Newlog: convert sendto_realops() to unreal_log() in 9 files. 2021-08-11 20:47:18 +02:00
Bram Matthys a94017c731 Remove sendto_ops_and_log(), use unreal_log() instead! 2021-08-11 19:10:30 +02:00
Bram Matthys edfd0d434f Newlog: convert remaining sendto_ops_and_log() 2021-08-11 19:09:07 +02:00
Bram Matthys ccfad0eed0 Enable high CPU usage detection, not sure yet for production, but
at least for U6 development.
2021-08-11 19:08:46 +02:00
Bram Matthys 609a6600aa Remove ircd_log(), use unreal_log() instead! 2021-08-11 18:01:00 +02:00
Bram Matthys 4968bf84fe Newlog: convert those in include/*.h too 2021-08-11 17:59:40 +02:00
Bram Matthys 4198b380f4 Newlog: convert the last ones to ircd_log 2021-08-11 17:55:15 +02:00
Bram Matthys 8d2f20ef41 Newlog: debug.c, match.c, module.c, random.c and then for
api-*.c log out of space in all circumstances.
2021-08-11 17:45:01 +02:00
Bram Matthys ca3c91ca17 Newlog: channel.c, send.c, support.c, windows/gui.c 2021-08-11 17:12:11 +02:00
Bram Matthys 11755b2093 Some variable renaming in start_listeners() 2021-08-11 16:48:44 +02:00
Bram Matthys 9333d4b264 Newlog: fdlist.c, socket.c 2021-08-11 16:48:26 +02:00
Bram Matthys 82f9dc6355 Newlog: misc.c 2021-08-11 16:42:04 +02:00
Bram Matthys 191f81dd63 Newlog: dispatch (io engine)
Hopefully no typos anywhere, since the compiler only checks about 1/3rd
of the code since it depends on the backend which code is used.
2021-08-11 16:03:54 +02:00
Bram Matthys fe21fd6024 Remove sendto_realops_and_log() and map some remaining temporary
to sendto_ops_and_log() which will soon disappear too.
2021-08-11 15:47:00 +02:00
Bram Matthys 9a620ef687 Newlog: make "Channel modes changed at runtime", "User modes changed at runtime"
match the "Permitted nick characters changed at runtime" log message.
2021-08-11 15:44:26 +02:00
Bram Matthys 9308e5b8a0 Change maximum chanmode +l value to 1 million and "coincidentally" also
change the IsInvalidChannelTS() macro to check for this value or lower.
2021-08-11 15:39:15 +02:00
Bram Matthys 9efe590a8e Newlog and fishy timestamp handling:
* New macro IsInvalidChannelTS() which evaluates to ts < 750000
* Check for faulty creation time ("fishy timestamp") at ALL places
  where channel->creationtime is set.
* Also, important, changed behavior:
  if !IsInvalidChannelTS then:
  1) We print our warning
  2) We pretend ts is our channel creationtime (which may be
     TStime() if the channel did not previously exist)
  3) We allow the command through and allow it to merge (in case of SJOIN)

This makes it so we still log the error (noisy) but on the other hand
we won't get "infected" by fishy timestamps since we will never set
them, no matter what happens.
2021-08-11 15:29:45 +02:00
Bram Matthys 471a97c5f6 Newlog: md, monitor, targetfloodprot, watch-backend, watch 2021-08-11 15:11:24 +02:00
Bram Matthys 2f8d6609d5 Newlog: jumpserver.c 2021-08-11 15:03:39 +02:00
Bram Matthys e5a1a05dcf Newlog: nick: nick collision stuff
Also get rid of server<->nick collision code, as servers are guaranteed
to contain a dot now by valid_server() so this cannot happen anymore.
2021-08-11 13:51:05 +02:00
Bram Matthys 7ef141b06a Newlog: getting rid of ircd_log in join, jointhrottle, message, sasl 2021-08-11 13:50:41 +02:00
Bram Matthys c76aa83baa Newlog: add $client.id (UID / SID) 2021-08-11 13:49:54 +02:00
Bram Matthys 349f5c4823 Newlog: convert kill.c 2021-08-11 13:21:49 +02:00
Bram Matthys a7668d266b Newlog: convert sjoin.c 2021-08-11 13:17:17 +02:00
Bram Matthys 21585980e1 Newlog: convert protoctl.c 2021-08-11 13:05:37 +02:00
Bram Matthys 21a95a13a6 Remove benchmarking from textban, nobody needs this anymore 2021-08-11 09:53:20 +02:00
Bram Matthys 74842a89a4 I suppose OPEROVERRIDE_INVITE is more accurate than OPEROVERRIDE_JOIN,
or at least more consistent.
2021-08-11 09:24:51 +02:00
Bram Matthys c9c78a32ed $client.detail -> $client.details... sigh. 2021-08-11 09:23:27 +02:00
Bram Matthys d38c10fae0 Fix calls to unreal_log().. LOG_INFO -> ULOG_INFO.. so easy to make this
mistake... too easy ;)
2021-08-11 09:21:33 +02:00
Bram Matthys bbf869eada Newlog: expand channel data more 2021-08-11 09:20:25 +02:00
Bram Matthys 78f16710c4 Newlog: convert all OperOverride messages (INVITE, KICK, MODE, TOPIC) 2021-08-11 09:13:13 +02:00
Bram Matthys 3f5fd3d5b8 Newlog: add log_data_channel(). TODO: expand a lot more. 2021-08-11 09:12:57 +02:00
Bram Matthys 94f1a232c8 UnrealDB: write v1 header from now on.
This means you can downgrade from UnrealIRCd 6.0.0 to 5.2.x
but not to 5.0.9 or lower without loosing the .db files.
That should be acceptable.
2021-08-11 08:40:34 +02:00
Bram Matthys 9db40cd4a0 Newlog: update channeldb, reputation, tkldb 2021-08-11 08:24:12 +02:00
Bram Matthys 8cd3647ae0 Rename mtag.can_send() to mtag.should_send_to_client().
This because "can send" is ambigious and could be interpreted to
mean that the client may send this mtag to us, while in fact this
function decided whether to send TO the client.
2021-08-10 18:57:47 +02:00
Bram Matthys 932094de72 Newlog: chgcmds (CHGHOST, CHGIDENT, CHGNAME) 2021-08-10 17:39:52 +02:00
Bram Matthys 48efe353af Newlog: when there are two clients involved with a clear issuer/target
relationship, make the issuer "client" (this was already so) and
the target is "target" (and no longer sometimes "victim").
For consistency, of course :D
2021-08-10 17:34:14 +02:00
Bram Matthys 2d72dd0c00 Newlog: convert blacklist to use newlog 2021-08-10 17:29:23 +02:00
Bram Matthys 798106c805 Avoid logging LINK_DISCONNECTED message twice, and also fix the
IP address in the message. We now use ip:port from the link block
if we failed to connect, and otherwise we use the ip from the
connection if the connection is established (also because it
can be a remote connection, not linked directly to us)
2021-08-10 15:08:07 +02:00
Bram Matthys c5347a554d Remove some old LOG_* loglevels, now that these are using newlog.
Also move SQUIT message to newlog, although this may cause
duplicates, so need to (re-)check later.
2021-08-10 14:54:22 +02:00
Bram Matthys 6e3de0c297 Some reindenting/whitespace in struct.h 2021-08-10 14:48:49 +02:00
Bram Matthys 6e996d7ffb Remove unused structs: ConfigItem_log, ConfigItem_unknown, ConfigItem_unknown_ex 2021-08-10 14:45:20 +02:00
Bram Matthys 4e5dd044f5 Require module header with version "unrealircd-6" now 2021-08-10 14:37:10 +02:00
Bram Matthys 7063cd0c86 Module coders: add UNREAL_VERSION so you can more easily check UnrealIRCd
versions in #ifdef's. Eg: #if UNREAL_VERSION > 0x05020100 to check if >5.2.1
2021-08-10 14:33:10 +02:00
Bram Matthys f742d08643 Remove some whitespace 2021-08-10 14:25:34 +02:00
Bram Matthys 2c011202a4 Integrate iConf.network in iConf itself as the distinction between
these "network settings" and other settings has been lost in time.

Rename some of these variables and macro's.
ircnetwork -> NETWORK_NAME
ircnet005 -> NETWORK_NAME_005
defserv ->? DEFAULT_SERVER
hidden_host -> CLOAK_PREFIX
helpchan -> HELP_CHANNEL

Also one config change (visible to admins):
set::hiddenhost-prefix is now set::cloak-prefix
We still accept the old name, though.
The example conf has been updated as well, but not the wiki yet.
2021-08-10 14:22:42 +02:00
Bram Matthys a4d9ef3947 Get rid of some shorts. Sorry... i hate these :D.
Also get rid of some unused stats struct members.
2021-08-10 14:07:54 +02:00
Bram Matthys cc8b047819 Remove old client->user->flood stuff as it was moved to client->local->flood
a few versions before and is now unused.
2021-08-10 14:00:47 +02:00
Bram Matthys dca7142152 Rename client->user->lastaway to client->user->away_since 2021-08-10 13:57:44 +02:00
Bram Matthys c55e65b47b Remove client->server->timestamp (completely unused) 2021-08-10 13:55:57 +02:00
Bram Matthys 8b19168f1b Get rid of client->server->up, since client->uplink->name provides the
same information.
2021-08-10 13:52:10 +02:00
Bram Matthys cc1e361ba9 More simplifications / code cleanups in stats.c 2021-08-10 13:32:36 +02:00
Bram Matthys fa263570a4 Get rid of some debug stuff in stats which i never look at anyway 2021-08-10 13:26:44 +02:00
Bram Matthys 641d514853 Move traffic stats from client->local->sendM/sendK/receiveM/receiveK/sendB/receiveB
into a client->local->traffic struct.
2021-08-10 13:22:59 +02:00
Bram Matthys 420eb2ffb6 Rename client->serv to client->server: this is set if the client is a server,
just like client->user is set if the client is a user.

Rename client->srvptr to client->uplink: this is the uplink that the client
is connected to. If the client is a user then it is set to the server that
the client is connected to, if the client is a server then it is set to the
server that the server is connected to (the.. tadah.. uplink).
For local clients it is always set to &me.
2021-08-10 12:52:46 +02:00
Bram Matthys 0f71381589 typedef aWhowas -> WhoWas 2021-08-10 12:44:54 +02:00
Bram Matthys 90a01ed7f9 Rename client->local->lasttime to client->local->last_msg_received
(Last time any message was received, i.e. the socket was read)
2021-08-10 12:40:07 +02:00
Bram Matthys 73f8976a3a Rename client->local->firsttime to client->local->creationtime
(Time user was created (connected on IRC))
2021-08-10 12:38:07 +02:00
Bram Matthys 43f42edfb7 Rename client->local->nextnick to client->local->next_nick_allowed 2021-08-10 12:36:48 +02:00
Bram Matthys a076e7a93a Remove client->local->lastsq since it is unused (only written, never read) 2021-08-10 12:36:06 +02:00
Bram Matthys 6b36399533 Rename client->local->last to client->local->idle_since
(Last time a RESETIDLE message was received (PRIVMSG))
2021-08-10 12:34:13 +02:00
Bram Matthys 4dbc2ac860 Rename client->local->since to client->local->fake_lag, since it is used
for fake lag calculations only (well, except for 1 corner case).

As said, modules should use the new function:
void add_fake_lag(Client *client, long msec)
2021-08-10 12:26:19 +02:00
Bram Matthys 4d947c3e51 Convert fake lag changes to use void add_fake_lag(Client *client, long msec) 2021-08-10 12:24:16 +02:00
Bram Matthys d59cfa092a Add terminal_supports_color(), used by logging to terminal code.
We now also correctly disable color support if someone is on
a color-capable terminal but redirects the output of the boot
to a file, eg: bin/unrealircd >boot.log 2>&1
2021-08-10 09:24:08 +02:00
Bram Matthys e2be262088 Some more SSL/TLS -> TLS references (for admins, in modules.default.conf) 2021-08-10 09:19:44 +02:00
Bram Matthys b751588211 Use "TLS" in ./Config too 2021-08-10 09:15:53 +02:00
Bram Matthys 0495022122 Still use "SSL/TLS" in HELPOP docs. 2021-08-10 09:13:35 +02:00
Bram Matthys 7ad7b36312 Remove useless ifdef, this was never reached. 2021-08-10 09:09:21 +02:00
Bram Matthys 532a9becda Massive renames of SSL/TLS and SSL to TLS. People should know the term by now :D 2021-08-10 09:07:32 +02:00
Bram Matthys 3832081eed Rename client->user->svid to client->user->account.
Just as a reminder: don't blindly assume that if anything is set here
that the user is logged in, there is IsLoggedIn(client) for that.
Reason: if the account name starts with a digit or is "*" then the
user isn't actually logged in ;)
2021-08-10 08:14:35 +02:00
Bram Matthys 18762446ac Add show_event_id_console to enable/disable showing subsys.event_id on console
and disable it by default (TODO: make configurable at compile time)
2021-08-09 18:23:09 +02:00
Bram Matthys 6c35a4e907 Newlog: Add coloring of messages on terminal and change order on disk
to match the order on IRC. IOTW: subsystem.EVENT_ID and loglevel are
now swapped. New log format on disk is:
[timestamp] subsystem.EVENT_ID loglevel: message
2021-08-09 18:00:14 +02:00
Bram Matthys 28b0283dc2 Use NameValue for coloring. 2021-08-09 17:44:04 +02:00
Bram Matthys b055b862e4 New: NameValue struct and functions nv_find_by_name() / nv_find_by_value().
These were previously used by the config system as config_binary_flags_search()
but can be useful in other areas as well.
2021-08-09 17:43:15 +02:00
Bram Matthys 595c1fdf42 Some more newlog conversions and cleanups of boot screen. 2021-08-09 17:10:36 +02:00
Bram Matthys d54c005cda Newlog: convert some ircd_log()'s in conf.c 2021-08-09 17:05:27 +02:00
Bram Matthys 61ccd94466 Newlog: convert tls.c to use new log system 2021-08-09 14:41:35 +02:00
Bram Matthys 689c528864 Newlog: add log_data_tls_error() 2021-08-09 14:15:06 +02:00
Bram Matthys f1023b6653 Fix compile warnings with gcc 2021-08-09 13:43:36 +02:00
Bram Matthys bc9525528c Get rid of report_error() and report_baderror() now that the last
function call has been replaced with unreal_log().
2021-08-09 12:20:13 +02:00
Bram Matthys 2d8ae5d43a Move some functions from src/socket.c, that don't belong there,
to src/serv.c and src/misc.c
2021-08-09 12:13:30 +02:00
Bram Matthys 3a9975713a Move connect_server() from src/socket.c to src/modules/server.c (efunc) 2021-08-09 12:10:24 +02:00
Bram Matthys 88e9b51354 Newlog: now really finish server.c conversion. Yeah, there were more... 2021-08-09 11:59:39 +02:00
Bram Matthys d795bd7d39 Newlog: finish server.c conversion... and enjoy the new multiline logging :D 2021-08-09 10:18:25 +02:00
Bram Matthys 8187c4049f Renumber PROTO_'s 2021-08-09 09:36:15 +02:00
Bram Matthys f982d06674 Use json_string_unreal() everywhere instead of json_string()
This because in UnrealIRCd we may encounter non-UTF8 sequences,
which this function will censor out.
Also, this takes care of returning json_null() if the string was
NULL, which is usually what we want as well.
2021-08-09 08:54:50 +02:00
Bram Matthys 4ad7d02ffa Changes to unrl_utf8_make_valid():
1) No longer impose a static maximum length
2) Caller must provide a work buffer and maximum length
3) Add a strict length check option
2021-08-09 08:49:01 +02:00
Bram Matthys 91a3c71d60 We now (try to) kill the "old" server when a server links in with the same
name, handy when the old server is a zombie waiting for ping timeout.

NOTE: atm this only works if someone links directly to us and there is
an existing server local or remote.
There is no code yet for a remote & remote scenario, which requires (or
at least prefers) having a creationtime for server connects, requiring
a SID command change.
2021-08-08 20:15:22 +02:00
Bram Matthys 2c8ef11004 Newlog: finished server.c conversion, yay. 2021-08-08 19:34:46 +02:00
Bram Matthys 93facdcdf4 Newlog: re-add syslog support 2021-08-08 17:39:37 +02:00
Bram Matthys 65e97e4140 Fix crash in set::server-linking::autoconnect-strategy sequential-fallback
when a remote server links to another server.
2021-08-08 15:57:33 +02:00
Bram Matthys a198d99850 Newlog: SLOG: actually use the JSON "msg" instead of parv[4]
And document SLOG command.
2021-08-08 15:27:04 +02:00
Bram Matthys f501772cbe Whoops... remove multi-line logging test code :D 2021-08-08 15:11:34 +02:00
Bram Matthys 53e283082f For IRCOps with unrealircd.org/json-log: in case of a multi-line message
we will now only send the JSON in the first message.

Also fix log file timestamp missing with multiline.

And rename do_unreal_log_ircops() to do_unreal_log_opers()

Add safe_free_message_tags()
2021-08-08 15:10:04 +02:00
Bram Matthys bc9e17aeb0 Add multiline support to unreal_log()
Any \n's will be expanded to multiple lines.
* For JSON disk logging there is no change.
* For text disk logging it will show as:
  [time] facility subsys.CODE+
  [time] facility subsys.CODE+
  [time] facility subsys.CODE
  So a plus sign is added if another message is to follow.
* For notices to opers/snomasks exactly the same (plus sign if needed).

Untested. More changes to follow eg to notice dropping the json
in the followup msgs.

This also changes the logging format for text disk to match
the output on server notices, we no longer log as:
[TS] facility subsystem event_code: msg....
But as:
[TS] facility subsystem.event_code: msg....
2021-08-08 12:04:41 +02:00
Bram Matthys 01542cdf77 Add line2multiline() which takes a string with \n's and returns a MultiLine
linked list.
2021-08-08 11:28:54 +02:00
Bram Matthys 2eb1f97d25 Newlog: server.c: Use SERVER_LINKED_REMOTE for remote links as
they use a slightly different format and you may want to exclude
these from certain logging. Also mention the correct uplink there.
2021-08-08 11:18:51 +02:00
Bram Matthys bac8b297c7 Newlog: more server.c conversions (all local server connect rejects done) 2021-08-08 11:02:44 +02:00
Bram Matthys 12adca5817 Set client->name early to provided servername and drop the servername
argument from verify_link() since now you can just use client->name.

Also more newlog for server.c (more to follow)
2021-08-08 10:15:59 +02:00
Bram Matthys a339efad2a Add exit_client_fmt() which accepts formatting characters. 2021-08-08 10:14:48 +02:00
Bram Matthys f843fc6d23 Serialize json with JSON_COMPACT.
Saves a bit of room, especially when the JSON travels over network this
maybe save some "crucial" bytes (and in that case it looks better too,
since the \s's in message tags only make it less readable).
2021-08-07 18:14:38 +02:00
Bram Matthys d17db626b3 Add some notes for the release notes (:D) 2021-08-07 17:49:33 +02:00
Bram Matthys fbe3d6124b Add unrealircd.org/json-log CAP, which sends JSON logs to IRCOps.
This basically enhances the regular snomask/ircop notices with
JSON logs, the same logs that are logged to disk (with type 'json').
This allows bots/machines to much more easily parse server notices
such as connect notices or.. anything.

Note that JSON logs are quite large, so make sure the ircop has
a BIG class::sendq!

Also, everyone can set the cap but it is only effective for IRCOps.
2021-08-07 17:32:54 +02:00
Bram Matthys ab180b086c Rename recently added mtag: s2s/json -> unrealircd.org/json-log 2021-08-07 17:17:37 +02:00
Bram Matthys adfa81ee07 Get rid of >1024 msg length check in sendbufto_one. 2021-08-07 17:16:34 +02:00
Bram Matthys fb9af08e83 Add coloring to snomask/ircop messages based on log level.
This will later be configurable, of course.
2021-08-07 16:15:29 +02:00
Bram Matthys 9885af1486 Validate and rewrite remotely received JSON via SLOG cmd.
This makes it use OUR timestamp, so timestamps in logs are properly
sequential. The originial timestamp is saved in "original_timestamp".
Finally, we (over)write "log_source" with the remote server name.
2021-08-07 15:49:29 +02:00
Bram Matthys b75f6b4086 Newlog: add "log_source" 2021-08-07 15:49:12 +02:00
Bram Matthys 64180d8a2c Send and receive json as well in SLOG server to server message.
TODO: validate JSON
2021-08-07 15:22:06 +02:00
Bram Matthys bac38926a6 Make compiling with -O0 work again 2021-08-07 15:21:48 +02:00
Bram Matthys 654a88a53a Easy message tags sending restrictions to permit full 4094 bytes.
Needed for next commits.
2021-08-07 15:20:53 +02:00
Bram Matthys 659b553351 Add slog.c, initial version of S2S logging. 2021-08-07 14:40:08 +02:00
Bram Matthys 0739af0812 Add initial remote logging support via SLOG (S2S cmd).
Also call the log::destination "remote" instead of "global".
2021-08-07 14:38:06 +02:00
Bram Matthys 39e45c2be3 Add newlog TODO item 2021-08-07 14:14:19 +02:00
Bram Matthys f4af4acb16 Newlog: fix rehash and memory leak 2021-08-07 14:01:44 +02:00
Bram Matthys e59cd278cd log { } now uses the new log system and is used for logging to disk,
snomasks, opers, global (remote), ..

For disk logs we currently ignore the sources and log everything.

NOTE: REHASH is untested and will memory leak for sure.
2021-08-07 13:04:07 +02:00
Bram Matthys b8837844fb Newlog: new config plan, ditch set::logging and use log blocks soon.
In this commit it is still called logx { }. Will merge them soon
into one log { } block.
2021-08-07 10:39:54 +02:00
Bram Matthys 2aff2727ed Re-order matching in log_sources_match() for performance. 2021-08-07 09:14:32 +02:00
Bram Matthys 839367272a Rename $client.nuh to $client.details as it is generic detailed
client information and not necessarily nick!user@host in all cases.
2021-08-06 20:59:54 +02:00
Bram Matthys 33a9b745a8 Support client.a.b.c.d etc with "infinite" depth (as long as the
variable is max 255 characters).
This fixes the client connecting notice that previous commit
knowingly broke.
2021-08-06 20:55:57 +02:00
Bram Matthys f38a43434e Newlog: expand client.server more, and also move some stuff to client.user
This means we now have $client.user.username but the expansion system
does not allow items more than 2 deep atm (only $client.something
but not $client.something.other). Will fix later. (TODO)
In the meantime the connection notice will look weird :D
2021-08-06 20:32:35 +02:00
Bram Matthys c22207c4ca Drop cf_ prefix from ConfigFile and ce_ prefix from ConfigEntry structs.
Also rename them to describe better what they do.

ConfigFile:
cf_filename -> filename
cf_next -> next
cf_entries -> items

ConfigEntry:
ce_fileptr -> file
ce_varlinenum -> line_number
ce_fileposstart -> file_position_start
ce_fileposend -> file_position_end
ce_sectlinenum -> section_linenumber
ce_varname -> name
ce_vardata -> value
ce_cond -> conditional_config
ce_entries -> items
ce_next -> next
ce_prevlevel -> parent

Also add doxygen docs for both structs.
2021-08-06 17:50:45 +02:00
Bram Matthys 3eef42c385 Let's log everything except ULOG_DEBUG on the console when booting.
Better than missing an important message.
2021-08-06 16:24:44 +02:00
Bram Matthys 6d216c3a90 Validate set::logging better. 2021-08-06 15:47:51 +02:00
Bram Matthys 1b00ea9137 Fix module not loading using config_status() instead of config_error()
which wasn't logged on the console.
2021-08-06 15:47:24 +02:00
Bram Matthys 9c210ba3fa Merge branch 'unreal60_dev' of github.com:syzop/unrealircd-next into unreal60_dev 2021-08-06 15:27:46 +02:00
Bram Matthys e75ea8d00e Temporarily send to all opers if there is no matching set::logging::snomask
nor set::logging::all-opers configuration.

This so you at least have logging for now ;D
2021-08-06 15:27:03 +02:00
k4be 50eaee19a7 Merge branch 'unreal60_dev' into unreal60_dev+watch 2021-08-06 15:25:13 +02:00
k4be 55a5574a4b Merge branch 'unreal60_dev' into unreal60_dev+watch 2021-08-06 15:23:37 +02:00
Bram Matthys 4c3fa999a7 use 'all-opers' (not 'all-ircops') to be consistent. 2021-08-06 15:23:17 +02:00
Bram Matthys f34d3bd861 Add set::logging block and the logging to snomask mapping.
Note that without such a block nothing will be sent to ircops at all
(anything that comes from unreal_log anyway).
In a later commit either a snomasks.default.conf will be added and/or
an internal default mapping.

This also moves the recursion trap to earlier in the logging code,
which has the side effect that debug traffic regarding snomasks is
no longer logged.
2021-08-06 15:19:36 +02:00
Bram Matthys e9ffeb2d33 Newlog: validate log level, event id and subsystem now. We crash immediately
when any of these are wrong. Obviously this should probably be changed to
only do it in DEBUGMODE in a final stable release :D

We also crash if 'msg' contains a percent sign ('%'). This is to avoid
mistakes where someone uses eg '%s' in there, which is not supported.
Unfortunately it also prevents stuff like '100%' so this should probably
be removed too at some point.
2021-08-06 11:50:28 +02:00
Bram Matthys bfe9fc49e4 Fix non-JSON logging (set type 'text' by default) 2021-08-06 11:29:49 +02:00
Bram Matthys 065d24e248 In register_user() use client->user->XXX instead of user->XXX.
Has always been annoying me.. :D
2021-08-06 11:11:09 +02:00
Bram Matthys 92757f6d9f Newlog: convert local client connects and disconnects.
Also makes the connect message and the standard log message consistent.
2021-08-06 11:05:59 +02:00
Bram Matthys f3035a49f8 Newlog (JSON): enrich client object with 'reputation' and 'security-groups'.
The former is an integer and may not always be available (eg: very early
before the user is connected). The latter is an array.

TODO: opt-in/out of all these expansions as they come at a performance penalty
2021-08-06 11:04:22 +02:00
Bram Matthys 4a72b8f519 Remove unnecessary debugging/benchmark info from eos, channeldb, reputation, tkldb 2021-08-06 10:32:42 +02:00
Bram Matthys 088996b16e Make ulining an UnrealIRCd server a fatal link error instead of a warning.
https://www.unrealircd.org/docs/FAQ#bad-ulines
2021-08-06 09:39:09 +02:00
Bram Matthys ddf639836b Cleanup server.c: make server_sync() function only do the syncing and
move the parts that deal with adding lists, tagging as uline etc back
to the caller, that is.. cmd_server().
2021-08-06 09:36:38 +02:00
Bram Matthys 4de2fa648f Some more server_sync cleanups 2021-08-06 09:32:59 +02:00
Bram Matthys 64f62adb1b Code cleanup in server_sync(): cptr -> client 2021-08-06 09:29:29 +02:00
Bram Matthys cb14b987b6 Newlog: server.c 2021-08-06 09:26:33 +02:00
Bram Matthys cfccc8f05c Add $client.servername. Also add json_string_possibly_null() which is
a wrapper that will return a 'null' JSON object for null strings and
otherwise a string object for non-NULL. It seems by default this is
not the case which is a bit annoying. Maybe we should re-wrap all
code to use this. We'll see.
The problem is when this is not done, then a $variable won't be
expanded and would show up like literally "$variable" as if the
variable was never passed on.
2021-08-06 09:24:24 +02:00
Bram Matthys 5b44baab1f ULOG_WARN -> ULOG_WARNING. Better be consistent. This was the only
ULOG_* level that used an abbreviated term.
2021-08-06 08:50:45 +02:00
Bram Matthys e29fd0afdc Show [debug] instead of [???] 2021-08-05 20:43:02 +02:00
Bram Matthys 29e4f8d56f Newlog: FLOOD_BLOCKED (+s +f notices) 2021-08-05 20:42:24 +02:00
Bram Matthys 970c138711 Remove fullstatus-on-load from antirandom example conf 2021-08-05 20:24:50 +02:00
Bram Matthys 01e86d547d Cleanup antirandom a bit (hardly used status on load option, and
lots of debugging). Also add newlog.
2021-08-05 20:16:27 +02:00
Bram Matthys 55f2ef502e Newlog: add $client.info (gecos/realname for users, info on servers) 2021-08-05 20:16:09 +02:00
Bram Matthys 0bdf1e3c35 Newlog: tls_antidos 2021-08-05 20:15:54 +02:00
Bram Matthys e341903e53 Newlog: update connthrottle 2021-08-05 17:46:24 +02:00
Bram Matthys d3bd525eef Fix "You were forced to part" message on SAPART that was accidentally deleted 2021-08-05 17:30:36 +02:00
Bram Matthys 4115eaf483 Use memory pool for channels 2021-08-05 17:20:24 +02:00
Bram Matthys 6ba6a8fd9a Fix memory leak due to unreal_log() / unreal_log_raw() last argument
being NULL. This is a vararg argument and it causes a leak when
running in debug mode because we add some magic source file,
source line number and function.

Note to self: don't put NULL there :D
2021-08-05 17:05:25 +02:00
Bram Matthys 3c7112469b Drop 2nd argument to find_channel which was always NULL everywhere anyway. 2021-08-05 17:02:39 +02:00
Bram Matthys 8dd6640bf5 Rename get_channel() to make_channel() to match make_user() and
change some more calls to make_channel() to use find_channel().
Also make it take 1 argument instead of 3.

Needed to be careful in sjoin code since the previous code set
channel->creationtime to 0 if client was a remote. Now merged
a few if's into one. Should be correct :D.
2021-08-05 16:55:28 +02:00
Bram Matthys cf1a5c7090 Replace get_channel() calls with !NOCREATE or 0 with find_channel() 2021-08-05 16:43:33 +02:00
Bram Matthys da07fbf28f Make Channel struct fixed-size rather than the name[1] trick.
Also, do some more validations on remote names now that it is fixed.
2021-08-05 16:40:26 +02:00
Bram Matthys 6bad375ad7 Rename channel->chname to channel->name. 2021-08-05 16:34:45 +02:00
Bram Matthys a118a3313d Newlog: SAPART/SAJOIN and also broadcast SAJOIN now so all servers can log
it appropriately.
2021-08-05 16:30:14 +02:00
Bram Matthys b21048c3e1 Broadcast SAPART so other servers now it is a forced part and can log it
appropriately.
2021-08-05 16:24:38 +02:00
Bram Matthys 149beb10e3 Update sajoin logging: use $channels rather than $channel since it may be a list. 2021-08-05 16:11:43 +02:00
Bram Matthys bda671fa14 Newlog: Add ULOG_DEBUG log level, and update reputation.c to use newlog. 2021-08-05 14:17:39 +02:00
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 5c9b7cf15f Add MONITOR command and fix numerous problems with WATCH. 2021-07-21 20:23:07 +02:00
k4be b0c30cd1a6 Remove unused prototypes 2021-07-21 18:06:31 +02:00
k4be 4ec455bf06 Add selective watch removal.
Clean up linked list item deleting.
2021-07-21 18:04:01 +02:00
k4be b01bc76a69 WATCH command should only modify own entries. 2021-07-20 21:38:42 +02:00
k4be 7fab97d364 Add watch notification hook.
This will likely reduce performance, but this should not matter in modern times.
Also added flags to let modules know which one the entry belongs to, and what
to do with it.
Now modules should be able to add their own WATCH methods (like IRCv3 MONITOR),
or extend functionality to notify about other changes than the default log on,
log off and away statuses (like SETNAMEs).
2021-07-20 20:59:36 +02:00
k4be 0700640330 Create "watch-backend" module that will serve for all watch-like commands. 2021-07-20 20:26:31 +02:00
k4be 6ec6c37839 Add watch calls to efunctions.
(Doing nothing useful at this point.)
Also bump MAXEFUNCTIONS.
2021-07-19 21:28:29 +02:00
k4be bcbcc10b9d Move watch code from core to module 2021-07-19 18:16:28 +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
Bram Matthys 8322a48026 ** UnrealIRCd 5.2.1 ** 2021-07-08 17:42:52 +02:00
Bram Matthys 0971cf7d70 modules.optional.conf: example set::antirandom block: Use CIDR
instead of standard wildcard.
In this case, since it's antirandom, it is not really important
as someone is not going to add DNS records specially to avoid
triggering antirandom. That makes no sense since it is much
easier to avoid using a random looking name.
Main reason of changing it here is to set a good example.
2021-07-07 14:20:15 +02:00
Bram Matthys b398c3d101 Change default exempt from 127.* to 127.0.0.0/8 so it does not match
arbitrary hosts that have a host starting with "127.". A rather stupid
oversight on my part, really.

In the meantime, if this happens, then you can still resort to using
ZLINE/GZLINE as a workaround to ban such a user. (The exemption won't
match against the host because DNS lookups are not done for zlines)

Reported by armyn in https://bugs.unrealircd.org/view.php?id=5957
2021-07-07 09:21:17 +02:00
Bram Matthys 141dd8acd0 Load settings from 5.2.0.x dot releases as well 2021-07-03 15:18:47 +02:00
Bram Matthys 94993a03ca ** UnrealIRCd 5.2.1-rc1 ** 2021-07-03 14:42:34 +02:00
Bram Matthys 1d62ca1153 Send account tag to recipient on INVITE.
Reported by ProgVal in https://bugs.unrealircd.org/view.php?id=5951
2021-07-03 14:18:15 +02:00
Bram Matthys 527726be41 Take message tags into account when calculating fake lag.
This was more of a oversight because the cmdbytes calculation happens
in a different function after message tags have already been processed.
Also, wasn't really important up to now since we only allow quite short
tags at the moment.

Instead of just counting these in cmdbytes, as would be the most logical
and easiest fix, we use a different strategy:
We use a separate counter for message-tags so clients benefit from the
"rounding down rule". In other words: the first xyz bytes give you
no extra penalty compared to before (eg they are "free"). Useful for
clients who use eg @label heavily.
By default this is 90 bytes for unknown-users and 180 bytes for
known-users. See lag-penalty-bytes in set::anti-flood.
2021-07-03 09:33:19 +02:00
Bram Matthys ee9db59d36 Fix two more small memory leaks on REHASH.
Now we are at zero leaks again with ASan, or so it seems.
2021-07-02 11:42:58 +02:00
Bram Matthys 12299b45bf Fix small memory leak on REHASH (<1kb): free set::anti-flood block 2021-07-02 10:56:51 +02:00
Bram Matthys abaed84190 Order CHATHISTORY TARGETS response in descending order (newest first)
https://bugs.unrealircd.org/view.php?id=5904
2021-07-02 10:42:40 +02:00
Bram Matthys 35f8598f3f Fix crash if using persistent channel history: if you had ANY rehash error
(often completely unrelated to channel history) and you then rehashed again
UnrealIRCd would crash. Reported by gh0st.
May be the same issue as reported by adamus1red in
https://bugs.unrealircd.org/view.php?id=5943

This has to do with SavePersistentPointer/LoadPersistentPointer calls
which normally work fine but this particular module uses it in MOD_TEST
causing a certain sequence of events causing a double free or read-
after-free if you do it slightly differently.
2021-07-02 09:16:58 +02:00
Bram Matthys f0db0735a8 Update release notes a bit
[skip ci]
2021-06-30 13:32:20 +02:00
Bram Matthys 696d5f05fb Last argument in fd_open() is now used to indicate what should be done on a
later fd_close() call. This also removes fd_map() since fd_open w/FDCLOSE_NONE
now does that.

* If you use fd_socket() or fd_accept(), then no change.
  When fd_close() is called we call close() on *NIX and closesocket() on Win.
* If you use fd_fileopen(), then no change.
  When fd_close() is called we will call close() on both *NIX and Win.
* If you used fd_open() and then fd_unmap() because you didn't want us
  to close the socket, then use fd_open() with FDCLOSE_NONE and
  just call fd_close() instead of fd_unmap().
  We will not actually close the fd in fd_close() (FDCLOSE_NONE).
* If you called fd_open() with other intentions then either specify a
  FDCLOSE_SOCKET / FDCLOSE_FILE as the last argument, or more likely:
  don't use fd_open() at all and use fd_socket() or fd_fileopen() instead.

For reasons on this change, see previous patch. This way is more sane and
makes it harder to make mistakes even beyond Windows-specific issues.
2021-06-30 11:33:46 +02:00
Bram Matthys 329f48334c I/O engine: track if a fd is a file or socket, needed for Windows.
This fixes a file descriptor leak in Windows that happened in the
logging code. The most visible effect of this was if you had a
log::maxsize set then on Windows you would see:
"Max file size reached, starting new log file"
Every other line, forever (and not actually starting a new log).

fd_close() previously did not close the file descriptor of a file
on Windows because on Windows it needs to call close() for a file
and closesocket() for a socket, and it always did the latter.
On *NIX it's more easy and you can just always close() any fd.
2021-06-30 11:06:44 +02:00
Bram Matthys a44b1cb63e Fix ./unralircd genlinkblock printing out a confusing error message if
you have serversonly listen block without tls.
Reported by Valware in https://bugs.unrealircd.org/view.php?id=5945
2021-06-30 10:06:19 +02:00
Bram Matthys 0bd2cfd0fc Update file_exists() function to work with directories on Windows.
And then let's use the similar (and faster) function on Linux too.
2021-06-28 19:33:14 +02:00
Bram Matthys 137703f04a Add cipherscan profile for OpenSSL 3.0.0. 2021-06-28 15:56:05 +02:00
Bram Matthys c586592516 Add -nodes (no DES) to openssl command so it doesn't ask for a
password on OpenSSL 3.0.0 and later when generating the standard
self-signed certificate.
2021-06-28 13:59:27 +02:00
Bram Matthys 088218817d Whitespace.......
[skip ci]
2021-06-28 13:07:15 +02:00
Bram Matthys 50089d340a Build test updates
[skip ci]
2021-06-28 13:02:36 +02:00
Bram Matthys cf5966cce4 Call early_init_ssl() even more early, fixes './unrealircd module list'
from crashing and other symptoms.
Crash was introduced with the OpenSSL 3.0.0 changes from
a541b8f4ad, so 9 days ago.
2021-06-28 08:18:43 +02:00
Ramiro Bou 26295151a9 Add microsecond precision to TSCTL ALLTIME (#147) 2021-06-28 06:27:02 +02:00
Bram Matthys c667662e9b Windows: Allow UnrealIRCd to be terminated gracefully (without prompt)
via taskill /im unrealircd.exe. Needed for BuildBot.
2021-06-27 19:21:56 +02:00
Bram Matthys ec3407a42f Set -Wno-tautological-compare on clang 3.x (yeah old version),
this to shut up false positives in buildbot.
2021-06-27 18:13:52 +02:00
Bram Matthys 30155ddd7c Only call reinit_tls() when rehashing. 2021-06-27 17:22:15 +02:00
Bram Matthys 79740c4a38 Make "REHASH" and ./unrealircd rehash also run the same code as "REHASH -tls",
if on OpenSSL 1.1.1 or later.

We trust OpenSSL 1.1.1 and later to be good enough to handle all
the reference counting and freeing nowadays, which is something that
was not done correctly in (much) older OpenSSL versions, leading
to crashes on one hand and on memory leaks on the other hand.

In OpenSSL 1.1.0 and earlier we do not rehash tls on simple "REHASH",
since that code has not been vetted. However, nobody should be
running those old OpenSSL versions anyway, since they are out of
official OpenSSL support.
2021-06-27 15:38:40 +02:00
Bram Matthys a8e52fdead Bump sjoin module version to 5.1
[skip ci]
2021-06-27 07:41:21 +02:00
Bram Matthys c37c965506 Fix SJOIN not properly propagated due to a copy-paste error in the SJSBY
vs non-SJSBY code. Reported by puckipedia in
https://bugs.unrealircd.org/view.php?id=5934
2021-06-27 07:39:02 +02:00
Bram Matthys 1347b33c14 Update release notes
[skip ci]
2021-06-26 19:44:47 +02:00
Bram Matthys 2afc57aa38 Use IsLoggedIn() macro everywhere where possible.
Based on previous reports and patches from k4be in
https://github.com/unrealircd/unrealircd/pull/129

Looks much cleaner now.

This also filters out the edge case where user_account_login()
could have been called when a user transitioned from "not logged in"
to "unconfirmed account". It did not cause any issues AFAICT but
it is not really expected either.
2021-06-26 11:47:08 +02:00
Bram Matthys 68d172854d Remove IsARegNick() as we already have IsRegNick() 2021-06-26 11:19:47 +02:00
Bram Matthys 06c0a34ab1 Assume all services use account names (SVID), and drop suport for services
that only set +r on people. To my knowledge, practically no services are
out there anymore that do not use proper SVIDs (and that can link with
UnrealIRCd 5).
2021-06-26 11:14:52 +02:00
Bram Matthys 9f10fa2193 Improve error message when trying to use SASL with an unconfirmed
services account.

This adds set::authentication-prompt::unconfirmed-message with
a default of:
unconfirmed-message "You are trying to use an unconfirmed services account.";
unconfirmed-message "This services account can only be used after it has been activated/confirmed.";
See https://www.unrealircd.org/docs/Set_block#set::authentication-prompt

Note that this is only shown for services which allow SASL from
unconfirmed services account in the first place, like atheme.
Anope does not allow it, which is something that could very well
be considered 'correct' as well. In that case you would simply
get the "Authentication failed" message instead
(set::authentication-prompt::fail-message).
2021-06-26 11:03:53 +02:00
Guillaume Hérail 317b3df01e modules/tkl: Fix wrong tkl names in table (#139) 2021-06-26 09:27:55 +02:00
Bram Matthys f30ce90732 Update release notes a bit
[skip ci]
2021-06-25 15:52:14 +02:00
Ramiro Bou 4dbc1f8771 Allow remote servers to write to the link-security MD object (#145) 2021-06-25 14:50:53 +02:00
Bram Matthys 114d54ac61 Allow larger IDLEN for incoming, but keep sending current length.
I would like a bit more room for this in the future,
but until then we will keep sending UIDs of length 9 in
server to server traffic, so no change at all.
2021-06-25 12:17:33 +02:00
Bram Matthys 26a3444f4e Validate the UID in cmd_uid(). Reported by Valware in
https://bugs.unrealircd.org/view.php?id=5925

This does two things in cmd_uid() now:
* It checks if parameter 6 in UID is a valid UID, using valid_uid()
* It checks if the first 3 characters of the UID match the SID
2021-06-25 11:47:23 +02:00
Bram Matthys e9e2504bf4 Don't allow remote servers to write to our MD client objects by default.
Modules can still opt-in via mreq.remote_write=1 to allow it for
certain moddata.
For example, k4be may want to do this for his geoip-base module which
allows a single server to set moddata "geoip" for all connecting clients,
including remote clients.
If you are a moddata provider then you can enable it like this:
 ModDataInfo mreq;
 [..]
 #if UNREAL_VERSION_TIME >= 202125
 mreq.remote_write = 1;
 #endif
 [..]

See discussion on https://github.com/unrealircd/unrealircd/pull/142
2021-06-25 11:28:32 +02:00
Bram Matthys e80c7b5b65 Add set::anti-flood options lag-penalty and lag-penalty-sec.
This also allows known-users to execute slightly more commands per second.

For people who want their trusted users/bots to allow even more commands
per second (eg 20cmds/sec) we now have a nice FAQ item that uses this:
https://www.unrealircd.org/docs/FAQ#high-command-rate
2021-06-23 16:21:06 +02:00
Bram Matthys 28f98da5f8 Remove debug message "Checking flood_limit_exceeded()" that was logged.
This was a leftover from debugging and should not have been present
in 5.2.0. Reported by westor.
2021-06-23 16:16:47 +02:00
Bram Matthys 3fabc1ef5f New security-group::include-mask item so you can put clients into
security-groups based on masks too.
2021-06-23 13:22:17 +02:00
Bram Matthys 7779a4e353 Show git version hash id in /INFO if you are using git
Suggested in https://bugs.unrealircd.org/view.php?id=5920 by KindOne
2021-06-21 15:08:24 +02:00
Bram Matthys 9fde768201 New block set::server-linking and change autoconnect strategy to 'sequential'
* New block [set::server-linking](https://www.unrealircd.org/docs/Set_block#set::server-linking)
  * For link blocks with autoconnect we now default to the strategy
    'sequential', meaning we will try the 1st link block first,
    then the 2nd, then the 3rd, then the 1st again, etc.
  * We now have different and lower timeouts for the connect and
    the handshake. So we give up a bit more early on servers that
    are currently down or extremely lagged.
2021-06-21 14:53:35 +02:00
Bram Matthys 883a1e02ad Initial work on new set::server-linking block:
set {
        server-linking {
                autoconnect-strategy parallel;
                connect-timeout 10s;
                handshake-timeout 20s;
        }
}

Right now the only autoconnect-strategy is 'parallel', which is simply
the existing behavior since 4.x. A future commit will add other
strategies and may or may not change the default as well.

The bit that is working already is that you can now specify different
timeouts for the connect()/TLS_connect() call and for the rest of
the handshake (when the "SERVER" message is seen), this so the connect
timeout can be relatively short.

All this will be documented later in the wiki and release notes.
2021-06-21 13:23:15 +02:00
Bram Matthys 52297e24b6 Don't send "local" channel modes to remote servers.
They were already ignored in MODE by remote UnrealIRCd servers,
but this makes it so local modes (+Z and +d at the moment)
are not sent across the wire.

This also changes the channel_modes() function to have an additional
'hide_local_modes' argument. Set this to 1 if you are building a
buffer that will be sent to remote servers, otherwise use 0,
which is far more common.

Also, this will skip saving of local channel modes to channeldb
since all of these are temporary, or at the moment anyway.

Thanks to alice for reporting this bug and providing a good test
case to help fix this issue and the previous ones.
2021-06-19 17:25:26 +02:00
Bram Matthys fcc7a2cf06 Channel mode +d is local, so should be tagged as such. 2021-06-19 17:03:26 +02:00
Bram Matthys dd1f572acb The code for -d (so after -D+d) never took QUITs into account. Fun. 2021-06-19 16:59:54 +02:00
Bram Matthys 06633047a2 Remove "HCN" from 005. Nobody uses this anyway. 2021-06-19 14:14:33 +02:00
Bram Matthys a541b8f4ad Add support for OpenSSL 3.0.0 (based on -beta1)
Now compiles fine without any warnings.

Note that certificate_quality_check() is an outstanding TODO item.
2021-06-19 13:10:52 +02:00
Bram Matthys e28895c8a9 Show 'security-groups: known-users' etc in connect notice to opers. 2021-06-19 12:49:09 +02:00
Bram Matthys 6cc50d16d0 Fix security group code seeing remote users as always on TLS.
Likely not that important until now, but fix needed for next...
2021-06-19 12:47:52 +02:00
Bram Matthys 991f9f347e Allow wildcards in ~a extban, also special code for ~a:0 and ~a:*
~a:0: match all unauthenticated users
~a:*: match all authenticated users
~a:SomeUser: match only SomeUser, also allow wildcards here, even
though that is usually a very bad idea :D
2021-06-19 11:13:30 +02:00
Bram Matthys fb4b21982d Start writing early release notes for 5.2.1, in particular the new allow
and mask options that should give people food for thought.
[skip ci]
2021-06-19 10:41:04 +02:00
Bram Matthys 905850a825 Bump version to 5.2.1-git and indicate this is bleeding edge 2021-06-19 10:21:46 +02:00
Bram Matthys b72ea1d945 Change allow block to use allow::mask instead of allow::ip / allow::hostname
We use 'mask' everywhere in the config except here, which is annoying
and also inflexible since mask has several nice options, see
https://www.unrealircd.org/docs/Mask_item

Users upgrading will receive a warning, and a reference to
https://www.unrealircd.org/docs/FAQ#allow-mask
but the IRCd will continue to boot (it is not an error).
2021-06-19 10:17:18 +02:00
Bram Matthys deead90ac3 Allow extended server ban syntax in ::mask entries. Eg mask ~a:Syzop; 2021-06-19 09:12:18 +02:00
Bram Matthys f71f6c8fe3 Another update to positive and negative mask rules, the rules are now:
- If you have only negating entries, like '!abc' and '!def', then
  we assume an implicit * rule first, since that is clearly what
  the user wants.
- If you have a mix, like '*.com', '!irc1*', '!irc2*', then the
  implicit * is dropped and we assume you only want to match *.com,
  with the exception of irc1*.com and irc2*.com.
- If you only have normal entries without ! then things are
  as they always are.

This patch also makes the behavior for unreal_mask_match() and
unreal_mask_match_string() the same.
2021-06-19 08:44:03 +02:00
Bram Matthys f7d115e87c More fixes and enhancements for deny link::mask
( 5d6738b3e8 )
2021-06-19 08:00:04 +02:00
Bram Matthys 360d3f507f Move try_connections() from core to server module 2021-06-18 17:21:08 +02:00
Bram Matthys 497c3059ea Fix to support existing deny link::mask syntax as well. 2021-06-18 16:05:50 +02:00
Ramiro Bou 5d6738b3e8 Allowing multiple masks in "deny link" blocks. (#140) 2021-06-18 15:13:50 +02:00
Bram Matthys f0d00ff109 modules.optional.conf: elaborate a bit more on antimixedutf8 score.
And set the default there to 8 instead of 10, which should be OK.
2021-06-16 13:33:01 +02:00
Bram Matthys 89755ccec6 ** UnrealIRCd 5.2.0.1 **
Note: existing 5.2.0 users on *NIX can upgrade without restart to
have the spamfilter fix by using:
./unrealircd hot-patch wrongspamfilter520
2021-06-16 08:25:07 +02:00
Bram Matthys fb8c7a5a75 Fix weird behavior for users in pre-connect stage, eg showing
up in WHOIS. Reported by armyn and Valware.
2021-06-15 20:26:12 +02:00
Bram Matthys 8a655b8bb4 Fix spamfilter not working with type 'c'.
If you had a spamfilter on type 'c' but not on 'p' then it would not
trigger. Reported by armyn in https://bugs.unrealircd.org/view.php?id=5913
This probably went unnoticed because most people add spamfilters
on 'pc' (or even 'pcnN').
2021-06-15 20:01:58 +02:00
Bram Matthys ce807c4e21 Fix Windows build 2021-06-14 10:22:46 +02:00
Bram Matthys f7933a8d72 Set version to 5.2.0 2021-06-14 10:19:06 +02:00
Bram Matthys de4c09eae4 ** UnrealIRCd 5.2.0 ** 2021-06-14 10:14:23 +02:00
Bram Matthys c60b5f48c2 Update release notes 2021-06-14 09:43:04 +02:00
Bram Matthys 210bb2201e Update release notes
[skip ci]
2021-06-14 09:08:44 +02:00
Bram Matthys f8934a44c8 Update release notes
[skip ci]
2021-06-14 08:06:29 +02:00
Bram Matthys 572b349cbd set::restrict-commands: new option exempt-tls which allows SSL/TLS users
to bypass a restriction.
2021-06-14 08:00:48 +02:00
Bram Matthys 389a971f96 Fix rapid autoconnect protection to work with >120 servers (:D) 2021-06-07 17:11:20 +02:00
Bram Matthys 36097fbdce Fix SQUIT being sent back to where it came from.
Reported by Ariadne Conill in https://bugs.unrealircd.org/view.php?id=5906

This patch applies cleanly against 5.2.0-rc1 and 5.0.9.x.

Needs more testing, though, as fiddling with SQUIT code and the
various directions and far/near server distinctions can be tricky.
2021-06-07 10:22:23 +02:00
Bram Matthys 5237ebaabc Fix crash in 5.2.0-rc1: don't call flood_limit_exceeded_log() if a remote
server causes the target flood protection limit to be hit for a target
user or a channel.
2021-06-07 07:48:03 +02:00
Bram Matthys a22ac547c2 Some markup stuff
[skip ci]
2021-06-06 17:37:51 +02:00
Bram Matthys cc490ca924 When using old set::anti-flood settings it is now a (big) warning instead
of an error. Also the warning will differ depending on whether you use
the defaults that were in example.conf for a long time, or some custom
settings.

It's not perfect but should help people with migrating from 5.0.x to 5.2.x.
2021-06-06 17:35:17 +02:00
Bram Matthys 3335eb3305 Fix a doc URL and a (now) confusing syntax example
[skip ci]
2021-06-06 17:09:31 +02:00
Bram Matthys 46550cf180 Update example conf with new anti-flood block.
Replace it with a reference to the documentation instead of trying
to include some or all of the defaults since 1) the block is huge
nowadays with all the settings, and 2) this way we can tweak the
defaults over time in newer versions rather than having people
change their configuration file.
2021-06-06 09:01:31 +02:00
Bram Matthys 3188b7be2d Small code cleanup for two efuncs, so the names match. 2021-06-06 08:33:20 +02:00
Bram Matthys 20c20b3053 Try to explain to people that symmetric encryption works with keys (:D) 2021-06-05 19:20:11 +02:00
Bram Matthys 173af8c88c ** UnrealIRCd 5.2.0-rc1 ** 2021-06-04 11:13:02 +02:00
Bram Matthys 020421a01c Mention websocket type negotiation (Sec-WebSocket-Protocol) in release notes.
[skip ci]
2021-06-04 10:39:18 +02:00
Bram Matthys f6c2b93c72 Show how many sockets/clients the server can handle in 'STATS S'.
Suggested by westor in https://bugs.unrealircd.org/view.php?id=5838

This also fixes a bug where output from modules for 'STATS S' was
shown twice (eg: modef-default-unsettime shown twice).
2021-06-04 10:09:28 +02:00
Bram Matthys 67deb7ec8c UnrealIRCd script: restart is now identical to stop+start (:D) 2021-06-04 09:16:44 +02:00
Bram Matthys 25db0c73e4 Compiler too dumb to detect this properly... 2021-06-04 09:11:15 +02:00
Bram Matthys 6771c98d76 Move check for secret block to beginning of unrealdb_open() so we don't
end up with a 0 byte file due to an easy-to-avoid error later on.
2021-06-04 09:09:06 +02:00
Bram Matthys 148ea98307 Load chathistory module by default 2021-06-04 08:46:09 +02:00
Bram Matthys a7f2406557 Add security-group "webirc" by default. This matches users who
connect through approved webirc gateways, the ones in
https://www.unrealircd.org/docs/WebIRC_block
2021-06-02 19:32:10 +02:00
Bram Matthys e126d924a5 Somehow DEBUGMODE was turned on by last commit, now off again by default. 2021-06-02 19:31:05 +02:00
Bram Matthys 40bc3ef8cc Bump version to 5.2.0-git. This is still work in progress.
Note that we are on the 'unreal52' branch now and have left 'unreal50'
2021-06-02 15:27:14 +02:00
Bram Matthys d9b80d889f Update curlinstall script for ./configure from cURL 7.77.0 and above. 2021-06-02 14:35:37 +02:00
Bram Matthys d360ae7845 Add some markup in release notes
[skip ci]
2021-05-30 19:37:51 +02:00
Bram Matthys 517298007d If no log { } block is present, we used to only log errors to ircd.log.
From now on we simply enable ALL logging to ircd.log, so also connects,
kills, and so on.
2021-05-30 19:35:52 +02:00
Bram Matthys 3eb0bc24ea Add log::flags "flood" to log flood messages 2021-05-30 19:30:36 +02:00
Bram Matthys f8a732747b Get rid of mempool LOG_DBG which is never used 2021-05-30 19:27:35 +02:00
Bram Matthys 6358a2e5ff Remove this check due to clang complaining. Whatever. 2021-05-30 19:11:50 +02:00
Bram Matthys 5acef88ceb All violatons of target-flood, nick-flood, join-flood, away-flood,
invite-flood, knock-flood, max-concurrent-conversations are now
reported to opers with the snomask 'f' (flood).
2021-05-30 19:10:18 +02:00
Bram Matthys cb604d6df0 Update release notes
[skip ci]
2021-05-30 18:49:18 +02:00
Bram Matthys 6f92233919 The set:anti-flood block has been redone so you can have different limits
for "unknown-users" and "known-users".
As a reminder, by default, "known-users" are users who are identified
to services OR are on an IP that has been connected for over 2 hours
in the past X days.
See https://www.unrealircd.org/docs/FAQ#new-anti-flood-block
for more information on the layout of the new block.

NOTE: This actual feature, the relase notes and the documentation
      are all work in progress.
2021-05-30 18:45:27 +02:00
Bram Matthys 3076ed5a98 Make pretty_time_val() output like "2m30s" instead of "2 minutes 30 seconds".
I think people will understand both and it is currently rather long.
And a bit confusing too with all the spaces, easy to overlook something eg
in /STATS S where it is being used.
2021-05-30 14:50:27 +02:00
Bram Matthys 79ded54df1 Make join-flood use the new framework too, well... partially anyway. 2021-05-28 18:08:07 +02:00
Bram Matthys 36b9faa7cd Code cleanup: move flood control to generic system 2021-05-28 17:59:39 +02:00
Bram Matthys 3e1f092afc Rename FLD_* to CHFDL_* in chanmodes/floodprot.c, so it does
not clash with future stuff.
2021-05-28 15:48:54 +02:00
Bram Matthys 191990b881 Code cleanup: at some places "ClientUser" was used instead of "User". 2021-05-28 15:26:58 +02:00
Bram Matthys d9c0397e25 Code cleanup: this zeroing isn't useful as we already memset. 2021-05-28 15:25:10 +02:00
Bram Matthys da519ae04a Get rid of duplicate checks for anti-flood.
Sorry this is too much effort and i think admins should be smart
enough to figure this out themselves.
2021-05-28 14:52:09 +02:00
Bram Matthys e1e718f982 Update release notes
[skip ci]
2021-05-28 10:38:32 +02:00
Bram Matthys 78ca5ecc3e Add "draft/bot" message tag to messages from +B clients.
As mentioned in https://ircv3.net/specs/extensions/bot-mode
2021-05-28 10:36:38 +02:00
Bram Matthys 0bd813733f Fix file header
[skip ci]
2021-05-28 10:07:26 +02:00
Bram Matthys 845a582d76 Add support for +draft/reply and load the module by default.
See https://ircv3.net/specs/client-tags/reply for the draft.

Can be used by clients to indicate to which message they are writing
a reply. This can be especially useful for bots, to indicate that
a response belongs to a user request, eg a !trigger.
2021-05-28 09:14:40 +02:00
Bram Matthys 4db7866676 Update release notes
[skip ci]
2021-05-26 11:27:27 +02:00
Bram Matthys d3ee89ffa5 Fix help.conf 2021-05-26 07:51:43 +02:00
Bram Matthys a85a38e69d Add the ability to SPAMFILTER message-tags.
The new target type is called 'T' and we match against "name=value"
of each message tag (or just "name" if it is without value).

Example: SPAMFILTER ADD -simple T kill 0 this_is_a_test +typing=active
(No this is not a suggestion :D)

This probably won't be used much at all, but it is good to have the
option available in case there is some massive problem,
especially since more message tags may pop up sooner or later.

Caveat: this is actually a bit slow as we may have to check multiple
message tags for a single line.
If there are zero message-tag spamfilters then we will automatically
short-circuit and save all this CPU, which will be the most common case.
2021-05-25 20:31:10 +02:00
Bram Matthys 264ed614fc Implement Sec-WebSocket-Accept from
https://github.com/ircv3/ircv3-specifications/pull/342
2021-05-24 18:33:55 +02:00
Bram Matthys 872aa93635 Move some string helpers to src/misc.c
skip_whitespace() and read_until()
2021-05-24 18:32:57 +02:00
Bram Matthys cd9ac916de Allow setting set::history::channel::playback-on-join::lines to zero
in case you want to disable this feature.

Note that clients that are using CHATHISTORY will already no longer
receive history-on-join ("push") since they REQ a CAP that will inhibit
this and they will "pull" the history instead when they want/need to.

So... this option is really only there if you want to disable it for
non-CHATHISTORY-clients.
2021-05-24 09:59:20 +02:00
Bram Matthys 3ded34b405 Windows: run db tests
[skip ci]
2021-05-24 09:22:17 +02:00
Bram Matthys 2375c35f2b Fix crashreporter to show big warning if you have 3rd party modules
loaded. The code to raise this warning was already present but it
was not being shown in many cases (when it actually should).

It now looks like this, if you run ./unrealircd start and previously
crashed AND have any 3rd party mods loaded:

The IRCd has been started now (and is running), but it did crash 1 seconds ago.
Crash report generated in: /home/ircd/unrealircd/tmp/crash.report.core.1621838267.txt

** IMPORTANT **
Your UnrealIRCd crashed and you have 3rd party modules loaded (modules created
by someone other than the UnrealIRCd team). If you installed new 3rd party
module(s) in the past few weeks we suggest to unload these modules and see if
the crash issue dissapears. If so, that module is probably to blame.
If you keep crashing without any 3rd party modules loaded then please do report
it to the UnrealIRCd team.
The reason we ask you to do this is because MORE THAN 95% OF ALL CRASH ISSUES
ARE CAUSED BY 3RD PARTY MODULES and not by an UnrealIRCd bug.

Shall I send a crash report to the UnrealIRCd developers?
NOTE: If the crash is caused by a 3rd party module then UnrealIRCd devs can't fix that.
2021-05-24 08:38:07 +02:00
Bram Matthys 842e06d7d3 Possibly fix small memory leak. 2021-05-23 13:59:57 +02:00
Bram Matthys 92b9fa07a1 Make history backend non-PERM so it can be upgraded on the fly.
Tested:
* Rehashing and sending messages before after (multiple times)
* Terminating
* Unloading by commenting out
2021-05-23 13:56:03 +02:00
Bram Matthys 88d7829e5b Allow lower set::restrict-commands::xyz::connect-delay values.
Suggested by Le_Coyote in https://bugs.unrealircd.org/view.php?id=5873
2021-05-23 09:46:33 +02:00
Bram Matthys 137cc7f20b Update some URLs
Suggested by westor in https://github.com/unrealircd/unrealircd/pull/136
2021-05-23 09:44:18 +02:00
Bram Matthys 9c0710a9a4 Adjust +H setting if a channel goes -r and had a high setting
that was only allowed for registered channels (+r).
2021-05-23 09:26:38 +02:00
Bram Matthys 7ccbb6ebf1 Update release notes
[skip ci]
2021-05-22 19:29:23 +02:00
Bram Matthys b6626b2b60 Update module coders section in release notes
[skip ci]
2021-05-22 19:06:49 +02:00
Bram Matthys 3ad6878865 Set new maximums for channel mode +H. If the channel is +r then the maximum
is now 5000 lines / 31 days. For unregistered it is 200 lines / 31 days.
Previous setting was 200 lines / 7 days for both.

Admins can tweak these settings, see:
https://www.unrealircd.org/docs/Set_block#set::history

More code to deal with corner issues will follow later.

UnrealIRCd module coders [!]:
This also changes the channel mode API conv_param. You can use
the UNREAL_VERSION_TIME >= 202120 condition to detect this.
Eg:
 #if UNREAL_VERSION_TIME < 202120
 int my_conv_param(char *para, Client *client);
 #else
 int my_conv_param(char *para, Client *client, Channel *channel);
 #endif
2021-05-22 18:15:26 +02:00
Bram Matthys 7a22ec8b6b Announce CHATHISTORY=xx in 005 2021-05-22 15:32:29 +02:00
Bram Matthys d6b64de162 Silence compiler warning by reordering stuff. 2021-05-22 15:14:29 +02:00
Bram Matthys 8431cd43b2 Fix read-after-free 2021-05-22 14:59:54 +02:00
Bram Matthys c0b86c757c Change chanmode +H parameter to show hours and days when needed and
possible if it rounds off nicely, eg +H 100:7d. Note that the
existing syntax is still accepted, eg +H 20:1440 and +H 20:1440m
are both converted to 20:1d.

With potentially higher time values this change makes the mode
parameter a lot more readable.

Support for translating timevalues is already in UnrealIRCd 5.0.2
and higher, so should be fine for nearly everyone.
2021-05-22 14:49:25 +02:00
Bram Matthys c6873292b9 Implement CHATHISTORY TARGETS...
Except that it still needs to order the result by timestamp,
which it does not do at the moment.
2021-05-22 13:36:16 +02:00
Bram Matthys 937cc94940 Add CAP draft/chathistory and don't send history-on-join if this
CAP is enabled by a client.
2021-05-22 12:16:52 +02:00
Bram Matthys abeb222eed Implement CHATHISTORY BETWEEN 2021-05-22 11:50:51 +02:00
Bram Matthys 188dc7792d Fix crash on remote CHATHISTORY cmd (by servers/services). 2021-05-21 07:20:26 +02:00
Bram Matthys 3543bff286 Update list of donators 2021-05-19 19:24:18 +02:00
Bram Matthys cda145b62a Add initial version of CHATHISTORY command
from https://ircv3.net/specs/extensions/chathistory

Current status of the module in UnrealIRCd:
* A significant part of this is done and working
* Currently in modules.optional.conf to get test exposure,
  not yet loaded by default.
* CHATHISTORY subcommands implemented: BEFORE, AFTER, LATEST, AROUND
* It does not implement the subcommand "BETWEEN" yet
* It does not announce or recognize the (draft) CAP's yet
* It does not announce the ISUPPORT token CHATHISTORY=xx yet
* Testcases need to be written to validate everything
* There will be bugs, now, and also while implementing the rest
  in the days to come.
2021-05-19 16:19:41 +02:00
Bram Matthys ad84a5227a Remove version check for curl and libssl. Nowadays they have ABI
guarantees so it should all be OK. (And nowadays they probably
are true too :D)
2021-05-18 20:35:33 +02:00
Bram Matthys 7f0cae0473 Remove warning in release notes on file corruption,
now that things are more tested. [skip ci]
2021-05-17 16:51:49 +02:00
Bram Matthys 9a7f2b0ea2 Update for DB tests, now finished in test framework. 2021-05-17 16:44:21 +02:00
Bram Matthys c916d1d9ef Allow secret::password-file to only exist on-boot, so after booting
the file is allowed to no longer exist. This so you can do things
like only connecting an USB stick during UnrealIRCd boot and then
pull it out once booted.
2021-05-17 15:18:28 +02:00
Bram Matthys 013184533d Add DB writing/reading tests to BuildBot so it is tested on every commit. 2021-05-17 12:45:35 +02:00
Bram Matthys be81152da7 Move hash generation outside cfg() and do it early just to be safe. 2021-05-17 12:38:43 +02:00
Bram Matthys 8c71cd1a65 * Make channeldb write the db on terminate
* Fix channel history issues with writing on terminate
* Change tkldb and reputation to only write the db
  on terminate and not on every REHASH anymore

..all this thanks to the new loop.ircd_terminating, so modules can
see the difference between regular rehash and terminating.
2021-05-17 11:49:28 +02:00
Bram Matthys c79cc6f430 Add ModuleSetOptions(modinfo->handle, MOD_OPT_UNLOAD_PRIORITY, priority);
so modules can indicate if they wish to be unloaded before or after others.
This is used by the channel and history modules so they can save their
databases before the chanmodes modules are unloaded.

Also, made ModuleSetOptions() a void function. I don't think anyone
used the returned value and it now no longer is strictly bitmask add/del
so returning an unsigned int would be a tad confusing.
2021-05-17 11:43:46 +02:00
Bram Matthys 74083d7440 In AddListItemPrio() explicitly set item->priority to prio. 2021-05-17 11:39:45 +02:00
Bram Matthys 4fa468bd4f on DelListItem set prev/next to NULL on the item itself (not the list) 2021-05-17 11:31:55 +02:00
Bram Matthys d7bf35e0d9 Set loop.ircd_terminating when IRCd is terminating (signal 15, /DIE, etc) 2021-05-17 11:08:54 +02:00
Bram Matthys 61e0ed3d03 Give UnrealIRCd 10 seconds to terminate insteads of just 1, now that
we may have more database writing to do on terminate.

Actually 10 seconds would be really long, but 2-3 seconds may be
quite realistic if you have lots of TKLs, permanent channels,
reputation entries (users), etc.

Oh yeah, and I really hate writing PORTABLE shell code...
2021-05-17 09:05:47 +02:00
Bram Matthys 263593634e Flush any dirty history log files to disk on terminate (eg: ./unrealircd stop) 2021-05-17 08:47:39 +02:00
Bram Matthys cb3c0b48ca Don't call hbm_delete_db() if not running in persistent mode. 2021-05-17 08:10:51 +02:00
Bram Matthys ae873ab25a Compile fixes for Windows 2021-05-16 19:15:01 +02:00
Bram Matthys f79fec62f1 Add CAP unrealircd.org/history-backend which declares the policy/
configuration on how history is stored (in memory and/or on disk).
This is similar to other disclosing policies like
unrealircd.org/link-security and unrealircd.org/plaintext-policy.
The reason for this cap (and similarly the other caps) is that
the user can make an informed decision on whether it finds the
policy/safety/privacy of an acceptable level or not.

Fixes for turning persist on/off on the fly (REHASH)

Make release notes a bit more clear.
2021-05-16 17:52:59 +02:00
Bram Matthys e58b22c45d Write some early release notes.
[skip ci]
2021-05-16 17:26:35 +02:00
Bram Matthys 011cc9e1d5 Persistent channel history: prevent mixing of .db files from elsewhere. 2021-05-16 17:25:36 +02:00
Bram Matthys 5e4d9cdc61 Delete persitent history immediately when channel goes -P.
And also handle -P+P.
2021-05-16 17:18:52 +02:00
Bram Matthys 5c8752dfc6 Get rid of various warnings/errors due to recent work. 2021-05-16 16:57:01 +02:00
Bram Matthys 14a99d755e UnrealDB history: Use SHA256 with pre- and post- hashsecret
for the file names, instead of MD5.
2021-05-15 20:55:08 +02:00
Bram Matthys 13f9afeaf4 Add sha256hash() function for convenience. 2021-05-15 20:48:04 +02:00
Bram Matthys 05dd788dab Add support for secret::password-prompt (entering on console)
This is one of the 3 currently supported methods.
Documentation will follow later.
2021-05-15 18:52:01 +02:00
Bram Matthys 1752afee44 Move running_interactively() from crashreport.c to misc.c 2021-05-15 18:28:21 +02:00
Bram Matthys 55b0422dd0 Bail out sooner, otherwise confusing. 2021-05-15 18:28:03 +02:00
Bram Matthys 3bf0c9e653 Add support for persistent channel history, if the channel is +P and +H.
This is not enabled by default and requires additional configuration,
documentation will follow later.
2021-05-15 15:43:07 +02:00
Bram Matthys 95cfafcd51 Include dirent.h by default. 2021-05-15 15:42:34 +02:00
Bram Matthys 73ae7ccbef Mod API: Add CONFIG_SET_HISTORY_CHANNEL so chanmodes/history
can delegate configuration to history_backend_mem.
2021-05-15 15:41:02 +02:00
Bram Matthys ff84f17f72 Move strtolower_safe() from antirandom to support.c 2021-05-15 15:38:57 +02:00
Bram Matthys 7fa0e07487 UnrealDB: Oops, previous commit broke unrealdb_write_str() w/NULL strings. 2021-05-05 19:20:33 +02:00
Bram Matthys 8783280a68 Make UnrealDB big-endian-proof. Rather rare, but you never know
on what hardware people end up running UnrealIRCd.

Also (unrelated) add a check for >64kb strings in unrealdb_write_str()
and return an API error. That too is unlikely to ever happen, but..
better be correct.
2021-05-05 19:04:11 +02:00
Bram Matthys df3bb510a1 Windows: Ignore compiler warning C6029 in unrealdb.c as it is a false positive.
src/unrealdb.c(462): error C2220: warning treated as error - no 'object' file generated
src\unrealdb.c(379) : warning C6029: Possible buffer overrun in call to 'fread':  use of unchecked value 'c'.

[..fread of c->config->saltlen..]
if (c->config->saltlen > 1024)
{
        unrealdb_set_error(c, UNREALDB_ERROR_HEADER, "Header is corrupt (saltlen=%d)", (int)c->config->saltlen);
        goto unrealdb_open_fail; /* Something must be wrong, this makes no sense. */
}
c->config->salt = safe_alloc(c->config->saltlen);
if (fread(c->config->salt, 1, c->config->saltlen, c->fd) != c->config->saltlen)

VS2019 doesn't understand that this is safe.
2021-05-05 13:44:33 +02:00
Bram Matthys 623745d274 Fix Windows BuildBot
[skip ci]
2021-05-05 11:23:42 +02:00
Bram Matthys bd11d06a39 Windows compile fixes for unrealdb and libsodium. 2021-05-05 10:49:15 +02:00
Bram Matthys 214a98addb Add libsodium to Windows build
[skip ci]
2021-05-05 09:48:17 +02:00
Bram Matthys deffc908e3 Document UnrealDB API and get rid of unrealdb_write_data/unrealdb_read_data.
API users must use specific size/type functions instead, otherwise it is
simply too dangerous / too easy to overlook issues.
2021-05-04 11:03:48 +02:00
Bram Matthys cc348701a2 UnrealDB: check for write errors in all conditions (not just some)
And set the error message/code properly. Didn't set it before because of
'c' being freed, but we have unrealdb_get_error_code() and
unrealdb_get_error_string() now that can (and should) still be used
in such cases.
2021-05-04 09:07:37 +02:00
Bram Matthys a349fa2ae4 UnrealDB: Fix for short read / final end of file (for unencrypted files) 2021-05-04 09:01:04 +02:00
Bram Matthys 4f8ac3c6cf UnrealDB: Fix reading final end of file (crypto-side) 2021-05-04 08:55:08 +02:00
Bram Matthys 282162b4aa Various small UnrealDB fixes 2021-05-04 08:36:45 +02:00
Bram Matthys 576f8b1aae Fix bug with unrealdb caching 2021-05-03 18:25:59 +02:00
Bram Matthys 2a29c2f3b3 Update tkldb to use UnrealDB functions 2021-05-03 18:06:05 +02:00
Bram Matthys 2340f14973 Fix unrealdb reading due to last-minute change earlier today 2021-05-03 18:04:56 +02:00
Bram Matthys 1606f28555 Add unrealdb_write_char() / unrealdb_read_char() 2021-05-03 17:48:23 +02:00
Bram Matthys 6860046b20 Make the "UnrealIRCd 4 is no longer supported" section a bit shorter
in the release notes.
[skip ci]
2021-05-03 15:33:41 +02:00
Bram Matthys eb4d7fb3f0 Set version to 5.0.10-git with disclaimer not to use it yet. 2021-05-03 15:27:30 +02:00
Bram Matthys 30d64f2ebe Use UnrealDB functions in channeldb. 2021-05-03 15:15:25 +02:00
Bram Matthys 40ace27e7d Add UnrealDB reading capability to reputation module.
We still write the old format, unless encryption is enabled.
2021-05-03 15:14:56 +02:00
Bram Matthys dde3e0ccb2 Add unrealdb and secrets API. Documentation and more information will
follow in later commits.
2021-05-03 15:07:10 +02:00
Bram Matthys dd33b38264 Fix extended server ban ~a:accname not working for shun and also
not always kicking in on *line either.
We now check for shuns/*lines in user_account_login(), so upon
SASL or NS IDENTIFY etc. This also means that the client could
now be killed in that function, so callers should take extra
care and take that into account. We check for IsDead() in our
calls now (if it's our client anyway).

Hopefully this doesn't break anything.........
2021-04-17 14:42:40 +02:00
Bram Matthys d6b0981433 Module coders: Update HOOKTYPE_LOCAL_NICKCHANGE and HOOKTYPE_REMOTE_NICKCHANGE.
I forgot to include message tags earlier, so this is a breaking change:
-int hooktype_local_nickchange(Client *client, char *newnick);
-int hooktype_remote_nickchange(Client *client, char *newnick);
+int hooktype_local_nickchange(Client *client, MessageTag *mtags, char *newnick);
+int hooktype_remote_nickchange(Client *client, MessageTag *mtags, char *newnick);

Be sure to update your hooks!
You can use something like: #if UNREAL_VERSION_TIME>=202115
2021-04-17 10:38:25 +02:00
Bram Matthys 85d20e8bd5 Optimize libsodium for current CPU (just like libargon2 does)
Is about 5x speed improvement in practice.
2021-04-10 12:38:20 +02:00
Bram Matthys e497feef24 Add c-ares and libsodium version output to boot screen and /VERSION.
OpenSSL, PCRE2 and cURL were already there.
2021-04-09 19:30:53 +02:00
Bram Matthys 5daf7e7ebe Compile with system libsodium, fallback to shipped version.
This library provides easy to use functions for encryption/decryption
among other things. There is some overlap with things that
OpenSSL also provides but not all.
2021-04-09 13:44:31 +02:00
Bram Matthys e596b730af Move channel history sending from one layer to the other.
This so for example history_backend_mem() does not do any sending.
Less efficient but needed for later when things get more complex.
2021-04-07 09:42:18 +02:00
Bram Matthys 4dc999d2b6 Update some API doc 2021-04-07 09:16:52 +02:00
Bram Matthys 5cddc8d212 If a user answers the curl path manually at the final ./Config question
about curl, then verify that it is actually a correct answer by
checking for <prefix>/bin/curl-config.
2021-03-29 19:24:26 +02:00
Bram Matthys f04697ba7c Add disclaimer to config.settings. 2021-03-29 19:09:37 +02:00
Bram Matthys 775c00c096 Add displaying of reputation score in WHOX (if IRCOp).
The new display field is called 'R', use something like:
WHO * %cuhsnfmdaRr

At the moment only "displaying" is available and not "searching"
on reputation. If you need that, you're stuck with the /REPUTATION
command at the moment. Too much hassle to implement that.

About reputation: https://www.unrealircd.org/docs/Reputation_score
2021-03-28 18:23:02 +02:00
Bram Matthys 0ea86fce83 Forbid using extended server bans in ZLINE/GZLINE as they only work on *@IP.
...and give a hint to use KLINE/GLINE instead.
2021-03-27 09:11:15 +01:00
Bram Matthys d9fbb51a33 Fix error message for /ELINE not working with certain types.
Reported by westor in https://bugs.unrealircd.org/view.php?id=5843

This makes the code more generic so it's just adding a 1/0 in
the TKL types table.
2021-03-27 09:10:56 +01:00
Bram Matthys 4725b5547b Mention correct tag names (which also happen to be URLs) for
unrealircd.org/userip and unrealircd.org/userhost.
Reported by Nav|C.
2021-03-26 15:14:25 +01:00
Bram Matthys e31755bc7c *** UnrealIRCd 5.0.9.1 *** (faster build, lower memory requirements during build)
Note: the only change between 5.0.9 and 5.0.9.1 is:
* Build improvements on *NIX (faster compiling and lower memory requirements)
* Windows version is unchanged and still 5.0.9
2021-03-26 08:30:21 +01:00
Bram Matthys ed50c8fb8c Make shipped c-ares build a lot faster (for systems without system c-ares).
Type:           Parallel build:  Non-parallel build:
Before change   92 seconds       304 seconds
After change     7 seconds        21 seconds

All this thanks to a simple --disable-tests being passed to c-ares' configure.
2021-03-22 08:25:59 +01:00
Bram Matthys 1d0ac57bfa Don't try parallel make if less than 750MB memory is available
(that is, MemAvailable, not MemFree). The ./Config script with
all shipped libs compiled actually has a memory peak of 450M
in my tests with -j4, but let's err on the safe side...

Reason for all this:
This helps on shells with limited memory, especially if they
don't have swap.

We actually don't take swapping into account, so even if you
have plenty of swap but "low" on memory then we won't force a
parallel build. That's okay, since in such a case a parallel
build is not so useful anyway with (slow!) swapping.

This code only works on Linux. Let's hope *BSD guys are smart
enough to have a decent system setup.
2021-03-22 08:13:58 +01:00
LeCoyote 00711f905c Actually read security-group::tls from the conf file (fixes #0005836) (#133) 2021-03-21 07:39:49 +01:00
Bram Matthys 80fbef8b5c *** UnrealIRCd 5.0.9 *** 2021-03-19 20:08:21 +01:00
Bram Matthys 022ed9ae71 Remove explicit setting of send/receive buffer as modern OSs don't
need this and it slows things down for servers.

For clients it's not much of an issue, since traffic rates are low.

However, for server-to-server links it is an entirely different matter.
It is (only) noticeable if you have lots of traffic, such as when there
is a lot to sync while linking two servers, and especially when the two
servers are geographically further apart.
Tested with 100,000 G-lines on both sides being synced (20MB traffic):
* 20ms RTT (same country/state): speed up of x3
* 200ms RTT (transpacific): speed up of x6
2021-03-14 16:04:43 +01:00
Bram Matthys a880532ca7 Update ./Config autodetection of 5.0.8. 2021-03-12 17:53:40 +01:00
Bram Matthys 6761cdd66d UnrealIRCd 5.0.9-rc1 2021-03-12 17:50:52 +01:00
Bram Matthys 2765eaac26 Add find_nvplist() 2021-03-10 17:24:38 +01:00
Bram Matthys 57a6dd3600 Fix windows build. Now that we are using c-ares 1.17.1, the include
directory has changed that needs to be specified on Windows.
[skip ci]
2021-03-10 14:37:33 +01:00
Bram Matthys 01bfe5f7a7 Mention that the Windows build now supports TLSv1.3 too.
We moved from LibreSSL 3.1.4 to 3.2.4.
Support for TLSv1.3 was added in LibreSSL 3.2.2 from Oct 2020,
but it had some issues, hopefully by now they are resolved.
[skip ci]
2021-03-08 17:46:40 +01:00
Bram Matthys d42147d56c Update shipped C-ARES lib to 1.17.1 (19-Nov-2020) 2021-03-08 11:10:11 +01:00
Bram Matthys c352dcb8aa Update shipped PCRE2 lib to 10.36 (04-Dec-2020) 2021-03-08 11:07:10 +01:00
Bram Matthys f4b14330a8 Update curl-ca-bundle: Certificate data from Mozilla as of: Tue Jan 19 04:12:04 2021 GMT
https://curl.se/ca/cacert-2021-01-19.pem
[skip ci]
2021-03-08 11:00:33 +01:00
Bram Matthys 82af21639c Fix for -Werror=unused-result 2021-03-08 10:43:36 +01:00
Bram Matthys 1f47cc7824 Support for dated log files such as log "ircd.%Y-%m-%d.log" { }
Suggested by Amiga600 in https://bugs.unrealircd.org/view.php?id=5784

This also fixes a bug with log::maxsize on Windows (cannot overwrite
existing file with .old).

It simplifies the logging code a little and makes it a tad more readable.

And it adds an unreal_strftime() function to make things easy.
2021-03-08 10:37:28 +01:00
Bram Matthys 28bf68f39b More than 100 lines within an if when you can use if ! w/continue.. pff. 2021-03-08 09:53:28 +01:00
Bram Matthys 8a16a7392f Don't stat() the logfile if user has no log::maxsize 2021-03-08 09:51:00 +01:00
Bram Matthys 7b655a5e17 Merge two identical #ifdef's 2021-03-08 09:49:44 +01:00
Bram Matthys 29e8c2c770 Mention './unrealircd genlinkblock' as it should work in 5.0.8+. 2021-03-08 09:45:11 +01:00
Bram Matthys 44f8bea3c4 Minor crash reporter fixes and add command line crash test to test it. 2021-03-08 09:12:53 +01:00
Bram Matthys 636b068062 New option allow::global-maxperip, defaults to allow::maxperip+1.
Suggested by Jobe and PeGaSuS in https://bugs.unrealircd.org/view.php?id=5802
2021-03-07 11:30:02 +01:00
Bram Matthys 4bd0969583 spamfilter { } blocks caused some confusing whitespace in stats for
the spamfilter. Only after a rehash it showed the me::name as the
setter. From now on we just display -config- in the setter field,
like we do for all the other TKLs as well (ELINE, ban xyz, etc).
2021-03-07 10:43:47 +01:00
Bram Matthys 1854bfffd0 ELINE and except ban for type 'F' (spamfilter) were not working.
Reported by armyn in https://bugs.unrealircd.org/view.php?id=5820
2021-03-07 08:46:24 +01:00
Bram Matthys 17bdd6de1e Use different temporary filename. Not really important normally but
if running multiple ircds from the same directory you sometimes get
weird messages otherwise (not that we really support such a thing
but i use it while dev'ing).
2021-03-06 18:55:10 +01:00
Bram Matthys 94fea88319 CR+LF->LF conversion for help.nl.conf.
[skip ci]
2021-02-28 07:54:33 +01:00
Bram Matthys dc40d27cd8 Move set::anti-flood::unknown-flood-* to set::anti-flood::handshake-data-flood
which is a new block, documented at:
https://www.unrealircd.org/docs/Set_block#set::anti-flood::handshake-data-flood
The reason for this is better naming and allowing to tweak ban-action.
2021-02-28 07:52:33 +01:00
Bram Matthys 94b8f6575e Just some code cleanup (variable renaming) in tkldb, nothing more...
Make it consist tkldb/TKLDB instead of still some tkl_db/TKL_DB.
2021-02-11 08:19:33 +01:00
Bram Matthys 9e82f13c54 Fix bug in tkldb if ircd is rehashed every <300 secs it would never save.
Not reported by anyone, but yeah.. who knows there is someone out there
that does this :D.
Also make it work the same like channeldb by spreading the event.
2021-02-11 08:16:03 +01:00
Bram Matthys f1e3b7dcdf Tweak channeldb saving to be further apart from tkldb saving. 2021-02-11 08:02:58 +01:00
Bram Matthys 06d90a9d46 Behave better when multiple HOOKTYPE_RAWPACKET_IN modules are active.
If a module returns 0 ("UnrealIRCd please do not process this packet")
then don't call the next module in line (also because that one might
then change the return value to something different, which is bad).
2021-02-10 14:24:17 +01:00
Bram Matthys 25f8b8e4c7 Remove unnecessary include (was merged in sys.h a while back) 2021-02-10 14:22:30 +01:00
westor eb76ae7c67 Fix nocodes error message: tell user it blocks color also (#131) 2021-02-06 07:45:27 +01:00
k4bek4be b22e1c1a43 Fix call to HOOKTYPE_UMODE_CHANGE in SVSMODE
Was accidentally called with parameter being source (services, often nickserv) instead of the target user
2021-02-06 07:44:31 +01:00
Bram Matthys c71214cefe Rename nvplist functions to match the rest, fix resource leak,
and move the functions to list.c where they belong.
nvplist_add()		-> add_nvplist()
nvplist_add_fmt()	-> add_fmt_nvplist()
(new)			-> free_nvplist
2021-02-02 18:39:17 +01:00
Bram Matthys d4e0ee9431 *NIX: Bump default MAXCONNECTIONS from 8192 to 16384.
That is, when in "auto" mode, which is like for 99% of the users.
NOTE: the sytem may still limit the actual number of FD's to
a lower value, depending on the value of "ulimit -n -H".
2021-02-01 13:27:08 +01:00
Bram Matthys d84c820d5a Some text changes
[skip ci]
2021-01-31 19:47:01 +01:00
Bram Matthys 9d85b112dc Fix typo
[skip ci]
2021-01-31 18:56:18 +01:00
Bram Matthys 1baf5f9f7d Show reputation score and some other info in "Client connecting"
notices to IRCOps and in ircd.log.
See the release notes for more details.

Module coders:
You can use HOOKTYPE_CONNECT_EXTINFO to add your own additional
information as well. See get_connect_extinfo() for inspiration.
Use nvplist_add() or nvplist_add_fmt() to easily add your info
to the list.

Module coders II:
Small note: this moves the sending of the far connect notice
to /under/ HOOKTYPE_REMOTE_CONNECT instead of /above/.
2021-01-31 18:30:49 +01:00
Bram Matthys 82da314cf4 Dev docs: document svid better
[skip ci]
2021-01-29 19:12:51 +01:00
PeGaSuS e90d661e8d Fixed typo in ELINE example flags, from f to F (spamfilter) (#130) 2021-01-29 19:11:36 +01:00
Bram Matthys a6da4a5823 Small text fix on Windows for unrealsvc.exe usage instructions.
The command is 'unrealsvc' and not 'unreal'.
Also update copyright a bit since I have at least been updating
this file since 2006 (e679a6760b).
2021-01-27 17:11:17 +01:00
Bram Matthys b65584226c win_log(): avoid double LF in win_log() caused by previous commit. 2021-01-23 12:27:43 +01:00
Bram Matthys 9204939a7f Windows: improve logging on-boot, especially when running as a service.
When booting no log files are open yet as we have not parsed any log { }
entries yet. On *NIX we log to stderr during that stage.
On Windows it varies: when running in GUI mode we save the log to a
buffer and display it after booting in a dialog.
When running as a service on Windows we previously wrote SOME entries
to service.log, but other entries were not logged or shown anywhere.

This makes both GUI and Service-mode on windows log all ircd_log()
calls with LOG_ERROR, instead of only config_status(), config_warn()
and config_error() messages.

This also removes config_progress() which isn't used by anything.

Oh, and it also fixes a memory leak in the Windows boot code, a leak
that nobody would have noticed anyway, but still.
2021-01-23 12:22:48 +01:00
Bram Matthys 3a922d6ed5 Disable handshake delay for users that are exempt from blacklist checking.
The handshake delay exists so results from DNSBL's can be checked before
the user is fully online. Whenever someone is exempt from DNSBL checking
it serves no purpose, so we mark it that the user has no handshake delay.
This will speed up connecting by up to 2 seconds (by default).
Also updated WebIRC example to suggest this now:
https://www.unrealircd.org/docs/WebIRC_block#UnrealIRCd-side
2021-01-17 08:25:14 +01:00
Bram Matthys cd967a6ea6 Always exempt 127.* from gline, kline, etc.
The exempted ban types are only ones that will affect other connections as well,
such as gline, and/but not policy decissions such as bypassing qlines or maxperip.
Currently the list is: gline, kline, gzline, zline, shun, blacklist,
                       connect-flood, unknown-data-flood.
Suggested by PeGaSuS and others in https://bugs.unrealircd.org/view.php?id=5806
2021-01-17 08:06:23 +01:00
Bram Matthys 5034c2306b Fix "./unrealircd upgrade" so it actually works with GPG.
And if it is actually used/installed then make it a little bit
harder to bypass the case where the digitale signature does not match.
And yes, the bypass option does exist because in the future we
may have a different signing key. Who knows from what old version
people may upgrade years from now, after all.
2021-01-10 18:27:33 +01:00
Bram Matthys 0fd9c2ee6f Add doc/KEYS which contains the public key(s) used to sign UnrealIRCd releases 2021-01-10 16:26:22 +01:00
Bram Matthys 0e125abc36 New: "./unrealircd upgrade" to upgrade to latest UnrealIRCd release. 2021-01-10 16:22:33 +01:00
Bram Matthys 011ebf3ce7 Fix for previous. "Channel joinfloodflood" -> "Channel joinflood" :D 2021-01-10 08:05:53 +01:00
Bram Matthys ebed68f636 Channel mode +f source code cleanup 2021-01-10 07:55:56 +01:00
Bram Matthys f03f5bd974 Bump version to 5.0.9-git 2021-01-10 07:45:44 +01:00
Bram Matthys 380e039d95 *** UnrealIRCd 5.0.8 *** 2021-01-08 15:32:55 +01:00
Bram Matthys d558ea7ef0 Update release notes
[skip ci]
2021-01-08 15:15:44 +01:00
Bram Matthys 315f2ba4a9 Mention the FAQ URL if a link is rejected due to incorrect clock. 2021-01-04 13:23:00 +01:00
Bram Matthys 9377b66754 UnrealIRCd 4 is no longer supported
[skip ci]
2021-01-01 21:05:27 +01:00
Bram Matthys 646bdbb872 Allow ! in extended server bans, such as /GLINE ~G:!tls-users.
Previously it rejected ! for all type of *LINES to avoid users
making the mistake of banning nick!user@host in a *LINE.
Note that for non-extended-server-bans the ! is still forbidden.
2021-01-01 18:43:24 +01:00
Bram Matthys fa15ec1bec Add default security-group "tls-users" and "tls-and-known-users" 2021-01-01 18:42:27 +01:00
Bram Matthys b383197ae6 UnrealIRCd 4 no longer supported. 2020-12-31 14:27:10 +01:00
Bram Matthys 99defea611 ** UnrealIRCd 5.0.8-rc1 ** 2020-12-30 14:14:33 +01:00
Bram Matthys 5e068a2f28 Add symlink 'source' in the installdir to the UnrealIRCd source.
Useful for scripting purposes.
2020-12-30 13:44:50 +01:00
Bram Matthys 2f7b73fe10 Fix Windows build tests
[skip ci]
2020-12-30 13:16:24 +01:00
Bram Matthys 53d23038e5 Support for security groups and new +b ~G:unknown-users:
* There are two security groups by default: known-users and unknown-users.
  See https://www.unrealircd.org/docs/Security-group_block
* New extended ban ~G:securitygroupname, with the typical usage being
  MODE #chan +b ~G:unknown-users, which will ban all users from the
  channel that are not identified to services and have a reputation
  score below 25.
2020-12-30 12:42:56 +01:00
Bram Matthys f45a3a912f Make the binary print out a helpful message pointing to the script,
in case someone does like 'bin/unrealircd mkpasswd' or something.
2020-12-29 15:07:28 +01:00
Bram Matthys 04a45e8b83 Fix targetfloodprot module not exempting U-Lines (only matters if not +o).
It is highly recommended that services pseudo users all have +o since
there are likely many places where ULines don't bypass a restriction while
opers do. But still, this particular issue has been fixed, it caused
unexplained loss of messages which looked rather mysterious.
Reported by severinmueller in https://bugs.unrealircd.org/view.php?id=5799
2020-12-29 12:44:54 +01:00
Bram Matthys fc159fd131 Change set::modes-on-oper in example confs to +xws
Previously it was +xgws which was confusing since we don't have a +g
Reported by PeGaSuS.
2020-12-27 18:39:23 +01:00
Bram Matthys fff989c46e Make windows compile again by dropping const stuff added 2 commits ago
in reputation commit. Not important anyway.
2020-12-16 15:59:30 +01:00
Bram Matthys b2ceb9c825 Fix warning about certificate expiry appearing every 43 seconds
rather than twice a day. Reported by PeGaSuS in
https://bugs.unrealircd.org/view.php?id=5797
2020-12-16 15:40:02 +01:00
Bram Matthys 9d88bb6fe9 Add /REPUTATION #channel and /REPUTATION <NN
The reputation command (IRCOp-only) has been extended to make it
easier to look for potential troublemakers:
* ```REPUTATION Nick``` shows reputation about the nick name
* ```REPUTATION IP``` shows reputation about the IP address
* ```REPUTATION #channel``` lists users in channel with their reputation score
* ```REPUTATION <NN``` lists users with reputation scores below value NN
2020-12-06 16:37:31 +01:00
Bram Matthys fd41806079 Update release notes a bit (interim update only)
[skip ci]
2020-12-06 16:08:09 +01:00
Bram Matthys 4b53b02299 Add set::max-stats-matches which limits output such as '/STATS gline'
to the specified number of lines. This defaults to 1000.
This will prevent IRCOps from being flooded off ("Max SendQ exceeded")
if they list all *LINES and there are thousands.
In the newly introduced error message, after too many matches,
we also kindly point out to use filters like '/STATS gline +m *.nl'
2020-12-06 15:50:28 +01:00
Bram Matthys 8c04036fd8 Send ERR_ALREADYREGISTRED for USER and PASS rather than ERR_NOTFORUSERS.
Reported by Koragg in https://bugs.unrealircd.org/view.php?id=5766
2020-12-06 09:46:12 +01:00
Bram Matthys adc2a9774f Mention Q-line reason in server notices. Suggested by ivanp in
https://bugs.unrealircd.org/view.php?id=5774
2020-12-06 09:19:11 +01:00
Bram Matthys ece2dc9c12 Remove redundant output on './unrealircd version'. 2020-12-05 16:23:45 +01:00
Bram Matthys d573f77b10 API doc tweak
[skip ci]
2020-12-04 10:10:50 +01:00
Bram Matthys 7002139fad Add self-test to module manager for those who rm -rf their source directory. 2020-11-28 11:31:31 +01:00
Bram Matthys 7a3876e7b2 Doxygen U5 API docs: add examples to sendto_one(), sendto_channel()
and sendnumeric().
2020-11-24 19:27:22 +01:00
Bram Matthys f494707a47 Doxygen: document list_for_each_entry with examples and
add 'channels' to the page as well.
2020-11-23 10:25:49 +01:00
Bram Matthys 10e01aee0a Doxygen U5 API docs: document find functions and send API
See https://www.unrealircd.org/api/5/
And more specific: https://www.unrealircd.org/api/5/modules.html
2020-11-23 08:55:45 +01:00
Bram Matthys ca84a5cfc4 Leave 5.0.7 release notes for historic purposes.
Or: whoops.. shouldn't have deleted that.
[skip ci]
2020-11-22 18:40:14 +01:00
Bram Matthys 180653dce5 Set version to 5.0.8-git 2020-11-22 18:37:37 +01:00
Bram Matthys e15ea8f34d Mention EOL date of U4 in SECURITY.md for clarity. 2020-11-22 18:34:31 +01:00
Bram Matthys 836a3000bd Update some comments in ircd.c, nothing fancy. 2020-11-22 18:34:20 +01:00
Bram Matthys f808e56ffb Fix counting clients twice. Reported by Le_Coyote. 2020-11-22 16:03:42 +01:00
Bram Matthys bde91bcc5c Finish Hook API doxygen docs, ~100% done now. 2020-11-22 12:26:30 +01:00
Bram Matthys 6dcecd7866 Update doxygen index
[skip ci]
2020-11-21 19:13:31 +01:00
Bram Matthys fcb1767500 Update module API doxygen docs: the hook docs are now 80% done. 2020-11-21 19:08:17 +01:00
Bram Matthys 8372224c01 Add vertical spacing to function prototypes
[skip ci]
2020-11-21 18:10:29 +01:00
Bram Matthys f8343c2e2a Move s_die definition to h.h. 2020-11-18 07:47:26 +01:00
Bram Matthys 8d7e25e50e Make get_file_time() and get_file_size() available via h.h.
And move those 2 functions plus file_exists() to misc.c.
2020-11-16 18:21:27 +01:00
Bram Matthys 20b2975a2c Hmm.. genlinkblock is not very useful without this. 2020-11-16 18:14:52 +01:00
Bram Matthys ecabef1654 Fix whitespace in ./Config
Indent properly and use tabs, not spaces.
Hopefully not breaking anything in the process....
2020-11-13 19:29:16 +01:00
Bram Matthys e48cf87d52 Some more explanation on certificate generation if you are first installing.
Users who already have an SSL certificate won't be bothered by this,
just like before.
2020-11-13 19:17:54 +01:00
Bram Matthys 8720c846a1 And some more hook documentation... 2020-11-08 18:48:11 +01:00
Bram Matthys 8f7e40a6dc Compile fix for gcc with previous commits. 2020-11-08 16:42:39 +01:00
Bram Matthys c369551721 Commit first 40% of Hook API Documentation in doxygen.
The remaining 60% consists of placeholders at the moment.

Note: if you are running git then don't try to live-reload these
changes, ircd must restart.
2020-11-08 16:16:59 +01:00
Bram Matthys 0ae05dcd60 Remove unused code in secureonly. This isn't used since the +z/+Z split. 2020-11-08 10:02:27 +01:00
Bram Matthys 132b44219d Create SECURITY.md 2020-11-01 14:57:21 +01:00
k4bek4be da6ccb639d Fix a warning typo (#126)
Deprecated warning mentions set::oficial-channels, which should be set::official-channels
2020-10-22 19:37:41 +02:00
James Park-Watt 45fd0625e5 Fixed a typo in Config script (#127)
Config script referenced conf/tls/server.crt.pem in an informational message.
It should be conf/tls/server.cert.pem
2020-10-22 19:36:53 +02:00
Robert Scheck 831737f13e Exit with a successful return code upon receipt of SIGTERM (#125) 2020-10-20 07:26:57 +02:00
Robert Scheck ebe0a43828 Add $(DESTDIR) support for 'make install' (#124)
When packaging UnrealIRCd as RPM, 'make install' needs to install
the files into $RPM_BUILD_ROOT rather into '/'. Just changing the
paths via ./Config or ./configure does not fit, because otherwise
UnrealIRCd is finally looking for $RPM_BUILD_ROOT/etc/unrealircd/
rather /etc/unrealircd/. It's fully backwards-compatible, because
normally $DESTDIR is not being passed.
2020-10-19 17:12:46 +02:00
Bram Matthys 75efe02040 And add config check for X509_get0_notAfter().
For our Ubuntu 16 friends.
2020-10-11 15:56:06 +02:00
Bram Matthys b3510c5da8 Fix for previous commit with OpenSSL <1.1.0 (Debian 8, Ubuntu 16, ..)
Thank you BuildBot.

This means on older OpenSSL's we are not going to have certificate
expiry checks. Those OpenSSL versions were deprecated by the OpenSSL
team itself, so yeah then you will miss out a few things.
2020-10-11 15:39:27 +02:00
Bram Matthys 6778b3e26d Warn when SSL/TLS certificate is expired or expires soon (<7d).
Since an expired certificate usually means that users cannot connect
we will actively warn all IRCOps about this situation twice a day.
2020-10-11 15:00:09 +02:00
Bram Matthys 8619d1e763 Add optional allow::options::reject-on-auth-failure, as requested
by armyn in https://bugs.unrealircd.org/view.php?id=5769.

The default behavior in 5.x is to continue matching:
allow { ip *@*; class clients; maxperip 2; }
allow { ip *@*; password "iwantmore"; class clients; maxperip 10; }
This so users who provide a password get additional rights,
such as a higher maxperip or a different class, etc.
If the user connects without a password then we simply continue
to the next block and use the general block with only 2 maxperip.

However, some people want to use passwords to keep other users out.
That is entirely understandable as it is an 'allow block' after all.
For example:
allow { ip *@*; class clients; maxperip 2; }
allow { ip *@*.nl; password "tehdutch"; class clients; maxperip 2; options { reject-on-auth-failure; } }
In this case anyone without the correct password will be rejected access.
2020-10-11 09:24:11 +02:00
Bram Matthys 00fa88daee Remove special code for '/who nick' and replace it with generic code
if someone searches explicitly on a nick name and that user exists.

This fixes a bug where doing '/who name a' would return only 1 result
if 'name' exists as a nick, even though multiple people with the
same account 'name' are online and visible to the user, as
reported in https://bugs.unrealircd.org/view.php?id=5761 by Koragg.
2020-10-11 08:37:22 +02:00
Bram Matthys 9c85cd5bc6 *** UnrealIRCd 5.0.7 release *** 2020-10-10 15:04:18 +02:00
Stanley 893dd84aaf Added help.nl.conf (Dutch), contribution from Stanley (#121)
Co-authored-by: DjSxX <46792280+DjSxX@users.noreply.github.com>
2020-09-30 17:49:01 +02:00
Bram Matthys f2d49eed04 Reputation used the score of the WEBIRC IP rather than the end-user IP.
This resulted in high reputation scores for all WEBIRC users.
Reported by DeviL.
2020-09-28 17:41:37 +02:00
Bram Matthys 5286edc0ef Make ./Config import settings from 5.0.6. 2020-09-28 10:23:56 +02:00
Bram Matthys 2d90245626 ** UnrealIRCd 5.0.7-rc1 ** 2020-09-28 10:04:06 +02:00
Bram Matthys 35ee1eb28a Some more small release note changes
[skip ci]
2020-09-28 09:13:48 +02:00
Bram Matthys f424a0560a Update release notes 2020-09-28 09:08:17 +02:00
Bram Matthys e62bad9924 Make it "End of /OPERMOTD command" at end of OPERMOTD.
Reported by bitmaster in https://bugs.unrealircd.org/view.php?id=3895
2020-09-27 20:21:55 +02:00
Bram Matthys b4b7908612 Fix '/STATS b' and '/STATS badword' not working.
Reported by CoreDuo in https://bugs.unrealircd.org/view.php?id=4722
2020-09-27 18:20:34 +02:00
Bram Matthys b01cbff3e1 Add message tags (such as server-time) to PONG.
Requested by GaMbiTo- and KiwiIRC authors in
https://bugs.unrealircd.org/view.php?id=5758
2020-09-27 16:57:28 +02:00
Bram Matthys 42da15bb6e Minor release note updates
[skip ci]
2020-09-27 12:27:47 +02:00
Bram Matthys 61e8c8d851 Fix labeled-response causing two lines in one websocket frame.
This goes against our guarantee of 1 IRC line = 1 websocket frame.
Reported by k4be in https://bugs.unrealircd.org/view.php?id=5708
2020-09-27 12:17:02 +02:00
Bram Matthys 9002c92062 Set version to 5.0.7-git and start on some early release notes. 2020-09-26 14:28:41 +02:00
Bram Matthys 57d0efbc58 Recode textbans so voiced users cannot bypass them.
Reported by Adanaran in https://bugs.unrealircd.org/view.php?id=5698

Although voiced users normally bypass bans, it is not really logical
for them to bypass filtering of banned words, since that is normally
a policy decission by channel management. So +v will not bypass it.

1) The problem is that this is enforced at the ban layer API.  The extban
routines, textban in this case, are not called when the user is voiced,
because voiced users bypass bans.  If we would change that in the ban API
then voiced users can also no longer talk through (=bypass) regular +b or
other extended +b such as ~a (account) etc.

2) I figured we would then make +T not use the ban API but the
can_send_to_channel hook instead.  However, then you have to do manual
looping through bans and such, it's rather ugly from a coding point of view,
and you risk "missing" things like ~T stacked with ~t.

3) Then I went back to look if the ban API could be changed by having the
textban module set a flag and then the ban api would call that specific
module still for voiced users.  While starting on that, unfortunately things
(variables, arguments) cascaded quickly into having to change all kinds of
underlying functions that would break the module API.

4) I then went back to option 2 and implemented it, trying to deal
   with all its caveats.
2020-09-26 13:43:46 +02:00
Bram Matthys 5320d54e8e Disallow ~T with any action extban, eg ~n:~T:censor:xyz.
We still allow timed bans though, eg ~t:1:~T:block:*whatever*
2020-09-26 12:49:58 +02:00
Bram Matthys 3701ce9a43 Document existing extended ban options. 2020-09-26 12:49:44 +02:00
Bram Matthys 02f0d059c5 hideserver::disable-links did did not disable /LINKS.
Reported by Apocalypse32 in https://bugs.unrealircd.org/view.php?id=5753
Probably since 5.0.0, due to my mass command api changes.
2020-09-26 12:16:17 +02:00
Bram Matthys a02f94f867 Clean up WHOX a bit and fix WHO hiding yourself if not in any channels,
reported by Koragg in https://bugs.unrealircd.org/view.php?id=5757.

This changes the following in the code of who_global():
1) We initialize all the 'marked' users to zero at the beginning,
   and remove the previously unmarking in the bottom loop that
   shouldn't have anything to do with it. Now there's "no way"
   to screw up initialization of marked users.
2) Check for marked users in the bottom loop.
3) Thanks to #1 and #2 we can now easily add simple logic like
   not skipping when client==acptr.
4) Similarly, we can remove checks for +i/-i in who_common_channel(),
   and as a bonus we will list common channel results altogether
   in the WHO result, rather than first +i on common and then at the
   very end the remaining -i (which may also be in common channels).

All in all, the code is now more like how I would write it, rather
than the original. It's now harder to screw things up if you change
some visibility or searching logic here or there.
2020-09-26 08:43:51 +02:00
Bram Matthys 578f8f248c Warn user when undocumented set::ssl::dh / set::tls::dh is present.
That option specified a Diffie Hellman parameter file. Since
UnrealIRCd 5.0.0 we no longer process this option.
This option has never been documented in the wiki docs.
We prefer and use ECDHE/EECDH with SSL_OP_SINGLE_ECDH_USE since 2015
to provide Forward Secrecy in SSL/TLS. And indeed, by now in 2020,
any properly maintained software uses it and old DH(E) usage has
fallen to less than 1%.

What this patch does is remove the unused code (since Dec 2019) and
show a warning if you have a ::dh config directive, so that at least
you are informed that it is unused/ignored. Since it was undocumented
it probably hardly affects anyone, but still, it is proper to inform.
2020-09-12 09:38:17 +02:00
Bram Matthys fea2522067 Fix memory leak on './unrealircd reloadtls' / '/REHASH -tls'
Reported by NoXPhasma in https://bugs.unrealircd.org/view.php?id=5745
2020-08-29 15:05:41 +02:00
Bram Matthys 8bed1cb42e Channel mode +l is now limited between 1 and 1 billion, so positive
numbers only. This makes things more logical for end-users.
This fixes https://bugs.unrealircd.org/view.php?id=5746,
bug reported by KindOne.
The same issue was also fixed by previous commit, but still:
it is better to limit things to a narrower range, this so you
don't get different behavior depending on the CPU a server uses.
2020-08-29 14:40:09 +02:00
Bram Matthys 10ecbffcaa Fix irc*printf handling of certain negative numbers 2020-08-29 14:13:58 +02:00
Moses f5132176b7 Baltics nickchars support (#119)
This adds support for latvian-utf8, estonian-utf8 and lithuanian-utf8
in set::allowed-nickchars. Patch from moseslecce.

Co-authored-by: David Lecce <3292014+davidlecce@users.noreply.github.com>
2020-08-26 07:17:07 +02:00
Bram Matthys db79823578 If no set::modes-on-connect is present we now default to +ixw.
This should be rare, since modes-on-connect is in the example
configuration file with +ixw since 2003, but still... just in
case someone completely misses the modes-on-connect configuration
item, then make sure that we have a safe and good default.
2020-07-25 19:22:50 +02:00
Bram Matthys 13fff82a56 Update version in Windows manifest 2020-07-15 19:55:19 +02:00
Bram Matthys 145ffb6d37 Fix "HISTORY" before 5.0.6 release. 2020-07-15 14:05:27 +02:00
Bram Matthys 422244a2e5 ** UnrealIRCd 5.0.6 ** 2020-07-15 13:47:49 +02:00
Bram Matthys f9e8df1972 Update release notes, add header.
[skip ci]
2020-07-15 13:44:47 +02:00
Bram Matthys dd57e08b18 UnrealIRCd 5.0.6 release notes
[skip ci]
2020-07-15 13:42:21 +02:00
Bram Matthys 1a349d041d Start writing release notes
[skip ci]
2020-07-15 08:52:41 +02:00
Bram Matthys 24e90c8955 History playback on join was not limited.
set::history::channel::playback-on-join::lines and
set::history::channel::playback-on-join::time were ignored,
the limit in the +H channel mode was used instead.
Reported by k4be in https://bugs.unrealircd.org/view.php?id=5707
2020-07-15 08:24:45 +02:00
k4bek4be c81b4b9d9e Call HOOKTYPE_ACCOUNT_LOGIN on UID message too (#112)
Module coders: this will also fire on server-syncs. If you want to skip
such events then check for IsSynched(client->srvptr)
2020-07-14 19:51:46 +02:00
Bram Matthys 5c566053d4 Merge branch 'unreal50' of github.com:unrealircd/unrealircd into unreal50 2020-07-14 19:33:52 +02:00
Bram Matthys 3894aeba97 Fix double batch on HISTORY #channel.
Reported by k4be in https://bugs.unrealircd.org/view.php?id=5709
2020-07-14 19:25:07 +02:00
k4bek4be 812d5bcc73 Fix sending RPL_LOGGEDIN on logout. (#111)
Move all client login notifications into a single place (the SASL module).
Reported by westor in https://bugs.unrealircd.org/view.php?id=5688
2020-07-14 18:39:10 +02:00
Bram Matthys 70496acfbe Fix spamfilter with tempshun action: was not blocking the message.
The tempshun was applied, but the 'trigger' message was let through.
Reported by armyn in https://bugs.unrealircd.org/view.php?id=5723
2020-07-14 08:30:29 +02:00
Bram Matthys ca6630a2fb Fix "called a function you should not call" server linking error that
happens if all of the following are true:
1) You use link::outgoing::tls-options (or ssl-options)
2) You do a REHASH -tls (or REHASH -ssl)
3) You do NOT do a regular REHASH
4) You try to link to the server in such a link block (outgoing!)

In other words: the problem may happen if you try to link after
a Let's Encrypt cert renewal, unless there has been a regular
REHASH between that and the outgoing linking attempt.

Reported by k4be and Le_Coyoto in https://bugs.unrealircd.org/view.php?id=5607
2020-06-26 15:11:01 +02:00
Bram Matthys faeb644b82 Require set::who-limit to be 1 or higher.
Confusion reported by armyn in https://bugs.unrealircd.org/view.php?id=5717
2020-06-26 07:23:47 +02:00
Bram Matthys b23e64cb2e Fix crash if configuration file contains empty set::cloak-method. 2020-06-25 07:29:05 +02:00
Bram Matthys 7901d61e92 Add Spanish help.conf (conf/help/help.es.conf). 2020-06-12 12:10:52 +02:00
Bram Matthys dcb89f933e Fix problem with simultaneous use of websocket and labeled-response,
depending on the module load order. Reported by k4be.
Changes:
* Websocket hooks:
  * Input should be run first
  * Output should be run last
* Labeled-response also had various hook priorities wrong
  * Pre command should be run near-first
  * Post command should be run near-last
  * Close connection (does the flush) should be run near-last
  * Packet should be run near-last
2020-06-10 08:21:20 +02:00
Bram Matthys 53bc8fdf5b Add BOT=B to 005 to indicate the bot user mode.
Suggested in https://github.com/ircv3/ircv3-ideas/issues/43
2020-06-08 08:49:17 +02:00
westor 0e3cfc68bb Fix to display the TLSversion correct on connect (#113)
Previously it didn't display correctly on server notice the TLSv* version on local connection.
Before: TLS_CHACHA20_POLY1305_SHA256
After: TLSv1.3-TLS_CHACHA20_POLY1305_SHA256
2020-06-07 16:13:26 +02:00
Bram Matthys d1d0237f2d ** UnrealIRCd 5.0.5.1 ** 2020-05-29 08:38:20 +02:00
Bram Matthys 3be50cb8d4 Temp quick fix for minor issue as well (#5688).
Proper PR from k4be will be done post-5.0.5.1.
2020-05-29 08:35:10 +02:00
Bram Matthys d2efe01d9b Revert "UTF8 support in spamfilter. We now ship with PCRE2 10.34 and require this"
This reverts commit bc70882bd3.
2020-05-29 08:25:47 +02:00
Bram Matthys 7b211efeb7 Fix NICK change showing up twice with SVSNICK.
Reported by westor in https://bugs.unrealircd.org/view.php?id=5687
2020-05-28 00:31:59 +02:00
Bram Matthys 8213eca7d6 Update release notes 2020-05-26 17:50:48 +02:00
Bram Matthys 9c42c20b3c *** UnrealIRCd 5.0.5 *** (will be published tomorrow) 2020-05-26 17:45:53 +02:00
Bram Matthys df5fd4e537 Adjust default set::anti-flood::target-flood rates to:
set {
    anti-flood {
        target-flood {
            channel-privmsg 45:5;
            channel-notice 15:5;
            channel-tagmsg 15:5;
            private-privmsg 30:5;
            private-notice 10:5;
            private-tagmsg 10:5;
        };
    };
};

Max 45 messages in 5 seconds means max 540 messages per minute,
with a peak of (surprise) 45 messages per 5 seconds...
That should be sufficient for every legit channel, right?
How can you chat if you get more than 9msgs/sec for 5 seconds straight?
Maybe I am even too liberal with these limits?

NOTICE and TAGMSG get lower limits because they are far less used
and have other concerns (eg: ringing a bell for NOTICE).

The default limits may be changed in later versions of UnrealIRCd
based on feedback and more insight in (big) channel rates.
2020-05-25 17:03:36 +02:00
Bram Matthys f56ac9384b Fix for previous... -grin-
Fix for 640caf09a1
2020-05-25 15:09:59 +02:00
Bram Matthys 640caf09a1 Fix silly bug in +f if you lowered the :seconds then it always became :7.
Eg: +f [5m]:30 and then a while later +f [5m]:20 always became [5m]:7.
This due to re-using the same counter in a loop.
2020-05-25 15:00:16 +02:00
Bram Matthys 3acf71458d Module coders: Add CAP_INVERT option. Patch from k4be. 2020-05-25 14:17:22 +02:00
Bram Matthys 15a5905d1b Hardening: add -fcf-protection (Control Flow Enforcement)
This provides ROP hardening, which is actually quite nice.
However, it requires CPU hardware support, which is pretty
non existant at the moment. So, right now, on most systems
this option will do nothing.
2020-05-25 08:21:42 +02:00
Bram Matthys e50b599b2e Hardening: add -fstack-clash-protection
This hardening option is likely not very useful but shouldn't hurt either.
2020-05-25 07:41:39 +02:00
Bram Matthys bf104160d6 Update Windows build to use newest LibreSSL.
[skip ci]
2020-05-24 19:35:42 +02:00
Bram Matthys dff71b9901 Fix Windows build. Yeah, slashes are important. 2020-05-24 19:28:25 +02:00
Bram Matthys efe4fab8a3 Revert "Update PCRE2 to 10.35 (09-May-2020)."
This reverts commit a8e3b2fe59
due to compile issues on Ubuntu 20.04. Bug filed upstream as
https://bugs.exim.org/show_bug.cgi?id=2578
2020-05-24 19:10:58 +02:00
Bram Matthys 740b74df0c Properly export mtaghandlers for clienttagdeny.
[skip ci]
2020-05-24 18:39:02 +02:00
Bram Matthys 60f143acfb Update curl-ca-bundle to Wed Jan 1 04:12:10 2020 GMT
[skip ci]
2020-05-24 17:37:16 +02:00
Bram Matthys a8e3b2fe59 Update PCRE2 to 10.35 (09-May-2020).
The minimum version required is kept at 10.34.
2020-05-24 17:31:59 +02:00
Bram Matthys 30acfcc8c5 UnrealIRCd 5.0.5-rc1 (internal RC, will not be published on site) 2020-05-18 19:28:28 +02:00
Bram Matthys 3bb044dc1c Update a comment
[skip ci]
2020-05-18 15:49:39 +02:00
Bram Matthys af51f6e2b2 Fix ELINE helpop docs regarding antimixedutf8. 2020-05-18 15:29:08 +02:00
Bram Matthys c98eb7c54e Get rid of }; in example and other shipped .conf files.
This is 1,5 years after 459a55245a
and we're on a new series too (5.0), so it was about time.

And YES you may still use }; if you want to. There are no
plans to deprecate or warn about it.
We simply ship with } in the shipped configs because it is
more logical that both { and } don't require a ; rather
than only { not requiring it.
2020-05-18 14:06:57 +02:00
Bram Matthys 5712f0f5d6 Use example.org domain everywhere in example*.conf and help*.conf.
And similarly, use ExampleNET instead of MYNet.
2020-05-18 13:44:52 +02:00
Bram Matthys e7725a3bf2 Reorder things a bit in draft release notes.
[skip ci]
2020-05-17 18:40:12 +02:00
Bram Matthys 528783a2fd Now that we have clienttags, fix this FIXME.
Also, remove unnecessary comment about calling lr_post_command() with
the last two arguments being NULL. We don't use these two variables
inside lr_post_command() after this change anyway.
2020-05-17 08:49:58 +02:00
k4bek4be 0aa5fb6e7c Add CLIENTTAGDENY module. (#108)
It implements the current version of CLIENTTAGDENY isupport token, as defined by IRCv3.
2020-05-16 10:04:33 +02:00
k4bek4be d533483a43 Support both +typing and +draft/typing mtags. (#109) 2020-05-16 09:57:23 +02:00
Bram Matthys 81c7e6ca05 Merge branch 'unreal50' of github.com:unrealircd/unrealircd into unreal50 2020-05-14 09:15:24 +02:00
Bram Matthys 941b745be2 Give an error when trying to place an *LINE that already exists.
Then the oper may decide if the original entry should indeed be
removed and re-added, or if (s)he should not touch it. These are
usually done by mistake anyway.
Updating existing entries by end-users was never intended and did
not work properly anyway (see bug comments). Issue reported by
Le_Coyote and armyn in https://bugs.unrealircd.org/view.php?id=5603
2020-05-14 09:13:49 +02:00
k4bek4be ec39d3c15b Remove unused message tag handlers on rehash (#106) 2020-05-13 19:19:06 +02:00
Bram Matthys 7a4832d337 Fix missing ERROR when using a @label, reported by k4be.
This had to do with the queued packet (in the labeled-response module)
not being sent because the client was freed before the
post packet hook was called.
2020-05-11 19:18:41 +02:00
Bram Matthys 893cc2db99 Update draft release notes a bit with the changes of past few days.
[skip ci]
2020-05-09 12:20:50 +02:00
Bram Matthys 8d2e05f5ef Fix crash when combining +P with a 3rd party module, or actually
any parameter channel mode module loaded after channeldb.
Reported by GaMbiTo, with help from PeGaSuS, Gottem and k4be
in https://bugs.unrealircd.org/view.php?id=5669

It is not safe to call channel mode parameter functions when
unloading modules. Makes sense I think.

We now no longer write the db on rehash, which is something i
didn't like anyway (wasted CPU cycles). The problem was that
one could not just scratch the write db call, as otherwise if
someone rehashes every minute would cause the db never to
be saved. This is because on each rehash the event to write
the db gets rescheduled to +5 minutes in the future.
We now work around that in the same way as connthrottle does.
Obviously it would be better to make the event system itself
deal with this, but that is (way) too much for now.
2020-05-09 11:58:26 +02:00
Bram Matthys 4832559642 LoadPersistentLong() called the wrong function, always raising a warning/error. 2020-05-09 11:51:59 +02:00
Bram Matthys 606a35bed0 Fix crash when using deny link::rule with oversized argument.
Reported by moody in https://bugs.unrealircd.org/view.php?id=5667
2020-05-08 14:58:49 +02:00
Bram Matthys 6a3a2530b1 Fix echo-message not working for TAGMSG. Reported by k4be. 2020-05-08 11:12:48 +02:00
Bram Matthys ae9f06ebae Fix TAGMSG in the user-to-user case being delivered to clients with
an argument too many (" :"). Reported by k4be.
2020-05-08 11:09:31 +02:00
Bram Matthys 666d5631fe Send TAGMSG only to message-tags people. Duh. 2020-05-07 10:54:38 +02:00
Bram Matthys a80364f55a Use https:// rather than http:// in an example. 2020-05-06 18:08:28 +02:00
Bram Matthys 45624ff2ab Set TARGMAX= for TAGMSG to 1 (same setting as we have for NOTICE). 2020-05-06 16:51:05 +02:00
LeCoyote 8c2df61725 Improve antimixedutf8: detect CJK and other scripts (#105) 2020-05-06 12:39:00 +02:00
Bram Matthys 98930785e5 Copy-paste error which turned NOTICEs into PRIVMSGs. -grin- 2020-05-06 11:26:39 +02:00
Bram Matthys cf2eecb0d1 Add set::anti-flood::target-flood and +draft/typing to release notes.
Again, these are still early release notes drafts.
2020-05-06 11:12:46 +02:00
Bram Matthys bf0d00c2b9 Update makefile for Windows build 2020-05-06 11:11:04 +02:00
Bram Matthys 90485453b7 Load typing-indicator module by default (IRCv3 +draft/typing) 2020-05-06 10:56:03 +02:00
Bram Matthys 31d3af22e2 Don't make channel mode +f 't' and 'm' act on TAGMSG...
otherwise people get kicked just for typing :D

We may add a new +f type later on, if there is a need for it.
2020-05-06 10:53:13 +02:00
Bram Matthys a259227424 New feature set::anti-flood::target-flood, provided by targetfloodprot module.
This limits X per Y messages for targets, regardless of sender. See docs:
https://www.unrealircd.org/docs/Set_block#set%3A%3Aanti-flood%3A%3Atarget-flood
2020-05-06 10:43:26 +02:00
Bram Matthys 2a093bb150 Moved CheckNull() to individual set::anti-flood::xx tests and
HOOK_CONFIGTEST with CONFIG_SET_ANTI_FLOOD, rather than a generic
one before processing these. Needed for set::anti-flood::target-limit.
2020-05-06 10:28:37 +02:00
Bram Matthys b8d4cf7763 Actually call moddata_free_channel(channel);
This was a FIXME item that should have been addressed earlier.
We didn't use any MODDATATYPE_CHANNEL in the core up to now so
this was overlooked. We do use it from now on, though, and it
may very well have been used in 3rd party modules already.
2020-05-06 09:04:43 +02:00
Bram Matthys 4e3817b4d5 Initial version of set::anti-flood::target-flood 2020-05-05 20:27:53 +02:00
Bram Matthys 57f524cbed Support for +draft/typing
This is the work from May 3rd.. need to commit it so i can merge the
flood protection that is related to this...
The final implementation will still need tweaking before pushed.
[skip ci]
2020-05-05 20:16:56 +02:00
k4bek4be 331134649f Add Polish translation for help.conf and update the English one (#104)
In English helpop add ELINE and extended server bans, fix some typo's....
2020-05-03 13:33:04 +02:00
Bram Matthys 166a772951 Fix except ban without type not exempting gline due to wrong character
being used ('g' instead of 'G'). Reported by DeviL.
https://bugs.unrealircd.org/view.php?id=5555
2020-05-03 09:41:32 +02:00
Bram Matthys aba3c8e53f Fix set::who-limit documentation and make IRCOps exempt from this limit.
reported by patphobos in https://bugs.unrealircd.org/view.php?id=5657
2020-04-29 16:30:24 +02:00
Bram Matthys 9c10bca2a2 Some more release note updates.
[skip ci]
2020-04-26 16:13:18 +02:00
Bram Matthys 2c703eba6e Make it possible to restrict a command to identified users only, with
no connect-delay restriction. Also remove the 'disable' option since
it is unneeded. You now simply use:
set {
    restrict-commands {
        somecommand {
        }
    }
}
...and the command is disabled.
And you add exempt-identified or exempt-reputation-score if needed.

See https://www.unrealircd.org/docs/Set_block#set%3A%3Arestrict-commands

Note that this also changes some command blocking logic, so I hope
I made no mistake there... only testing will tell.
2020-04-26 16:04:26 +02:00
Bram Matthys f5b3328103 Some more release note updates
[skip ci]
2020-04-26 15:33:05 +02:00
Bram Matthys 616820e5d8 Merge branch 'unreal50' of github.com:unrealircd/unrealircd into unreal50 2020-04-26 15:29:48 +02:00
Bram Matthys a4345d6091 Write some early release notes for 5.0.5 (won't be released soon)
[skip ci]
2020-04-26 15:29:02 +02:00
delthas 0c3b8e5d28 Fix trailing space in RPL_NAMREPLY (#100) 2020-04-26 09:00:09 +02:00
Bram Matthys ef5df81917 Merge branch 'unreal50' of github.com:unrealircd/unrealircd into unreal50 2020-04-26 08:48:56 +02:00
Bram Matthys 097903a246 Anope aliases: remove helpserv. Reported by k4be. 2020-04-26 08:47:42 +02:00
LeCoyote 275dffcd6b French helpop: add missing chmode +D (#102) 2020-04-26 08:45:38 +02:00
Bram Matthys 12ad8003bb Update shipped lib to c-ares 1.16.0 (released 2020-03-13) 2020-04-25 18:39:52 +02:00
Bram Matthys edb0f16942 Make /INVITE bypass ~f:#forward:*!*@* bans. Suggested by Balthazar
in https://bugs.unrealircd.org/view.php?id=5634
2020-04-25 17:06:01 +02:00
Bram Matthys ca2ba56d82 Add is_invited(client, channel) function. 2020-04-25 17:01:41 +02:00
Bram Matthys 0902ed7a99 Fix channel mode +L redirecting even if joining with correct channel key.
Reported by Balthazar in https://bugs.unrealircd.org/view.php?id=5644
2020-04-25 16:43:32 +02:00
Bram Matthys 07d2a92acd Fix build tests. 2020-04-25 09:48:58 +02:00
Bram Matthys 7b7e1a6158 Skip TLS tests on 32 bit due to cipherscan issue (not important to
run on ubuntu 18.04 32-bit anyway since we run these tests on
ubuntu 18.04 64-bit already as well).
2020-04-25 09:41:09 +02:00
Bram Matthys 0c080b3982 Fix crash in tkldb on 32 bit systems. Reported by k4be.
Also, get rid of compiler warnings (we can use C99 types now).
2020-04-25 09:27:31 +02:00
Bram Matthys 29b691f9b6 At least do some parallel compiling by default (make -j4)
if there is no MAKE nor MAKEFLAGS already set.
2020-04-19 19:41:45 +02:00
Bram Matthys bc70882bd3 UTF8 support in spamfilter. We now ship with PCRE2 10.34 and require this
version or newer on the sytem, otherwise we fall back to shipped version.

This fixes https://bugs.unrealircd.org/view.php?id=5187 among others.
It means:
* Case insensitive matches work better in UTF8 now, such as extended Latin.
  For example, a spamfilter on "ę" now also matches "Ę", while previously
  it did not catch this.
* Other PCRE2 features such as https://www.pcre.org/current/doc/html/pcre2syntax.html#SEC5
  are now available. For example you can now set a spamfilter with the regex
  \p{Arabic} to block all Arabic script, or
  \p{Cyrillic} to block all Cyrillic script (such as Russian)
  Use these new tools with care, of course. Blocking an entire language,
  or script, is quite a drastic measure.

All of this was possible because of the new PCRE2_MATCH_INVALID_UTF
compile time option which was introduced in PCRE2 10.34.
This also means we now require at least that PCRE2 version so
everyone can benefit from this new spamfilter UTF8 feature.
Many systems come with older PCRE2 versions so this means we will
fall back to the shipped PCRE2 version in UnrealIRCd. This means
./Config will take a little longer to compile things.

Although there is no indication as of now, but if this feature would
break things heavily then it might get reverted or configurable.
This is also why it was added just after 5.0.4 release and not right
before it, it needs some heavy testing.
2020-04-19 17:45:38 +02:00
Bram Matthys 4d85e162aa Bump git version to 5.0.5-dev. 2020-04-19 17:42:43 +02:00
Bram Matthys a8a8196147 *** UnrealIRCd 5.0.4 *** 2020-04-19 14:14:03 +02:00
Bram Matthys 6b2d0c4b4b Update release notes a bit
[skip ci]
2020-04-19 09:31:47 +02:00
Bram Matthys 775fa47197 Fix crash of currently running IRCd when you are running ./Config.
Reported by k4be and others.
For the crash to occur a few specific things had to happen:
1) The system is missing the argon2 dev library (or it is too old)
   causing us to use the UnrealIRCd-shipped argon2 library.
2) You ran ./Config while there is an existing IRCd running
3) Now some argon2 hash is being checked (eg due to an OPER attempt)
4) Crash

A very similar crash happens (to a LOT more people) when you
run './unrealircd restart' to do the actual upgrade. In such
a case, the old IRCd crashed (the one that was actually supposed
to die anyway). The annoying thing was that the crash reporter
would kick in to report such a crash which was actually quite
harmless. This is actually the same crash as described earlier
so should be fixed as well now.
This variant was reported by Shillos and others.
2020-04-18 16:50:24 +02:00
Bram Matthys 5dda640864 Cipherscan profile for Ubuntu 16.04: uses slightly different order. 2020-04-18 14:46:24 +02:00
Bram Matthys f419a61f94 Ubuntu 20.04 needs this change in order to still allow you to enable
TLSv1.0 or TLSv1.1. Otherwise it is impossible to enable by the application.

We are still going to turn off TLSv1.0 and TLSv1.1 by the end of this year
by default. Ubuntu 20.04 is just a couple of months too early. See also
the various browsers who postponed disabling TLSv1.0/TLSv1.1.

Also, regardless of the above, we want the admins running the IRC server
be able to control this and not having such a breaking change be dependant
on some distro default settings.
2020-04-18 12:40:45 +02:00
Bram Matthys 498f65aaad Improve the error a little bit if unrealircd.conf is missing.
Remove the talk about 3.2.x and and give a bit more context before
providing the link to the docs (which was already there, but still).
2020-04-18 10:22:47 +02:00
Bram Matthys 54a2fad8e3 In configure, swap the order of compiler and make check.
This results in a more general error message that is easy to google.
Also fix the gmake error to complain about make/gmake since it
may also indicate missing make.
2020-04-18 10:06:33 +02:00
Bram Matthys 6d74e64b22 Remove ./Config -clean which was only confusing as it did not clean much. 2020-04-18 08:06:57 +02:00
Bram Matthys e6f34ef22b Remove ./Config -nocache, you can just rm config.settings instead. 2020-04-18 08:05:17 +02:00
Bram Matthys 49d595f60c On *LINE removal it showed the wrong person in the notice sent to IRCOps
(on remote servers). It showed the originally setter and not the remover.
Reported by k4be in https://bugs.unrealircd.org/view.php?id=5629
2020-04-17 09:30:59 +02:00
k4bek4be 26c58dce47 Don't suggest old "posix" spamfilter to opers. (#101) 2020-04-16 19:18:37 +02:00
Bram Matthys a3784479a1 UnrealIRCd 5.0.4-rc1 (internal release candidate) 2020-04-15 17:45:17 +02:00
Bram Matthys bc6079c540 Update release notes
[skip ci]
2020-04-15 09:10:40 +02:00
k4bek4be 1b7c03df94 Send RPL_LOGGEDIN numeric to the user on post-registration SASL too (#97) 2020-04-15 09:04:31 +02:00
Ryan Allen 0b350be64c Removing duplicate line in conf prog header (#98) 2020-04-15 09:02:54 +02:00
LeCoyote cd059839c5 Update of the French help text. Quite a few items were pretty outdated (#99)
Fixed a couple of typos too.
2020-04-15 09:01:37 +02:00
Bram Matthys 68642a4e68 Make ./Config auto-import settings from 5.0.3 / 5.0.3.1. 2020-04-15 08:57:49 +02:00
Bram Matthys 9fab197021 Bump version to 5.0.4-dev. 2020-04-15 08:56:57 +02:00
Bram Matthys 682f9598d4 Add section header wrt upgrade from u4
[skip ci]
2020-04-15 08:49:10 +02:00
Bram Matthys abd0d3c04c Add initial version of release notes for 5.0.4
[skip ci]
2020-04-15 08:47:49 +02:00
Bram Matthys 349ee964cc Make the whox module use ModData. 2020-04-15 08:22:55 +02:00
Bram Matthys a6e6e44103 Set default permission for hide-idle-time back to IRCOps only for now.
We will extend the option later in UnrealIRCd 5.0.5.
This purely has to do with keeping the changes for 5.0.4 small and
contained since that will be mostly a bug fix release.
Since 5.0.5 will have more configurable options for hide-idle-time, I
have already renamed the single option that is exposed in 5.0.4
to set::hide-idle-time::policy since set::hide-idle-time is a
configuration block now, see docs at:
https://www.unrealircd.org/docs/Set_block#set%3A%3Ahide-idle-time
2020-04-15 08:17:53 +02:00
Bram Matthys f437593b8d Rewrite and expand notices+logging with regards to server linking / lost link.
When connecting, use slightly different wording (and use it consistently):
"Trying to activate link with server xyz"

When the connection is lost before synced:
"Unable to link with server xyz"

When the connection is lost after fully synced (eg: minutes later):
"Lost server link to xyz"

Important small changes (other than text):
* Log ERRORs from remote servers to the log (previously only shown to ircops)
* Some link errors could have been previously suppressed due to
  old code assuming other parts of the code would send or log the error
  (this would be the case for an error when calling SSL/TLS write functions)
* More?
2020-04-13 13:36:58 +02:00
Bram Matthys 177d017b06 Tiny code cleanup in conf to use allowed_channelchars_strtoval() 2020-04-13 10:06:11 +02:00
Bram Matthys d25f6f6759 Make set::hide-idle-time 'usermode' the default (regular users can set +I).
I think nowadays, with more attention to privacy, we should make this
option settable by users.

See previous commit for more information, or just visit the doc page at
https://www.unrealircd.org/docs/Set_block#set%3A%3Ahide-idle-time
if you want to use a different setting.
2020-04-13 10:02:05 +02:00
Bram Matthys 5dc1502119 New option set::hide-idle-time which configures when/if idle time should
be hidden. The options are: never, always, usermode, oper-usermode.
See https://www.unrealircd.org/docs/Set_block#set::hide-idle-time for
full documentation.

Suggested by Koragg, via https://bugs.unrealircd.org/view.php?id=5355

Module coders: before disclosing idle time, please call this function:
int hide_idle_time(Client *client, Client *target);
In UnrealIRCd we use it from WHOIS and WHO.
2020-04-13 10:00:27 +02:00
Bram Matthys 55ecfee0a4 Show in /WHOIS if a user is currently shunned. Only works for locally
connected users for technical reasons, so you will have to use double
whois to see it for remotes (/WHOIS Nick Nick) just like with idle time.

Suggested in https://bugs.unrealircd.org/view.php?id=5519
2020-04-13 08:50:18 +02:00
Bram Matthys c5ba66fbf6 UnrealIRCd was ignoring set::ident::read-timeout and using
set::ident::connect-timeout for the read timeout also.
This could lead to failed ident lookups on higher latency connections
because it only gave 3 seconds for the entire ident lookup rather than
the (max) 10 seconds that was intended.
Now both values are properly obeyed (3 for connect, 7 for read
timeouts, by default).
2020-04-12 17:46:23 +02:00
Bram Matthys a992b30a6a Fix for previous commit... -grin- 2020-04-12 17:08:33 +02:00
Bram Matthys 9887ef6955 Fix possible crash when unloading a module with moddata.
This only happens in some circumstances.

From now on EventDel() will simply mark the event as deleted.
The actual freeing is started in DoEvents() after the event loop.
This makes it safe to use EventDel() everywhere.

The previous attempt to fix that issue was
d29a55a8db but it introduced a
new crash issue for a slightly different case, as mentioned in
https://bugs.unrealircd.org/view.php?id=5553
2020-04-12 16:52:43 +02:00
Bram Matthys cf53797121 Fix crash if an authenticated server advertises a wrong hop count,
eg due to self-written services / toying around.
2020-04-12 15:49:11 +02:00
Bram Matthys 016dd20e16 Fix /TEMPSHUN -Nick not removing temporary shun on remote users.
Reported by k4be in https://bugs.unrealircd.org/view.php?id=5580
2020-04-12 15:10:01 +02:00
Bram Matthys 051fd4aebd Fix message tags (such as msgid) missing for JOIN 0 and SAJOIN 0. 2020-04-10 19:28:50 +02:00
Bram Matthys 891435e811 Fix SAJOIN to 0 (part all channels) resulting in a possible desync
when used on a multi-server network. This was due to the PART event
inadvertently not being sent towards the SAJOIN direction.
Bug reported by Cheiron in https://bugs.unrealircd.org/view.php?id=5616
2020-04-10 19:27:39 +02:00
Bram Matthys afb10be770 Channeldb was not properly restoring all channel modes, such as +P,
after a restart. Possibly depending on the module load order.
2020-03-29 08:42:08 +02:00
Bram Matthys 32170b81e3 Mention https://www.unrealircd.org/docs/FAQ#oper-requires-tls on OPER attempt
form an insecure connection. There we explain a bit on the why and how to
configure some random IRC clients.
This also silently adds support for multi-line messages in
set::plaintext-policy::user-message (for warn) and
set::plaintext-policy::oper-message (for warn and deny).
2020-03-06 08:58:55 +01:00
Bram Matthys 6224efdaf3 src/random.c: remove unused variable and reorder struct on Windows. 2020-02-18 14:55:57 +01:00
Bram Matthys 401fcf14aa Fix forced nick change not showing if you were not in any channels.
Eg with anope with the KILL option turned ON, a minute after taking
a registered a nick.
Very similar to c9b88343e2 which was
fixed in 5.0.0-beta1 for non-forced nick changes.
2020-02-12 00:55:29 +01:00
Bram Matthys 30ed989113 *** UnrealIRCd 5.0.3.1 *** 2020-02-11 18:36:52 +01:00
Bram Matthys a807cf026c Use the damn mod handle, what were you thinking!?? 2020-02-11 18:31:49 +01:00
Bram Matthys f585e895a2 Crash reporter: was missing many crashes due to search for core
files that end in .core, while on many systems it is just 'core'
without the dot. Reverted back to U4-style core file finding now.
Thanks to DeviL for helping to trace this issue.
2020-02-11 17:46:03 +01:00
Bram Matthys 8c0a2a1f96 Fix bug in hook prototype for FREE_USER. In most cases you are better
off not using this and you'll want to use the three other hooks anyway:
* HOOKTYPE_LOCAL_QUIT - for local quits of registered clients
* HOOKTYPE_REMOTE_QUIT - for remote quits of registered clients
* HOOKTYPE_UNKUSER_QUIT - for local quits of unregistered clients
  (that is, before they have completed NICK+USER etc)
2020-02-09 14:53:43 +01:00
Bram Matthys b7e2cbea0f Split off existing account-notify functionality to account-notify module
now that we have a hook, so the functionality of it is nicely contained
in a separate module.
2020-02-09 10:48:23 +01:00
k4bek4be 19e672ac22 Module coders: add ACCOUNT_LOGIN hook (#94) 2020-02-09 10:34:06 +01:00
Bram Matthys a283a1cf51 Add link to original UnrealIRCd 5 announcement, for easier navigation.
[skip ci]
2020-02-08 09:03:32 +01:00
Bram Matthys 88b13fed26 Move general comment about UnrealIRCd 5 up in release notes. 2020-02-08 08:44:26 +01:00
Bram Matthys 3febf6bc90 *** UnrealIRCd 5.0.3 *** 2020-02-08 08:39:15 +01:00
Bram Matthys febc4a45f3 Updated labeled-response: drop the draft/ prefix now that the specification
is ratified and also fix a serious flood bug in the implementation.
Oh, and move the loadmodule line to the correct place in modules.default.conf.
2020-02-08 08:09:53 +01:00
Bram Matthys de44549996 Import settings from 5.0.2. 2020-02-05 08:26:38 +01:00
Bram Matthys e0d70f577b Update release notes a bit
[skip ci]
2020-02-03 14:49:16 +01:00
Bram Matthys 50f916fcd8 Windows compile fixes 2020-02-02 19:34:44 +01:00
Bram Matthys 9211e105eb Add unrealircd.org/userhost message tag. Similar to previous, so IRCOps
can see the real host of a user in each message.
2020-02-02 18:12:07 +01:00
Bram Matthys 65a5943e97 userip tag: inherit from remote servers, if able. 2020-02-02 16:46:51 +01:00
Bram Matthys a05c187a56 Fixes for HISTORY command: default value not working and error if +H is
not set on the channel. Reported by westor.
2020-02-02 16:17:02 +01:00
Bram Matthys ed6a2cf3e3 Add new message tag "unrealircd.org/userip" which will communicate
the user@ip of users to IRCOps if the message-tags capability is
enabled. Idea from westor. This is work in progress.
2020-02-02 15:49:21 +01:00
Bram Matthys 63b61d456b Update wiki link
[skip ci]
2020-02-02 13:12:13 +01:00
Bram Matthys a56e3bee8f Fix double free due to recent changes, now that HOOKTYPE_LOCAL_CHANMODE
and HOOKTYPE_REMOTE_CHANMODE are called from the SJOIN code.
We now set the samode argument to -1 if it is an SJOIN server sync,
so chanmodes/permanent won't destroy the channel while processing
the SJOIN. The SJOIN code already takes care of destroying at the end.
2020-02-02 12:57:10 +01:00
Bram Matthys 43a9e74662 Set version to 5.0.3-git and write some early release notes. 2020-02-02 12:33:46 +01:00
Bram Matthys 1ea8443551 Mark history as official module 2020-02-02 12:23:26 +01:00
Bram Matthys 7a38f485ad It helps if you can compile in non-DEBUGMODE 2020-02-02 12:18:09 +01:00
Bram Matthys a8c191b291 Add new command: HISTORY #chan [lines]. This is meant for end-users
so they can fetch more history than the standard on-join history.

In the future we are also likely to implement IRCv3 CHATHISTORY
once that becomes an official specification. However, until it is
specified and until most major clients support it, several years
are likely to pass. It would be a shame to withhold channel
history to many end-users in the meantime when it takes so little
effort from us to provide an easy command.

See also
https://www.unrealircd.org/docs/Channel_history
And in particular the new section:
https://www.unrealircd.org/docs/Channel_history#Playback_frontends
which explains the relationship between on-join playback,
HISTORY and CHATHISTORY.
2020-02-02 11:57:51 +01:00
Bram Matthys b5a205f4f3 Fix /SQUIT for server 2 hops away not working correctly.
Reported by k4be in https://bugs.unrealircd.org/view.php?id=5539
2020-01-31 12:15:36 +01:00
Bram Matthys 63cf5e3d52 Make channeldb/tkldb write errors more uniform.
Use local macro and sendto_realops_and_log()
2020-01-29 09:28:43 +01:00
Bram Matthys 0302ef9733 Operclass permission change: immune:target-limit is now called
immune:max-concurrent-conversations since it bypasses
set::anti-flood::max-concurrent-conversations.
Indirectly reported by westor.
2020-01-29 09:01:25 +01:00
Bram Matthys ead0ad0aa6 Duh.. (fix for previous fixes)
[skip ci]
2020-01-26 10:41:04 +01:00
Bram Matthys 1dc08afa71 Add warning to EventMod() for low every_msec as well. Also, mention the name
of the event to ease debugging.
2020-01-26 10:35:14 +01:00
Bram Matthys eede8d3ff6 Fix warning regarding low ms_every in case of delayed module unloading. 2020-01-26 10:26:07 +01:00
Bram Matthys d482760c6f Fix warning about EventAdd with 2msec value.
Reported by ivanp in https://bugs.unrealircd.org/view.php?id=5540

This cleans things up a bit as well (remove duplicate code).
2020-01-26 10:22:28 +01:00
Bram Matthys 1b07f706bc Remove old STATS Z from stats help. Reported by Lord255 in
https://bugs.unrealircd.org/view.php?id=5541
2020-01-26 10:00:58 +01:00
Bram Matthys c9feaa0b15 Fix : at beginning of gecos being dropped off in intra-WHOIS.
This does NOT "fix" https://bugs.unrealircd.org/view.php?id=5538:
WHOIS nick
:localserver.example.com 311 test nick ident host * :realname
WHOIS nick nick
:remoteserver.example.com 311 test nick ident host * realname
.. because your IRC protocol parser should not care about a :
or a lack of :. For text not containing spaces nor :-prefix there
is no difference in meaning and it should parse to the same.

However, this DOES fix an issue if the realname itself started
with a colon, such as "USER x x x ::something":
WHOIS nick
:localserver.example.com 311 test nick ident host * ::something
WHOIS nick nick
:remoteserver.example.com 311 test nick ident host * :something
.. because that does not have the same meaning and is a real
incorrect drop of a character.
Yeah, I took into account spaces, but not a word starting with :, my bad.
2020-01-26 09:54:54 +01:00
Bram Matthys 6fa7dd8b88 Fix (SA)PART and KICK not being shown to chanops in +D channels for invisible
users (users that have not talked or been otherwise exposed).
Reported by PeGaSuS and LesterClayton in
https://bugs.unrealircd.org/view.php?id=5521 and
https://bugs.unrealircd.org/view.php?id=5542

Bug was due to use of 'CHFL_CHANOP' instead of 'PREFIX_OP' in
the 'prefix' argument of sendto_channel().... fun.
2020-01-26 09:35:04 +01:00
Bram Matthys 21278d2549 ** UnrealIRCd 5.0.2 release ** 2020-01-22 07:11:26 +01:00
Bram Matthys 65afb71111 Fix channel history using the wrong time unit. It is really +H lines:minutes
Release notes:
+* [Channel history](https://www.unrealircd.org/docs/Channel_history) used
+incorrect time internally, resulting in messages expiring too soon.
+The syntax is now really ```/MODE #chan +H lines:time-in-minutes```.
+To make clear that the time is in minutes, an 'm' will be added
+automatically by the server (eg ```+H 15:1440m```).

Bug reported by k4be.
2020-01-21 13:44:51 +01:00
Bram Matthys b5c9ee8ec5 Fix screwing up nearly everything 2020-01-20 18:03:16 +01:00
Bram Matthys 8a6968c933 UnrealIRCd 5.0.2 2020-01-20 17:28:56 +01:00
Bram Matthys fde678aacc Fix clash of CHFL_* flags. Found after bug report from k4be. 2020-01-20 16:00:33 +01:00
Bram Matthys d30f7e006d Specifying multiple channels ("#one,#two") in set::auto-join,
set::oper-auto-join or tld::channel was broken. It worked for the
very first user since boot or rehash, but after that only the
first channel was joined. Reported by PeGaSuS in
https://bugs.unrealircd.org/view.php?id=5535
2020-01-20 15:41:12 +01:00
Bram Matthys f3019f89a1 Fix github hate regarding <>
[skip ci]
2020-01-20 14:13:03 +01:00
Bram Matthys 9aa7b7e52f Update release notes
[skip ci]
2020-01-20 14:12:01 +01:00
Bram Matthys 83db4e07db Always fun that markdown has URI links in reverse order compared to wiki syntax.
[skip ci]
2020-01-20 14:07:29 +01:00
Bram Matthys ce94746898 More release notes updates
[skip ci]
2020-01-20 13:52:06 +01:00
Bram Matthys c65f7101f9 Update ./unrealircd genlinkblock output 2020-01-20 13:46:59 +01:00
Bram Matthys 5b8eba750f Make set::tls::outdated-protocols and set::tls::outdated-ciphers work
again. This ports change 96ee7083c8
from UnrealIRCd 4.x to 5.x. Reported by HeXiLeD.
2020-01-20 13:26:37 +01:00
Bram Matthys 70973ec18b Start writing release notes for 5.0.2. 2020-01-20 13:05:25 +01:00
Bram Matthys 870057d4f3 Add "./unrealircd genlinkblock" which spits out a link { } block. Hmm...
we'll see later if this is a good idea or not.. it has pros and cons.
2020-01-19 19:34:11 +01:00
Bram Matthys ffd0acf5d5 Add ./unrealircd <hot-patch|cold-patch> <nameofpatch> which will be
useful in the future. This would download a specific patch from
the unrealircd.org site, apply it, recompile, and then:
if it's a hot-patch it would rehash
if it's a cold-patch it would print a message that you should restart
the irc server.
2020-01-19 18:16:47 +01:00
Bram Matthys ca22b6282e Fix bounce modes raising a warning to ircops (Unknown channel mode +& from ..)
reported by k4be.
2020-01-18 16:52:01 +01:00
westor 48faed6938 Add information about type on spamfilter add (#90)
On spamfilter add, add  [type: simple] or [type: regex] in the snomask notice and log.
2020-01-17 07:19:13 +01:00
westor abeb5f50d0 Fixes two wrong /ELINE examples bantype (#92)
This should be 'G' and not 'g' :) :D
2020-01-17 07:16:18 +01:00
Bram Matthys e9d8341efd Mention the IRCOp guide in HELPOP OPERCMDS
( https://www.unrealircd.org/docs/IRCOp_guide )
2020-01-12 14:43:21 +01:00
Bram Matthys 094c444250 1) Fix incorrect ELINE documentation for types: gline (G, not g),
spamfilter (F, not f) and qline (Q, not q).
2) Error out when invalid ban exception types are given, so such errors
   don't go undetected anymore. Eg it will now print:
   "ERROR: bantype 'f' is unrecognized (in 'fgkz'). Note that the bantypes are case sensitive. Type /ELINE to see a list of all possible bantypes."
Reported by westor and Mi_01 in https://bugs.unrealircd.org/view.php?id=5528

Also, when at it:
3) Remove type 't' from ELINE syntax docs, which is in fact 'c'
   (which is already present in the list)
2020-01-12 13:19:37 +01:00
Bram Matthys 3456a5f90e Make /ELINE use set::manual-ban-target as well.
(just like KLINE GLINE etc)
2020-01-10 16:16:29 +01:00
Bram Matthys ef9506b95f Add set::manual-ban-target as well (affects /KLINE nick, etc).
Requested by marco500 in https://bugs.unrealircd.org/view.php?id=5029
For more information, see:
https://www.unrealircd.org/docs/Set_block#set::manual-ban-target
2020-01-10 15:54:04 +01:00
Bram Matthys 639c96cc84 https://www.unrealircd.org/docs/Set_block#set::automatic-ban-target
Remove old option set::ban-include-username and replace it with a more
generic option which defines what target a ban should apply to.

Also add some parts of set::manual-ban-target which will follow soon.
2020-01-10 15:43:23 +01:00
Bram Matthys 75eb509344 Make the new extended server bans feature also work in configuration file
Eg:
except ban {
        mask ~S:1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef;
};
And also in ban user { }

For more information see commit 596cf8e7de
and https://www.unrealircd.org/docs/Extended_server_bans
2020-01-10 13:09:16 +01:00
Bram Matthys bfed0893a9 Nothing important: in eline_type_requires_ip() add 'd'.
Although not entirely true, exempting a user from 'd' when using
an extended server ban or IP or ident is not recommended.
The information needed to exempt the user may not be available
at the time of the flood. Better to reject it than have it partially work.
2020-01-10 11:57:34 +01:00
Bram Matthys 596cf8e7de New: extended server bans: exempt by certificate fingerprint and SASL account.
See https://www.unrealircd.org/docs/Extended_server_bans

Examples with ELINE:
/ELINE ~a:TrustedAccount kg 0 This user can bypass kline/gline when using SASL
/ELINE ~S:1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef kgf 0 Trusted user with this certificate fingerprint
It also works with bans, although this would be less common:
/GLINE ~a:EvilAccount
A more useful purpose would be to use ~r (realname):
/GLINE ~r:*some*stupid*real*name*
(Although you could already ban realnames via spamfilter 'u')

For third party module coders:
If you have an extban in group 3 (a "matcher"-extban) then you
can opt-in to support this. You do so at extban registration time:
req.options = EXTBOPT_TKL;
or, if you already had another flag set, like for +I, then:
req.options = EXTBOPT_INVEX|EXTBOPT_TKL;
In any case, you set the .options before you call ExtbanAdd().

Note that if you do indicate support then your is_ok function
will be called like:
extban->is_ok(client, NULL, mask, EXBCHK_PARAM, MODE_ADD, EXBTYPE_TKL);
Important here is the NULL channel (since there is none)

Similarly your is_banned function will be called with BANCHK_CONNECT:
extban->is_banned(client, NULL, banstr, BANCHK_JOIN, &msg, &errmsg);
Here too, it is important to note that channel is NULL.
2020-01-10 11:45:25 +01:00
Bram Matthys 92c5f06e7e Fix incorrect spacing in HELPOP EXTBANS
[skip ci]
2020-01-10 09:06:28 +01:00
Bram Matthys d4826bd5c0 except throttle { } was not working, reported by LesterClayton in
https://bugs.unrealircd.org/view.php?id=5524

On a side note, the new method did work OK:
except ban { mask 127.0.0.1; type connect-flood; }
2020-01-09 18:23:27 +01:00
Bram Matthys edb4bd8cf2 Fix incorrect calls to HOOKTYPE_TKL_DEL causing crashes in modules
that use the parameters of this hook. Reported by Gottem.
2020-01-07 12:34:43 +01:00
westor 11ff177558 Add new option set::connthrottle::webirc-bypass
When set to 'yes' then when ConnThrottle detects a flood it will still
allow WEBIRC users in. The default is 'no'.
Suggested in https://bugs.unrealircd.org/view.php?id=5506
2020-01-05 17:27:11 +01:00
Bram Matthys 07753d112e Update for previous commit. See https://github.com/unrealircd/unrealircd/pull/87 2020-01-05 10:00:34 +01:00
k4bek4be cdea885b32 For ./unrealircd module parse-c-file use real line counts within the C file instead of within the special block 2020-01-05 09:57:29 +01:00
westor 2fa0edf599 Add support for "exempt-webirc" (#88)
Add new config option "exempt-webirc yes;" in set::restrict-commands::<commandname> in order to give exceptions in all WEBIRC user. This closes one of the 3 suggestions in https://bugs.unrealircd.org/view.php?id=5506
2020-01-04 17:39:38 +01:00
Bram Matthys d29a55a8db Update DoEvents() so it is safe to call EventDel() from within
an event handler. Until now it was NOT safe. Now it is.
2020-01-04 16:54:48 +01:00
Bram Matthys bb82138466 UnrealIRCd 5.0.1 2020-01-03 09:38:28 +01:00
Bram Matthys 672153cc4d Last update of release notes for 5.0.1?
[skip ci]
2020-01-03 09:22:12 +01:00
Bram Matthys a2d0194d94 More release note updates
[skip ci]
2020-01-03 09:14:50 +01:00
Bram Matthys 739caa5b88 Some more release note updates
[skip ci]
2020-01-03 09:05:26 +01:00
Bram Matthys ecaec0f062 Update release notes for upcoming 5.0.1 (first part)
[skip ci]
2020-01-03 08:48:09 +01:00
Bram Matthys 27ae0fa340 Fix "ERROR renaming 'data/reputation.db.tmp'" on Windows.
Reported by hc2995, notipa and floffy.
2020-01-02 16:35:24 +01:00
Bram Matthys eca761fcb9 Remove some unused vars in cmd_nick_remote and cmd_nick_local 2020-01-02 15:47:23 +01:00
Bram Matthys d7d673faf2 Multiple fixes related to ban actions:
1) Fix issue if HOOKTYPE_IS_HANDSHAKE_FINISHED rejects the user
2) Fix authprompt issue. We now allow adding the TKL in
   place_ban_host() for soft-kline/etc. Previously all the
   soft-kline/gline/zline/gzline acted like soft-kill.
3) The blacklist module did not allow clients in with action 'warn',
   reported by westor in https://bugs.unrealircd.org/view.php?id=5501
2020-01-02 15:36:42 +01:00
Bram Matthys 7278c9c8f4 @if causes miscounting of line numbers shown in config errors.
Reported by Gottem in https://bugs.unrealircd.org/view.php?id=5509
2020-01-02 13:05:26 +01:00
Bram Matthys b4fb4568fc Possibly fix a hang issue. Reported by westor. 2020-01-02 12:46:37 +01:00
Bram Matthys f8c6996edd Fix SID being shown (eg: 001) when services set the TOPIC. Reported by westor. 2019-12-31 13:26:31 +01:00
Bram Matthys a6b5f17656 Fix WHOX 'm', this should be an AND operation, eg: 'WHO +zo m' lists
IRC Operators (+o) that have +z set.
Similarly, 'WHO +o-z m' lists IRCOps (+o) which are -z.
Issue found while writing the HELPOP WHO documentation.
2019-12-31 13:22:35 +01:00
Bram Matthys 410148ea91 Document the WHOX syntax in /HELPOP WHO 2019-12-31 13:22:01 +01:00
Bram Matthys 77e859459a Add )
[skip ci]
2019-12-31 09:44:33 +01:00
Bram Matthys 114ef14a31 Log who (client) or what (signal) requested a config file /REHASH. 2019-12-31 09:41:19 +01:00
Bram Matthys ca576944e6 Don't test w/services on FreeBSD since it errors mysteriously atm. 2019-12-30 19:06:41 +01:00
Bram Matthys 2c23d4299c Send a better error when JOIN is used for a channel without hash mark (#).
Reported by k4be in https://bugs.unrealircd.org/view.php?id=5514
2019-12-30 19:02:20 +01:00
Bram Matthys fccb3b2f5b Add /ELINE exception type 'm' to bypass allow::maxperip.
In the configuration item you can now achieve the same via:
except ban { mask 1.2.3.4; type maxperip; }
Or even:
except ban { mask { 1.2.3.4; 8.8.8.8; }; type maxperip; }
etc.

Suggested by The_Myth in https://bugs.unrealircd.org/view.php?id=5507

Also, fixed an issue where the IRCd was counting servers as
clients for maxperip, which doesn't make much sense in practice,
so it only counts users now.
2019-12-30 18:23:55 +01:00
Bram Matthys e4d9e001d8 Merge branch 'unreal50' of github.com:unrealircd/unrealircd into unreal50 2019-12-30 17:54:40 +01:00
Bram Matthys c789ac6abe Add channel:override:mlock operclass permission which allows overriding
MLOCK restrictions when services are down (set::services-server).
Suggested by westor in https://bugs.unrealircd.org/view.php?id=5273
By default all opers with the *-with-override privilege have this,
which sounds OK to me.
2019-12-30 17:52:22 +01:00
GottemHams c2e3c8c8b1 Fix antirandom incorrectly defining its own BAN_ACT_WARN -- which is different from the one defined in include/struct.h and used in banact_stringtoval() -- resulting in kills instead of warns 2019-12-30 12:21:15 +01:00
Bram Matthys c215a3621a Use SNI in modulemanager. Not needed for the default one, but if you add
custom ones you might need it.
2019-12-28 18:50:03 +01:00
Bram Matthys 910f2ad383 Module manager: more error details when it fails to fetch a repository. 2019-12-28 18:05:22 +01:00
Bram Matthys aa7b199a8a Fix crash when reading configuration file with a password that is in
the old and unsupported unrealircd-specific md5/sha1 style.
2019-12-28 15:10:34 +01:00
Bram Matthys 63b77796ed sendto_server(&me, -> sendto_server(NULL,
Not sure where the &me originally came from, but it is used in a few places
and is only confusing since it has no meaning... nowadays anyway.
2019-12-27 17:23:24 +01:00
Bram Matthys 4a547a766e Remove HOOKTYPE_LOCAL_NICKPASS (now useless), see previous commit. 2019-12-23 16:42:10 +01:00
Bram Matthys c9cf74a735 Drop support for sending server pass (PASS xx) to nickserv. Use SASL!
It wasn't working anyway in 5.0.0 and this behavior was non-standard.
2019-12-23 16:40:06 +01:00
Bram Matthys e3b806ec60 Fix command override priorities again. Lowest value is called first,
just like hooks now. Yeah we've messed up a few times by now.
Seems only Gottem uses them :D
So now it would call for example: prio -10, prio 0, 10, 20, cmd.
This matches the behavior of hook priorities (and swhois etc.)
2019-12-23 13:10:33 +01:00
Bram Matthys 595e448239 If do_cmd() is called with NULL mtags then we now generate message tags,
run the command, and free them again right before return.
2019-12-23 10:56:25 +01:00
GottemHams 3a55dd8422 TKL exceptions (E-Lines) were missing an expiration notification =] 2019-12-22 21:33:35 +01:00
GottemHams a1ae90cd16 Fixed incorrect order in which command overrides were processed 2019-12-22 19:01:53 +01:00
Bram Matthys bf379526e1 Test framework: don't run with ASan on Debian 8 due to false positives
[skip ci]
2019-12-22 14:58:02 +01:00
GottemHams fac16fe1c0 match_* functions actually return 1 on match and not 0 :D 2019-12-22 14:48:04 +01:00
GottemHams 35d6e9a067 Fixed mismatch in config variable naming for require-module 2019-12-22 14:47:07 +01:00
Bram Matthys f1b30be34e Print a better error message for users answering the wrong directory in
the first ./Config question.
2019-12-21 10:32:24 +01:00
Bram Matthys d8af0c170b sys/resource.h must be included earlier, otherwise ulimit (the fd limit)
is left unchanged at 1024.
2019-12-14 05:23:10 +01:00
Bram Matthys 4c255ccbd5 Remove some old "release candidate" references in the docs. 2019-12-13 09:15:18 +01:00
Bram Matthys eac9cdc319 UnrealIRCd 5.0.0 release 2019-12-13 08:38:42 +01:00
Bram Matthys 25bc2b7923 Fix crash on nick change. 2019-12-12 16:58:26 +01:00
Bram Matthys a46a2e050d ./Config: import settings from rc2/rc1. 2019-12-12 16:57:51 +01:00
Bram Matthys f118f95ffa Some minor release notes updates (need to quote some stuff) 2019-12-11 19:54:30 +01:00
Bram Matthys 9fc508483f webredir module should not depend on curl (fix symbol not found error) 2019-12-11 19:54:17 +01:00
Bram Matthys 9a96c32706 Release notes: update text since --enable-asan is no longer on by default
[skip ci]
2019-12-11 18:05:13 +01:00
Bram Matthys f3e538170e Minor update in release notes 2019-12-11 17:21:38 +01:00
Bram Matthys 3a4d2d907a Fix tkldb/channeldb causing a 'File exists' error every 5 minutes. 2019-12-11 13:10:26 +01:00
Bram Matthys a078a5d659 Print a warning that upgrade-conf is for 3.2.x to 4.x, and not for 4.x to 5.x
since there are no mandatory changes. For more information why this is
unnecessary, see commit 32ca956e77.
2019-12-11 12:23:43 +01:00
Bram Matthys bc358e7b35 Bump UnrealProtocol to 5000 so I don't forget to do it later ;) 2019-12-08 18:47:51 +01:00
Bram Matthys b9729a4f29 Fix bug in syncing spamfilters: ban act char vs string. Didn't always matter,
but for example 'gzline' became 'gline' on the other link.
Also replace 'unsigned short action' -> 'BanAction action'
2019-12-08 13:45:59 +01:00
Bram Matthys 32ca956e77 There were only 2 breaking changes in 4.x -> 5.x confs. Now there are 0.
Turning these errors into warnings instead should be fine and makes
the upgrade process (and instructions) easier.
* set::oper-only-stats is now a warning
* except tkl is auto-transformed into except ban and is now a warning
Both warnings contain clear instructions on what to do to get rid of
the warning message.
2019-12-08 09:33:38 +01:00
Bram Matthys cad664e749 Fix invalid parameter in jumpserver module 2019-12-07 18:05:50 +01:00
Bram Matthys 4bfdd84712 Document send.c a bit more. 2019-12-07 16:00:03 +01:00
Bram Matthys 55cad6fe05 Fix SASL authentication not working properly on servers 2+ hops away
from services. Reported by Koragg and The_Myth in
https://bugs.unrealircd.org/view.php?id=5485
The test framework has been updated to test these cases better.
2019-12-07 10:08:27 +01:00
Bram Matthys c1b6bebbf4 Add doc/doxygen/ to .gitignore
[skip ci]
2019-12-06 11:00:35 +01:00
Bram Matthys 9e652b95c7 Tweak doxygen output a bit. Drop -rc2 suffix. Make more clear that this
is for developers / module coders only.
[skip ci]
2019-12-06 09:01:21 +01:00
Bram Matthys 7764358eb7 Remove some old URL reference / old deprecation notice for set::scan. 2019-12-06 08:44:51 +01:00
Bram Matthys d7301f1b11 Convert some http:// to https:// that were not previously updated it seems
[skip ci]
2019-12-06 08:43:37 +01:00
Bram Matthys 0bbb935a32 Rename CHECKPROTO() to CHECKSERVERPROTO() to avoid mixing up server caps
and client caps in the future.
2019-12-06 08:32:36 +01:00
Bram Matthys a0b0526556 CAP LIST wasn't outputting anything. Reported by Koragg in
https://bugs.unrealircd.org/view.php?id=5483
2019-12-06 08:29:53 +01:00
Bram Matthys d9166bd62d Disable address sanitizer (ASan) now that we are preparing for 5.0.0 stable.
This can still be enabled during ./Config by answering to the last question:
--with-asan
But it is no longer enabled by default since it causes a slowdown of X and
increases memory by a factor Y.
2019-12-05 20:16:44 +01:00
Bram Matthys bf61973a6d Print a warning when changin me::name that this change is not effective
until you restart the server.
Yeah it's really too much hassle atm to make that particular setting
/rehash'able, this will probably never change.
Fortunately changing that is rather rare. At least printing the
warning should help those users doing it.
2019-12-01 19:06:22 +01:00
Bram Matthys 12af48a433 Typo in release notes, reported by Koragg 2019-12-01 15:02:40 +01:00
Bram Matthys 28539d41e0 Fix incorrect prototype for HOOKTYPE_TOPIC, has mtags. 2019-11-29 12:23:13 +01:00
Bram Matthys 35dd6c66b1 Fix doxygen documentation for sendto_channel 2019-11-29 12:21:58 +01:00
Bram Matthys e5f9061636 Update Config.header a bit and release UnrealIRCd 5.0.0-rc2. 2019-11-29 08:18:50 +01:00
Bram Matthys 0f7f872a97 Update release notes and set version to 5.0.0-rc2. The actual public
release will probably be on Friday, though.
2019-11-27 19:37:38 +01:00
Bram Matthys 7869c31ea5 Add the extras/doxygen directory.
Command to generate is: doxygen extras/doxygen/Doxyfile
Will publish this "soon"... of course it's not 100% complete but it's quite good.
2019-11-27 16:53:49 +01:00
Bram Matthys 1576f8df23 Warn on some limitations of the @if stuff:
* Cannot use include within an @if
  ..but you can just use an include and then within that file use
  an if, to work around it.
* Cannot use loadmodule within an @if

For both this is because include & loadmodule are processed before
the rest. I think most people will be fine with those restrictions,
though.
2019-11-27 16:45:39 +01:00
Bram Matthys 540e7552f9 Fix crash when using conditional configuration (@if $var == ....)
reported in https://bugs.unrealircd.org/view.php?id=5281
It was not removing parts properly if an if didn't match,
leading to a use-after-free bug on-boot (or on rehash).

In the process I renamed config_entry_free to config_entry_free_all
since that is what it does. And I created a new config_entry_free(ce)
to free only 'ce' stuff... which is what we want from the
preprocessor.
2019-11-27 15:44:48 +01:00
Bram Matthys 1a1b9ddada If you changed listen::ip and rehashed it would not apply those changes
if you were switching from a IP-specific listener to a * (all) listener.
Reported by vectr0n in https://bugs.unrealircd.org/view.php?id=5235
2019-11-27 13:25:30 +01:00
Bram Matthys 7fe3407508 Clean up whitespace 2019-11-27 13:10:06 +01:00
Bram Matthys 05f0968ccd Test the various set::tls (and ::tls-options) files for existence
so we properly error and exit/fail when booting.
Reported in https://bugs.unrealircd.org/view.php?id=5350
2019-11-27 13:06:02 +01:00
Bram Matthys 1e3d726df7 Setting user mode +q now requires the self:unkickablemode permission.
This is included in the *-with-override operclasses.
2019-11-27 12:35:58 +01:00
Bram Matthys f6515131aa Handle timed bans in combination with forward, eg: +b ~t:10:~f:#chan:*!*@host 2019-11-27 12:11:26 +01:00
Bram Matthys 0b8d435232 +L can now be set by +o (or higher) instead of requiring +q (channel owner).
Also, update helpop on the new meaning of +L: if unable to join, then
the user is forwarded to the specified channel.
2019-11-27 12:00:57 +01:00
Bram Matthys ae30978680 Fix numeric 470, is now:
:irc.test.net 470 nickname #originalchannel #redirect :[Link] Cannot join channel #originalchannel (you are banned) -- transferring you to #redirect

Previously this was completely incorrect:
:irc.test.net 470 nickname [Link] Cannot join channel ..etc...
(yeah even lacking a colon)
2019-11-27 11:38:48 +01:00
Bram Matthys 332ca4898c Don't send CANNOTSENDTOCHAN (404) twice for dropped repeats in +f. 2019-11-27 10:33:51 +01:00
Bram Matthys a8534a6063 Add new function kick_user() for use by modules. This so KICKs are
done in a consistent way.
2019-11-27 10:33:08 +01:00
Bram Matthys 5d4c474472 Clean up KICK a bit, necessary for next commit which is a bug fix 2019-11-27 10:01:21 +01:00
Bram Matthys 1c3eff4232 Update KNOCK to be sent across servers. This will cause double notices
if you are running a mixed U4 and U5 network, but it solves the situation
where a knock-flood is only detected locally. Since KNOCK usage isn't
that common and flooding is worse than double notices during the
transition period, I went with this change..
2019-11-27 09:56:39 +01:00
Bram Matthys a0a8b6b4eb Fix alias type channel not working properly. Note that the channel needs
to exist and needs to be -n now.
Previously the logic was the wrong way around which made it message
through +n channels and not work if you were actually in the channel.
Fun.
2019-11-24 20:23:34 +01:00
Bram Matthys 72e0f1a8fb Don't send CANNOTSENDTOCHAN (404) if KICK'ed by floodprot 2019-11-22 12:03:38 +01:00
Bram Matthys 48802cd9f3 Fix no error shown on PRIVMSG to +n channel (message is blocked, though) 2019-11-22 10:48:51 +01:00
Bram Matthys 58bb93174c Fix memory leak on 'DNS c' (clear DNS cache) 2019-11-20 16:09:59 +01:00
Bram Matthys 43edef1ad0 Free all set options, some were missing before
(now follows struct order)
2019-11-20 16:07:07 +01:00
Bram Matthys e16064a2a5 Add anope to automated tests (we now have anope & atheme) 2019-11-20 09:51:04 +01:00
Bram Matthys ab42e12002 Make SVSLOGIN a broadcast, so all servers have the same svid information
for the user. Otherwise with post-connect SASL authentication you will
have different login information on server X compared to server Y
(the server with the user on it was always correct, though).

Also, add a function called user_account_login() which is used by both
SVSMODE/SVS2MODE and SVSLOGIN to send ACCOUNT messages to the channel.
This too was missing for SVSLOGIN (post-authentication SASL).

For this fix to be 100% effective, you need 100% UnrealIRCd 5.
2019-11-18 15:39:18 +01:00
Bram Matthys 54513307ec Fix ident check not working with some (most?) clients. Reported by
The_Myth in https://bugs.unrealircd.org/view.php?id=5462.
Now the code is much more generic/liberal. And more ugly.
2019-11-18 15:02:55 +01:00
Bram Matthys 2daa187114 At the end of the automated tests, kill more processes (services) 2019-11-18 10:38:58 +01:00
Bram Matthys 27bc208853 Update tests script to test services (1/2) 2019-11-18 10:14:28 +01:00
Bram Matthys 1930179079 In do_numeric(), don't send UID to local users. 2019-11-18 09:46:34 +01:00
Bram Matthys 22394e8cb3 And another SASL fix on our side for atheme 2019-11-18 09:38:56 +01:00
Bram Matthys bf3ee74659 Fix SASL with atheme 2019-11-18 09:26:51 +01:00
Bram Matthys 99d3d8e450 Fix another direction problem, this one had a clear FIXME :) 2019-11-18 08:43:14 +01:00
Bram Matthys 1b710bc101 Merge branch 'unreal50' of github.com:unrealircd/unrealircd into unreal50 2019-11-18 08:17:48 +01:00
Bram Matthys b88c8ec804 Fix sending PRIVMSG back to original sender. This made atheme go
in a sending loop if you used a services logging channel.
Reported by The_Myth in https://bugs.unrealircd.org/view.php?id=5469
The same bug was reported and seemingly fixed before, but wasn't
actually.
2019-11-18 08:16:23 +01:00
westor 1a28750fb6 Fixed a typo in servicebot module description (#83) 2019-11-17 19:21:35 +01:00
Vitor Luis 7fadb0667b Update help.conf (#86)
Added the new floodtype 'r' to the list of types and added the 'd' action to the floodtypes 'm' and 't' (not sure about the type 'c').
2019-11-17 19:20:59 +01:00
Bram Matthys 39530ab840 Fix warning on "make pem": Can't load tls.rnd into RNG. Reported by PeGaSuS. 2019-11-17 19:16:17 +01:00
Bram Matthys 74bbc92cf0 Make configure exit when no GNU Make is present (eg no 'gmake' on *BSD).
https://bugs.unrealircd.org/view.php?id=5310
2019-11-17 15:46:45 +01:00
Bram Matthys 84f59226ba Print a clear error if you try to use remote includes without enabling
remote includes support. This rather than "no such file or directory".
2019-11-15 14:41:23 +01:00
Bram Matthys abbc55741a UnrealIRCd 5.0.0-rc1 release 2019-11-15 11:04:39 +01:00
Bram Matthys 0899a734c0 Fix LINKS not showing ourselves. 2019-11-15 09:24:38 +01:00
Bram Matthys 840995d994 Fix bug in Windows crash reporter, was sometimes missing crashes
as it always ignored the first core file.
2019-11-15 09:06:27 +01:00
Bram Matthys 564cf26d56 Comment out some Windows GUI shit that can crash the IRCd.
This is just "About UnrealIRCd" and such, not really important.
2019-11-15 08:07:54 +01:00
Bram Matthys dd38165cb0 Set version to 5.0.0-rc1 and update release notes. NOT RELEASED yet..
there will likely be more fixes within a few hours before -rc1 release.
2019-11-15 07:07:29 +01:00
Bram Matthys 4c4fe038c0 Update warning regarding anope in Config.header too. 2019-11-14 17:38:13 +01:00
Bram Matthys b487b92ac5 Run ./unrealircd module install third/dumpcmds during tests. 2019-11-14 17:37:30 +01:00
Bram Matthys 8c95a8f119 Don't forget to mention ./unrealircd module uninstall... 2019-11-14 17:34:19 +01:00
Bram Matthys ee1e01bec8 Fix small memory leak on config error 2019-11-11 17:27:52 +01:00
Bram Matthys 77e308783f Fix extra whitespace in USERHOST/USERIP (minor) 2019-11-11 14:17:44 +01:00
Bram Matthys 6710e5c047 Fix SILENCE -xyz output (return value error) 2019-11-11 13:42:26 +01:00
Bram Matthys 56bc6f3939 Fix numeric 271 output which has own nick twice. This bug is also
present in UnrealIRCd 4, and possibly in 3.2.x as well.

This changes:
SILENCE
:irc1.test.net 271 self self evilperson!*@*
To:
SILENCE
:irc1.test.net 271 self evilperson!*@*
2019-11-11 13:31:50 +01:00
Bram Matthys 864b15c0d6 Fix another numeric error in MOTD and use ISO date format (Y-m-d). 2019-11-11 12:21:17 +01:00
Bram Matthys a34bb40da4 Fix format of various numerics that use sendnumericfmt(). 2019-11-11 11:31:42 +01:00
Bram Matthys e1163c8734 Windows installer: reindent .iss and fix some end -> end;
[skip ci]
2019-11-11 11:12:40 +01:00
Bram Matthys 788cdd2956 On Windows, if you choose to run UnrealIRCd 5 as a service, it now runs
under the NetworkService account, rather than LocalSystem (SYSTEM).

Something along those lines was suggested long ago in:
https://bugs.unrealircd.org/view.php?id=2330 with a patch
from BuHHunyx.

The more recent pull request from AlexandraBryant suggested to use
the NetworkService account and also fixed the (major) problem with the
original patch that caused UnrealIRCd to hang for 15 seconds when
UnrealIRCd was started in GUI mode (non-services mode).

The installer was changed to automatically set the appropriate
permissions on the UnrealIRCd 5 folder if "Install as a service"
was selected. This so NetworkService can write, otherwise it would
be unable to copy modules to tmp\, write to log files, etc. etc.

We print a clear warning if you manually install the service at
a later stage, suggesting to run the installer instead or to
manually change the permissions.

Better error checking and reporting was added when running 'unrealsvc'
and when we are unable to connect to the service manager. This is
much more common nowadays as you need elevated admin permissions.
2019-11-11 09:44:31 +01:00
Bram Matthys 52dbfc38b7 Fix service on Windows not working in UnrealIRCd 5 now that we
have the bin\ directory.
2019-11-11 09:43:39 +01:00
GottemHams 39fc55dca3 require-module now SQUITs on explicitly required/denied modules (by config), also change version check to require a minimum version (require module::version config directive) 2019-11-07 22:03:02 +01:00
Bram Matthys 8fb125f588 Add some connect and read timeouts to the module manager when
checking repositories and downloading C files (this was a TODO item).

Give a clear hard error if ALL repositories failed
(failed to connect, download or parse).

Make a few commands work regardless of repository status.
In fact, these don't connect to repositories at all since they
don't need to. Thus, these commands are always available:
./unrealircd module [uninstall|generate-repository|parse-c-file]
of which only 'uninstall' is of importance for end-users.

Finally, make parse-c-file print a better error in case the file
could not be opened. Note that this command is only there for
module developers and repository managers, not end-users.
2019-11-04 10:52:51 +01:00
Bram Matthys 31edd45223 Update release notes: require anope 2.0.7 (if using anope, that is) 2019-11-03 16:50:42 +01:00
Bram Matthys 1a6343bff3 Fix missing cloak module on Windows (:D), just in time for 5.0.0-beta1. 2019-11-02 09:13:20 +01:00
Bram Matthys 449f69485f Fix some memory leaks in ./unrealircd module.
Not terribly important at the moment, but still...
2019-11-02 08:14:25 +01:00
Bram Matthys 078c6696af Update release notes a bit
[skip ci]
2019-11-01 21:29:52 +01:00
Bram Matthys 6bb83dc5bc Bump version to 5.0.0-beta1 2019-11-01 20:05:05 +01:00
Bram Matthys 42d4d4a680 Compile fixes for Windows 2019-11-01 19:46:07 +01:00
Bram Matthys 7bf51f36a6 Fix column alignment in './unrealircd module list' 2019-11-01 17:25:36 +01:00
Bram Matthys 6402dfd2fe send_multinotice() -> sendnotice_multiline() 2019-11-01 13:12:40 +01:00
Bram Matthys dfa83aa6e5 Add module manager. See https://www.unrealircd.org/docs/Module_manager
Also update release notes and some unrelated changes.
BIG commits. Lots of work. Requires more testing.
2019-11-01 12:57:12 +01:00
Bram Matthys 801d359ad1 Allow importing build settings from UnrealIRCd 4.x, but don't copy 3rd party
modules as they wouldn't compile anyway.
2019-10-28 13:12:51 +01:00
Bram Matthys c105e6958c Update curl-ca-bundle to version of Wed Oct 16 03:12:09 2019 GMT
from https://curl.haxx.se/docs/caextract.html
2019-10-27 10:23:12 +01:00
Bram Matthys bcfa6389c2 Update shipped PCRE2 library from 10.32 to 10.33 (16 Apr 2019) 2019-10-27 10:18:14 +01:00
Bram Matthys 86ce42103a Make the 'silence' module optional. Suggested by westor in
https://bugs.unrealircd.org/view.php?id=5415
Technically we now provide 3 default efunc handlers that always return 0.
2019-10-27 09:40:55 +01:00
Bram Matthys 8bb5bda47a Pass correct modinfo argument to MOD_UNLOAD(). This fixes a crash
on SavePersistentPointer().
2019-10-27 09:33:37 +01:00
Bram Matthys e1e815bb2f Fix crash if 2+ REHASHes right after each other when also unloading
a channel mode module with parameters or a module with moddata.
2019-10-27 09:18:29 +01:00
Bram Matthys 72d71e30ce Fix unloading of chanmode modules crashing the server. Reported by westor
in https://bugs.unrealircd.org/view.php?id=5412
2019-10-27 09:07:43 +01:00
Bram Matthys 03cdf5043f Fix +f not detecting repeats in case of 1st message, REHASH, 2nd message.
This due to a missing SavePersistentPointer() on the siphash key.
[skip ci]
2019-10-27 08:52:07 +01:00
Bram Matthys be68a72b42 Hostile server: reject nicks that start with a digit in do_remote_nick_name() 2019-10-27 08:44:28 +01:00
Bram Matthys 5d7bd995fa Show correct idle time when a fresh user connects.
Reported by The_Myth in https://bugs.unrealircd.org/view.php?id=5454
2019-10-26 19:18:24 +02:00
Bram Matthys 298e9f2ea6 Advertise 'configtest' in './unrealircd' usage/help.
[skip ci]
2019-10-26 19:02:45 +02:00
Bram Matthys fb8055c6ef Add './unrealircd configtest' which tests the configuration but does
not actually start the server. Any warnings and errors are printed
only to the console.
Suggested in https://bugs.unrealircd.org/view.php?id=5219
2019-10-26 18:55:26 +02:00
Bram Matthys 52c8ef3815 get_sno_str -> get_snomask_string, get_mode_str -> get_usermode_string,
get_snostr -> get_snomask_string_raw, get_modestr -> get_usermode_string_raw
2019-10-26 11:42:05 +02:00
Bram Matthys 9b15c758cd make_virthost() -> make_cloakedhost() and change parameters:
/** Calculate the cloaked host for a client.
 * @param client        The client
 * @param curr          The real host or real IP
 * @param buf           Buffer to store the new cloaked host in
 * @param buflen        Length of the buffer (should be HOSTLEN+1)
 */
void make_cloakedhost(Client *client, char *curr, char *buf, size_t buflen)
2019-10-26 11:38:53 +02:00
Bram Matthys 21ef90e503 Document channel mode api and two other files. 2019-10-26 11:22:10 +02:00
Bram Matthys da5aefaad7 Get rid of class.h 2019-10-26 10:02:00 +02:00
Bram Matthys ab7a4af46a find_command(char *cmd, int flags) / find_command_simple(char *cmd) 2019-10-26 10:00:04 +02:00
Bram Matthys 9aff820d1a Find_* -> find_*, eg Find_alias -> find_alias. 2019-10-26 09:57:15 +02:00
Bram Matthys 64342a0d16 Document api-command.c and command API page. Change find_Command.
(more in next commit)
2019-10-26 09:56:18 +02:00
Bram Matthys 24c60fd85e Fix some doxygen tags (eg @notes to @note) 2019-10-26 09:33:09 +02:00
Bram Matthys 9c79ca6655 Document all functions in src/channel.c 2019-10-26 09:11:09 +02:00
Bram Matthys 9050011300 Document all functions in src/serv.c.
Also remove the DALINFO command.
2019-10-25 19:49:34 +02:00
Bram Matthys 86d15804a8 Document all functions in src/tls.c 2019-10-25 19:31:30 +02:00
Bram Matthys e9ab8fd45e Document all functions in src/support.c
And replace atime(str) with config_checkval(str, CFG_TIME)
2019-10-25 19:30:50 +02:00
Bram Matthys c45181d07f Document (doxygen) src/misc.c entirely 2019-10-25 14:29:14 +02:00
Bram Matthys 845f9ca8ed Uniform spelling: seetle on sync/synced/desync/desynced, rather than
synch/synched/desynch/desynched.
2019-10-25 14:07:58 +02:00
Bram Matthys c0f2e6be6a Remove src/extra.c and move the last function, ircd_log, to src/misc.c 2019-10-25 13:59:59 +02:00
Bram Matthys 47affa7f31 Move some DCCALLOW functions 2019-10-25 13:57:33 +02:00
Bram Matthys 51b0a7a373 Update HOOKTYPE_STATS: will now be called for unknown flags and for
all known flags as well. So you can now add stats via modules.
Only the stats help is currently missing if you do so.
=> Moved dccdeny stats to dccdeny
2019-10-25 13:51:22 +02:00
Bram Matthys 09854abade Move the dcc deny stuff into the dccdeny module, that is:
functions from extra.c, entire undccdeny and svsfline,
large functions that were in message.c and conf.c
2019-10-25 13:39:24 +02:00
Bram Matthys 88f45020d8 Remove outdated STATS Z and STATS R information. 2019-10-25 11:31:06 +02:00
Bram Matthys ec1b2c60f2 Remove src/cloak.c, integrate the function in src/user.c
(also move the related one from src/misc.c to the same place)
2019-10-25 11:26:08 +02:00
Bram Matthys 75fa6a25b8 Remove src/uid.c, integrate those two functions in src/user.c 2019-10-25 11:23:07 +02:00
Bram Matthys 84918ac68f Remove src/md5.c, integrate those two functions in src/misc.c 2019-10-25 11:19:18 +02:00
Bram Matthys 2fca0f9cc3 Remove src/kline.c, integrate these 15 lines in src/serv.c 2019-10-25 11:16:02 +02:00
Bram Matthys 6ffcf62272 Rename src/err.c to src/numeric.c 2019-10-25 11:10:12 +02:00
Bram Matthys cb4d2f9cf0 Get rid of set::new-linking-protocol and __PANGPANG__ stuff for
compatibility with old 3.2.x servers.
2019-10-25 10:58:04 +02:00
Bram Matthys 00aee86b66 Clean up and document all functions in src/socket.c. Also,
remove calls to and the finish_auth() function, which did nothing.
2019-10-25 10:51:18 +02:00
Bram Matthys 599f83cbd4 Move some #define's out of the way, some re-indenting, .. 2019-10-25 09:47:52 +02:00
Bram Matthys 13b5ccda4f Merge bsd.c into socket.c (delete src/bsd.c). 2019-10-25 09:38:27 +02:00
Bram Matthys db85de54ca Remove packet.c, now that it is empty. 2019-10-25 09:33:42 +02:00
Bram Matthys e6c7fcda7d Move "real command" stuff to src/api-command.c and move dopacket() to
src/parse.c. Also re-order functions in parse.c so they appear in
logical order (1->2->3->4) rather than various helper functions first
and some random order.
2019-10-25 09:32:30 +02:00
Bram Matthys 910477c94a Don't apply fake lag to servers 2019-10-25 09:13:05 +02:00
Bram Matthys fb0842216f Remove old bullet point in release notes that is now mentioned
a few lines up. [skip ci]
2019-10-19 18:32:54 +02:00
Bram Matthys 8e3ba03752 Convert remaining GLOBOPS to sendto_umode_global().
Yeah, don't worry, the GLOBOPS command will stay too, this is just
an internal cleanup.
2019-10-19 11:50:35 +02:00
Bram Matthys e0533c5f80 Use client id in SAJOIN and SAPART.
This will break logging and oper notices on U4, but we'll deal with that
later in some U4 release.
2019-10-19 11:45:08 +02:00
Bram Matthys 5960c76102 Fix SETNAME not working, reported by s and The_Myth in
https://bugs.unrealircd.org/view.php?id=5453
It had the match_spamfilter() logic reversed. I audited all other
calls to the function as well and they are fine.

Also, CHGHOST CHGIDENT CHGNAME SETHOST SETIDENT SETNAME are now
tested by the test framework.
2019-10-19 08:52:59 +02:00
Bram Matthys 04171f7f20 Clean up m_message a bit 2019-10-18 15:00:52 +02:00
Bram Matthys a72482bbb2 Fix PRIVMSG/NOTICE showing send UID/SID to end-user due to change from
a few days ago. Reported by westor.
2019-10-18 14:10:01 +02:00
Bram Matthys 5cd7134cc2 Reject invalid SID from PROTOCTL. 2019-10-18 14:00:46 +02:00
Bram Matthys 9171d58ad0 Some unimportant changes
[skip ci]
2019-10-18 13:54:40 +02:00
Bram Matthys b9d432820b Update ./Config and the more/less screen, now that release notes are
online (or in markdown format, anyway) we can skip some stuff.
2019-10-18 08:42:06 +02:00
Bram Matthys 6dffe38bd3 Update release notes a bit
[skip ci]
2019-10-18 08:36:01 +02:00
Bram Matthys e2158e3608 Fix possible lack of string termination (NUL) in buildvarstring() 2019-10-17 21:01:55 +02:00
Bram Matthys 3a3c5b9c55 Remove an abort() 2019-10-17 07:44:43 +02:00
Bram Matthys ff067cd826 More kill path stuff gone now. 2019-10-17 07:32:45 +02:00
Bram Matthys 49c2f7c2c3 Get rid of this whole kill path nonsense. 2019-10-16 11:11:46 +02:00
Bram Matthys bed8a0ca2b Remove set::oper-only-stats from config. Don't mention set::allow-user-stats
there since that is a niche feature that 99% is unlikely to use.
2019-10-14 18:50:24 +02:00
Bram Matthys d0b9b02d05 We no longer use a blacklist for stats (set::oper-only-stats) but
have a whitelist now instead (set::allow-user-stats).
Suggested by tabrisnet, The_Myth and Jobe in
https://bugs.unrealircd.org/view.php?id=3375 and
https://bugs.unrealircd.org/view.php?id=5109
2019-10-14 18:46:14 +02:00
Bram Matthys 63298af6b2 Get rid of BREPORT_xx mess. 2019-10-14 17:36:04 +02:00
Bram Matthys 87406d752b Fix crash on set::official-channels and deprecate it's use. Use +P channels
instead now that all settings are preserved accross restarts.
2019-10-14 16:10:27 +02:00
Bram Matthys 446f9a89c3 Assume password is sent when allow::password is cert/certfp and client
has a SSL/TLS fingerprint. Reported by Stealth in:
https://bugs.unrealircd.org/view.php?id=3372
2019-10-14 15:08:37 +02:00
Bram Matthys 43593d12cb netinfo.c & server.c: use sendto_umode_global() rather than 2 functions. 2019-10-14 12:23:09 +02:00
Bram Matthys e1b0b0bc8e Make tracing bugs easier if you used AddListItem twice - or at least
detect some cases of it (it will not detect the case where it is
a single-item list).
2019-10-14 08:53:05 +02:00
Bram Matthys f9ec129bbd Make hunt_server() use SID/UID for sender and destination.
Hopefully this doesn't break anything...
2019-10-14 08:34:16 +02:00
Bram Matthys 1a1ce5716e Move hunt_server from user.c to serv.c (makes sense). 2019-10-14 08:33:12 +02:00
Bram Matthys cc36b34f93 Remove unnecessary (void) casts everywhere.
Only use (void) for system/library calls that you want to ignore
explicitly, eg (void)close, if the return value is irrelevant.
2019-10-14 08:23:30 +02:00
Bram Matthys c60bd2e441 Try to use more me.id where possible (rather than me.name) 2019-10-14 08:09:57 +02:00
Bram Matthys d724bdc492 Finish up changes from yesterday. 2019-10-14 07:49:23 +02:00
Bram Matthys f40c9f3c88 Change various client->name to client->id in S2S traffic. More to
follow tomorrow, including me.name to me.id changes (though these
are far less important) and send.c + non-sendto_server hunts...
2019-10-13 20:41:13 +02:00
Bram Matthys 44f9423e13 Remove ID() macro as client->id always contains a proper UID now. 2019-10-13 20:11:58 +02:00
Bram Matthys 1dde1721ad Reorder functions in nick.c in a more logical way. No actual code changes.
[skip ci]
2019-10-13 19:47:26 +02:00
Bram Matthys b9a0f938c0 Cleanup cmd_user since it's now client-only and move the server-bits into cmd_uid. 2019-10-13 19:43:41 +02:00
Bram Matthys a970e5ed9b Fix far connect notice to IRCOps being in incorrect format. 2019-10-13 18:48:56 +02:00
Bram Matthys 2c337dc58b Split off cmd_nick in cmd_nick_local and cmd_nick_remote and clean it up.
Also, partially cleanup cmd_uid, but still work to be done there (the
last part).
2019-10-13 18:39:10 +02:00
Bram Matthys 746ea5b558 Clean up cmd_server / cmd_sid now that 100% of the network is SID. 2019-10-13 16:22:56 +02:00
Bram Matthys 154aab6ec4 No need for clear functions since PROTOCTL does not allow it. 2019-10-13 09:42:29 +02:00
Bram Matthys bcfd2ab529 Rip out support for servers lacking TKLEXT/TKLEXT2 (always send TKLEXT2 format) 2019-10-13 09:39:00 +02:00
Bram Matthys 560b73b6f7 Similar to previous commits, but for UMODE2. Actually no change, though,
since lack of UMODE2 was not supported in U4 anyway (maybe even 3.2.x).
2019-10-13 09:35:31 +02:00
Bram Matthys a9890448d8 Rip out support for servers lacking SJ3 2019-10-13 09:33:39 +02:00
Bram Matthys 545c2560e6 Rip out support for servers lacking SIDs/UIDs.
More cleanups will follow later for this one.
2019-10-13 09:24:26 +02:00
Bram Matthys 930ede1c86 Rip out support for servers lacking SJOIN/SJOIN2 2019-10-13 09:09:59 +02:00
Bram Matthys 0670bfffb9 Rip out support for servers lacking NICKIP 2019-10-13 08:59:26 +02:00
Bram Matthys fb4d994f40 Rip out support for servers lacking NOQUIT. 2019-10-13 08:56:05 +02:00
Bram Matthys 8d5f896790 Rip out support for servers lacking NICKv2 2019-10-13 08:54:16 +02:00
Bram Matthys c9b88343e2 Fix not seeing own nick change if not in any channels. Reported by westor. 2019-10-12 17:26:29 +02:00
Bram Matthys bbf2cd3a3e Fix incorrect relaying of numeric replies from remote servers (eg WHOIS nick nick). 2019-10-12 17:18:12 +02:00
Bram Matthys 8383b714ce Fix crash on SASL. Reported by westor. 2019-10-12 15:41:58 +02:00
Bram Matthys 742e27802e Fix 100% CPU issue with message-tags after REHASH. (this fix is in alpha4) 2019-10-12 09:12:17 +02:00
Bram Matthys f5137678ff Update 5.0.0-alpha4 release notes a bit. 2019-10-12 08:42:40 +02:00
Bram Matthys d55eb642e5 Fix 421 in restrict-commands, again. 2019-10-11 20:42:05 +02:00
Bram Matthys 139e5faae6 UnrealIRCd 5.0.0-alpha4 (release tomorrow) 2019-10-11 20:31:15 +02:00
Bram Matthys 03645750f1 Protect against services that don't reply to SASL: time out the SASL
session after a 15 seconds timeout. The exact timeout value can be
changed by adjusting set::sasl-timeout, which should be (quite a bit)
less than set::handshake-timeout by the way. 15<30 now, so fine.
2019-10-11 19:17:59 +02:00
Bram Matthys 3c4d14ca58 Warn about the necessity of an anope patch, which is pending since February... 2019-10-11 18:55:01 +02:00
Bram Matthys 96509f6802 except tkl { } -> except ban { } in example*conf
[skip ci]
2019-10-11 17:57:33 +02:00
Bram Matthys 9f2530fdb7 Fix 421 numeric syntax if command is blocked (commit from yesterday).
Reported by westor.
2019-10-11 17:07:28 +02:00
Bram Matthys ff5f2d97a0 Some release notes markdown changes (always fun when 3 markdown editors
show the output in 3 different ways, and github is even different)
[skip ci]
2019-10-11 16:24:24 +02:00
Bram Matthys 62352c2b70 Update release notes, refer to web/github or the .md file. 2019-10-11 16:19:54 +02:00
Bram Matthys a5e6fb4a12 Convert release notes to markdown (add many links)
[skip ci]
2019-10-11 15:58:55 +02:00
Bram Matthys 65f6b97ea7 Advertise as "draft/labeled-response-0.2" rather than "draft/labeled-response".
[skip ci]
2019-10-11 15:58:23 +02:00
Bram Matthys 98f1974c8f Don't fall through (fix for previous commit). 2019-10-11 15:01:19 +02:00
Bram Matthys 77bee69951 Fix Windows build 2019-10-11 14:46:13 +02:00
Bram Matthys 394168c288 Style fixes: "char* " -> "char *" etc. 2019-10-11 12:23:45 +02:00
Bram Matthys ccaec871bb And some fixes, to previous commits and older issues. 2019-10-11 12:19:04 +02:00
Bram Matthys aec54db360 Add is_extended_ban() which does a quick check for "~x:". This, rather
than scattered checks - which are sometimes different - everywhere in
the source code.
Also extban handler "is_ok" was being called with EXBTYPE_EXCEPT
rather than EXBTYPE_INVEX for +I. (Not reported by anyone)
2019-10-11 11:17:50 +02:00
Bram Matthys 33c176e59e Juse in case pcre2_get_error_message() fails... 2019-10-11 11:17:29 +02:00
Bram Matthys 1d0fa3278f Protect against flawed S2S traffic: more checks for bad base64
encoded IP addresses.
2019-10-11 11:16:16 +02:00
Bram Matthys 3d81c7101c Merge branch 'unreal50' of github.com:unrealircd/unrealircd into unreal50 2019-10-10 19:51:56 +02:00
Bram Matthys f7a35bd77e Fix for change from yesterday in JOIN: parv[1] would point to
a stack buffer in do_join but it goes out of scope after a return
from that function, still pointing to invalid data. Duh.
2019-10-10 19:46:08 +02:00
GottemHams be571f81c6 Changed snotice to numeric 421 for commands disabled/restricted by the restrict-commands module 2019-10-09 21:00:41 +02:00
Bram Matthys 80353cd7d3 Win......
[skip ci]
2019-10-09 19:24:09 +02:00
Bram Matthys e1fdba7931 Windows....................... 2019-10-09 19:16:34 +02:00
Bram Matthys 62110778dd Silence Windows compiler warning 2019-10-09 18:55:04 +02:00
Bram Matthys 04334f022e Fixes for Windows build 2019-10-09 18:20:06 +02:00
Bram Matthys 22dec96f9a No clean_channelname() anymore but a valid_channelname() function. Also,
deal with servers with different set::allowed-channelchars settings:
* We reject the link if set::allowed-channelchars settings differ between
  UnrealIRCd 5 servers.
* For the case where you have a mixed network consisting of UnrealIRCd 4.x
  and UnrealIRCd 5.x servers we try not to desync, BUT will not allow
  anyone to join the invalid channels locally. For IRCOps a message is
  printed with additional information on such a failed JOIN attempt.
See https://www.unrealircd.org/docs/Set_block#set::allowed-channelchars
for the different settings, which are best and U4<->U5 advice.
2019-10-09 18:11:02 +02:00
Bram Matthys fbbd915403 Reject link if set::allowed-channelchars differ. 2019-10-09 15:59:59 +02:00
Bram Matthys 798b223ee3 Convert some more stuff to enums (config preprocessor mostly). 2019-10-06 07:54:46 +02:00
Bram Matthys d2a93c3a03 websocket module will now only disable show-connect-info on the ports
that have listen::options::websocket. It will no longer disable it
on all ports.
2019-10-06 07:37:55 +02:00
Bram Matthys ba7ff01e0f Remove some unnecessary checks 2019-10-06 07:25:31 +02:00
Bram Matthys 24f73d8c4f Crash fixes for can_send_to_user / can_send_to_channel from earlier. 2019-10-05 18:31:29 +02:00
Bram Matthys c399aab016 Support for labeled-response in LIST (I really wanted this) 2019-10-05 18:21:47 +02:00
Bram Matthys f992a0c1c0 Finish up labeled-response implementation. Load by default to get the
thing tested. Will do at least 1 other commit soon related to this.
2019-10-05 17:33:22 +02:00
Bram Matthys b3947c7a14 Use proper HOOK_* return types in HOOKTYPE_PRE_LOCAL_CONNECT, fixes crashes. 2019-10-05 15:19:40 +02:00
Bram Matthys 9a8fd43873 ISON response was incorrect 2019-10-05 15:04:54 +02:00
Bram Matthys b2705089ce Clean up floodprot_*nickchange now that the prototypes are the same
for local and remote. Suggested by westor.
2019-10-05 13:00:18 +02:00
Bram Matthys 2eecf4f2da Use generic numeric 531 (ERR_CANTSENDTOUSER) for all such cases and use hook
CAN_SEND_TO_USER rather than HOOKTYPE_PRE_USERMSG (which is now removed).

As for the numeric change: this makes it much easier for client devs.
You rarely need to differentiate in the client code between the various
causes. One only cares about detecting that the message was not sent and
that the user needs to be informed.
This replaces various NOTICEs, ERR_NOCTCP, ERR_NONONREG etc. with just the
new numeric 531, which is taken from InspIRCd. The syntax is:
:server 531 yourname targetname :reason for the block
This makes it similar to numeric 404 (ERR_CANNOTSENDTOCHAN) that is used to
indicate that a channel message was blocked.

For module devs, the new hook CAN_SEND_TO_USER prototype is:
int hooktype_can_send_to_user(Client *client, Client *target, char **text, char **errmsg, int notice);
You can replace the text via this, by setting *text in your function.
You can block the message, by returning HOOK_DENY. If doing so, then
you must also set *errmsg to an appropriate value.
Do not send any error message to the user! UnrealIRCd will take care of
sending the error message for you, if you set *errmsg.
Only if you need something special you could violate this rule, but
preferably not!

As you can see, CAN_SEND_TO_USER works just like CAN_SEND_TO_CHANNEL.
2019-10-05 12:53:41 +02:00
Bram Matthys 4a59e66af2 Fix for previous 2019-10-05 09:55:28 +02:00
Bram Matthys df71812707 HOOKTYPE_CAN_SEND and HOOKTYPE_PRE_USERMSG changes:
1) HOOKTYPE_CAN_SEND is now called HOOKTYPE_CAN_SEND_TO_CHANNEL
   The arguments and return values are unchanged
2) similarly can_send() is now called can_send_to_channel()
3) If you want to block or alter a message you must now
   use HOOKTYPE_CAN_SEND_TO_CHANNEL and return HOOK_DENY from
   there with an appropriate *errmsg filled (see nocolor and
   many other modules for an example)
4) You CANNOT use HOOKTYPE_PRE_USERMSG anymore to block a message.
   I actually wanted to rip this hooktype out entirely, but
   delayjoin needs it. HOOKTYPE_PRE_USERMSG is only useful for
   notification that a message is going to be sent BEFORE it is
   actually sent (which is exactly what delayjoin needs, so it
   can send a JOIN if the user is currently invisible).
5) This is all to make things more clean:
   * HOOKTYPE_PRE_USERMSG is only for delayjoin
   * HOOKTYPE_CAN_SEND_TO_CHANNEL is used for exactly what the
     name implies. You can also change the message text there,
     such as for +G, +S, etc.
2019-10-05 09:48:33 +02:00
Bram Matthys 798f502875 Mass change (at least this one could be fully automated): 'chptr' -> 'channel'
to be consistent with the 'sptr' -> 'client' rename earlier.
2019-10-05 08:49:10 +02:00
Bram Matthys c2d7da6e35 Rename channel list to 'channels', for next commit. 2019-10-05 08:47:24 +02:00
Bram Matthys 858debdd01 Protect against duplicate PROTOCTL EAUTH (possible memleak) 2019-10-05 07:49:54 +02:00
Bram Matthys 3a64077f51 Use 'client' everywhere (if there is no confusion) instead of 'sptr' or 'cptr'.
This so I - and others - don't constantly have to wonder whether the client
is called sptr, cptr or acptr in a simple routine.
Insane --> 212 files changed, 6814 insertions(+), 6945 deletions(-)
Couldn't just mass-replace of course since there are places where there
are multiple clients involved. So had to check each function.
Also renamed some 'acptr' to 'target' and such.

I will write a page with new style rules later.. but in short if there is
only 1 client involved it will now be called 'client'.
2019-10-04 15:25:35 +02:00
Bram Matthys 40cd6aa639 Get rid of reference counting in User, which was unused. 2019-10-04 13:25:56 +02:00
Bram Matthys 9d98e6b411 do_join: int -> void 2019-10-04 13:22:53 +02:00
Bram Matthys e8c17e3aed Get rid of pseudo ID's. This also means that SASL with anope won't work
anymore if you run latest anope 2.0.6. You need the fix from Feb 9, 2019:
https://github.com/anope/anope/commit/da6e2730c259d6d6356a0a948e85730ae34663ab
(.. which also fixes SASL problems with anope + UnrealIRCd 4 by the way)
or just run anope latest git (2.0 branch).

Not sure about atheme... should test this.

Technical details: we used a pseudo ID / sasl cookie until recently,
this has always been planned to be phased out when we got UID's.
I didn't phase it out in U4 (but could have done so) but just did now in U5.
This simplifies everything as now you can just refer from the services
side to the user with the UID/SID. This also makes it so services can now
target the user in other functions as well, like NOTICE.
(Feel free to request other functions if something isn't working)
2019-10-04 13:13:46 +02:00
Bram Matthys 999fde8fee Update release notes (the module coders section) on the recent changes. 2019-10-04 12:38:01 +02:00
Bram Matthys 3d5e49e701 Get rid of FLUSH_BUFFER, since we no longer signal things that way.
Merge check_init and AllowClient into one single AllowClient()
and make it use the more logic 1 and 0 return values for allow / deny.
Similarly, use logic 1 / 0 return values for verify_link.

Module coders:
HOOKTYPE_CHECK_INIT and HOOKTYPE_PRE_LOCAL_CONNECT, changed the
return value, you should now use HOOK_*, eg HOOK_DENY to stop
processing (eg client killed).
2019-10-04 12:30:51 +02:00
Bram Matthys 3f18cf5ea1 find_shun() return value change, simply 1 / 0 now. 2019-10-04 11:41:12 +02:00
Bram Matthys 9e4dbf8c89 dead_link() -> dead_socket() since that is more descriptive 2019-10-04 11:36:34 +02:00
Bram Matthys cbe20e1d5a check_unknowns -> handshake_timeout, check_tkls -> match_tkls and inversion
of the return value.
2019-10-04 11:35:51 +02:00
Bram Matthys 92df36a87f Return values of various functions changed, in particular the ones
that deal with finding TKL's or spamfilters etc.
More will likely follow, to make things more logical.
Also, run_spamfilter -> match_spamfilter
place_host_ban, can_privmsg, check_dcc, find_tkline_match all impacted.
2019-10-04 11:30:27 +02:00
Bram Matthys 3126a3fae4 BIG changes internally that will break all modules and required many
code changes in UnrealIRCd itself:
1) Clients are no longer freed directly by exit_client. Most fields
   are freed, but 'sptr' itself is not, so you can use IsDead() on it.
2) exit_client now returns void rather than int
3) ALL command functions return void rather than int.
   Of course this also affects do_cmd, command overrides, etc.

This is a direct consequence of the removal of 'cptr' earlier, as that
was used to signal certain things that are now no longer possible
(and it raises the question if things were always correctly signaled
in the first place, so may fix some bugs).
It also makes the code more resillient against cases where you forgot
to check if the client was freed. Still, you are encouraged to do an
IsDead(sptr) if you are calling functions that may kill clients,
such as command functions or things that may use spamfilter.

More changes will follow, such as the removal of FLUSH_BUFFER.
2019-10-04 10:28:41 +02:00
Bram Matthys ea6651fb26 More Windows fixes
[skip ci]
2019-10-02 15:00:35 +02:00
Bram Matthys 0092263fee Possibly fix Windows build 2019-10-02 14:55:15 +02:00
Bram Matthys ab3feff7c2 exit_client() now takes 3 parameters rather than 5:
** Exit this IRC client, and all the dependents (users, servers) if this is a server.
* @param sptr        The client to exit.
* @param recv_mtags  Message tags to use as a base (if any).
* @param comment     The (s)quit message
* @returns FLUSH_BUFFER is returned if a local client disconnects,
*          otherwise 0 is returned. This so it can be used from
*          command functions like: return exit_client(sptr, ....);
2019-10-02 14:54:09 +02:00
Bram Matthys 1c746afdf1 Fix broken build by last minute change 2019-10-02 14:45:25 +02:00
Bram Matthys 4ac8015f84 Remove 'cptr' from all commands, hooks, etc. It only confuses people and
'sptr' is sufficient and in most cases the only one you should care about.
Should you need it, you can access sptr->direction in cases where you
need the old information (usually only for some sendto_* functions
and some protoctl checks), so 'cptr' was redundant too.

[!] This change likely introduces some bugs. This was many hours of work.
I only cut some corners in 4 functions, which will be fixed at a later
stage..... yes, more major changes to come.

On the plus side, I likely fixed some bugs in the process. Situations
where cptr vs sptr usage was incorrect. Eg using cptr->name (near server)
when sptr->name should be used (the actual source server), etc....
2019-10-02 14:25:40 +02:00
Bram Matthys 396ae3f218 Module coders: rename M_* to CMD_*, eg M_SERVER -> CMD_SERVER.
Also add more doxygen documentation.
2019-09-30 10:25:26 +02:00
Bram Matthys 9d7cf312cf Cleanup main line parsing code, move do_numeric() to parse.c.
Add complete doxygen documentation for parse.c.
2019-09-30 08:56:21 +02:00
Bram Matthys d7ef752888 Detect combination of non-UTF8 nickchars in use and websocket type text.
In such a case we refuse to run since the consequences are too big.
(Actually I may change the non-UTF8 channel warning to an error as well,
 right now it isn't.. simply because I cannot read a certain setting)

From both the non-UTF8 channel and user warning/error, we now refer to:
https://www.unrealircd.org/docs/WebSocket_support#websockets-and-non-utf8
which contains a bit more detailed information as to the WHY.
2019-09-23 10:20:38 +02:00
Bram Matthys 9669e32447 test set { } settings before all the rest 2019-09-23 09:33:57 +02:00
Bram Matthys 0b5a4bf51d Compile fix for Windows 2019-09-23 08:29:46 +02:00
Bram Matthys 3f5ea851cb Do a better job at detecting ASan 2019-09-23 08:14:41 +02:00
Bram Matthys 4ae374477f Add websocket support for 'text' instead of current 'binary'. And change
how you use websockets in the configuration file:
In addition to loading the websocket module you now ALSO have to mark
specific listen blocks with listen::options::websocket, and you have
to specify a type as well. Example:
listen {
	ip *;
	port 1234;
	options {
		websocket { type binary; }
	}
}
The type 'text' is compatible with kiwi although this is currently
completely untested. Also I should add something to the release notes
about this change. Tomorrow...
2019-09-22 20:49:37 +02:00
Bram Matthys d9e8206b80 Fix memory leak in modules.c 2019-09-22 20:20:25 +02:00
Bram Matthys 5a57eec4c7 Channel names must now be valid UTF8 by default.
We actually have 3 possible settings of set::allowed-channelchars:
utf8:  Channel must be valid UTF8, this is the new default
ascii: A very strict setting, for example in use at freenode,
       the channel name may not contain high ascii or UTF8
any:   A very loose setting, which allows almost all characters
       in the channel name. This was the OLD default, up to and
       including UnrealIRCd 4. It is no longer recommended.
For most networks this new default setting of utf8 will be fine, since
by far most IRC clients use UTF8 for many years already.
If you have a network that has a significant portion of chatters
that are on old non-UTF8 clients that use a specific character set
then you may want to use set { allowed-nickchars any; }
Some Russian and Ukrainian networks are known to need this.

Devs: src/utf8.c has been added which will be used by this and
by other functionality later.
2019-09-22 18:42:21 +02:00
Bram Matthys cd713369b1 Update Windows makefile, was missing ident_lookup.
[skip ci]
2019-09-22 15:25:56 +02:00
Bram Matthys 6687591bb0 Fix for build without DEBUGMODE. 2019-09-22 15:06:47 +02:00
Bram Matthys 5b8f393a8f * EventAdd() changed the order of parameters and expects every_msec now
which specifies the time in milliseconds rather than seconds. This
  allows for additional precision, or at least multiple calls per second.
  The minimum allowed every_msec value is 100 at this time.
  The prototype is now: EventAdd(Module *module, char *name,
  vFP event, void *data, long every_msec, int count);
2019-09-22 15:05:00 +02:00
Bram Matthys 4d277ccef8 Clean up and comment SocketLoop. Also preparations for later. 2019-09-22 14:20:22 +02:00
Bram Matthys b17deb7517 Fix for previous commit. See also the notes there :D 2019-09-22 13:35:17 +02:00
Bram Matthys 117a87dd8e I/O engine performance improvements (and fixes)
This is work in progress. The work was already done but the patch was
postponed until after alpha3 since it's not sufficiently stable yet.
2019-09-22 08:43:27 +02:00
Bram Matthys 784ba625ec Fix crash shortly after THROTTLE RESET. Bug was introduced yesterday
with commit b4636f183c
2019-09-22 08:24:05 +02:00
Bram Matthys 97cf32c941 Compile fix for Windows 2019-09-21 18:31:49 +02:00
Bram Matthys e846596b37 UnrealIRCd 5.0.0-alpha3 2019-09-21 18:19:33 +02:00
Bram Matthys c3f250750b Add support for storing ELINEs in tkl.db. Reported by westor in
https://bugs.unrealircd.org/view.php?id=5418
2019-09-21 18:12:20 +02:00
Bram Matthys 953cb774ad ASan: log to tmp/unrealircd_asan.<pid> and attach this if the IRCd
crashes (has a core file) to the crash bug report.
Also, disable leak detection since this is too noisy and would cause
a core dump each time + bothering the user to submit a crash report
+ send this crashreport etc. We still enable this in our own tests
though, but not for end-users.
2019-09-21 18:04:30 +02:00
Bram Matthys 4ecd7cca4c Fix memory leak when unloading an ISupport module. 2019-09-21 16:52:27 +02:00
Bram Matthys b4636f183c connthrottle: use SavePersistentPointer/LoadPersistentPointer rather
than temporary file to dump and read current settings (the old method).
2019-09-21 16:41:23 +02:00
Bram Matthys 330cf9ed24 Remove confusing information regarding /TSCTL. 2019-09-21 16:29:53 +02:00
Bram Matthys 83492a613d Fix memory leak in modules codes. 2019-09-21 16:07:44 +02:00
Bram Matthys dd536b4a92 Fix memory leak with conditional config.
And remove the comment which predicted this memory leak (:D)
2019-09-21 16:05:15 +02:00
Bram Matthys f88f30c815 Mark delayjoin module as perm, as we don't support dynamic unloading this,
which would be too much coding effort for such an unusual event.
(Reloading is fine though, for eg upgrading-on-the-fly)

Issue reported by westor in https://bugs.unrealircd.org/view.php?id=5416
2019-09-21 15:31:46 +02:00
Bram Matthys 4426cdacc9 Disable the warning from 95f9c56a16
that was not supposed to be committed :D
It would also warn about if'd out blocks, which is confusing,
so best to disable the warning altogether for now.
2019-09-18 20:09:10 +02:00
Bram Matthys b24fe0f336 Just in case someone uses a set::anti-flood::connection-flood of X:1... 2019-09-18 19:37:08 +02:00
Bram Matthys 95f9c56a16 Add warning if an unknown $VAR is encountered (without @define).
Also, you can escape a $VAR to $$VAR if you really just mean $VAR literally.
Such usage would be very rare though.
Note that the parser is smart enough to know that $var is never a
global variable, it only warns for valid variable names like $VAR and
even then only if it's at the end or has whitespace/dot/comma/etc.
So... false positives should be extremely low...
2019-09-18 09:43:45 +02:00
Bram Matthys 2c9be4eb97 Conditional conf: syntax is now always @define $VAR "xyz". Also restrict
the variable names to UPPERCASE, digits and underscores (A-Z0-9_).
This makes them easily distinguishable from other items in the conf,
so they don't clash with for example $ip in blacklist::reason.

The @define confusion was reported by Gottem and westor.
2019-09-18 08:49:27 +02:00
Bram Matthys 41f2b5f884 Fix some more numerics with incorrect arguments in U5: WATCH and failed
to JOIN reasons, such as when banned.
2019-09-17 18:53:35 +02:00
Bram Matthys 66345246ef Fix incorrect /ADMIN output, reported by westor. 2019-09-17 18:29:09 +02:00
Bram Matthys b2cfc6de69 Fix double free in AWAY due to changes of past week. 2019-09-16 07:41:33 +02:00
Bram Matthys 70a8985d43 Compile with -fno-common 2019-09-15 16:57:45 +02:00
Bram Matthys 54cb647925 Fix odd looking remote /REHASH message to globops. 2019-09-15 15:47:56 +02:00
Bram Matthys f3ec97ee23 floodprot (+f): fix issue where 't' was kicking innocent users due to
flooding. The 't' action was activated in if no 'r' type was present
because the counter was not reset.
https://bugs.unrealircd.org/view.php?id=5401
2019-09-15 15:33:30 +02:00
Bram Matthys c7c3fbdfa8 struct stats *ircstp; -> IRCStatistics ircstats; (for statistics, /STATS) 2019-09-15 14:48:45 +02:00
Bram Matthys bea2564e5d IRCStatistics ircstats; -> IRCCounts irccounts; (this is used for LUSERS) 2019-09-15 14:39:51 +02:00
Bram Matthys 677afe9ca4 Don't use memory pools when using ASan, since it would miss things.
-> See my comment in src/mempool.c
2019-09-15 14:37:59 +02:00
Bram Matthys f81f221b13 Use memory pool for Client and LocalClient. Also reorder struct a bit. 2019-09-15 12:28:50 +02:00
Bram Matthys 1a24a634e5 Make Link functions (make_link, free_link) use memory pool code.
Also clean up a bit.
2019-09-15 11:33:17 +02:00
Bram Matthys edb199841a Move all the (remaining) LIST stuff to modules/list and use ModData. 2019-09-15 11:07:15 +02:00
Bram Matthys 085c0f0c4e Move jointhrottle data from moddata_client to moddata_local_client
since we only count for local users.
2019-09-15 09:50:27 +02:00
Bram Matthys ffe5abe30b ModData: moddata_localvar -> moddata_local_variable,
moddata_globalvar -> moddata_global_variable,
and the just-added moddata_localclient -> moddata_local_client
..all this so it's more consistent
2019-09-15 09:47:54 +02:00
Bram Matthys b2f32c1746 Add moddata_localclient(), which is for locally connected clients only.
Make the silence module use this.
2019-09-15 09:26:54 +02:00
Bram Matthys 654919f2c4 Make modules/silence use ModData and remove more out of the core.
It uses a Silence struct now, rather than Link.
Also, SILENCE is handled only for local clients now (different
cost/benefit tradeoff nowadays).
2019-09-15 09:03:30 +02:00
Bram Matthys 6cc94b4b11 Move add_silence and del_silence out of the core to modules/silence 2019-09-15 07:52:04 +02:00
Bram Matthys 2b2fb8906e Zero memory in make_link() - needed since memory changes of today. 2019-09-14 21:03:12 +02:00
Bram Matthys 7c9a188cb7 Done. New rule: use safe_alloc, safe_free, safe_strdup,
do NOT use malloc/calloc/free.
2019-09-14 17:26:55 +02:00
Bram Matthys f2e3712d62 Remove various if's and such that are now unneeded
This is part 5 of the memory function / caller changes.
2019-09-14 17:23:07 +02:00
Bram Matthys a75d10d3e4 Some remaining malloc() calls -> safe_alloc()
Unimportant, but this way 100% of those is done.
This is step 4 of X of the memory function / caller changes.
2019-09-14 17:15:15 +02:00
Bram Matthys 950fc5001e Update memory allocation calls, step 3 of X
This changes free() calls to safe_free().
This mass change could be automated and unaudited, fortunately.
2019-09-14 17:12:37 +02:00
Bram Matthys 9fc1e758ab Mass change of dst = strdup(str) to safe_strdup(dst,str) but with a manual
audit since 'dst' must now be initialized memory.
There's still a raw_strdup() if you insist.

This is step 2 of X of memory allocation changes
2019-09-14 16:58:01 +02:00
Bram Matthys de87b439b7 Update memory allocation routines. Step 1 of X. 2019-09-14 16:52:53 +02:00
Bram Matthys 7c6358024c Add 'natural order' string comparison to core: strnatcmp and strnatcasecmp
extern int strnatcmp(char const *a, char const *b);
extern int strnatcasecmp(char const *a, char const *b);
This will be handy for version comparisons. For example they will
return -1 (=lower) for things like ("1.4.9", "1.4.10"), unlike strcmp.

Also, some loosely related spelling fixes elsewhere.
2019-09-14 08:12:47 +02:00
Bram Matthys f1f0acdd25 ident_lookup: reject spaces and control characters early.
...even though in m_nick there is code so it never gets into
sptr->user->username.
2019-09-13 19:37:28 +02:00
Bram Matthys 9b14970c2a Move ident lookups to module 'ident_lookup' and rewrite the code
to be a bit less ugly. The module is loaded by default so you can
still use set::options::identd-check like before, even though I
hate ident... it's old shit... still, other's seem to like it.

More changes will follow later. There is still some ident stuff
in the core at the moment and the module is currently PERM, which
largely (but not entirely) defeats the purpose of being a module.
That will be fixed at a later time as well.
2019-09-13 19:21:29 +02:00
Bram Matthys 3592d8db3a Update name in first few lines of .c files.
Eg: src/modules/m_away.c is src/modules/away.c nowadays.
2019-09-13 15:46:20 +02:00
Bram Matthys baf02e8980 Rename all m_* functions to cmd_* functions. 2019-09-13 15:45:19 +02:00
Bram Matthys bb1bb35f50 MOD_LOAD(xyz) is now just MOD_LOAD(), same for MOD_TEST, MOD_INIT,
MOD_UNLOAD. And MOD_HEADER(xyz) is now MOD_HEADER even without ()
since this isn't a function, really.
To make things understandable I added the following to the
developer section of the release notes:

* The module header is now as follows:
  ModuleHeader MOD_HEADER
    = {
          "nameofmodule",
          "5.0",
          "Some description",
          "Name of Author",
          "unrealircd-5",
      };
  There's a new author field, the version must start with a digit,
  and also the name of the module must match the loadmodule name.
  So for example third/funmod must also be named third/funmod.
* The MOD_TEST, MOD_INIT, MOD_LOAD and MOD_UNLOAD functions no longer
  take a name argument. So: MOD_INIT(mymod) is now MOD_INIT()
2019-09-13 15:27:40 +02:00
Bram Matthys 9114c0ed85 The name of the module must now match the relative path, e.g.
the chanmodes/delayjoin module must be named chanmodes/delayjoin
in the module header.
This because currently we have two module names for each module,
one is the name from the MOD_HEADER and the other is the
relative path, such as used by loadmodule and is_module_loaded().

This commit also (not entirely, but practically) breaks loading
of modules outside the regular modules path. I don't think that's
a problem, although it could use a bit more documentation.
2019-09-13 15:09:07 +02:00
Bram Matthys b40981f0ab Prevent a dlopen() if module is already loaded (instead of ~50 lines
further down). This is in case you have two loadmodule lines, which
isn't particularly unusual. Saves some CPU too....
2019-09-13 14:52:57 +02:00
Bram Matthys 5c209bf6ca require-module: CONFIG_RUN: only return 1 for settings that are for us. 2019-09-13 09:46:41 +02:00
GottemHams 43b03e75a6 Fixed some now-outdated comments in require-module, also send deny module notices globally instead of locally and change the default message for this 2019-09-12 21:45:33 +02:00
GottemHams 4a85e4cd8b Load require-module by default [skip-ci] 2019-09-12 20:54:09 +02:00
GottemHams ab7cdbf2a7 Fix a couple of bugs recently introduced in require-module, also delay SQUITting until after the current SMOD command has been parsed 2019-09-12 19:48:33 +02:00
Bram Matthys 70410b3f33 Remove unused variables (67 files done, will do rest another time). 2019-09-12 17:57:01 +02:00
Bram Matthys 8d2dad4796 chanmodes/floodprot: remove old +f 1:1 conversion code, cleanup a bit
and remove unused variables (unused now, that is).
2019-09-12 16:49:20 +02:00
Bram Matthys c3f7bbd9c0 require-mode: account for a little bit more room in S2S command
(not just hostname but also the command "SMOD" etc.. let's just say
16 bytes for now)
..and some minor cleanups of variables that are not needed.
2019-09-12 07:55:34 +02:00
Bram Matthys cafe3cfd6d Some S2S command changes to new require-modules module:
REQMODS Gmodname:version ....
to:
SMOD G:modname:version ....
Also, call the module require-module to be consistent with the
naming of the configuration directive.
Not sure yet of the set name, but call it set::require-module for
now as well.
2019-09-12 07:38:55 +02:00
Bram Matthys 88cbc38ff2 Do some more syntax checking, even for servers.
This fixes a crash in case of incorrect server to server traffic.
2019-09-12 07:16:18 +02:00
GottemHams 3948c3a74b Forgot to remove a lil' comment :D [skip-ci] 2019-09-11 22:26:53 +02:00
GottemHams 358a31eaee First draft of require-modules module (require modules globally or deny them) 2019-09-11 22:18:03 +02:00
GottemHams daa2441c1c Stray tab in rmtkl :D 2019-09-11 22:14:03 +02:00
Bram Matthys c833ac2082 And some final cleanups of today, nothing important. 2019-09-11 20:07:47 +02:00
Bram Matthys 482c85de44 Get rid of this sptr->serv->user, as we already have sptr->serv->by
to track who initiated the connect. It also didn't seem to be displayed
anywhere but in /TRACE.
2019-09-11 19:46:52 +02:00
Bram Matthys 5659a2b177 Document more core structs.
[skip ci]
2019-09-11 19:44:10 +02:00
Bram Matthys 9b113c27e4 Document some more structs and group them in a logical place. 2019-09-11 19:07:11 +02:00
Bram Matthys c72d848b61 Get rid of MembershipL since there's no difference anymore between
local membership structs (MembershipL) and remote ones (Membership),
so they are now all called... Membership.
2019-09-11 17:53:29 +02:00
Bram Matthys bf2c5110db IsPerson() -> IsUser(), MyClient() -> MyUser(), etc.
This so we have a few simple concepts:
Client: this can be a user, server, or something unknown yet
Then the type of clients:
User: this is a user, someone with a nick name.
Server: this is a server
Etc.
2019-09-11 17:43:17 +02:00
Bram Matthys fcf0ff4e3c Document client statuses (cptr->status) and some more renames. 2019-09-11 16:52:11 +02:00
Bram Matthys 2df5326615 Overhaul of all client flag macros (mass renaming, always use getters/setters/checkers) 2019-09-11 16:00:47 +02:00
Bram Matthys e372e9118d Move cptr->count to cptr->local->identbufcnt since this only used by
the ident reading code nowadays, which obviously only happens for
locally connected users.
2019-09-11 14:36:12 +02:00
Bram Matthys d80e601760 Rename sptr->username to sptr->ident, since that is what it is.
[skip ci]
2019-09-11 14:31:14 +02:00
Bram Matthys c69bdbe175 ->status is now an enum of ClientStatus and STAT_xx -> CLIENT_STATUS_xx 2019-09-11 14:27:32 +02:00
Bram Matthys 792709bf4f Move cptr->fd to cptr->local->fd. This may cause some crashes while
the rest of the code is audited / checked ;)
2019-09-11 14:21:07 +02:00
Bram Matthys 68b7368305 Document Client struct
[skip ci]
2019-09-11 14:14:09 +02:00
Bram Matthys cb236eea88 Rename cptr->from to cptr->direction, since the 'from' is rather misleading
as cptr->from is NOT (necessarily) the server where cptr is connected to.
So we now call it cptr->direction since it indicates the directly connected
server (or &me)... in other words: the direction of the client path.
2019-09-11 14:03:27 +02:00
Bram Matthys 6a019d6188 Let's allow user connections.
*sigh*
(at least we have automated tests for this)
2019-09-11 13:44:55 +02:00
Bram Matthys 628aab3a76 Duh, check NULL pointer properly in Auth_Check() in case of NULL structs.
Fixes crash-on-connect due to an earlier commit last hour.
2019-09-11 13:38:49 +02:00
Bram Matthys 1e6a3bdd55 Bump PASSWDLEN to something "large enough for everyone" (256) rather than current (48). 2019-09-11 13:27:45 +02:00
Bram Matthys 786054e6b7 Remove 'md5', 'sha1' and 'ripemd160' from auth code. These are insecure and
old authentication types that are already deprecated in UnrealIRCd 4.x.
They don't contain any rounds which means they can be cracked at a rate of
millions per second. Use the secure hashing type 'argon2' instead
(or, if you must, use the less secure 'bcrypt' type).
2019-09-11 13:17:28 +02:00
Bram Matthys 04607f5b1a Various auth cleanups: Auth_Check() now returns 1 on allow and 0 on deny (!)
to keep things simple, rather than having 4 different return values
(yes.. FOUR!).
[skip ci]
2019-09-11 13:10:15 +02:00
Bram Matthys 05e776fb71 More cleanups: now mostly auth-related: use better names and use enums
for authentication types. Rename Auth_Make to Auth_Hash. Add docs. etc.
2019-09-11 12:37:34 +02:00
Bram Matthys e8d53ffe8e And more type changes to make things consistent and more readable. 2019-09-11 11:04:31 +02:00
Bram Matthys 2a5ea10453 Lots of changes again. Most notable: Cmdoverride -> CommandOverride,
including things like CallCmdoverride() to CallCommandOverride().
Type changes like aTKline -> TKL and many more (in particular
aSomething to Something etc. such as aWatch to Watch) but these are
less used by 3rd party module coders.
2019-09-11 10:20:00 +02:00
Bram Matthys f55682cbaa More (typedef) struct name changes. Mostly configuration but also
aCommand to RealCommand. Although not sure if this latter makes
things a lot more descriptive :D. Can revisit later.
(more to follow)
2019-09-11 10:04:47 +02:00
Bram Matthys 23116d344a Give structs the same name as the typedefs. Rename aClient to Client,
aChannel to Channel, and some more. Third party module coders will
love this. But.. it makes things more logical and the doxygen output
will look more clean and logical as well.
(More changes will follow)
2019-09-11 09:48:00 +02:00
GottemHams fbd7ff1f5a Implemented set::min-nick-length (default 0 aka no minimum required) and added a line for it to /stats S, as a bonus my editor strips trailing whitespace :D 2019-09-09 20:33:38 +02:00
GottemHams a0db737408 hideserver module still used old-style version string [skip-ci] 2019-09-09 19:46:46 +02:00
Bram Matthys 5b361e69bb Get rid of configure check for strtoul and the src/strtoul.c file. 2019-09-09 17:49:10 +02:00
Bram Matthys ec2fdb82e0 Get rid of configure check for strerror() 2019-09-09 17:45:24 +02:00
Bram Matthys 80bc15c6d3 Apparently our strtoken() is special, don't bother then. Still, get rid of
the configure check.
2019-09-09 17:32:59 +02:00
Bram Matthys 1cdbbe043f Make strtoken() use strtok_r / strtok_s.
And get rid of the config check, as strtoken() never existed anyway.
2019-09-09 17:19:25 +02:00
Bram Matthys e5f73fdbcd Don't use custom inet_pton{4,6} functions
[skip ci]
2019-09-09 17:08:25 +02:00
Bram Matthys 078cfa88ea Get rid of configure check for strtok()
[skip ci]
2019-09-09 16:58:44 +02:00
Bram Matthys 36cb2226cc Get rid of checking inet_pton/net_ntop. Should be available on IPv6-capable
operating systems. And we require IPv6-capable since UnrealIRCd 4 already,
so.. ;)
2019-09-09 16:51:31 +02:00
Bram Matthys c86d03dcca Windows build fixes 2019-09-09 16:46:57 +02:00
Bram Matthys 5f9e919b18 Remove more configure checks: malloc.h, AC_FUNC_SETPGRP, AC_FUNC_SETVBUF_REVERSED
[skip ci]
2019-09-09 16:38:24 +02:00
Bram Matthys 5e4c481d93 Yes, strcasecmp is always available, configure. 2019-09-09 16:30:02 +02:00
Bram Matthys ca2239827e Get rid of NICK_GB2312/NICK_GBK/NICK_GBK_JAP in config.h. I am not aware
of anyone actually using these. So running with this was rather untested
(if it worked at all, which I doubt).
2019-09-09 16:20:26 +02:00
Bram Matthys 7d4b7c2fed Get rid of stricmp/strnicmp (use strcasecmp/strncasecmp) 2019-09-09 16:13:32 +02:00
Bram Matthys 9636f83a2b Always assume POSIX signals (on non-Windows, that is). 2019-09-09 16:08:18 +02:00
Bram Matthys 05af50d1fc Remove some HPUX stuff. We don't support or test this so leaving
this in the source gives a false impression. Also some ULTRIX
stuff (from 1995???).
2019-09-09 15:53:44 +02:00
Bram Matthys 1183e88077 Remove old SunOS / Solaris / AIX code.
And some other outdated things for non-POSIX systems...
2019-09-09 15:46:19 +02:00
Bram Matthys 8d453ffc40 Get rid of index() and some useless casts 2019-09-09 14:54:49 +02:00
Bram Matthys 3f690ec1df Get rid of configure checks for inet_addr and inet_ntoa. 2019-09-09 14:47:42 +02:00
Bram Matthys d434cf948b Get rid of bcmp/bcopy/bzero. 2019-09-09 14:41:40 +02:00
Bram Matthys e34888802a Move check for C99 compiler to the beginning and print some meaningful
hint to the user if it cannot be found.
2019-09-09 14:09:58 +02:00
Bram Matthys 2276185939 Get rid of more ./configure checks.
(Let's see if Windows complains again...)
2019-09-09 13:56:37 +02:00
Bram Matthys a0aec38df2 Get rid of DISABLE_USERMOD, since you can achieve the same in U5 via
the restrict-commands module in a dynamic way (with more options too).
2019-09-09 13:27:25 +02:00
Bram Matthys 5141e3cdfe Fix for Windows due to previous
[skip ci]
2019-09-09 13:16:31 +02:00
Bram Matthys a9e0655650 Remove more old stuff from ./configure 2019-09-09 13:11:30 +02:00
Bram Matthys 90d39d4665 tkldb module: Turn a few config_error() into config_warn() since
we continue, while errors mean we would fail to boot (or fail to rehash)
which is not the case.
2019-09-08 20:50:55 +02:00
Bram Matthys c423f9c8f7 Remove some more ./configure checks that are likely unneeded. 2019-09-08 20:22:45 +02:00
Bram Matthys 7be894bcda Let's see if we can drop unreal_CHECK_TYPE_SIZES in configure.ac.
Saves some ./configure CPU time.
2019-09-08 20:14:35 +02:00
Bram Matthys 0c4502bf79 Define and use SIPHASH_KEY_LENGTH rather than some magic value. 2019-09-08 14:15:23 +02:00
Bram Matthys ebd9c738f2 Some cleanup/rewrites of 'r' (repeat) in the floodprot module (+f).
Use a more simple hashing algorithm and one that uses 64 bits,
don't allocate any memory dynamically, just use an int64_t.
Also, only do the hashing if 'r' is actually enabled in +f
on the channel, as otherwise it's pointless.
2019-09-08 14:06:40 +02:00
Bram Matthys 9fe82e4a9f Fix read-after-free in HOOKTYPE_LOCAL_PART hook. 2019-09-08 08:41:58 +02:00
Bram Matthys e9847a2279 Fix OOB read due to last commit (62c7f67f7a) 2019-09-08 08:38:13 +02:00
Bram Matthys 62c7f67f7a Make StripControlCodes() filter out zero width space as well (U+200B). 2019-09-07 18:32:21 +02:00
Bram Matthys 08a4c489f6 Update HELPOP SPAMFILTER. The syntax was OK but the explanation under it
was confusing since it was explaining the fields in a different order.
2019-09-07 18:00:58 +02:00
Bram Matthys ec5a66ba80 UnrealIRCd 5.0.0-alpha2 release 2019-09-07 15:54:15 +02:00
Bram Matthys 7eb9ed90cb Cleanup sub1_from_channel. Don't kick insecure users on +z channels when we
are merging (equal TS), only kick our users when we are on the losing side
(=if there is a different TS, IOTW: the channel was recreated later).
2019-09-07 14:45:47 +02:00
Bram Matthys ab0608a98c Don't send OperOverride notice if &me (server)
[skip ci]
2019-09-07 11:06:04 +02:00
Bram Matthys c6cfc2f5c8 Fix receiving "+i must be set" twice (for users) or more (for opers)
[skip ci]
2019-09-07 10:52:38 +02:00
Bram Matthys b9e2f1c5fb Fix crash in RMTKL (only possible with rogue server traffic)
[skip ci]
2019-09-07 10:25:36 +02:00
Bram Matthys 62dc1181ba Protect against late bogus PROTOCTL SID=xxx (from authenticated servers) 2019-09-07 10:16:46 +02:00
Bram Matthys d3db771a1b Add some tracing code until a certain RMTKL bug is found. 2019-09-07 09:35:50 +02:00
Bram Matthys 7c9325d8d1 Move get_mode_bitbychar() and get_extmode_bitbychar() to the core
rather than helper functions in floodprot. (I need them)
2019-09-07 09:24:26 +02:00
Bram Matthys 62c0edde12 Partially rewrite SVSMODE #chan code to fix a crash from hostile servers.
Also get rid of the TS parameter in there, which nobody uses anyway.
It didn't even refer to the channel TS.. quite confusing..
it used user->since... so it seems it was against crossing users
(nick changes)... well, we have UID for that now.
2019-09-07 08:02:07 +02:00
Bram Matthys 579c4bd884 Compile with -O1 in ASan mode, rather than -O0. 2019-09-06 20:58:32 +02:00
Bram Matthys dc5fd50a54 Fix potential issues if msgbypass extban module is not loaded.
[skip ci]
2019-09-06 20:55:42 +02:00
Bram Matthys a3e911a174 Make issecure (+Z/-Z) use the same msgids network-wide. 2019-09-06 15:18:45 +02:00
Bram Matthys cf873d826a Add MessageTag *mtags argument to various (channel related) hooks, in case
they need access to those. For more information, see:
https://bugs.unrealircd.org/view.php?id=5343
2019-09-06 14:30:16 +02:00
Bram Matthys 4a6f56e967 Fix list modes not being restored properly from channeldb. 2019-09-06 13:06:53 +02:00
Bram Matthys 758dc74315 Fix memory leak in new ban exception code. 2019-09-06 09:15:27 +02:00
Bram Matthys 9b1fa66434 Duh, I meant, NOREMOVETMP.
[skip ci]
2019-09-06 09:13:19 +02:00
Bram Matthys 46486310dc Obey #define REMOVETMP (for testing) 2019-09-06 09:02:17 +02:00
Bram Matthys 73d320f553 Use enum for BAN_ACT_* and silence a (stupid) clang warning. 2019-09-05 20:54:31 +02:00
Bram Matthys 868895c70a Add except ban type 'all'. For a full list of options, see
https://www.unrealircd.org/docs/Except_ban_block#UnrealIRCd_5
Also, fix shun (s) not being available as an exempt option (bug).
2019-09-04 19:38:23 +02:00
Bram Matthys 750479aa2c Add more /ELINE options to bypass the following types: unknown data flood,
antirandom, antimixedutf8 and ban version. Just type /ELINE to see the
options / syntax. (TODO: more testing)
2019-09-04 18:43:06 +02:00
Bram Matthys 72664fc3df Deal with hostile servers in msgid code 2019-09-02 20:45:58 +02:00
Bram Matthys 0724c0ce13 stfu compiler, you are wrong 2019-09-02 20:16:46 +02:00
Bram Matthys 7ff78b4cf6 Make config test for except ban::type. Also use 'connect-flood'
rather than throttling, since that's the term we use everywhere
in our documentation and for config options.
2019-09-02 20:14:48 +02:00
Bram Matthys a006a9aea9 Recode tkl type table. '/STATS except' works now (lists ELINEs and
except ban in config).
If you want to play with exceptions, type /ELINE for information.
For the configuration file it is important to know that 'except tkl'
is now called 'except ban'.
Also if you do not specify an except ban::type we now default to
exempt from all regular server ban types (but not qline, spamfilters,
blacklist or throttling)
2019-09-02 19:30:23 +02:00
Bram Matthys 58618bf2b6 Add support for ban exceptions, via /ELINE and via the config file.
Still need to fix some FIXME/TODO items and things haven't been
fully tested yet, so server sync issues or crashes are still possible.
Release notes will be updated another day as well..
2019-09-01 20:49:14 +02:00
Bram Matthys 76b1655f9b Add TKL exception type handling (phase 2 of X) 2019-09-01 10:58:29 +02:00
Bram Matthys cdcac52d81 It helps if I git add src/api-efunctions.c... 2019-09-01 09:40:44 +02:00
Bram Matthys 3fcd25b542 Split off efunctions to src/api-efunctions.c, use enums and
a different style of initializing the efunctions table which
is less error-prone.
2019-09-01 09:38:55 +02:00
Bram Matthys 2483376796 Fix crash on adding QLINE (reported by The_Myth) and 'STATS bannick'
should really show QLINEs as well. Up to now it only showed (local)
config banned nicks.
Fixes https://bugs.unrealircd.org/view.php?id=5387
2019-09-01 08:31:03 +02:00
Bram Matthys 8a6c84876e Rewrite/cleanup huge portion of TKL handling (16 files updated, but
src/modules/tkl.c is the main one).
Also move DB writing/reading functions to src/misc.c so they can be
removed out of channeldb and tkldb.

Important note to current tkldb users:
Unfortunately due to the major cleanup I had to remove upgrading
for previously saved tkl db files. That seemed not worth the effort
for maybe <15 current users or so. It also makes the tkldb code
a lot more cleaner. Otherwise it would be a huge mess.

Currently a FIXME item: spamfilter support in RMTKL.
2019-08-31 15:29:04 +02:00
Bram Matthys 0116c4f0d6 Partial TKL recode - (pre) phase 1 2019-08-28 20:21:04 +02:00
Bram Matthys e6c321c7dc Some cleanups / comments added, but no real code changes. 2019-08-28 18:08:38 +02:00
Bram Matthys c1babb7411 Fix reading unitialized memory due to one of the commits from yesterday
(in the crash reporter)
2019-08-28 07:13:31 +02:00
Bram Matthys 19a0d205e6 Enable core dumps if using ASan (applies to alpha/beta and dev builds) 2019-08-27 16:27:56 +02:00
Bram Matthys d477e4930e Crash reporter: include libc for better debugging. 2019-08-27 16:05:32 +02:00
Bram Matthys 308ac85bba UnrealIRCd crash reporter: require TLSv1.2 or later 2019-08-27 14:24:27 +02:00
Bram Matthys 083953ca00 Release notes: Developers: mention ModuleHeader changes.
[skip ci]
2019-08-27 14:15:44 +02:00
Bram Matthys 17c6b5976d Update output of MODULE command (MODULE -all) to include the author,
slightly change the output and use RPL_TXT rather than NOTICE.
2019-08-27 14:12:00 +02:00
Bram Matthys fc69c5300e Windows buildbot fixes
[skip ci]
2019-08-27 12:47:30 +02:00
Bram Matthys fa29e22ea2 Windows build: attempt build tests
[skip ci]
2019-08-27 08:46:54 +02:00
Bram Matthys 10faaf91ba Bump module header version to "unrealircd-5", add author field
and remove old dependency field (never used, was always NULL,
broken since 3.2.x)
I'll add some constraints later on things like names and versions.
IOTW: more changes to follow, don't mass update your own mods yet.
2019-08-26 20:29:47 +02:00
Bram Matthys 526e5e09a4 Fix for commit from an hour ago. One was unable to remove the
+nt modes by f.e. setting set::modes-on-join to "+";
2019-08-26 19:35:40 +02:00
Bram Matthys a72e4f39f2 Fix both duplicate channel messages (reported by The_Myth) and
set::broadcast-channel-messages not having any effect (reported
by FwdInTime). Yes, both fixes from earlier were incomplete.
2019-08-26 19:21:14 +02:00
Bram Matthys 890e4c9acd Set set::modes-on-join to +nt by default and also put it in the
example.conf. Leaving it empty by default is strange and contrasts
with our "secure by default" principle.
2019-08-26 18:22:12 +02:00
Bram Matthys d331f22dbc Windows buildbot updates 2019-08-25 19:00:26 +02:00
Bram Matthys 8d2ac9c50e Fix set::broadcast-channel-messages configuration item not working.
Reported by FwdInTime in https://bugs.unrealircd.org/view.php?id=5367
2019-08-25 18:52:39 +02:00
Bram Matthys e0b941739c Fix problem with PRIVMSG echoing back in S2S. Reported by The_Myth. 2019-08-25 18:49:10 +02:00
Bram Matthys 4e1768d9ed Windows: Blah 2019-08-25 18:41:36 +02:00
Bram Matthys 0e529f75f8 Windows: attempt build tests
[skip ci]
2019-08-25 18:02:50 +02:00
Bram Matthys ebaac5a6b8 Get rid of various never used config options and also port
the U4 fix for Windows where it says "Too many connections"
way too quickly. (Sorry for mixing both in 1 commit..)
2019-08-25 17:48:32 +02:00
Bram Matthys 38b55fb3c5 Not ready for release yet, but bump git version to alpha2 already now that
the Windows build is working (5.0.0-alpha1 had no Windows build).
2019-08-25 14:38:02 +02:00
Bram Matthys 6ead10f42d Windows: build with /WX (equivalent to -Werror) and turn on
/analyze again. Not sure how long I can bear that last one though
as now compilation takes about 15 minutes rather than a few.
2019-08-25 14:03:11 +02:00
Bram Matthys 8484511296 Make Windows build compile without warnings with /W3
Disable these warnings, though:
C4267: downgrade of size_t to int and such. pointless...
C4101: unreferenced local variable
C4018: signed/unsigned mismatch
C4244: implicit conversions with "possible loss of data".
       there are 75+ of them and they are likely all harmless
       and/or intentional (usually plain obvious too)
C4996: fixme! warnings about deprecated functions, currently only for GetVersion..
2019-08-25 13:00:31 +02:00
Bram Matthys 6f884a6f60 Windows build: cannot pass by reference directly.
Solves:
warning C4133: 'function': incompatible types - from 'long *' to 'const time_t *const '
2019-08-25 10:36:17 +02:00
Bram Matthys c7a057cab1 Fix for previous commit (windows makefile etc..). 2019-08-25 10:23:25 +02:00
Bram Matthys 33dc939a6d Windows build: remove more warnings. Update Makefile.windows. 2019-08-25 10:04:57 +02:00
Bram Matthys dea31523e3 Add some (redundant) information regarding the last ./Config question.
[skip ci]
2019-08-24 20:02:47 +02:00
Bram Matthys d357ef8957 More config.h cleanups. Lower kill chase time limit from 90 to 30
which seems more reasonable to me.
2019-08-24 19:57:40 +02:00
Bram Matthys 153e38be10 Get rid of "max sendq" ./Config question, which actually was only
setting the default class::sendq that pretty much everyone overrides
in class (isn't this even required? ;D).
Rename to DEFAULT_SENDQ since we have DEFAULT_RECVQ too.
2019-08-24 19:50:39 +02:00
Bram Matthys d19b4e70ad Remove old and broken option SHOW_INVISIBLE_LUSERS 2019-08-24 19:45:26 +02:00
Bram Matthys d06715d9ee REMOTEINC_SPECIALCACHE is no longer optional 2019-08-24 19:41:14 +02:00
Bram Matthys 9e02ca2b3c More FORMAT_STRING() checking, get rid of old (non-)USE_VARARGS stuff.
Fix some more bugs (type differences) when compiling in DEBUGMODE.
2019-08-24 19:37:25 +02:00
Bram Matthys a3b5f29626 Mass change of time_t in printf-like functions to %lld with an
explicit cast to (long long). On *NIX we could get away with
lazily assuming time_t is of the same length as long (and use %ld),
even though the specification says nothing about it.
Unfortunately on Windows things are not that simple:
'time_t' is 'long long' (64 bits) and both 'int' and 'long'
are 32 bits, even when compiling in 64 bit mode.

This problem could be 'fixed' in multiple ways:
One way would be to minimize the usage of time_t and use 'long long'
or 'uint64_t' everywhere for variables to minimize casting later.
I, however, chose to maintain 'time_t' for most of time grabbing
and time calculations (eg: delta), and do the explicit cast in
any printf-like functions that may be there.
Both solutions work. I mostly like the explicit time_t look, so one
can immediately recognize a variable relates to time.
2019-08-24 18:33:52 +02:00
Bram Matthys 85b3b91b19 Windows build: Add format string verification during build.
(Will be used to hunt and fix those time_t integer type mismatches)
2019-08-24 17:10:44 +02:00
Bram Matthys 1f99b282b0 Similarly, get rid of DISABLE_STACKED_EXTBANS ./Config question since
that define no longer exists...
2019-08-23 20:39:27 +02:00
Bram Matthys 444c4f4381 Get rid of some old/rarely used ./Config shit 2019-08-23 20:37:27 +02:00
Bram Matthys a6eac922ea Remove unused function create_snomask() 2019-08-23 20:28:48 +02:00
Bram Matthys ccf80d16f2 SnomaskAdd(): remove 3rd argument (unset_on_deoper), as all snomasks
are IRCOp-only now, they will always be removed on deoper.

-extern Snomask *SnomaskAdd(Module *module, char ch, int unset_on_deoper, int (*allowed)(aClient *sptr, int what), long *mode);
+extern Snomask *SnomaskAdd(Module *module, char ch, int (*allowed)(aClient *sptr, int what), long *mode);
2019-08-23 20:23:54 +02:00
Bram Matthys e889a07849 Updates to ircvsnprintf(): add %lld and remove special handling of %lu.
And some re-indenting when we're at it...
2019-08-23 08:41:47 +02:00
Bram Matthys 9a562dea24 Windows: Move the uninstaller to bin\uninstaller
Windows: Use generic docs URL for documentation
2019-08-22 20:15:46 +02:00
Bram Matthys d6faa00ae8 Use generic includes 2019-08-22 19:15:16 +02:00
Bram Matthys 02a4bbc348 Get rid of this stupid 'TS' type, just use 'time_t'. 2019-08-22 18:39:28 +02:00
Bram Matthys e65f96a9e0 Windows build: 'clean' should really cleanup..
[skip ci]
2019-08-22 18:07:53 +02:00
Bram Matthys 8c70769bef Windows: Use W7 API (or later) so we have inet_pton/inet_ntop. 2019-08-22 18:01:59 +02:00
Bram Matthys 8007a83020 Get rid of include/inet.h and use system headers properly. 2019-08-22 17:48:39 +02:00
Bram Matthys a1920d7733 Windows installer: require Windows 7 or newer (bye XP/Vista)
[skip ci]
2019-08-22 17:34:41 +02:00
Bram Matthys 1c52557c92 Update makecert.bat for Windows with new paths
[skip ci]
2019-08-22 17:10:09 +02:00
Bram Matthys 02d3364373 More Windows fixes... 2019-08-22 16:43:05 +02:00
Bram Matthys d8f080de67 Drop support for systems without snprintf() and vsnprintf()
Those are in POSIX.1-2001. Even Windows has them nowadays...
"Our" implementation doesn't even work properly under Win64.
2019-08-22 16:41:39 +02:00
Bram Matthys f5168b6323 Buildbot: U5: curl-ssl -> curl (always SSL/TLS after all...) 2019-08-22 15:40:03 +02:00
Bram Matthys b8c6e2e88b Updates for BuildBot on Windows:
32 to 64 bit transition, visual studio 2019 and some directory name
updates as we now put all the shit in c:\dev\unrealircd-5-libs,
or c:\projects\unrealircd-5-libs in case of buildbot..
2019-08-22 15:34:05 +02:00
Bram Matthys 87b8d27648 Windows: move *.exe and libraries to bin\ directory, move LICENSE.txt
and Donation.txt to doc\
2019-08-22 15:08:16 +02:00
Bram Matthys bcceea9065 Windows: build fixes and it is now a 64 bit application.
See https://bugs.unrealircd.org/view.php?id=5320
Expect several more major fixes/changes to follow...
2019-08-22 14:43:19 +02:00
Bram Matthys b87b4dd61a Windows: Fix path in makecert.bat 2019-08-22 14:37:49 +02:00
Bram Matthys 5e0ed6d626 UnrealIRCd 5.0.0-alpha1 2019-08-20 19:39:04 +02:00
Bram Matthys 71935d6d48 Use +f in +f examples (duh)
[skip ci]
2019-08-19 16:41:11 +02:00
Bram Matthys 142289c2de Let's just call it a database rather than persistent storage file.
Also, fix a small memory leak if the database was corrupted.
2019-08-19 16:38:57 +02:00
Bram Matthys 86f7d8c5cc Document new 'r' (repeat) flood type and 'd' (drop) action in release notes.
[skip ci]
2019-08-19 16:28:41 +02:00
Bram Matthys 5a8d231c6d Floodprot changes (floodprot.c):
1) Clean up check_for_chan_flood()
2) Make the new repeat action kick by default (instead of forcing 'b'
   if no action is specified)
3) Also make repeat work with timed bans
2019-08-19 16:12:51 +02:00
Bram Matthys dd5d93ae77 Mostly cleanups / unimportant stuff. 2019-08-19 15:27:03 +02:00
Bram Matthys 7cda4eab53 Fix memory leaks in the new tkldb and channeldb modules. 2019-08-19 15:26:15 +02:00
Bram Matthys cbea57fefe Fix read after free in module API code when unloading channel mode,
client capability, history backend or message tag for good.
2019-08-19 15:25:12 +02:00
Bram Matthys 6f87314bbf Funny mistake :D 2019-08-19 10:10:47 +02:00
Bram Matthys e72845bddf link::options::tls was not working (an alias for link::options::ssl) 2019-08-18 19:25:42 +02:00
Bram Matthys fc0c06621b AppArmor: use a more generic rule for data/ now that we have all these
databases, and who knows what else the user has (think: 3rd party modules).
2019-08-18 18:42:33 +02:00
Bram Matthys d8e121fbc5 Another test commit for buildbot. 2019-08-18 16:51:34 +02:00
Bram Matthys fac5036d5f Test commit 2019-08-18 16:40:38 +02:00
Bram Matthys c27e7fa0dd Some small README updates. 2019-08-18 11:19:18 +02:00
Bram Matthys b312a88b0a Update test framework location 2019-08-18 11:18:52 +02:00
Bram Matthys fdabc7e5ad Fix memory leak on server sync. 2019-08-18 09:40:31 +02:00
Bram Matthys 33fcc5b550 Enough updates on labeled-response and echo-message for today.
Note that the labeled-response implementation currently requires
'batch' and will always start a BATCH if there is any response.
Later on we can implement a simple queue so we don't have to
start a batch for 1-line responses (which works, but looks a bit
silly if you look at raw server traffic). That may be after alpha1,
though, as there are more (important) things to work on right now.
2019-08-18 09:24:43 +02:00
Bram Matthys 4ccb290dac Fix two TODO's. 2019-08-18 08:27:43 +02:00
Bram Matthys bdcee3fcfa Send BATCH even if client is lacking message-tags CAP. 2019-08-18 08:27:07 +02:00
Bram Matthys 1a305b0b45 Remove this old code in hunt_server() or we end up sending message
tags twice. (This code was there before sendto_one() got it's
extra MessageTag * parameter)
2019-08-18 08:06:08 +02:00
Bram Matthys d9694a4644 Fix for history module if 'batch' is negotiated but 'server-time' is
not. Previously this would result in receiving an empty BATCH (with
no history content, that is), which is confusing.
2019-08-18 07:25:26 +02:00
Bram Matthys 448ee87ed4 More and more and more
[skip ci]
2019-08-17 15:45:37 +02:00
Bram Matthys 5bc91a02f9 Some minor text changes in release notes.
[skip ci]
2019-08-17 15:44:49 +02:00
Bram Matthys 52aed93707 Add preliminary release notes for UnrealIRCd 5 2019-08-17 15:41:03 +02:00
Bram Matthys e1822997b8 Make 'webredir' module work if 'websocket' module is loaded,
which is quite likely even.
2019-08-17 13:00:33 +02:00
Bram Matthys 15254470a7 Do some minimal checks on the provided set::webredir::url
[skip ci]
2019-08-17 13:00:09 +02:00
Bram Matthys 9fbd7f33fc The set::webredir block should be commented out by default.
[skip ci]
2019-08-17 12:48:30 +02:00
Bram Matthys c941c529c3 Load 'reputation' and 'connthrottle' by default. Add to example.conf. 2019-08-17 12:46:43 +02:00
Bram Matthys 143d747e66 Rename 'cmdrestrict' to 'restrict-commands'. Load the module by default
so you can use set::restrict-commands without having to loadmodule.
Restrict the LIST and INVITE commands in the example.conf, which is
often a good idea. Finally, document the configuration/usage at:
https://www.unrealircd.org/docs/Set_block#set::restrict-commands
2019-08-17 12:34:14 +02:00
Bram Matthys 6c02c896d9 add +H to HELPOP CHMODES 2019-08-17 12:06:05 +02:00
Bram Matthys 8ae9e85a9a Channel history: set default playback on join lines to 15. 2019-08-17 12:05:23 +02:00
Bram Matthys 5f99586982 And another fix for 0d2d4d5bca. 2019-08-17 09:36:29 +02:00
Bram Matthys f10ec9aebc Fix for previous commit (0d2d4d5bca) 2019-08-17 09:31:58 +02:00
Bram Matthys 0d2d4d5bca Rename match() and _match() to match_simple() -AND- invert the return value
of match_simple() and match_esc(). So, developers, be aware, this is how
you should use the function in a correct way:
if (match_simple("*fun*", str))
    printf("It was fun\n");

Rationale:
I've always been annoyed by the inversed logic, even though it was similar
to strcmp. So I've reverted it.
I could have chosen to maintain match() rather than this match_simple()
name, but this way I force (3rd party module) devs to update their function,
while otherwise everything would mysteriously fail due to the inverted logic.
2019-08-17 09:20:49 +02:00
Bram Matthys e1fcc3a667 Rename match() and _match() both to match_simple()
and get rid of the "bahamut optimized version".
Stage 1 of 2.
2019-08-17 09:15:34 +02:00
Bram Matthys c01c9248f5 Revert e428c77c47 (only to try again later) 2019-08-17 09:05:09 +02:00
Bram Matthys e428c77c47 match() -> match_nuh() and _match -> match_simple() 2019-08-17 08:56:18 +02:00
Bram Matthys 870f10b8a5 Extban ~T:block:something is now auto-converted to ~T:block:*something*
since this is pretty much always what you want. Otherwise it's just
too confusing that things don't match.
2019-08-17 08:36:59 +02:00
Bram Matthys 29a3994d24 Fix some logic in add_listmode_ex(). Probably not terribly important
but theoretically one could have seen a "ban list full" error message
multiple times in rare cases.
2019-08-16 20:16:11 +02:00
Bram Matthys 0f7a172c30 Rename who to who_old, since whox is now loaded by default and
loading who_old should only be done if you want the classic old WHO.
2019-08-16 18:14:30 +02:00
Bram Matthys ccb534c3e9 res.{c,h} -> dns.{c,h} and moddata.c -> api-moddata.c 2019-08-16 18:09:25 +02:00
Bram Matthys dfcd465103 Rename some api-*.c files to be more descriptive. 2019-08-16 18:00:26 +02:00
Bram Matthys fffd459bf9 src/extbans.c -> src/api-extbans.c, and the same for extcmodes and umodes.
I suppose what is and what is not an API can be considered a bit arbitrary
but for us it is the stuff we expose via the module api. We now have:
api-clicap
api-command
api-event
api-extbans
api-extcmodes
api-history-backend
api-isupport
api-mtag
api-umodes
2019-08-16 17:52:49 +02:00
Bram Matthys fd37f050b8 Rename src/events.c to src/api-event.c for consistency. 2019-08-16 17:47:07 +02:00
Bram Matthys 4e0f1f5ffa Re-indent events.c and remove ancient event system locking routines. 2019-08-16 17:45:35 +02:00
Bram Matthys 41051cf3c7 Remove some unused variables
[skip ci]
2019-08-16 17:37:36 +02:00
Bram Matthys a408b61f32 For some unknown reason del_ListItem() iterated the entire list. Weird. 2019-08-16 17:36:15 +02:00
Bram Matthys 08b4844050 Update credits for UnrealIRCd 5. 2019-08-16 15:18:58 +02:00
Bram Matthys 3a454e3eb3 free_mtags() -> free_message_tags() 2019-08-16 14:54:28 +02:00
Bram Matthys 887cf24fd7 Add channeldb module (loaded by default): this saves all channel settings
such as name, creationtime, modes, topic, bans/exempts/invex to a database
and restores it on-boot. It only does this for +P (persistent) channels.
2019-08-16 14:42:25 +02:00
Bram Matthys d8f839ed44 floodprot (source code): use proper variable names. Not sure why I
didn't do this back in 2003... ah well, that was 16 years ago,
I forgive myself :D
2019-08-15 18:56:08 +02:00
Bram Matthys 7193600a08 Force buildbot.. 2019-08-15 12:09:21 +02:00
Bram Matthys e22000ed48 Buildbot test... 2019-08-15 12:02:11 +02:00
Bram Matthys d91f21a687 Update more old references to U4.. 2019-08-15 11:55:18 +02:00
Bram Matthys 9e1556a6f7 Dumdeedum 2019-08-15 11:44:20 +02:00
Bram Matthys 6dc7aac372 Update some unrealircd-4 references to unrealircd-5.
.. or actually I just want to test buildbot :D
2019-08-15 11:26:20 +02:00
Bram Matthys 16f3b797e4 Use different OpenSSL functions that are more of a hassle but
also exist in older versions such as 1.0.1.
2019-08-15 09:02:42 +02:00
Bram Matthys ced8b0935d Check for and refuse to run with <2048 bits RSA keys. I hope nobody is
using 1024 bit RSA keys in 2019, but always better to check and inform
the admin about such a big mistake.
2019-08-15 08:52:28 +02:00
Bram Matthys f58fff47d4 Small text change
[skip ci]
2019-08-14 09:28:14 +02:00
Bram Matthys 2127a36f61 Remove ~R extban as it is redundant now that we have ~a.
All services should have account names by now.
2019-08-13 21:08:22 +02:00
Bram Matthys a32e285d63 Document ~f extban in helpop.
[skip ci]
2019-08-13 21:01:49 +02:00
Bram Matthys e5b40f13df Change the new extban from ~L to ~f:#forward:*!*@*.
... this just to annoy Gottem.
2019-08-13 20:56:38 +02:00
Bram Matthys 4d74ca9d9a Take out labeled-response until it is unbroken (as in: don't load
by default for now). Not a high priority item at the moment.
2019-08-13 18:49:18 +02:00
Bram Matthys 4f4a867b58 Update prototype of HOOKTYPE_CHANMSG to include sendflags, prefix and target.
I needed the target for echo-message, and also in the history module we no
longer save to the history any @#channel messages, since otherwise they
could be played back to people we shouldn't see them ;)
2019-08-13 18:45:38 +02:00
Bram Matthys 4c8fe6e8d9 Add CAP echo-message. 2019-08-13 18:36:25 +02:00
Bram Matthys 912eea52d7 More NULs are always a good thing.
[skip ci]
2019-08-13 18:13:01 +02:00
Bram Matthys 5279212b30 More SSL to TLS changes 2019-08-13 13:09:49 +02:00
Bram Matthys 39bb0299f1 /REHASH -ssl -> /REHASH -tls 2019-08-13 12:59:56 +02:00
Bram Matthys 135b4808d0 Update example configs to use tls instead of ssl 2019-08-13 12:58:10 +02:00
Bram Matthys c4b276d2d8 Windows: another conf\ssl to conf\tls instance (in the installer)
[skip ci]
2019-08-12 14:54:50 +02:00
Bram Matthys 7fa2b8be05 More ssl -> tls moves. Also recommend to use 'certfp' rather than
the longer 'sslcertfp' or 'tlscertfp', we already support this since
4.0 so... updated the documentation as well.
2019-08-12 14:53:29 +02:00
Bram Matthys 8ff6ad17ee Part 4 of ssl/tls rename (not important)
[skip ci]
2019-08-12 14:44:14 +02:00
Bram Matthys b6c786d2c0 gplplusssl.rtf should mention LibreSSL, not OpenSSL.
[skip ci]
2019-08-12 14:43:10 +02:00
Bram Matthys ef739331b0 Rename ssl_antidos to tls_antidos. 2019-08-12 14:40:11 +02:00
Bram Matthys 2b0afacdf0 Rename of "ssl" to "tls" part 2 2019-08-12 14:35:32 +02:00
Bram Matthys 09cf485d6c Mass rename of "ssl" to "tls" everywhere. Including conf/ssl to
conf/tls. If you are upgrading then conf/ssl will be renamed to
conf/tls and a symlink will be added (so certbot etc won't fail).
This is part 1...
2019-08-12 14:26:31 +02:00
Bram Matthys 86844c3c2b Replace UnrealIRCd 4 -> UnrealIRCd 5 2019-08-12 13:49:35 +02:00
Bram Matthys 684baf9e59 Add a note to ./autogen.sh that this is only for devs, not end-users.
[skip ci]
2019-08-12 13:44:45 +02:00
Bram Matthys 2976c488b0 Delete appveyor.yml, as we are now using buildbot.
[skip ci]
2019-08-12 13:43:11 +02:00
Bram Matthys e44f572725 Rename makefile.windows -> Makefile.windows, consistent with Makefile.in
[skip ci]
2019-08-12 13:41:55 +02:00
Bram Matthys 7f903b422c Strip m_ prefix in modules (part II). Bump reported module version
of each module to 5.0 (or the ones that previously were 4.2, anyway).
2019-08-12 13:36:03 +02:00
Bram Matthys fc5569408d Drop the m_ prefix from modules.
So rename src/modules/m_*.c to src/modules/*.c and update makefiles
and modules.default.conf. Also remove m_ at various places in the
source files, but not the CMD_FUNC(), just the module name.
2019-08-12 13:32:58 +02:00
Bram Matthys 5701fbed20 Update installer script to reflect new windows paths
[skip ci]
2019-08-11 18:16:27 +02:00
Bram Matthys 4488819e69 Oops...
[skip ci]
2019-08-11 18:09:06 +02:00
Bram Matthys 61cf5f16d3 Ok.. I get it.
[skip ci]
2019-08-11 18:02:13 +02:00
Bram Matthys 63cfdb4b68 src/windows/win.h -> include/windows/win.h
and update the include name
@skipci
2019-08-11 17:58:53 +02:00
Bram Matthys 3d7117ea77 Whatever this is, I'm not leaving it alone :D
@skipci
2019-08-11 17:56:38 +02:00
Bram Matthys c68b0e9ab4 Rename windows.{c,h} -> win.{c,h} to avoid confusion 2019-08-11 17:51:48 +02:00
Bram Matthys 645989e602 Rename makefile.win32 to makefile.windows, among several other changes.
(Would surprise me if this compiles without failure, tho)
@skipci
2019-08-11 17:46:12 +02:00
Bram Matthys 1498f1e716 Rename directories from 'win32' to 'windows' 2019-08-11 17:40:08 +02:00
Bram Matthys 3a29677c79 Windows build fix, just rename the damn file. 2019-08-11 17:35:44 +02:00
Bram Matthys 6c398c58fc Windows makefile: you are weird. 2019-08-11 17:21:17 +02:00
Bram Matthys a53316d256 Rename src/s_svs.c to src/aliases.c, since that is what it contains. 2019-08-11 17:19:42 +02:00
Bram Matthys 03e095cd92 Rename src/s_*.c files: drop the useless s_ prefix. 2019-08-11 17:15:14 +02:00
Bram Matthys 0cd6b9bea1 Integrate s_auth.c into s_bsd.c (only 200 lines and the place fits well) 2019-08-11 17:09:22 +02:00
Bram Matthys 25687c2bed New efuncs: tkl_ip_hash() and tkl_ip_hash_type(), for the rmtkl module. 2019-08-11 14:48:07 +02:00
GottemHams ae8c0af51c Ported rmtkl (remove TKLs in bulk) while waiting for Syzop to implement some changes (compiles with a warning at the moment) 2019-08-10 21:55:34 +02:00
GottemHams f6df735291 floodprot: Floodtype 'r' for handling per-user repeated PRIVMSGs (CTCP/notice/ACTION/regular message) + action 'd' for dropping stuff for floodtypes 't' (per-user text) and 'r' 2019-08-10 19:25:51 +02:00
Bram Matthys 3c47e22b75 These TODO/FIXME's can be removed (well, except 1)
@skipci
2019-08-10 14:14:54 +02:00
Bram Matthys 5af31c4a30 These FIXME's can be removed.
@skipci
2019-08-10 14:12:29 +02:00
Bram Matthys c50f65c5bf Update two small FIXME's (nothing worth mentioning) 2019-08-10 14:09:00 +02:00
Bram Matthys 1cbfc85352 This FIXME was resolved AFAICT. In message-tags.c we do:
if (m->clicap_handler && (acptr->local->caps & m->clicap_handler->cap))
 return 1;
... so if messagetaghandler->clicap_handler is NULL then this won't be 1.
2019-08-10 13:34:01 +02:00
Bram Matthys 4d105afcf2 Update comments (duplicate words, blah)
@skipci
2019-08-10 13:29:14 +02:00
Bram Matthys a185e341e6 Update client_accepts_tag() to use the mtags API rather than
hardcoded if() statements.
2019-08-10 13:21:04 +02:00
Bram Matthys bcf21c9d7e Add fix for "bug" caught by fuzzer (incorrect @time in S2S traffic). 2019-08-07 17:33:11 +02:00
GottemHams 2c8f909759 Ported a major chunk of m_forward's functionality to chanmodes/link, with a bunch of improvements =] 2019-07-27 21:10:13 +02:00
GottemHams af2ef7d186 Updated cmdrestrict example configuration to reflect recent changes 2019-07-27 14:02:15 +02:00
GottemHams 3a1ae06345 cmdrestrict should be able to override any command, also couple of minor improvements 2019-07-27 13:56:30 +02:00
i 8c11ebd0e7 Make allow {} block always continue when there were no password or wrong password was specified. 2019-07-18 18:47:05 +03:00
i c9908a55c9 Added HOOKTYPE_CONFIGPOSTTEST for webredir module, to check if there is no set::webredir. 2019-07-16 01:18:41 +03:00
i e30de7b7a6 Removed default url for webredir module and refuse to load without url. 2019-07-15 21:59:41 +03:00
GottemHams 1079cded02 Nested comment blocks don't work anymore :D 2019-07-15 18:36:15 +02:00
GottemHams 19aad17d4e cfgstruct is not necessary for cmdrestrict :D 2019-07-14 23:08:42 +02:00
GottemHams 655027f5db Merge branch 'unreal50' of github.com:syzop/unrealircd-next into unreal50 2019-07-14 23:05:08 +02:00
GottemHams e5cfc5d798 cmdrestrict v1.0: Restrict specific commands until certain conditions have been met =] 2019-07-14 23:04:15 +02:00
i 53146f252c New module webredir (do 301 redirect for HEAD/GET/POST/PUT commands to the specified URL). 2019-07-14 22:37:55 +03:00
Bram Matthys 2894c16638 Lower set::ident::read-timeout to 7 seconds, which should be plenty
on the Internet of today.
2019-07-14 19:22:36 +02:00
Bram Matthys 1c5c501dc1 Remove m_nopost module as it is no longer useful.
UnrealIRCd already protects (for maaaany years) with ping cookies against
this attack. Making the m_nopost redundant.
Also, another module may be more useful (more on this soon...).
2019-07-14 19:07:32 +02:00
i d22a2a20f0 Make usermode +T block channel CTCP's as well. 2019-07-14 19:01:31 +03:00
Bram Matthys d9bd18c483 Remove TODO comment, now that it has been done [skip ci] 2019-07-13 16:00:49 +02:00
Bram Matthys c2445fa9c6 Add history_backend_null, which can be useful on servers where you
explicitly do not want to remember any channel history, such as on
a hub server to save memory.
Also, on Windows, ensure to compile all history_backend_*.c
2019-07-13 15:53:23 +02:00
Bram Matthys 3b67e83275 Add some FIXME's to labeled-response. Not going to work on that right now,
since there is more important things to do...
[skip ci]
2019-07-13 15:40:58 +02:00
Bram Matthys 806256e9c2 Move generate_batch_id() to core. Use chathistory BATCH type, if supported. 2019-07-13 15:25:56 +02:00
Bram Matthys ccfeac6eae Don't re-order mtags on history playback
Strictly, this is not a problem, but.. for our test framework it is better
and it looks cleaner too.
2019-07-13 08:20:12 +02:00
Bram Matthys 65b5e21464 Fix double 'time' mtag on history playback 2019-07-13 08:18:53 +02:00
Bram Matthys 0cda60301d Add set::broadcast-channel-messages [auto|always|never]:
This determines when UnrealIRCd will use broadcast instead of multicast
for delivering channel messages to servers.
The default is 'auto' which uses multicast but switches to broadcast
when channel mode +H is set. This is what people should normally use.
If you set it to 'never' then +H will not work properly if there are
servers with 0 users on them.
2019-07-13 07:59:12 +02:00
i 006b7e5a7c Hide serveropts from normal users. 2019-07-12 01:09:33 +03:00
i ca094f0a75 New set::ping-warning option (how fast the server should reply to PING before sending a warning to opers). 2019-07-11 16:47:02 +03:00
i 876758b73e Fix Custom OpenSSL binary path was ignored. 2019-07-11 14:20:01 +03:00
i a601f565e1 Do not override all libs. 2019-07-11 03:06:28 +03:00
i 57f6718086 Update configure script for previous commit. 2019-07-11 02:36:51 +03:00
i 4feba3edd5 Check whether linking with OpenSSL functions requires -ldl or -lpthread or both 2019-07-11 02:33:11 +03:00
i dbbcc6918a Fix Custom OpenSSL library path was ignored 2019-07-11 00:53:41 +03:00
i 60ebc1375e Support channel status prefixes for SAJOIN. 2019-07-10 17:42:46 +03:00
Bram Matthys 769955eab5 Require at least one SSL/TLS port to be open. In other words, change
https://www.unrealircd.org/docs/FAQ#Your_server_is_not_listening_on_any_SSL_ports
from a warning to an error.
2019-07-10 06:53:01 +02:00
Bram Matthys 3cff80ad8d Use SSL_CTX_set_min_proto_version() in a more inteligent way.
It shouldn't matter now, but if OpenSSL some day deprecates the old
way then at least it won't have silent disastrous effects.
2019-07-09 20:24:00 +02:00
Bram Matthys dc2c2c3f89 Re-indent ssl.c 2019-07-09 20:13:02 +02:00
Bram Matthys d09b9d53a4 Make SSL/TLS mandatory for UnrealIRCd to run. Previously you could get
around this by simply having no certs etc. I doubt anyone used it and
that was not a recommended configuration.
(More to come)
2019-07-09 20:06:11 +02:00
Bram Matthys 657985bf53 Make Debian 10 compile with -Werror. Add -Wno-cast-function-type 2019-07-07 18:17:32 +02:00
Bram Matthys efe73de70d -Wno-unused-but-set-parameter
[skip ci]
2019-07-07 18:11:54 +02:00
Bram Matthys 79bd78c0f3 Make it so UnrealIRCd has full control over the SSL/TLS versions in use
and not just the operating system.
This makes us use SSL_CTX_set_min_proto_version(), which unfortunately is
a less fine-grained control for disabling specific SSL/TLS versions.
However, after that we use SSL_CTX_set_options with SSL_OP_NO_xxx.
The latter is deprecated though. Will revisit this change before U5 release..
2019-07-07 10:22:29 +02:00
Bram Matthys 73bbf10170 Build tests: --enable-werror 2019-07-07 09:54:40 +02:00
Bram Matthys fa39bafe99 tls-tests: Check not only against baseline but against all
[skip ci]
2019-07-07 09:34:30 +02:00
Bram Matthys 6a44b002da Add cipherscan profile for openssl 1.0.1, as used by Debian 8 (jessie).
Main difference is that the curve used for ECDHE is fixed at prime256v1
rather than a list of multiple choices (this due to an openssl 1.0.1
limitation).
[skip ci]
2019-07-07 09:27:57 +02:00
Bram Matthys 0235c6f233 Remove 2 cipherscan profiles (only to reintroduce them later)
[skip ci]
2019-07-07 09:24:33 +02:00
Bram Matthys 3b3f63b990 Add HAVE_EXPLICIT_BZERO. Fix compile problems on Debian and other older
systems without explicit_bzero. Current usage is only in the PRNG which
is not very important anyway. We can re-visit later by attempting to
provide a fallback portable version, but from what I've seen this is
pretty ugly.
2019-07-07 09:18:34 +02:00
Bram Matthys 7ac11973d0 Fix crash in TOPIC with certain remote server traffic.
And make sure we don't change topic text if it comes from a remote link.
2019-07-06 17:48:44 +02:00
Bram Matthys 74325280dd Due to new defaults, the baseline for the SSL/TLS changed as well. 2019-07-01 07:45:48 +02:00
Bram Matthys 74cf811759 Failed to initialize a variable in changes last week.
Not caught by tests due to lack of -O2, we should add a buildbot for that..
2019-07-01 07:40:49 +02:00
Bram Matthys fea09b6659 Switch from RSA 4096 to ECC secp384r1 2019-06-30 10:53:58 +02:00
Bram Matthys d3d9b499a7 Move src/ssl.cnf -> extras/ssl.cnf
[skip ci]
2019-06-30 10:25:19 +02:00
Bram Matthys e90f6e0446 Remove 'make encpem'. Nobody uses this as it would mean you always need
to enter the private key password when UnrealIRCd is (re)started.
Similarly, remove all references to it on Windows as well, where people
thought clicking "Encrypt private key" was a good idea. Can't blame them,
it sounds good on first sight :D
[skip ci]
2019-06-30 10:23:15 +02:00
Bram Matthys 696c06b6a6 Load authprompt module by default. 2019-06-29 19:17:52 +02:00
Bram Matthys f0f69bfe48 Change set::ident::read-timeout from 30 to 15 seconds since otherwise
it exceeds set::handshake-timeout which would be very unfortunate for
those (few) poor users that are affected by this.
2019-06-29 18:51:02 +02:00
Bram Matthys 60a89b8c3f Change set::outdated-tls-policy::server and ::oper to deny.
Both servers and IRCOps must not use outdated SSL/TLS protocols or ciphers.
2019-06-29 18:34:27 +02:00
Bram Matthys 94faf02c70 Change set::plaintext-policy::oper to deny. IRCOps really must use SSL/TLS. 2019-06-29 18:31:37 +02:00
Bram Matthys 375b03c132 Fix (just created) bug in extcmode unloading (with param).
Update slot/param mapping. Now unloading should work well...
otherwise it crashed after destroying the channel.
2019-06-29 09:51:23 +02:00
Bram Matthys bbbdba1083 Make chanmodes/link module un-PERM. Thanks due to previous change. 2019-06-29 09:11:20 +02:00
Bram Matthys b605b7fd86 Use delayed module unloading not only for modules with moddata but also
for modules which have extended channelmodes with parameters,
since they have the same problem.
2019-06-29 09:10:18 +02:00
Bram Matthys 96ad3e8f71 Nothing special. Add a comment to blacklist module, in case someone
things it would be wise to make it unPERM ;)
[skip ci]
2019-06-29 08:55:36 +02:00
Bram Matthys 5d6f0a79ad Make jumpserver module non-PERM, thanks to LoadPersistentPointer etc. 2019-06-29 08:52:52 +02:00
Bram Matthys fbf4946777 Update tkldb to use new LoadPersistentInt/SavePersistentInt functions.
And before that, I fixed these functions so they actually work :D
2019-06-29 08:44:12 +02:00
i e03fa760ef update makefile.win32 for extbans/partmsg 2019-06-29 00:53:41 +03:00
i 780d9e95a2 extbans/partmsg: remove unused leftovers 2019-06-29 00:41:23 +03:00
i 7c4bd691fe fix modules.default loadmodule directive for partmsg 2019-06-29 00:39:23 +03:00
i cf3d01da06 extban ~p for hiding part/quit message 2019-06-29 00:30:10 +03:00
Bram Matthys 5182c664d1 Easier API for just-commited persistent variables. Example:
LoadPersistentPointer(modinfo, removefld_list, floodprot_free_removefld_list);
SavePersistentPointer(modinfo, removefld_list);

The above example was for a pointer, there are also functions for int and long,
which are even more simple:
LoadPersistentInt(modinfo, somevar)
SavePersistentInt(modinfo, somevar)
and
LoadPersistentLong(modinfo, somevar)
SavePersistentLong(modinfo, somevar)
both are untested, but will be tested soon...
2019-06-28 22:08:45 +02:00
Bram Matthys 0920967cc4 New module_load_variable / module_save_variable functions
and made floodprot to use these functions.
TODO: 1) Different functions for pointer/int/long, 2) macro?
2019-06-28 21:02:29 +02:00
Bram Matthys c720417487 MOD_UNLOAD() was always called with an invalid modinfo argument. 2019-06-28 21:01:43 +02:00
Bram Matthys 7fe1848340 Make floodprot no longer PERM so it can be reloaded. Useful if we ever
make a mistake in the module so we can upgrade it on-the-fly.
Or if someone wants to get rid of it.
TODO: consider abstracting the saving/restoring of vars.
2019-06-28 20:14:32 +02:00
Bram Matthys 8686bf978e Support for unloading channel modes with parameters (w/o MOD_OPT_PERM) 2019-06-28 20:07:21 +02:00
Bram Matthys 1757abf31a Duh.. 2019-06-28 19:16:21 +02:00
Bram Matthys 1f5acd852b Update tkldb to use (new) MODDATATYPE_LOCALVAR. 2019-06-28 19:11:34 +02:00
Bram Matthys 2a7fc8042d Add new moddata types: MODDATA_LOCALVAR and MODDATA_GLOBALVAR. Untested.
Code using it will soon follow (and then it will be tested :D)
2019-06-28 18:35:37 +02:00
Bram Matthys 38e9c100d4 Get rid of include/threads.h (unused) 2019-06-26 17:27:45 +02:00
Bram Matthys a2510a5dca Delete sock.h, isn't even used anymore.
[skip ci]
2019-06-26 17:25:34 +02:00
Bram Matthys 70cca778cd Test compile w/o sock.h 2019-06-26 17:19:10 +02:00
Bram Matthys c673e5bbc6 Get rid of now meaningless include/hash.h 2019-06-26 17:17:20 +02:00
Bram Matthys 8e44d4d5ab Get rid of weird NullChn, which is now just NULL :D 2019-06-26 17:13:45 +02:00
Bram Matthys ded4a65a60 u_int16_t -> uint16_t and u_int32_t -> uint32_t, remove typedefs for
these types and others, that should no longer be needed thanks to
stdint.h.
2019-06-26 17:06:46 +02:00
Bram Matthys e8f336622a u_int64_t -> uint64_t 2019-06-26 17:03:07 +02:00
Bram Matthys 709c84fff9 Remove stupid hash table layer for channels that only eats 256k+ extra
memory and causes unnecessary slowdown. Stupid ->hits and ->links.
And get rid of "return (xyz)", must be "return xyz" :D
2019-06-26 16:56:17 +02:00
Bram Matthys f1b0b6b76e Make throttling code (connect-flood) use SipHash and increase the
hash table size from 1019 to 8192 to have fewer collisions.
2019-06-26 16:46:28 +02:00
Bram Matthys d5395848b7 Double the size of hash tables to reduce collisions. 2019-06-26 16:16:56 +02:00
Bram Matthys c75a1ebb25 Make src/modules/history_backend_mem.c use SipHash. And also,
make the module permanent.. which is probably a good idea :D
2019-06-26 15:49:54 +02:00
Bram Matthys d2f4f53a4a Document functions in src/random.c 2019-06-26 15:41:47 +02:00
Bram Matthys 000fa08aee Remove FIXME. As there's no need to fix that.
[skip ci]
2019-06-26 15:38:57 +02:00
Bram Matthys 12511940d6 src/random.c: remove rs_stir_pid, since we don't fork anyway.
(or at least not in a way that matters...)
2019-06-26 15:12:43 +02:00
Bram Matthys a843567b70 Update src/random.c to use the ChaCha based random generator. 2019-06-26 15:02:25 +02:00
Bram Matthys 0d7f9e219e Update reputation module to use SipHash 2019-06-26 14:13:12 +02:00
Bram Matthys eafd929e24 Update DNS code to use SipHash 2019-06-26 14:08:03 +02:00
Bram Matthys 703be7eb29 Move some functions from parse.c to hash.c and add documentation
for various functions, such as find_person, find_client, etc.
2019-06-26 13:57:06 +02:00
Bram Matthys f6eac29592 hash_nick_name -> hash_client_name, hash_find_nickserver -> hash_find_nickatserver
Both were confusing :)
2019-06-26 13:45:55 +02:00
Bram Matthys d5b643ceee Rewrite hash table code to use SipHash (more to follow) 2019-06-26 13:24:02 +02:00
Bram Matthys df7bcc1326 Remove temporary FreeBSD workaround.
(reverts adf56ad8fd)
2019-06-26 07:14:35 +02:00
Bram Matthys 2894681c4f Cleanup m_topic. Handle the if's in a smart way rather than indenting X levels. 2019-06-26 06:55:01 +02:00
Bram Matthys e17ba624c7 Fix crash in new get_access(). This crash happens in case of
(malicious) server traffic.
Also seems we have a behvior change here: has_voice and such returned
1 for servers, now it returns 0. I can live with that, but may cause
more issues.
2019-06-24 16:24:01 +02:00
Bram Matthys 849d57be40 Fix msgid inconsistency in KICK. Thank you, new test framework :] 2019-06-24 14:00:47 +02:00
Bram Matthys 4213ca9ab1 Add MyClient() call in QUIT for set::part-instead-of-quit-on-comment-change
handling. Since we shouldn't PART remote users.. ;)
2019-06-23 17:14:35 +02:00
Bram Matthys 6fab82124a Call is_banned with BANCHK_LEAVE_MSG from both PART and QUIT.
The latter only if iConf.part_instead_of_quit_on_comment_change.
2019-06-23 17:10:41 +02:00
Bram Matthys c507db9005 Get rid of Windows compile warning regarding abort(). 2019-06-23 08:57:39 +02:00
Bram Matthys 7875fc9d7d Compile fixes for Windows due to cleanup from yesterday. 2019-06-23 08:03:33 +02:00
Bram Matthys 7161f33311 Code cleanup: make src/*.c use the generic #include "unrealircd.h" file
(with only a few exceptions)
Now, we'll find out later if Windows still compiles, I guess ;)
2019-06-22 21:18:08 +02:00
Bram Matthys e8ff5d77c7 Remove weird option set::snomask-on-connect. Doubt anyone uses it. 2019-06-22 19:36:54 +02:00
Bram Matthys 74586e7ecd Make all snomasks oper only (was just one: +s +k).
Maybe an API change later?
2019-06-22 19:34:04 +02:00
Bram Matthys f9b589d0c6 Remove almost 1000 lines, all functions that are (now) unused.
Also, drop support for snomasks to non-ircops (TODO: more)
2019-06-22 19:32:11 +02:00
Bram Matthys b8d033f11e The blacklist module is missing a call to blacklist_quit. Bug? 2019-06-22 19:11:16 +02:00
Bram Matthys f0f0a93cc5 Makefile: makes no sense to create modules/cap only to remove it later
[skip ci]
2019-06-22 17:57:42 +02:00
Bram Matthys e03c8135a9 CHFL_CHANPROT -> CHFL_CHANADMIN, is_chanprot -> is_chanadmin
These are just remnants of the past, when +a was called channel protection.
It is called channel admin since as long as I can remember, and in 90%
of the code and documentation it is called that way.
2019-06-22 17:32:57 +02:00
Bram Matthys cf29aa8feb Replace various 90% identical functions with some macro's instead. 2019-06-22 17:29:03 +02:00
Bram Matthys 19af2c6b5c Fix return value in can_send() and add tracing for modules that don't behave. 2019-06-22 17:21:57 +02:00
Bram Matthys 05202dd2a4 Move can_send() function from core to m_message. 2019-06-22 16:03:06 +02:00
Bram Matthys bf4d96e991 can_send() now returns 0 (false) or 1 (true), rather than magic values.
Also, the HOOKTYPE_CAN_SEND prototype changed so you can communicate
the error message in a flexible way, similar to what I just did
with extbans.
2019-06-22 15:57:32 +02:00
Bram Matthys f08557f2fd Propagate is_banned() errmsg to m_message layer. 2019-06-22 15:36:21 +02:00
Bram Matthys 7fd794c563 Make /VERSION send 005 properly. 2019-06-22 15:16:16 +02:00
Bram Matthys be49ef0bb8 More extban API changes... fun... 2019-06-22 15:11:16 +02:00
Bram Matthys 383f54a6c9 Fix bug caused last few weeks where user would receive a privmsg with
a SID/UID rather than server-/nickname.
2019-06-22 14:21:07 +02:00
Bram Matthys 086d370704 Change extban API: pass 'msg' in BANCHK_MSG and (new) BANCHK_LEAVE_MSG. 2019-06-17 20:19:34 +02:00
Bram Matthys 1cfebcf05e Add new set::part_instead_of_quit_on_comment_change to convert QUIT to PART
in case of a change in the quit comment, such as color stripping / blocking.
The default is 'no', but some users may like this to be 'yes' so things like
+S only affect the channel and not the quit for all channels.
This hereby also lays the groundwork for some next commits of 'i' :)
The configuration item name may still change if I think of a better one....
2019-06-17 08:20:42 +02:00
Bram Matthys b8cdb21754 Fix crash on "TKL" command without parameters. Due to rewrites from yesterday. 2019-06-17 07:46:32 +02:00
Bram Matthys c2ba6b40b8 Silently force a 'make clean' as otherwise part (or whole) of the
compiled source could be using different settings than the user
just requested when re-running ./Config.
2019-06-16 10:13:57 +02:00
Bram Matthys 7b42c252ea Some documentation updates, nothing important
[skip ci]
2019-06-16 10:08:50 +02:00
Bram Matthys 1d046b6f61 Move ban [nick|user|ip] { } block parsing to m_tkl. 2019-06-16 09:33:30 +02:00
Bram Matthys d106609d89 Move all spamfilter { } block parsing to m_tkl. 2019-06-16 09:21:39 +02:00
Bram Matthys 36808a60ac Remove all tk->flags & TKL_FLAG_CONFIG entries on rehash.
Make local spamfilter blocks use this too. Already did so for
ban xxx types that will cause kline/gline/zline and qline.
This also simplifies handling in the tkldb module.
2019-06-16 09:09:09 +02:00
Bram Matthys d0d454f696 Fix 100% CPU loop problem on REHASH due to bug in history backend (deja-vu). 2019-06-16 08:44:57 +02:00
Bram Matthys bd785a9309 Some initial work for the upcoming TKL 'e'/'E'/TKL_EXCEPT type. 2019-06-16 08:42:41 +02:00
Bram Matthys 18ae7b8925 Document *ALL* functions in m_tkl and remove efuncs that are no longer
needed: tkl_expire and tkl_check_expire, which are now self-contained
in the m_tkl module.
2019-06-16 08:35:56 +02:00
Bram Matthys b102e79f8e Use check_banned() from s_bsd too, less duplicate code. 2019-06-15 18:44:33 +02:00
Bram Matthys 24726d533d Make the require authentication { } block use the TKL layer.
Remove CONF_BAN_UNAUTHENTICATED.
2019-06-15 18:31:06 +02:00
Bram Matthys 8c2ce9a7d5 [tkldb] skip if (tkl->flags & TKL_FLAG_CONFIG) 2019-06-15 18:27:43 +02:00
Bram Matthys 8e6302d003 Rip out CONF_BAN_NICK, CONF_BAN_IP, CONF_BAN_USER, now that they are moved
to the TKL layer.
2019-06-15 18:18:19 +02:00
Bram Matthys 97fc19591c Add support for tkline->flag TKL_FLAG_CONFIG: item from configuration
file that cannot be deleted via commands such as /KLINE -...
And transform some ban XX entries to use the TKL system
TODO: test & rip out the old stuff
2019-06-15 18:08:43 +02:00
Bram Matthys a40cd9fae4 Rename dospamfilter() to run_spamfilter(), which is more meaningful. 2019-06-15 17:43:34 +02:00
Bram Matthys 630ab8f869 Fix some indentation 2019-06-15 17:37:02 +02:00
Bram Matthys 060502aedd Remove unused variables and some shadow... 2019-06-15 17:27:54 +02:00
Bram Matthys 4f4cda7f7d Cleanup part 2 of m_tkl. Splitting up in m_tkl_add / m_tkl_del and
various whitespace / indenting fixes.
2019-06-15 17:18:48 +02:00
Bram Matthys 876fda63ec Export tkl_type_string via efuncs (actually, the name may change...) 2019-06-15 17:06:41 +02:00
Bram Matthys 7542cdeaca Cleanup of m_tkl part 1. New tkl_chartotype (the reverse of tkl_typetochar).
Move stripcrlf() to core instead of at 3 places, rename calls of iCstrip()
to that. Hopefully I didn't break anything.. :D
2019-06-15 16:56:34 +02:00
Bram Matthys 41ba282ed6 Obey MAXMODEPARA under all circumstances. 2019-06-15 15:17:24 +02:00
Bram Matthys ca9b04a0fa Module API: EventAddEx() -> EventAdd() 2019-06-12 19:09:33 +02:00
Bram Matthys e3013ae067 Commit current work of history API and channel history mode (+H count:time)
Note: there are still some TODO items
2019-06-12 18:59:12 +02:00
Bram Matthys ed4bc8e8c5 Prevent running ./Config as root and print out a clear instruction.
Since UnrealIRCd 4 (and probably before) our instructions always mentioned
that you should not build or run UnrealIRCd as root.

Even system integrators are unlikely to build as root, but just in
case, the safety the check is in ./Config and not in ./configure.
2019-06-12 13:16:58 +02:00
Bram Matthys bfebfa1f00 Slightly better wording 2019-06-12 13:11:21 +02:00
Bram Matthys 3b7e959dd7 Merge branch 'unreal50' of github.com:syzop/unrealircd-next into unreal50 2019-06-12 13:09:40 +02:00
Bram Matthys 148dfc53a4 Make clear the user should not compile or run as root. Seems some
people miss this when they only read the README and not the
installation instructions from the wiki
( https://www.unrealircd.org/docs/Installing_from_source )
2019-06-12 13:08:22 +02:00
GottemHams bb4bd4dffc [tkldb] Forgot a check for local Q-Lines, also bail early when reading local spamfilters/Q-Lines 2019-06-11 15:54:53 +02:00
Bram Matthys 66be5a2ca6 Re-indent the FLAGS_* stuff in include/struct.h
And remove FLAGS_PING which was unused.
2019-06-10 18:50:05 +02:00
Bram Matthys fce0253b5a Remove unused FLAGS_CHKACCESS / SetAccess / ClearAccess.
Also, DoAccess() was already commented out in UnrealIRCd 4 or something.
This results in an empty finish_auth() function but that should be OK,
as ident checking takes place before parsing any other input IIRC.
2019-06-10 18:39:03 +02:00
Bram Matthys e5e260eaa1 Remove FLAGS_NONL / NoNewLine(), which isn't used since 4.0.0 or so.
And add a FIXME, or at least a TODO-investigate-this item ;)
2019-06-10 18:33:46 +02:00
Bram Matthys ac19f91eb8 Turns out it's not that easy.. ;) 2019-06-08 16:49:46 +02:00
Bram Matthys 573a601127 Nothing important, just a silly m_dummy :D 2019-06-08 14:37:22 +02:00
Bram Matthys 12dbbca15e Rip out support for changing offsets via TSCTL and tune file. Use NTP!!
Adjustments via TSCTL are never accurate enough.
2019-06-08 09:26:55 +02:00
Bram Matthys 3749f8d674 Remove timesync support. Use your OS time synchronization instead!
Timesync was previously disabled by default in March 2018.
2019-06-08 09:11:46 +02:00
Bram Matthys d796247ddf Re-indent 2019-06-07 15:08:23 +02:00
Bram Matthys a2ee5d67f3 Update a few hooks to include mtags, more will follow later.
This fixes inconsistent mtags accross server links with delayjoin.
2019-06-07 15:05:10 +02:00
Bram Matthys 1f2bb0d89b Delayjoin: if kicking invisible user we used to clear the invisibility
status of the victim (JOIN+KICK). That seems unnecessary to me, since
there is already code in place to handle this -- hopefully it works too.
2019-06-07 14:41:01 +02:00
Bram Matthys 61b4a6ea29 Add mtags in non-chan PRIVMSG. Remove sendto_message_one since you can
just use sendto_prefix_one. Actually it was only used at 1 place (m_message).
2019-06-07 14:25:28 +02:00
Bram Matthys 0e68265e12 Remove sock.h old compatibility code. Shouldn't be needed anymore.
(This provided FD_ZERO and such if the OS/libc did not provide it)
2019-06-07 12:42:28 +02:00
Bram Matthys 5ad0278f9e No longer check for big enough FD_SETSIZE. We all use poll/kqueue/epoll/etc now. 2019-06-07 12:39:39 +02:00
Bram Matthys de89de9558 Fix MODE not sending message tags across servers 2019-06-07 12:34:22 +02:00
Bram Matthys 13f3356963 Merge branch 'unreal50' of github.com:syzop/unrealircd-next into unreal50 2019-06-07 12:24:41 +02:00
Bram Matthys adf56ad8fd Re-enable FreeBSD workaround for mysterious test failures. 2019-06-07 12:24:25 +02:00
GottemHams d292d2ee9c Forgot to change a couple X:Line things to X-Line 2019-06-05 19:27:00 +02:00
GottemHams 8846506292 Might be a good idea to also skip local Q:Lines (ban nick {} blocks) :D 2019-06-05 19:19:03 +02:00
Bram Matthys e423f69082 [tkldb] Add some extra check for trailing DB data.
If everything goes correctly then after reading all TKL entries we
should be at the end of file. If there is still data after that,
something went wrong... quite wrong.. :D
2019-06-05 09:39:59 +02:00
Bram Matthys 673779eab9 Write string lengths as 16-bit rather than 64-bit: saves about 34% space
of the database file, with possible some small speed improvement as well.
2019-06-05 09:35:43 +02:00
Bram Matthys ec5811dc3b [tkldb] Save every 5 minutes now that writing is fast enough :)
And mention the benchmark figures in the .c file.
2019-06-05 09:01:04 +02:00
Bram Matthys eaa1b213b9 [tkldb] Use buffered I/O. Writing the DB is now 29 times faster.
Saving 100k zlines now takes 72ms instead of 2100ms
Loading 100k zlines now takes 510ms instead of 1300ms
2019-06-05 08:53:30 +02:00
Bram Matthys 1f6bb6d3cc Some benchmarking 2019-06-05 08:45:48 +02:00
Bram Matthys 498f728cbb [tkldb] If DB is corrupt then rename to .corrupt and start a new one.
This, rather than having the module not loaded at all, which could mean,
especially if missed the warning on boot, that you run for weeks or
months without having your TKL's stored, which would be a shame ;)
Also a failure to rename() is not fatal, as it likely means that we
don't have permissions, in such a case you will see a repeated error
every X minutes due to the write, which is good.
2019-06-05 08:22:22 +02:00
Bram Matthys 21f24cc596 Fix for NICK+USER order. Should be correct? Should check identd.. 2019-06-04 20:05:27 +02:00
Bram Matthys 5f8dd67051 if( -> if ( :D
[skip ci]
2019-06-04 20:04:22 +02:00
Bram Matthys e9da2eb3cb [tkldb] "skipped".. why? "expired" :D
And don't bother users too much about this, unless in DEBUGMODE.
2019-06-04 20:00:15 +02:00
Bram Matthys 6b1af917fc Do it the other way around than previous commit. Force 32 bit type.
So it's compatible with machines where int is 64bit (ILP64),
mostly for the future I guess.
2019-06-04 19:52:59 +02:00
Bram Matthys 628f367849 tkldb: version field should also be forced 64 bit or you'll have the same
problem with porting 32 to 64 again...
2019-06-04 19:34:37 +02:00
GottemHams 52b39acf78 Fixed return values/checks for helper functions/macros, return empty string instead of NULL when reading zero length strings, discard tkl->subtype and store spamf as a char instead of unsigned int, remove rewriting after DB read, also renamed TKLines/TKLs/etc to *-Lines for uniformity with other code 2019-06-03 20:45:56 +02:00
Bram Matthys bb91ac1c56 Update this a bit. Will take a look again later.
[skip ci]
2019-06-03 18:48:18 +02:00
Bram Matthys 9f64711113 Remove FreeBSD 12 workaround 2019-06-03 15:17:02 +02:00
Bram Matthys 597186d9c3 BuildBot: Fix run-tests on FreeBSD 12 2019-06-03 14:45:56 +02:00
Bram Matthys 253df2c8db BuildBot: -j3 -> -j4
[skip ci]
2019-06-03 13:31:58 +02:00
Bram Matthys 55757a5605 Remove references to old test framework.
[skip ci]
2019-06-03 13:30:15 +02:00
Bram Matthys 73cea64c9f Updates for IRC test framework: changed port to 5901 of irc1 2019-06-03 13:03:43 +02:00
Bram Matthys bc8e4a5c47 Updates for new IRC test framework 2019-06-03 12:59:22 +02:00
Bram Matthys 321cf75fb7 Resolve resolve merge conflict :D
[skip ci]
2019-06-01 08:57:19 +02:00
Bram Matthys 13f96b0a57 Small adjustments to tkldb: convert some to safefree(),
get rid of sizeof(char) - which is guaranteed to be 1 by C99 and
on any decent compiler and always use MyMallocEx even when it's not
necessary :D.
2019-06-01 08:53:17 +02:00
Bram Matthys e78e303314 Re-indent tkldb, sorry could not resist :D 2019-06-01 08:46:22 +02:00
Bram Matthys 2556ae9d70 [tkldb] Allow boot without existing database. Change return values to 1/0 (true/false). 2019-06-01 08:39:32 +02:00
Bram Matthys b8e65a2f7f Buildbot: *NIX build test: add -DNOREMOVETMP to make valgrind do a better
job at printing module information (I hope).
2019-06-01 08:24:31 +02:00
Bram Matthys 7c32e4d63f Windows build: fix makefile.win32 2019-06-01 08:23:33 +02:00
GottemHams 4dbe8a8238 Resolve merge conflict :D 2019-05-31 22:39:27 +02:00
GottemHams c697e2ea99 Renamed m_storetkl to just tkldb 2019-05-31 22:25:18 +02:00
GottemHams bf6f885b98 Storetkl now also supports the hashed *@IP Z:Line thingy, also added errno calls to all error output 2019-05-31 22:06:59 +02:00
GottemHams c43a1b15af Store TS types in a uint64_t before DB writing to prepare the module for a Year 2038 fix, also upgraded num/rewrite ints to 64 bit since they *might* be as big as tklcount 2019-05-31 21:23:19 +02:00
Bram Matthys c6389270f9 Remove a few useless #define's (And final test of buildbot today :D) 2019-05-30 21:02:27 +02:00
Bram Matthys c3add3b41c Windows build: Randomly remove some slashes, for no reason.
[skip ci]
2019-05-30 20:12:25 +02:00
Bram Matthys 7d7d736df3 More windows build fixes
[skip ci]
2019-05-30 20:03:50 +02:00
Bram Matthys 858b63e1d5 Windows: remove .CHANGES.NEW
[skip ci]
2019-05-30 19:56:54 +02:00
Bram Matthys 9af24a56f9 Buildbot: makefile.win32 updates
[skip ci]
2019-05-30 19:42:17 +02:00
Bram Matthys 57e06a7070 Windows: add api-mtag to makefile.win32 2019-05-30 19:36:15 +02:00
Bram Matthys f0a773ee59 Windows: Add conf_preprocessor to makefile.win32 2019-05-30 19:33:21 +02:00
Bram Matthys a2a7acc4bd Buildbot: more windows updates 2019-05-30 19:30:20 +02:00
Bram Matthys e8e113a8c0 Buildbot: ............................. 2019-05-30 19:23:15 +02:00
Bram Matthys 120ec5cea3 ............. 2019-05-30 19:22:14 +02:00
Bram Matthys d02b4de5d3 Buildbot: updates for windows 2019-05-30 19:20:15 +02:00
Bram Matthys 2682d7bc6d Buildbot: Updates for windows 2019-05-30 19:08:33 +02:00
Bram Matthys 9530006e70 BB: Terminate unrealircd at end of test (otherwise it may hang buildbot) 2019-05-30 16:48:05 +02:00
Bram Matthys 03fbc35fb7 Buildbot: Run cipherscan not on FreeBSD for now, so we can test the rest. 2019-05-30 16:14:06 +02:00
Bram Matthys 3f723323d0 BuildBot: Use gmake on FreeBSD and temporarily disable select-config. 2019-05-30 16:08:54 +02:00
Bram Matthys ecac3f9d4a Mention U5 in ./Config -quick restriction 2019-05-30 08:52:08 +02:00
Bram Matthys 1b0a7cb9b8 Fix build tests due to previous change. 2019-05-30 08:51:05 +02:00
Bram Matthys 195cd17d02 Rename LIBDIR to PRIVATELIBDIR in config.settings to avoid confusion. 2019-05-30 08:46:13 +02:00
GottemHams 4004152a7a Updated m_storetkl's descriptions for added clarity 2019-05-28 21:44:27 +02:00
GottemHams 0f97c03487 Probably a good idea to add storetkl stuff to Windows makefile too huh 2019-05-28 21:38:38 +02:00
GottemHams d8ff67d088 Added m_storetkl to modules.default.conf 2019-05-28 21:35:37 +02:00
GottemHams 35600fdfa0 Updated storetkl: write DB on a timer instead of hooking TKL_ADD/DEL, better DB format for improved compatibility with future Unreal versions, configurable .db path, support for softbans, write DB to a tempfile first to prevent corruption of existing DB, also applied some misc optimisations/portability improvements 2019-05-28 21:34:11 +02:00
Bram Matthys 6cf386ee87 ... 2019-05-27 19:22:04 +02:00
Bram Matthys 9e87f92c64 Fix small memory leak in SJOIN. 2019-05-27 19:20:25 +02:00
Bram Matthys f046482761 Freeing memory is usually a good idea (duh) 2019-05-27 07:43:44 +02:00
Bram Matthys 55a183bde4 Add "PROTOCTL MTAGS" to indicate message-tags & big buffer support.
This so we can link to UnrealIRCd 4.x....
2019-05-26 13:56:09 +02:00
Bram Matthys 57fd5f4f2b Add HOOKTYPE_IS_HANDSHAKE_FINISHED: if a module returns 0 then register_user()
will not be called. This is used, for example, by m_cap when the CAP LS
handshake is still in progress. Modules can add their own requirements
as they see fit.
Note that, as for (CAP) functionality, this adds nothing new, it just
implements it in a cleaner way, rather than all over the place,
like in UnrealIRCd 4.x.
2019-05-26 12:07:44 +02:00
Bram Matthys dde1cf3194 Fix some mtag FIXME's. 2019-05-26 11:45:58 +02:00
Bram Matthys 622cb43a48 Manual audit of exit_client() done, for mtags. 2019-05-26 11:36:40 +02:00
Bram Matthys 61b15d9f4d Mass update (automatic) of exit_client().
Next step is manual audit...
2019-05-26 10:45:54 +02:00
Bram Matthys be4ef2e7e3 Add message tags support in exit_client(). Yay.. another API change! 2019-05-26 10:36:39 +02:00
Bram Matthys 9f54a19801 New unified function for common: sendto_local_common_channels()
and make this support mtags so it now works for NICK, ACCOUNT, AWAY.
Still to do: exit client for QUIT.
2019-05-26 10:08:02 +02:00
Bram Matthys 39cd11f504 Fix OOB read due to message tag with trailing backslash. 2019-05-25 15:48:33 +02:00
Bram Matthys b63a67dea0 More parse/parse2 fixes like 6e219cd834.
This fixes an OOB write (NUL byte write) due to trusting 'length'.
It is now removed and renamed to bytes, it's only for adding lag.
2019-05-25 15:40:18 +02:00
Bram Matthys 39af766ced Add a FIXME 2019-05-25 15:40:10 +02:00
Bram Matthys a74bae0447 Some cleaning in m_sajoin. Whitespace and if() order. 2019-05-25 12:32:18 +02:00
Bram Matthys f320e32b7e Clean up compiler flag checker.
(Since we don't need the C++ check, we use C only)
2019-05-25 11:36:13 +02:00
Bram Matthys e0c2ccd99b Remove unused configure checks: HAVE_C99_VARLEN_ARRAY, HAVE_RAND_EGD,
and an AC_SUBST for MKPASSWDLIBS.
2019-05-25 11:27:53 +02:00
Bram Matthys 05e3ed63a0 Default to --with-system-pcre2. Now all shipped libs default to system libs. 2019-05-25 11:01:11 +02:00
Bram Matthys 5513b21936 Remove old extras/regex 2019-05-25 10:50:01 +02:00
Bram Matthys 1108b58951 Remove old TRE regex engine. Hasn't been maintained since 2010
and has various outstanding crash and 100% CPU issues.
We have been encouraging the PCRE2 engine since the start of
UnrealIRCd 4 already.
TRE is being phased out of U4 by the end of the year, so we can
safely remove it in U5 already.
2019-05-25 10:42:46 +02:00
Bram Matthys 185b4e05c0 Whoops, this #comment in 'make install' showed up to end-users. 2019-05-25 10:19:33 +02:00
Bram Matthys 4b45555edd Fix issue if compiling without TRE but with shipped argon2 (or other
combinations). Need to create libdir in ./Config ;)
2019-05-25 10:17:33 +02:00
Bram Matthys 6e219cd834 Remove confusing 'bufend' variable from parse and parse2 functions.
Such a variable suggests that we will never read past that, but that
is not the case, since we (correctly) assume that the buffer is
NUL terminated, which is ensured by dbuf_getmsg().
The 'length' is still available for informational purposes, to avoid
strlen()'s at various places.
Hm, I guess length can cause the same confusion as bufend, but still..
I like it better :D
2019-05-25 09:50:36 +02:00
Bram Matthys a2f37722ae Fix unitialized variable issues in message-tags handling. 2019-05-25 09:08:43 +02:00
Bram Matthys 8b1cd80700 Make labeled-response work again after API change.
TODO: handle both draft/ and without draft/, maybe upstream?
2019-05-25 09:08:26 +02:00
Bram Matthys 427885681d Make account-tag not inherit. I don't think there's a bug right now,
but it's not logical and makes it too easy to make a mistake.
2019-05-25 08:05:26 +02:00
Bram Matthys daab5abc92 Manual audit of sendto_one(): add mtags support where necessary. 2019-05-24 21:09:55 +02:00
Bram Matthys 6e5df1a4c0 Add mtags argument to sendto_one(). Phase 1 (automated), next is manual
audit of all sendto_one's. Also it doesn't work yet...
2019-05-24 17:38:48 +02:00
Bram Matthys c307d6c61b Make WHOX the default. Warn if you try to load both modules.
Now uses CommandAdd() instead of an override, which was just an
interim solution earlier.
2019-05-23 19:08:49 +02:00
i c528b22cdd CIDR support for /WHOX ip matching. 2019-05-22 23:01:55 +03:00
Bram Matthys 418b42e5bf More sendnumeric() and sendnumericfmt() conversions. 2019-05-22 17:09:12 +02:00
Bram Matthys 4a11309344 Transform sendto_one's to sendnumericfmt() - stage 1 2019-05-22 16:39:06 +02:00
Bram Matthys f8bee4941a Some fixes due to the sendnumeric() migration (see previous commits). 2019-05-22 12:58:38 +02:00
Bram Matthys 39029555cb A few more sendnumeric() conversions, putting numerics in main file. 2019-05-22 12:39:01 +02:00
Bram Matthys 7e4bfbc7c3 Move more to sendtxtnumeric()... and some sendnumeric() leftovers. 2019-05-22 12:10:57 +02:00
Bram Matthys 1a4cbb7023 sendnumeric() - phase 2 2019-05-22 11:41:46 +02:00
Bram Matthys c27bb26abc sendnumeric() - stage 1 2019-05-22 10:43:07 +02:00
Bram Matthys 5fb9b12d5e Mass-replace sending of notices with sendnotice(), which exists for quite a while now ;) 2019-05-22 09:34:34 +02:00
Bram Matthys a320bec089 More message tags support in the API. sendto_server() now has mtags
and sendto_match_butone as well.
Still about 15 FIXME's that need to be resolved, but committing early.
2019-05-21 19:00:35 +02:00
Bram Matthys 6d1d3de620 Move .CHANGES.NEW -> doc/Config.header 2019-05-19 16:30:27 +02:00
Bram Matthys f08e662878 Update and document modules.default.conf wrt IRCv3 features (CAPs etc). 2019-05-19 16:06:06 +02:00
Bram Matthys c3a929646c Move src/modules/cap/* to src/modules/ as the meaning got blurred.
For example, msgid / message-ids is not a CAP, while server-time is.
There mere fact of something being in CAP or not shouldn't cause
something to be in different directories ;).
2019-05-19 15:58:34 +02:00
Bram Matthys da31011b30 Move most of the message-tags stuff to the message-tags module. 2019-05-19 15:41:24 +02:00
Bram Matthys 13c59febbf Support for optional efunctions, with a default handler. 2019-05-19 09:49:53 +02:00
Bram Matthys 4e17f85fe6 1) New function new_message() which should be called when a new message is
sent, or at least for channel events.
2) Move adding of msgid/time/account tags to modules,
   which is their proper place.
2019-05-19 09:24:38 +02:00
Bram Matthys 10dcacdb0a @define, @if, @endif are all working.
You can do something like:
@define $SERVERIP "1.2.3.4"
listen {
    ip $SERVERIP;
    port 6667;
}

Supported @if types:
@if $VARIABLE == "something"
@if $VARIABLE != "something"
@if defined($VARIABLE)
@if !defined($VARIABLE)
@if module-loaded("somename")
@if !module-loaded("somename")
2019-05-18 16:06:28 +02:00
Bram Matthys 35fa6cedac Convert some alloc+strlcpy to safestrldup in config code.
-curce->ce_vardata = MyMallocEx(ptr-start+1);
-    strlcpy(curce->ce_vardata, start, ptr-start+1);
+safestrldup(curce->ce_vardata, start, ptr-start+1);
2019-05-18 14:32:36 +02:00
Bram Matthys 1adb02b56b Move new preprocessor from yesterday to it's own file (src/conf_preprocessor.c) 2019-05-18 13:58:27 +02:00
Bram Matthys fad8c35847 Initial support for dynamic configuration, $define, $if, $endif.
Early commit, still cleaning up to do.
But what works is:

$define SERVER      "hub.example.org"

$if SERVER == "hub.example.org"
link .... {
....
}
$endif

$if defined(SERVER)
....
$endif

And also we have mod-loaded() which even works half-way in a block
such as in helpop:
help Chmodes {
[..]
$if module-loaded("chanmodes/stripcolor")
        " c = Block messages containing mIRC color codes [o]";
$endif
$if module-loaded("chanmodes/noctcp")
        " C = No CTCPs allowed in the channel [h]";
$endif
};

As said, still need to cleanups and there are some limitations.
Also the idea is to be able to use defined values in variable names/values
but that has not yet been implemented.
2019-05-17 20:43:36 +02:00
Bram Matthys 7204f156c2 Store relative path and is_module_loaded() now has a small behavior change.
You now call it with a path like is_module_loaded("extbans/timedban").
This, among other reasons, so you can differentiate between modules with
the same name, such as "usermodes/noctcp" and "chanmodes/noctcp".
2019-05-17 18:48:37 +02:00
Bram Matthys 330e4018c3 Comment out hideserver by default 2019-05-17 18:46:52 +02:00
Bram Matthys 83991ae2a7 Fixed issue where REHASH caused 100% CPU loop. 2019-05-17 13:40:01 +02:00
GottemHams 6e5aa1fd93 Added m_storetkl for persisting TKLines across IRCd restarts 2019-05-14 20:48:12 +02:00
Bram Matthys 4ace26ec3f Another test commit 2019-05-13 17:03:50 +02:00
Bram Matthys d9380ce3bc Test commit 2019-05-13 16:09:50 +02:00
Bram Matthys 605c2addcf Update documentation URL already (no it will not exist for the
next couple of months, probably)
2019-05-13 15:44:15 +02:00
Bram Matthys e6d474adae Temporarily remove .travis.yml to make clear that we do not use it
at the moment. Also, write a long multi-line comment. No this has
nothing to do with testing an IRC bot of any kind...
2019-05-13 15:43:01 +02:00
Bram Matthys a81ebd6632 Dumdeedum 2019-05-13 15:03:20 +02:00
Bram Matthys 7aa6c6e167 Test framework: add run-tests.bbwrapper 2019-05-13 13:41:13 +02:00
Bram Matthys cf57b3d09c Revert workaround bac365ef12 from 2 commits ago 2019-05-13 13:13:23 +02:00
Bram Matthys f2a5a143b7 Changes for buildbot infrastructure 2019-05-13 13:07:37 +02:00
Bram Matthys bac365ef12 Turn this off so I can run tests 2019-05-13 12:45:39 +02:00
Bram Matthys aff3c16c08 Provide --enable-asan and --disable-asan to toggle address sanitizer.
Since we are currently pre-alpha I decided to enable it by default
so we as devs don't forget to do so :)
2019-05-12 15:25:11 +02:00
Bram Matthys 5ebd096f16 Initial implementation of message-tags from May 5, 2019.
This also includes buffer modifications to have a larger read buffer
and IRCv3 implementations (partial or not) for:
labeled-response, msgid, server-time, batch and account-tag.

As said, it is the initial and partial implementation.
There are still various FIXME's and TODO's, the API of various
functions may still change (actually that is true for the next
months, even) and some stuff is currently in the core that will
be moved to modules.
2019-05-12 13:46:44 +02:00
Bram Matthys a87d54355a Update version to 5.0.0-dev
I'm sure there will be many other U4 references still...
2019-05-12 13:29:40 +02:00
Bram Matthys 4981bf472c Bump reputation version from 1.0.1 to 1.2 2019-05-11 14:17:45 +02:00
Bram Matthys 3a0d8fc06c Fix another reputation issue: reputation not showing in WHOIS when
a remote user has just connected (could take up to 5 minutes) and
a fix required for previous commit for connthrottle.
2019-05-11 14:15:52 +02:00
Bram Matthys 7a7266bc2f Bump connthrottle version from 1.1 to 1.2 2019-05-11 14:02:42 +02:00
Bram Matthys 64c8096361 Fix connthrottle module counting non-local connecting registered users
always as new users (regardless of reputation), causing the protection
to kick in too quickly for the poor new users. This was noticeable
after for example one server died and new users reconnecting massively
to the remaining servers. Reported by Lord.
2019-05-11 13:58:07 +02:00
Bram Matthys 9f8e73dca7 Make CAP commands case sensitive.
Suggested by Koragg in https://bugs.unrealircd.org/view.php?id=5263
2019-05-10 08:57:16 +02:00
Bram Matthys 872ebca6fa Don't forward PASS to services if the user is already logged in via SASL.
Reported by westor in https://bugs.unrealircd.org/view.php?id=5264
2019-05-10 08:49:40 +02:00
Vitor Luis 92ceb129da Helpop update (#81)
Update help.conf with soft actions and changed *:Lines to be *-Lines which goes more accordingly with the new rewording in UnrealIRCd IRC messages.
2019-05-04 14:45:33 +02:00
Bram Matthys b0d3476176 HELPOP: Update MKPASSWD documentation 2019-05-04 13:47:07 +02:00
Bram Matthys 09d31d8ded Enhance WHOX->WHO auto-conversion for +s serv.er.name, reported by k4be. 2019-05-03 13:15:17 +02:00
Bram Matthys 8a6cbfaaf0 Show linking error messages if these happen during the handshake and we
have already fully authenticated the server (but when it technically is
not fully linked as a server yet, eg post-EAUTH but pre-SERVER).

Also, send ERRORs to junk snomask from untrusted sources. After all,
the junk snomask is precisely there to enable briefly to debug issues.
In case of link errors we always advice to check BOTH sides of the link
as an IRCOp, and this advice still stands. This may just help a little
for people who do not follow our advice.
2019-05-02 09:30:15 +02:00
Bram Matthys 5b63d28e2a Improve error messages in case of failed server linking due to mixed
password types (eg: plaintext on one side, spkifp on the other side).
Refer to https://www.unrealircd.org/docs/FAQ#auth-fail-mixed

Also, unrelated to the above, don't say "Bad password?" if the
password type is not of type plaintext, since it would be confusing.
2019-05-02 08:55:22 +02:00
Bram Matthys 377fa25244 UnrealIRCd 4.2.3 2019-04-30 09:23:44 +02:00
Bram Matthys f9bbeaa6ca [nopost] Send these harmless kill messages to the junk snomask.
Nowadays these are pretty much never proxy attacks. Only scanners and
crawlers trying HTTP commands on IRC connections.. which isn't even that
weird anymore since people tend to open up port 443 for SSL/TLS IRC
to bypass firewall restrictions.
2019-04-28 12:12:53 +02:00
Bram Matthys d3f061bbd9 Updates to example.tr.conf and help.tr.conf by Serkan
[skip ci]
2019-04-28 11:48:11 +02:00
Bram Matthys 8bbc136a66 Updates to help.tr.conf by Serkan 2019-04-27 12:51:27 +02:00
Bram Matthys cc15cd63de [reputation] Disable benchmark, config error should be warning. 2019-04-25 09:56:35 +02:00
Bram Matthys 9bd4f25af5 Handle FLUSH_BUFFER gracefully (only matters in rare cases, such
as in the case of malformed server traffic).
2019-04-22 14:37:37 +02:00
Bram Matthys 15ea9a9347 UnrealIRCd 4.2.3-rc1 2019-04-22 08:25:26 +02:00
Bram Matthys d6e285bdfc AppVeyor: replace wget with curl, since wget mysteriously fails.
[skip travis]
2019-04-22 07:42:04 +02:00
Bram Matthys b1944284bd Trace appveyor issue...
[skip travis]
2019-04-22 07:33:16 +02:00
Bram Matthys 1ada6c09f1 Make clang happy 2019-04-22 07:28:05 +02:00
Bram Matthys 4234400e22 Add 'reputation' and 'connthrottle' modules to fight drones.
See https://www.unrealircd.org/docs/Connthrottle
2019-04-22 07:11:25 +02:00
Bram Matthys 81e2099f7b We already checked for the openssl library but if the openssl binary was
not found then this was not treated as a fatal error. Now it is, since
you will fail later in the installation process when a certificate file
is being made (resulting in mysterious 'req: command not found' errors).
Also, improve the error message both for the missing openssl library
and openssl binary case.
2019-04-15 18:56:11 +02:00
Bram Matthys f3bd95fa42 Create some preliminary release notes.
[skip ci]
2019-04-14 14:12:06 +02:00
Bram Matthys 2ba65ed35c Move previous release notes to doc/RELEASE-NOTES.old
[skip ci]
2019-04-14 13:47:11 +02:00
Bram Matthys 11c6604aeb Print out clear warning/error if using an old spamfilter.conf.
For example for Windows users, or for *NIX users where the automated
patching of the spamfilter.conf did not work.
I've tried to make the error message as clear and big as possible
and the wiki article as clear as possible as to what the user needs
to do. Not much more I can do.... :)
2019-04-14 13:45:11 +02:00
Bram Matthys 4e75af79fa 'make install' will now upgrade the spamfilter.conf examples from
'posix' to 'regex' if the user is using the exact same spamfilter.conf
that shipped with UnrealIRCd 4.x until now. Otherwise, we do not
update anything. Also, custom spamfilters in this file are not touched.
Let's hope this will apply to most of our users to ensure that they
will have no or less issues with the 'posix' to 'regex' conversion
process.
2019-04-14 13:01:31 +02:00
Bram Matthys 3ba5153362 Abort when using list functions on structs with incorrect order.
This is mostly to guard 3rd party module writers against making
such a mistake. Up to now such a mistake would silently corrupt
memory without warning or error. That is, until you crashed :D.
2019-04-14 11:01:20 +02:00
Bram Matthys 570c59b2b2 Bump UNREAL_VERSION_TIME.
[skip ci]
2019-04-12 11:01:15 +02:00
Bram Matthys 3aa5048300 Improve error message if someone uses set::something literally in the
configuration file.
Also, make (global)'unknown directive' errors fatal, as they should be.
2019-04-07 17:09:12 +02:00
Bram Matthys 9d7354147d Add two blacklist blocks in example conf: DroneBL and EFnet RBL. 2019-04-05 21:06:50 +02:00
Bram Matthys 5c30d1af6d * Badword blocks now use PCRE2 if using regex at all (rare,
usually the fast badwords system is used instead)
* Code deduplication in src/modules/{chanmodes,usermodes}/censor.c
  to src/match.c -- which may be moved later again to efuncs.
* Add --without-tre:
  This means USE_TRE will be enabled by default right now
  but if using --without-tre it will be undef'ed. This so we
  can prepare for the TRE phase-out in 2020.
* Remove include/badwords.h, put contents in include/struct.h
2019-04-05 18:19:23 +02:00
Bram Matthys 9e69cd722d Remove unused regex support in antirandom 2019-04-05 16:27:07 +02:00
Bram Matthys 422f76a723 Fix very minor memleak introduced about 2-3 weeks ago. 2019-04-04 19:24:23 +02:00
Bram Matthys f111b5c1ad Update spamfilter.conf: convert some to 'simple' matchers and make clear
that these are just old examples from the year 2005.
Also, no longer include spamfilter.conf from the example*conf by
default as they do not contain any useful spamfilters nowadays.
2019-04-04 18:31:59 +02:00
Bram Matthys 05c4cb5e8f Replace match-type 'posix' with 'regex' in example spamfilter.conf.
Note that I should probably check if they still work now.. ;)
2019-04-02 21:04:40 +02:00
Bram Matthys 83372cc2c8 Bump example.conf server sendq from 5M to 20M. 2019-04-02 20:34:39 +02:00
Bram Matthys bd05cf8e58 Stop accepting /SPAMFILTER add -posix. You should really use PCRE2 by now.
Similarly, raise a warning for spamfilter { } blocks in the configuration
with match-type 'posix'.
See: https://www.unrealircd.org/docs/FAQ#spamfilter-posix-deprecated
2019-04-02 20:33:03 +02:00
Bram Matthys ee342d9b84 Re-indent set_mode and use new paracount_for_chanmode(). 2019-03-27 16:59:42 +01:00
Bram Matthys 8b222a1ed2 -Wno-empty-body 2019-03-27 14:00:35 +01:00
Bram Matthys b2307af8ec Get rid of "unknown option -Wno-invalid-source-encoding" warning when there
is another warning being triggered.
-copy paste comment from configure.ac-
We check for the -Woption even though we are going to use -Wno-option.
This is due to the following (odd) gcc behavior:
"When an unrecognized warning option is requested (e.g.,
 -Wunknown-warning), GCC emits a diagnostic stating that the option is not
 recognized.  However, if the -Wno- form is used, the behavior is slightly
 different: no diagnostic is produced for -Wno-unknown-warning unless
 other diagnostics are being produced.  This allows the use of new -Wno-
 options with old compilers, but if something goes wrong, the compiler
 warns that an unrecognized option is present."
Since we don't want to use any unrecognized -Wno-option, we test for
-Woption instead.
2019-03-27 13:44:29 +01:00
Bram Matthys e7de6cf3a4 Fix compile issue and report error when unable to write to pid file
(data/unrealircd.pid by default).
2019-03-27 13:26:30 +01:00
Bram Matthys dd2af3b31c Enable additional compiler warnings. Update code to conform to these
new standards, possible to compile with -Werror with them.
2019-03-27 09:03:30 +01:00
Bram Matthys 5a38d8ed75 Fix misleading indentation. 2019-03-25 18:37:05 +01:00
Bram Matthys 6d3a98653e The maximum number of clients (MAXCONNECTIONS) no longer defaults to 1024.
The new question in ./Config now defaults to 'auto' (both for new installs
and for upgrades). You can still specify a manual limit but it is no longer
recommended.
A MAXCONNECTIONS of 'auto' means - at present - that UnrealIRCd will try
to set a limit of 8192. This is quite a bump from the original 1024.
On systems where this is not possible we will simply use the highest amount
possible, such as 4096 on many systems, or 1024.
In fact, we now no longer error when MAXCONNECTIONS is higher than the
'ulimit -n' limit but will adjust ourselves to the limit.
Only if the effective limit is below 100 we will print out a fatal error
since running in such a scenario is highly discouraged.
The reason for this change is that nowadays with drone attacks we may need
to be able to handle more concurrent sockets. Also, many Linux distro's
have a default setting of unlimited or 4096 nowadays, out of the box.

For people packaging UnrealIRCd (not end-users):
The ./configure --with-fd-setsize=xx option was removed and the
optional(!!) --with-maxconnections=xx option has been added.
We recommend you NOT to pass this option. Not passing it means that
the previously mentioned 'auto' mode will be used, which is likely
best for most users.

Module coders:
Although it is unlikely you accessed the 'MAXCLIENTS' variable,
if you did, it is now called 'maxclients' (lowercase) since it is
adjusted at runtime and no longer a macro.
2019-03-25 15:43:26 +01:00
Bram Matthys ad173cc5d0 Ignore join flood check in channel mode +f when the server just booted.
This new option is called set::modef-boot-delay (default: 75 seconds).
See https://www.unrealircd.org/docs/Set_block#set::modef-boot-delay
2019-03-25 13:27:28 +01:00
Bram Matthys 5b20716e9b [cleanup] floodprot: move set::modef-* handling from core to module. 2019-03-25 13:10:03 +01:00
Bram Matthys 6c837d3ce4 Cleanup _test_operclass config code. 2019-03-25 09:33:59 +01:00
Bram Matthys 9ca53369e7 Lots of config code checks for "if (!cep->ce_varname)" however this is a
condition that will never happen, as it is already handled by the parser.
2019-03-25 09:21:15 +01:00
Bram Matthys 15d77298fe Empty blacklist::dns::type could lead to a crash (config file error).
All the rest are things that "will never happen" or dead code.
2019-03-25 09:04:31 +01:00
Bram Matthys 4490b8744e Use HAVE_RLIMIT instead of FORCE_CORE. And get rid of error message. 2019-03-24 15:50:56 +01:00
Bram Matthys a9b3e05b0c Brain damage 2019-03-24 15:22:02 +01:00
Bram Matthys b3e9d391d8 More updates to api-command, remove old functions such as del_Command(). 2019-03-24 15:18:41 +01:00
Bram Matthys e19639a1bd Fix compile problem #ifndef DEBUGMODE 2019-03-24 15:13:34 +01:00
Bram Matthys 59e3a42304 For the function declaration of command overrides, module coders are now
encouraged to use CMD_OVERRIDE_FUNC(override_xyz) rather than declaring
the function themselves. This works similar to CMD_FUNC(somecmd).
Example:
/* Forward declaration */
CMD_OVERRIDE_FUNC(override_xyz);
[..]
MOD_LOAD(somemodule)
{
	CmdoverrideAdd(modinfo->module, "XYZ", override_xyz);
[..]
CMD_OVERRIDE_FUNC(override_xyz)
{
	/* Do something useful here */
2019-03-24 08:27:26 +01:00
Bram Matthys 60952328f0 Add function type checking in CommandAdd()
And, for aliases, now use AliasAdd(), CommandAdd() is no longer permitted
for it. Do any modules use this?
2019-03-24 08:16:45 +01:00
Bram Matthys f9db29b768 Smart.. moving code to a separate function resulting in the use
of sizeof() on a char *...
2019-03-24 07:48:08 +01:00
Bram Matthys cb60bf286d Get rid of this useless DLLFUNC junk. This is only needed for symbols
that need to be visible from the outside of the .DLL (symbol export).
Long story short: you never need to use this yourself in a module.
Where needed it is already handled by UnrealIRCd.
2019-03-23 19:53:12 +01:00
Bram Matthys edfc832aa8 Some minor code cleanups, use CMD_FUNC() where possible. 2019-03-23 19:45:34 +01:00
Bram Matthys 7bcf419eda Add references to the technical S2S documentation
@skip-ci
2019-03-23 19:39:56 +01:00
Bram Matthys e4ddc80c2a Code cleanup: m_protoctl. Has always been ugly, just was never bothered
enough to clean it up. Also, remove PROTOCTL -<option> support, which is
not used by anything and was only supported on a handful of options
anyway. Also remove some debugging and PROTOCTL_MADNESS.
Finally, add a reference to the technical documentation.
2019-03-23 19:23:10 +01:00
Bram Matthys a11ee2b1a2 Skip * in PROTOCTL SERVERS=. This probably caused a bug which could be
triggered by doing quick server connects (crossing requests), something
that the PROTOCTL SERVERS= code is supposed to prevent (it should be
safe to connect to X servers at the same time, even every second).
2019-03-23 19:04:59 +01:00
Bram Matthys 5992a759f7 return 0.. 2019-03-23 18:44:00 +01:00
Bram Matthys ab50bf2afc Communicate server featureset (and changes) across server links.
Previously various information was only available for directly attached
servers, since it is communicated via PROTOCTL.
Now, we will also communicate information about leafs behind us.
IRCOps can use the /SINFO command to see these server features.
Services codes don't need to do anything, or at least are not expected
to do anything. They can still receive the information and do something
with it, of course...
Read the following technical documentation for full information,
as it will outline very specific rules for using the command S2S:
https://www.unrealircd.org/docs/Server_protocol:SINFO_command
2019-03-23 17:56:59 +01:00
Bram Matthys 335a7569bb Bugs like this can keep you occupied for a while:
safestrdup(somevar, s+10);
..always caused somevar to be NULL :D.
2019-03-17 20:16:21 +01:00
Bram Matthys 7ad6b15e92 It would be nice if expired TKL's actually get removed (duh).
Caused by fac1e30b91 from March 3, 2019.
2019-03-15 16:34:30 +01:00
Bram Matthys 761ae02935 Change assert() to if..!...abort() so it produces proper core dumps.
Yeah, that's how it works, unfortunately.
2019-03-15 16:03:48 +01:00
Bram Matthys fd73739847 Handle SSL_ERROR_WANT_READ in a better way. 2019-03-10 15:00:45 +01:00
Bram Matthys 872830bdf2 I give up. Test framework will no longer run on Travis-CI, ruby is broken. 2019-03-09 15:38:08 +01:00
Bram Matthys b396dc3c20 .. 2019-03-09 15:33:31 +01:00
Bram Matthys f47dc78418 . 2019-03-09 15:31:48 +01:00
Bram Matthys 2c114d458e ............................... 2019-03-09 15:27:46 +01:00
Bram Matthys f039e08f0b Travis-CI + ruby = .... 2019-03-09 15:17:31 +01:00
Bram Matthys e0a4e7fe71 Travis-CI: :/ 2019-03-09 15:05:47 +01:00
Bram Matthys 2e79c34c11 Travis-CI: more diagnostics 2019-03-09 11:59:33 +01:00
Bram Matthys 99b379fca8 Travis-CI: :( 2019-03-09 11:47:18 +01:00
Bram Matthys 584f3e9d6d Travis-CI: argh argh 2019-03-09 11:32:27 +01:00
Bram Matthys 20550981f8 Travis-CI: argh! 2019-03-09 11:12:55 +01:00
Bram Matthys 5d69fe9d93 Missing return NULL in find_tkline_match_zap_matcher (due to commit from
a few days ago)
2019-03-09 10:23:19 +01:00
Bram Matthys ad063ba36a Fix ./unrealircd spkifp complaining that it could not find the certificate
file if you specified a relative path. Until now only absolute paths worked.
Bug reported by CrazyCat.
2019-03-08 09:32:05 +01:00
Bram Matthys fac1e30b91 Major TKL speed improvements. 2019-03-03 20:25:05 +01:00
Bram Matthys 87c81e7e9f This fsync() call slows things down too much at high connection rates. 2019-03-03 19:03:05 +01:00
Bram Matthys 41c1f01011 Bump version to 4.2.3-dev to make clear that this git version is under development. 2019-03-03 17:14:09 +01:00
Bram Matthys 16659de0b2 Changing set::anti-flood::invite-flood had no effect. It was always 4:60.
Reported by Betaman2k in https://bugs.unrealircd.org/view.php?id=5222
2019-03-03 14:16:49 +01:00
Bram Matthys 766055d5c0 Fix set::ban-setter and set::topic-setter being set to nick-user-host
out of the blue. The classic C mistake where = instead of == was written
in an if statement... duh.
2019-03-02 08:49:47 +01:00
Bram Matthys de1548de73 UnrealIRCd 4.2.2. 2019-03-01 14:38:44 +01:00
Bram Matthys f599ea02cb WHO(X) auto-conversion bug regarding 'a' and 'c' which no longer exist
in WHOX.
2019-03-01 14:34:43 +01:00
Bram Matthys d068cd41ca Fix crash in websocket module. 2019-03-01 14:10:06 +01:00
Bram Matthys d7e5ff82f0 Update curl-ca-bundle.crt (Wed Jan 23 04:12:09 2019 GMT) 2019-03-01 13:57:35 +01:00
Bram Matthys e16e2b36d8 UnrealIRCd 4.2.2-rc2 2019-02-11 09:19:38 +01:00
Bram Matthys c6f01aa3f1 Protect 2 more commands against rogue server to server traffic. 2019-02-11 08:47:51 +01:00
Bram Matthys 294560f944 KILL: Not sure if this fixes anything but at least it's less cryptic. 2019-02-10 17:30:39 +01:00
Bram Matthys 9a0bd31cf8 Fix unlikely crash if you had a spamfilter targetting away that was
only local (so in .conf) and it hit a remote user.
Also, re-indent this monster...
2019-02-10 17:09:48 +01:00
Bram Matthys 1dbef111fb Fix crash if receiving malformed server to server traffic (from an
authenticated server): TKL deleting a spamfilter with insufficient
parameters.
2019-02-10 17:08:47 +01:00
Bram Matthys 1f03dbdd05 CHGNAME and SETNAME: if a remote user used a realname that was banned
on this server then we could possibly crash. (Fortunately most networks
use the same ban realname blocks on all their servers)
2019-02-10 14:54:28 +01:00
Bram Matthys 3712fad891 When a server does not use SID's, set empty id as before.
This bug was post-rc1, caused by dde8f914fb.
2019-02-10 14:48:29 +01:00
Bram Matthys 7e444d3b9f Fix SJOIN bug in rc1: was using an incorrect buffer when SJSBY was
not used, such as in a mixed version scenario.
2019-02-10 14:43:34 +01:00
Bram Matthys 77d3e844dc Fix a bunch of REHASH memory leaks. 2019-02-10 10:36:20 +01:00
Bram Matthys 7d5c3a1b68 Fix hang/crash due to commit from yesterday, reported by k4be.
(cause: dde8f914fb)
2019-02-10 09:56:53 +01:00
Bram Matthys c7f00edd9d Quicker handshake when using many CAP requests and/or AUTHENTICATE.
I was wondering why the handshake took 4 seconds for a client which
authenticates using SASL. Turns out that fake lag was kicking in due
to the many "CAP req" commands combined with the other handshake stuff.
Now the first 15 (or so) "CAP" requests are "free", without fake lag.
2019-02-09 16:47:24 +01:00
Bram Matthys 78cd122a05 Allow SASL post-registration. Unfortunately the anope unreal4 protocol
module also requires an update to support this.
2019-02-09 14:39:34 +01:00
Bram Matthys dde8f914fb Internal: make UID available early (pre-auth). 2019-02-09 14:35:48 +01:00
Bram Matthys a740570710 Fix crash bug (in rc1 only) if ::ssl-options are being used and the
outdated SSL protocols/ciphers are being checked.
2019-02-08 12:02:52 +01:00
Bram Matthys 9c0f1f3505 Fix OOB read in m_whox.
Strange order for a compare, first the 2nd byte, then the 1st byte ;)
Anyway, this issue can only be triggered since rc1, no big issue.
2019-02-06 19:31:10 +01:00
Bram Matthys e443182573 UnrealIRCd 4.2.2-rc1 2019-02-06 16:00:38 +01:00
Bram Matthys 988f64e3b3 Fix crash when linking (caused by commit from 4 days ago). 2019-02-06 12:54:37 +01:00
Bram Matthys f92a6fec79 Release notes: clarify flood limit in older versions
@skip-ci
2019-02-06 12:17:47 +01:00
Bram Matthys 70a9a6f6b2 Added INVITE and KNOCK flood protection (command rate limiting).
set::anti-flood::invite-flood defaults to 4 per 60 seconds.
set::anti-flood::knock-flood defaults to 4 per 120 seconds.
2019-02-06 12:00:51 +01:00
Bram Matthys 57f97a5a43 Removed a debugging message and fixed TARGMAX being broken after a REHASH. 2019-02-06 09:24:31 +01:00
Bram Matthys 1e1f750b44 New set::max-targets-per-command which configures the maximum number
of targets accepted for a command, eg /MSG nick1,nick2,nick3,nick4 hi.
Also changed the following defaults (previously hardcoded):
* PRIVMSG from 20 to 4 targets, to counter /amsg spam
* NOTICE from 20 to 1 target, to counter /anotice spam
* KICK from 1 to 4 targets, to make it easier for channel operators
  to quickly kick a large amount of spambots
See https://www.unrealircd.org/docs/Set_block#set::max-targets-per-command

(actually still need to write the documentation)
2019-02-04 17:51:09 +01:00
Bram Matthys 1e6d8ea536 Fix compile problem due to previous commit. 2019-02-04 14:42:17 +01:00
Bram Matthys 9f4296d648 New set::anti-flood::max-concurrent-conversations which configures the
maximum number of conversations a user can have with other users at the
same time. Until now this was hardcoded at limiting /MSG and /INVITE to
20 different users in a 15 second period. The new default is 10 users,
which serves as a protection measure against spambots.
See https://www.unrealircd.org/docs/Set_block#maxcc for more details.
2019-02-04 09:52:08 +01:00
Bram Matthys 7153468081 UnrealIRCd will now warn if your ulines { } are matching UnrealIRCd servers.
See https://www.unrealircd.org/docs/FAQ#WARNING:_Bad_ulines
2019-02-02 08:44:14 +01:00
Bram Matthys be50ef4a1e Get rid of warning on-boot "Channel modes changed at runtime" 2019-02-02 07:53:07 +01:00
Bram Matthys f9415e1a91 m_whox: now accept and transform most classic UnrealIRCd WHO requests
such as "WHO +s serv.er.name" to "WHO serv.er.name s".
It also does advanced transformation such as "WHO -m z" to "WHO -z m"
**copy paste from comment in code**
Flag a: user is away                                            << no longer exists
Flag c <channel>: user is on <channel>                          << no longer exists
Flag g <gcos/realname>: user has string <gcos> in his/her GCOS  << now called 'r'
Flag h <host>: user has string <host> in his/her hostname       << no change
Flag i <ip>: user has string <ip> in his/her IP address         << no change
Flag m <usermodes>: user has <usermodes> set                    << behavior change
Flag n <nick>: user has string <nick> in his/her nickname       << no change
Flag s <server>: user is on server <server>                     << no change
Flag u <user>: user has string <user> in his/her username       << no change
Behavior flags:
Flag M: check for user in channels I am a member of             << no longer exists
Flag R: show users' real hostnames                              << no change (re-added)
Flag I: show users' IP addresses                                << no change (re-added)
**end of paste**
Of course we cannot convert 100% from classic UnrealIRCd WHO to WHOX-style
because things like "WHO +m r" could mean either "search for +m in realname" (WHOX)
or "search for +r in modes" (classic). In cases like this we assume WHOX, so to not
break any WHOX compatibility.

Added matchers: 'R' (show real host) and 'I' (show IP)

This code will need more testing, both by classic WHO and by WHOX users...
2019-02-01 17:46:59 +01:00
Bram Matthys eecd29bdc8 WHOX: adaptions for UnrealIRCd part 1:
* No longer require a ! prefix for ircops to see users
* "WHO *" is no longer different than the rest
  (previously in m_whox would only list users on 1st channel)
Neither is part of the WHOX specs.
2019-02-01 15:21:53 +01:00
Bram Matthys 52e72c2ed9 Update reference to RELEASE-NOTES.old (link used wrong branch) 2019-02-01 14:27:07 +01:00
Bram Matthys 1790efd05d The message sent to users upon *LINE can now be adjusted completely via
set::reject-message::kline and set::reject-message::gline.
See https://www.unrealircd.org/docs/Set_block#set::reject-message
Suggested by k4be in https://bugs.unrealircd.org/view.php?id=5198
2019-02-01 14:25:52 +01:00
Bram Matthys ff9ca3c8ef Add 005 token DEAF=d 2019-01-31 17:47:06 +01:00
Bram Matthys a999b305a5 Remove 005 CMDS= token, which was an unnecessary abstraction and was
not picked up by any other IRCd. The 005 tokens KNOCK MAP USERIP are
now used instead. We do not announce STARTTLS in 005 anymore as this
is way too late (post-handshake, sensitive info already sent and/or
received). Not to mention STARTTLS is not the preferred method to
setup a secure connection in the first place.
Module coders: this means CommandAdd() with M_ANNOUNCE should no
longer be used. If a 3rd party module does use it, then UnrealIRCd
will now raise a warning. In a later UnrealIRCd version the flag
is likely to be removed completely so would cause a compile error.
(I doubt any module uses this anyway... but still..)
2019-01-31 17:34:07 +01:00
Bram Matthys 6cbd2744d7 * The default maximum topic length has been increased from 307 to 360.
* You can now set more custom limits. The default settings are shown below:
  set {
      topic-length 360; /* maximum: 360 */
      away-length 307; /* maximum: 360 */
      quit-length 307; /* maximum: 395 */
      kick-length 307; /* maximum: 360 */
  };
* A new 005 token has been added: QUITLEN. Works similar to KICKLEN.

The ability to adjust the topic length in the configuration file was
requested by Amiga600 in https://bugs.unrealircd.org/view.php?id=4692
At that place is also additional information on why there is a
"maximum" for topic length.
2019-01-30 17:50:17 +01:00
Bram Matthys 41239119f8 Update release notes a bit. 2019-01-30 16:54:56 +01:00
Bram Matthys 88030c63fb 1) Simplify dealing with isupport (numeric 005) stuff from the config code.
There's now no longer a difference between a rehash or boot.
2) Other cleanups in s_conf.c as well. Looks better now.
3) Sort the 005 tokens alphabetically. Enforcing some other 'logical order'
   was futile and this makes things consistent between rehashes.

For module coders this adds some new functions, such as IsupportSet,
IsupportSetFmt and IsupportDelByName. I'll document them later.
2019-01-30 16:42:19 +01:00
Bram Matthys 98fca7979f Code cleanup: internally rename iConf.nicklen to .nick_length to match the
convention that set::some-name is called iConf.some_name
2019-01-30 10:49:44 +01:00
Bram Matthys 5eaa711969 Update release notes to reflect current state. 2019-01-28 16:06:59 +01:00
Bram Matthys d085fb09c1 Three new config items to make topic and ban setter nick!user@host and
to control synchronization of the +beI setter across server links
(that is, the feature just introduced one commit ago):
set {
     topic-setter [nick|nick-user-host]; /* nick = default */
     ban-setter [nick|nick-user-host]; /* nick = default */
     ban-setter-sync [yes|no]; /* yes = default */
};
This also means that --with-topicisnuhost / TOPIC_NICK_IS_NUHOST
is now removed, since this now goes via set::topic-setter.

Also, moved the "first" PROTOCTL from include/common.h to send_proto()
in src/s_serv.c so the bunch of PROTOCTL lines is all in one place
(and so I could conditionally send SJSBY).
Ok, it's not entirely all in one place, PROTOCTL EAUTH is still sent
at another place (early, duh), but still..
2019-01-28 15:41:44 +01:00
Bram Matthys 874d99e0eb For +beI lists the 'set by' and 'set at' information is now synchronized
when servers link. Thus, you can see the real setter and time also after
a netsplit (/mode #channel b). This, unlike before, when setby was
name.of.server and time was the time of the synch.
This requires the entire network to run UnrealIRCd 4.2.2 or later.
Suggested by k4be in https://bugs.unrealircd.org/view.php?id=5183
Technical details: the PROTOCTL token to enable this is "SJSBY" and see
https://www.unrealircd.org/docs/Server_protocol:SJOIN_command for more
information, in particular the last section there.
2019-01-28 14:36:41 +01:00
Bram Matthys 4aa2d47deb Run test framework with a hub in-between to test command propagation. 2019-01-28 09:29:44 +01:00
Bram Matthys ed1f47f80a Can't stand http:// URLs... 2019-01-25 20:50:05 +01:00
Bram Matthys 2a3dd0e350 what is this 'return 0' doing here... 2019-01-23 16:36:42 +01:00
Bram Matthys ac9463a83f Rename hook HOOKTYPE_CAN_SEND_SECURE to HOOKTYPE_SEND_CHANNEL, which is
more descriptive and AFAICT nobody uses this hook in a public 3rd party
module anyway.
2019-01-21 17:02:14 +01:00
Bram Matthys 083826ee94 modules/usermodes/noctcp (+T): 1) only block CTCP's and not CTCP REPLIES,
2) allow IRCOps to bypass user mode +T restrictions. Reported by St3Nl3y,
HeXiLeD and Koragg in https://bugs.unrealircd.org/view.php?id=5166
2019-01-21 16:55:29 +01:00
Bram Matthys ee20160bc3 Add another type for HOOKTYPE_CONFIGTEST and HOOKTYPE_CONFIGRUN
for CONFIG_LISTEN. This so a module can have custom options in
the listen block. Like all other CONFIG_* options you are supposed
to return 1 if your module handles this option and 0 if not.
From HOOKTYPE_CONFIGTEST you can also return -1 to indicate error
for an option that is handled by the module.
Note that 'cep' is passed, that is the option for the variable
that is being checked, and not the 'ce', the parent of the listen
block. If you want to access the parent, then use ce->ce_prevlevel.
2019-01-21 13:55:20 +01:00
Bram Matthys 7a3ba05c03 Similar to previous commit, fix resolving of temporary modules (.so files)
in crash reports as well... and make them in English, regardless of the
users' locale... better for us ;)
2019-01-21 13:37:52 +01:00
Bram Matthys 6fcacdf148 Fix './unrealircd backtrace' not working correctly in non-English environments.
The script symlinks any missing tmp/xxxx.so's to the real module name but
depends on English statements (ugly, yeah, but it works). With a non-English
locale this did previously not work so the backtrace was screwed.
2019-01-21 13:30:15 +01:00
Bram Matthys 41e6d5b7e9 Fix for strangely formatted 'creation date' if compiled with certain locales.
Reported by k4be.
2019-01-21 13:26:22 +01:00
Bram Matthys bcb667c59e New hook HOOKTYPE_WELCOME (aClient *acptr, int after_numeric): allows you
to send a message at very specific places during the initial welcome
https://www.unrealircd.org/docs/Dev:Hook_API#HOOKTYPE_WELCOME
2019-01-21 10:12:46 +01:00
Bram Matthys 25ede84a04 This makes more sense. Also testing announcement bot :D 2019-01-21 10:10:51 +01:00
Bram Matthys c726df5758 Travis-CI: The job exceeded the maximum log length, and has been terminated.
Fantastic. https://github.com/travis-ci/travis-ci/issues/1382
2019-01-18 15:31:14 +01:00
Bram Matthys 013dd06aee Travis-CI: End of argh. 2019-01-18 14:45:55 +01:00
Bram Matthys 3bacb28555 Travis-CI: no comment 2019-01-18 14:24:19 +01:00
Bram Matthys 8a9971618f Travis-CI: ..or without sudo..
I really love this..
2019-01-18 14:05:45 +01:00
Bram Matthys 3e3da94a41 Travis-CI: new image, have to install bundler again. 2019-01-18 14:00:00 +01:00
Bram Matthys 4d5e627b27 Update release notes: * New set::outdated-tls-policy which describes what to
do with clients that use outdated SSL/TLS protocols (eg: TLSv1.0) and
ciphers.  The default settings are to warn in all cases: users connecting,
opers
/OPER'ing up and servers linking in.  The user will see a message telling
them to upgrade their IRC client.  This should help with migrating such
users, since in the future, say one or two years from now, we would want to
change the default to only allow TSLv1.2+ with ciphers that provide Forward
Secrecy.  Instead of rejecting clients without any error message, this
provides a way to warn them and give them some time to upgrade their
outdated IRC client.
https://www.unrealircd.org/docs/Set_block#set::outdated-tls-policy
2019-01-18 13:38:14 +01:00
Bram Matthys 425571a8d2 Update UnrealIRCd version to 4.2.2-dev 2019-01-18 13:22:58 +01:00
Bram Matthys e82dbdce1a Update doc/RELEASE-NOTES.old. Now contains 4.2.0 and 4.2.1 release notes,
I forgot the 4.2.0 one earlier..
2019-01-18 13:20:28 +01:00
Bram Matthys 4681603c52 Fix bug where "link-security" was downgraded to level 1 if using 'spkifp'. 2019-01-18 13:10:51 +01:00
Bram Matthys 778be86c66 Update HELPOP EXTBANS on ~t (timed bans), ~m (msgbypass) and ~T (textban)
since these are loaded by default since UnrealIRCd 4.2.0.
2019-01-14 15:10:23 +01:00
Bram Matthys f4b432ae94 Add RC4 and 3DES to set::ssl::outdated-ciphers, in case anyone uses some
insecure custom ::ciphers setting, this so RC4 and 3DES still get flagged.
2019-01-12 11:29:16 +01:00
Bram Matthys 67d691fce9 * New set::outdated-tls-policy which describes what to do with clients
that use outdated SSL/TLS protocols (eg: TLSv1.0) and ciphers.
  The default settings are to warn in all cases: users connecting,
  opers /OPER'ing up and servers linking in. The user will see a message
  telling them to upgrade their IRC client.
  This should help with migrating such users since in the future, say one
  or two years from now, we would want to change the default to only allow
  TSLv1.2+ with ciphers that provide Forward Secrecy. Instead of rejecting
  clients without any error message, this provides a way to warn them and
  give them some time to upgrade their outdated IRC client.
  https://www.unrealircd.org/docs/Set_block#set::outdated-tls-policy
2019-01-12 11:08:18 +01:00
Bram Matthys 8e7a085474 AppArmor profile in extras/security/apparmor: no changes but make it
clear that this has been tested on Ubuntu 16.04 and Ubuntu 18.04.
2019-01-12 10:52:05 +01:00
Bram Matthys 5fd673d059 Rename PLAINTEXT_POLICY_* to POLICY_ (and similarly, the struct, etc) 2019-01-11 13:27:29 +01:00
Bram Matthys a1d2698ead Provide get_ssl_options_for_client() to get the SSLOptions * for a client. 2019-01-11 13:16:09 +01:00
Bram Matthys b0c8629284 Travis-CI: remove TLS test for libressl-25 (no longer supported)
[skip ci]
2019-01-11 12:34:43 +01:00
Bram Matthys 72a3a445ee Travis-CI: Update OpenSSL and LibreSSL versions
* Remove LibreSSL versions that are no longer supported (2.5.x and 2.6.x).
* Add LibreSSL 2.8.x (current stable) and 2.9.x (current dev)
* OpenSSL releases only had updates in their 'letter suffixes'
2019-01-11 11:54:13 +01:00
Bram Matthys 9668aaaade Travis-CI: Rename .txt files to match $BUILDCONFIG 2019-01-11 11:42:36 +01:00
Bram Matthys dbeb5af2ea Updates to SSL/TLS tests. 2019-01-11 11:30:40 +01:00
Bram Matthys 227abacdb5 Hm? 2019-01-11 10:52:16 +01:00
Bram Matthys 8e1af5f304 Update SSL/TLS tests and put them in extras/tests/tls 2019-01-11 10:45:20 +01:00
Bram Matthys 9873382e6b Add SSL/TLS tests. 2019-01-11 10:06:21 +01:00
Bram Matthys 7d68ea0570 Update default ciphers, or actually only the ones not providing PFS, by
preferring AES-256 over AES-128 (in contrast to the Mozilla "intermediate"
profile which prefers AES-128). Again, this only affects non-PFS cases, as
all modern clients with PFS already had CHACHA20 and AES-256 negotiated.
The portion of non-PFS clients should only be few percent, if any.
I was actually considering removing non-PFS ciphersuites but it seems a bit
early to do so, at least not without more research on affected clients.
2019-01-11 09:19:44 +01:00
Bram Matthys dbbe6e7248 Travis-CI: another attempt 2019-01-10 20:29:11 +01:00
Bram Matthys 981a5d44b2 Travis-CI: install specific bundler (wtf?) 2019-01-06 20:34:16 +01:00
Bram Matthys 2a9b20369b Travis-CI: use Ubuntu 16.04 instead of 14.04
...since 14.04 seems to fail due to an outdated ruby.
2019-01-06 20:14:04 +01:00
Bram Matthys 8c9e4b8668 Poison unused parv[] elements that code should never access.
The last parv[] array element will be NULL. Accessing any elements after
that is undefined, similar to reading past the nul byte of a string.
This poison will help catch such bugs. Without this poison your code
will also crash, now it just crashes more consistently.
2019-01-06 19:21:59 +01:00
Bram Matthys dbf7aeb386 UnrealIRCd 4.2.1.1: compile fix for Debian stretch if you have a version of
libargon2 installed that does not provide Argon2id.
2019-01-03 08:57:59 +01:00
Bram Matthys 4965fc6741 Fix for systems with libargon2 that don't have Argon2id (Debian 9.6).
Apparently Debian stretch has 20160821's version which just falls short.
20161029 already has it included. We'll now use shipped libargon2 for
versions below 20161029. Thanks to vectr0n for reporting the issue.
2019-01-02 19:20:42 +01:00
Bram Matthys c173b17064 Fix SAJOIN, SAPART and SAMODE not working due to operclass.default.conf
using the 'sacmds' permission, when it should actually be 'sacmd'.
Reported by Stanley.
2018-12-28 17:55:32 +01:00
Bram Matthys 5da3ef8889 UnrealIRCd 4.2.1 (will publish tomorrow) 2018-12-26 23:06:33 +01:00
Bram Matthys 8b0cad3845 Fix for 'require authentication' (duh)
.. yeah I and others were still using 'require sasl' :D
2018-12-22 10:36:48 +01:00
Bram Matthys 56568f4033 Update release notes. This may be final for 4.2.1-rc1. 2018-12-22 10:12:53 +01:00
Bram Matthys 43de2dd747 Update release notes 2018-12-21 18:05:06 +01:00
Bram Matthys 73502ca4b6 Update help.conf with new WHO status flag 's' (secure) 2018-12-21 18:03:57 +01:00
Bram Matthys bb7bc90612 Forgot to update c-ares version in extras/curlinstall.... 2018-12-21 15:59:51 +01:00
Bram Matthys ad9a1b0b94 Import settings from UnrealIRCd 4.2.0
[skip ci]
2018-12-21 15:57:08 +01:00
Bram Matthys e30712f3d4 Update Windows libraries and the Windows build command for build tests.
[skip travis ci]
2018-12-21 15:42:32 +01:00
Bram Matthys f3f397b066 Update shipped libs: c-ares to 1.15.0 and PCRE2 to 10.32 2018-12-21 15:32:23 +01:00
Bram Matthys f1844e40a5 Set version to 4.2.1-rc1. The release notes are still likely to change. 2018-12-21 15:24:12 +01:00
Bram Matthys 54c17aa65d Indicate 's' in WHO reply flags if the user is secure (SSL/TLS). 2018-12-21 14:21:19 +01:00
Bram Matthys bb0530f694 In the authprompt documentation point the user to (possibly) tweaking
the set::handshake-timeout setting as well.
2018-12-21 13:24:25 +01:00
Bram Matthys 7755d10829 [authprompt] Suggest /QUOTE AUTH .. instead of /AUTH .. 2018-12-21 07:58:38 +01:00
Bram Matthys 62e30ec342 Fix typo in config warning. 2018-12-21 07:58:12 +01:00
Bram Matthys 267c2f3e56 Make authprompt work for soft KLINE/GLINE and soft-xx ban actions
(in registration phase anyway), as promised earlier in the documentation.
2018-12-19 17:42:13 +01:00
Bram Matthys 7f8172faef Bump fakelag on failed authentication attempt (SASL, real or emulated) 2018-12-19 17:41:28 +01:00
Bram Matthys 7aaf5e9a42 Update release notes regarding a fix from today.
[skip ci]
2018-12-19 17:13:39 +01:00
Bram Matthys 88fadc134d Fix build issue on Windows
[skip travis ci]
2018-12-19 13:58:44 +01:00
Bram Matthys 0ac56e4444 Fix line number in error messages being off, as reported in
https://bugs.unrealircd.org/view.php?id=5169
caused by commit 51ed51dff1
2018-12-19 13:50:09 +01:00
Bram Matthys 56a964bba1 Hide remote includes auth information in error messages. Reported by Jellis
in https://bugs.unrealircd.org/view.php?id=5172
2018-12-19 13:02:36 +01:00
Bram Matthys 6b089dfcd6 The new module is now called authprompt. Also wrote an article:
https://www.unrealircd.org/docs/Authentication
And "require sasl" is now "require authentication"
(the old name will only raise a warning, not cause an error)

Note that authprompt currently only does the "require authentication"
stuff and not yet the soft-xx actions. That will be something for
later this week, but I've already documented it as such (here and
there anyway).
2018-12-17 17:32:43 +01:00
Bram Matthys b1e1b6d9d5 quick fix for build tests, will fix later. 2018-12-16 16:40:35 +01:00
Bram Matthys ce4aeff63f Add saslemulation to Windows makefile.
[skip travis ci]
2018-12-16 15:53:12 +01:00
Bram Matthys 2ed958f2ee Fix typo in modules.optional.conf. 2018-12-16 15:52:04 +01:00
Bram Matthys 9f3e060a3d This is a better one line description. 2018-12-16 13:56:17 +01:00
Bram Matthys 0254894368 Authentication prompt for non-SASL users:
We previously introduced the "require sasl" block which allows you to
force users from certain IP addresses to authenticate with their nickname
and password via SASL. We now offer a new experimental module called
'saslemulation' which will help non-SASL users by showing a notice and
asking them to authenticate to their account via /AUTH <user>:<pass>.
See https://www.unrealircd.org/docs/Set_block#set::sasl-emulation

Note that this is work in progress, although the functionality of
already works. Still need to do some cleaning and expand the scope.
And more testing...
2018-12-16 13:51:22 +01:00
k4bek4be c124f65027 fix IPv6 DNS blacklist (#78)
Fix IPv6 blacklist checking (DNSBL). Patch from k4be.
2018-12-15 19:53:33 +01:00
Bram Matthys 3774e5661f Fix for *-with-override operclasses. 2018-12-14 18:10:14 +01:00
Bram Matthys a0167c35c0 Major reorganization of operclass privileges:
* The operclass privileges have been redone. Since there were 50+ changes
  to the 100+ privileges it makes little sense to list the changes here.
  If, like 99% of the users, you use default operclasses such as "globop"
  and "admin-with-override" then you don't need to do anything.
  However, if you have custom operclass { } blocks then the privileges
  will have to be redone. For more information on the conversion process,
  see https://www.unrealircd.org/docs/FAQ#New_operclass_permissions
  For the new list of permissions, with much better naming and grouping:
  https://www.unrealircd.org/docs/Operclass_permissions
The inconsistency in the privileges was initially reported by webczat in
https://bugs.unrealircd.org/view.php?id=4771
The subsequent reorganization took two full days, so.. hopefully the
people who are using - or plan to use - custom operclasses will like the
new layout... except that they need to redo their work of course ;)
2018-12-14 17:05:32 +01:00
Bram Matthys e470541a8b Windows............ whatever. 2018-12-10 18:28:13 +01:00
Bram Matthys 267f6adc54 Tadah. Fix vs2017, reported by Gottem. 2018-12-10 18:15:22 +01:00
Bram Matthys 7dcb5a5bb1 The authentication types 'md5', 'sha1' and 'ripemd160' have been
deprecated because they can be cracked at high speeds. They still
work, but a warning will be shown on boot and on rehash.
Please use 'bcrypt' or (even better) the new 'argon2' type instead:
"./unrealircd mkpasswd argon2" or "/mkpasswd argon2 passwd" on IRC.

Also, not in release notes because it would take up too much text:
Unix crypt is a bit more complicated: most types are outright 'bad',
while other types have reasonable security similar to 'bcrypt'.
To be honest these people should probably use 'argon2' since it's
a lot better. Then again, warning about this when it's still such
a common hashing method (now, in 2018) may be a bit overzealous.
So: not warning about crypt types $5/$6 which use SHA256/SHA512
with normally at least 5000 rounds (unless deliberately weakened
by the user), but we do warn about other crypt() usage.

Also, mkpasswd support for those deprecated types has been removed since
there's no good reason to generate new password hashes with these.
2018-12-10 15:46:11 +01:00
Bram Matthys 02184fe3a0 Write release notes (reflecting current state, anyway).
[skip ci]
2018-12-10 09:00:35 +01:00
Bram Matthys b335f8c284 Remove -lrt and -ldl for systems lacking pkg-config and building with
system libargon2.
2018-12-10 08:49:30 +01:00
Bram Matthys 8bbcd94071 Set UnrealIRCd version to 4.2.1-dev 2018-12-10 08:24:57 +01:00
Bram Matthys 9fdd93f0e4 Fix libargon2 autodetection (system lib). 2018-12-10 08:19:41 +01:00
Bram Matthys 942da806dd Make build test compile with Argon2 lib 2018-12-09 17:56:04 +01:00
Bram Matthys a852b480d5 Add support for Argon2 password hashes (argon2id).
Also, make this the default for './unrealircd mkpasswd'.
The Windows version also works.. I just need to create a new library
package, will be done later today or tomorrow.
https://bugs.unrealircd.org/view.php?id=5116
2018-12-09 17:22:12 +01:00
Bram Matthys 459a55245a No longer require "};" in config files, from now on "}" will suffice.
Note that both }; and } forms are accepted now, even mixed, and this
will not raise a warning or error.
I've always found it odd that we required a ; after }. In a language
like C for typedef structs it has some meaning since there could be
an alias between the } and the ;, but in UnrealIRCd there's no such
thing.
2018-12-08 16:03:58 +01:00
Bram Matthys 51ed51dff1 Remove non-standard 'nested comments' features, also known as
"comments within comments are not ignored".
Reported by bekarfel in https://bugs.unrealircd.org/view.php?id=4075
FAQ entry: https://www.unrealircd.org/docs/FAQ#Nesting_comments
2018-12-08 15:51:50 +01:00
Bram Matthys 7cd0bbbcb9 On second thought, for m_whox the priority is not important,
so set it to zero (0).
2018-12-08 15:29:02 +01:00
Bram Matthys 9cfff2d07d In 4.2.0 we added support for priorities in CmdoverrideAddEx(),
however it turns out they were accidentally reversed.
This is now corrected: highest number = highest prioty.
Reported by Gottem in https://bugs.unrealircd.org/view.php?id=5162
2018-12-08 15:23:42 +01:00
Bram Matthys 8d1047d4e9 Remove old function is_irc_banned(). Ahhh, WebTV times.. 2018-12-08 13:06:41 +01:00
Bram Matthys 84686f02bb Fix checking for target nick bans (cannot change to a nick that is banned).
This was and still is the default, set::check-target-nick-bans 'yes', however
the feature was broken since UnrealIRCd 4.0.0 (-betaX) by commit
709c7e890e. Reported by PeGaSuS and St3Nl3y.
2018-12-08 13:01:27 +01:00
Bram Matthys 4bef3a5238 Nothing important. Update comments of place_host_ban() and add an explicit
'case BAN_ACT_SOFT_KILL', even though it is already handled by 'case default'.
2018-11-21 14:26:35 +01:00
Bram Matthys 4a0dcc5f13 Load antimixedutf8 from modules.optional.conf 2018-11-21 12:35:25 +01:00
Bram Matthys 9d5e46c43c Set default score to 10. Prevents innocent Russians from getting caught :D 2018-11-18 20:07:09 +01:00
Bram Matthys 9f7b8997f2 Fix stupid bug for <4.2.0, reported by PeGaSuS 2018-11-18 19:52:54 +01:00
Bram Matthys 112c5d922e Fixes for Cyrillic (false positives when speaking Russian, etc...) 2018-11-18 19:39:39 +01:00
Bram Matthys b89bd719a7 Compatibility... 2018-11-18 18:50:45 +01:00
Bram Matthys d0799a0f04 Build antimixedutf8 2018-11-18 18:28:28 +01:00
Vitor 6f3ef8e3a7 Update help.conf (#76)
Update help.conf with +Z and +D
2018-11-18 18:21:34 +01:00
Vitor 4b5e950ffd Update antimixedutf8.c (#77)
Fix credits in antimixedutf8.
2018-11-18 17:00:55 +01:00
Bram Matthys 793e827218 Add "anti mixed utf8" module (antimixedutf8):
This module will detect and stop spam containing of characters of
mixed "scripts", where some characters are in Latin script and other
characters are in Cyrillic.
This unusual behavior can be detected easily and action can be taken.

loadmodule "antimixedutf8"; /* or third/antimixedutf8 */
set {
        antimixedutf8 {
                score 5;
                ban-action block;
                ban-reason "Possible mixed character spam";
                ban-time 4h; // For other types
        };
};
2018-11-18 15:19:11 +01:00
Bram Matthys d11b3228e6 ** UnrealIRCd 4.2.0 ** 2018-09-29 21:31:35 +02:00
Bram Matthys 98a33f7485 Windows: modules.optional.conf missing 2018-09-29 20:08:26 +02:00
Bram Matthys 02d69e7d83 Update release notes / version 2018-09-28 15:32:31 +02:00
Bram Matthys 2509482e02 Update UnrealIRCd version 2018-09-28 09:31:35 +02:00
Bram Matthys 6acfa3404b UnrealIRCd version updates 2018-09-28 09:26:40 +02:00
592 changed files with 167927 additions and 93129 deletions
-20
View File
@@ -1,20 +0,0 @@
_ _ _ ___________ _____ _
| | | | | |_ _| ___ \/ __ \ | |
| | | |_ __ _ __ ___ __ _| | | | | |_/ /| / \/ __| |
| | | | '_ \| '__/ _ \/ _ | | | | | / | | / _ |
| |_| | | | | | | __/ (_| | |_| |_| |\ \ | \__/\ (_| |
\___/|_| |_|_| \___|\__,_|_|\___/\_| \_| \____/\__,_|
Configuration Program
for UnrealIRCd 4.0.19-rc2
This program will help you to compile your IRC server, and ask you
questions regarding the compile-time settings of it during the process.
regarding the setup of it, during the process.
A short installation guide is available online at:
https://www.unrealircd.org/docs/Installing_from_source
Full documentation is available at:
https://www.unrealircd.org/docs/UnrealIRCd_4_documentation
+2
View File
@@ -0,0 +1,2 @@
github: [syzop]
patreon: UnrealIRCd
+59
View File
@@ -0,0 +1,59 @@
name: Linux CI
on:
push:
branches: ["unreal60_dev"]
pull_request:
branches: ["unreal60_dev"]
permissions:
contents: read
packages: read
env:
NOSERVICES: 1
RUNTESTFLAGS: "-slightlyfast"
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
compiler:
- { c: gcc, cpp: g++ }
- { c: clang, cpp: clang++ }
env:
CC: ${{ matrix.compiler.c }}
CXX: ${{ matrix.compiler.cpp }}
steps:
- name: Checkout
#uses: actions/checkout@v4
#no, pin to v4.2.2 for security reasons:
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
#and we don't need the credentials later..
with:
persist-credentials: false
fetch-depth: 1
- name: Install dependencies
run: |
sudo rm -f /var/lib/man-db/auto-update
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
build-essential pkg-config libssl-dev libpcre2-dev libargon2-dev \
libsodium-dev libc-ares-dev libcurl4-openssl-dev libjansson-dev
- name: Install python dependencies
run: |
python -m pip install --break-system-packages pyasyncore pyasynchat
- name: Build
run: extras/build-tests/nix/build
- name: Run tests
run: extras/build-tests/nix/run-tests
+23 -4
View File
@@ -6,12 +6,9 @@ conftest.*
config.settings
extras/pcre2*
extras/c-ares*
extras/regexp*
config.status
extras/tre*
extras/ircdcron/ircd.cron
extras/ircdcron/ircdchk
src/modules/snomasks/Makefile
src/modules/chanmodes/Makefile
src/modules/extbans/Makefile
src/modules/usermodes/Makefile
@@ -33,10 +30,11 @@ tags
server.cert.pem
server.key.pem
server.req.pem
ssl.rnd
tls.rnd
# Ignores for platform stuff
.DS_Store
[D|d]esktop.ini
# Ignores for build artifacts
*.so
@@ -47,6 +45,24 @@ src/ircd
src/version.c
src/include
# Ignores for windows stuff
## Binaries
*.dll
*.exe
*.map
*.pdb
*.lib
## Build artifacts
*.obj
*.exp
*.ilk
*.res
##Other
*.tmp
UnrealIRCd.def*
*.nativecodeanalysis.xml
# Ignores for mac stuff
## Various settings
*.pbxuser
@@ -72,3 +88,6 @@ xcuserdata
src/macosx/build/
DerivedData
src/macosx/pods/
# Doxygen generated files
doc/doxygen/
-6
View File
@@ -1,6 +0,0 @@
[submodule "extras/tests/ircfly"]
path = extras/tests/ircfly
url = https://github.com/unrealircd/ircfly.git
[submodule "extras/tests/functional-tests"]
path = extras/tests/functional-tests
url = https://github.com/unrealircd/unrealircd-tests.git
-28
View File
@@ -1,28 +0,0 @@
language: c
os:
- linux
compiler:
- clang
- gcc
script: extras/build-tests/nix/build $BUILDCONFIG
env:
- BUILDCONFIG=""
- BUILDCONFIG="system-cares"
- BUILDCONFIG="system-cares system-curl"
- BUILDCONFIG="local-curl"
matrix:
include:
- os: osx
env: BUILDCONFIG=""
- os: osx
env: BUILDCONFIG="system-cares"
- os: osx
env: BUILDCONFIG="system-cares system-curl"
- os: osx
env: BUILDCONFIG="local-curl"
- env: BUILDCONFIG="libressl-25"
- env: BUILDCONFIG="libressl-26"
- env: BUILDCONFIG="libressl-27"
- env: BUILDCONFIG="openssl-102"
- env: BUILDCONFIG="openssl-110"
- env: BUILDCONFIG="openssl-111"
+4
View File
@@ -0,0 +1,4 @@
.DONE:
@echo "Please use GNU Make (gmake) to build UnrealIRCd"
.DEFAULT:
@echo "Please use GNU Make (gmake) to build UnrealIRCd"
+5
View File
@@ -0,0 +1,5 @@
Help out and make UnrealIRCd a better product!
You can do so by reporting issues, testing, programming, documenting,
translating, helping others, and more.
See https://www.unrealircd.org/docs/Contributing
+575 -548
View File
File diff suppressed because it is too large Load Diff
+86 -98
View File
@@ -34,11 +34,11 @@ FROMDOS=/home/cmunk/bin/4dos
#
#XCFLAGS=-O -g -export-dynamic
IRCDLIBS=@IRCDLIBS@ @TRE_LIBS@ @PCRE2_LIBS@ @CARES_LIBS@ @PTHREAD_LIBS@
IRCDLIBS=@IRCDLIBS@ @PCRE2_LIBS@ @ARGON2_LIBS@ @CARES_LIBS@ @SODIUM_LIBS@ @JANSSON_LIBS@ @PTHREAD_LIBS@
CRYPTOLIB=@CRYPTOLIB@
OPENSSLINCLUDES=
XCFLAGS=@PTHREAD_CFLAGS@ @TRE_CFLAGS@ @PCRE2_CFLAGS@ @CARES_CFLAGS@ @CFLAGS@ @HARDEN_CFLAGS@ @CPPFLAGS@
XCFLAGS=@PTHREAD_CFLAGS@ @PCRE2_CFLAGS@ @ARGON2_CFLAGS@ @CARES_CFLAGS@ @SODIUM_CFLAGS@ @JANSSON_CFLAGS@ @CFLAGS@ @HARDEN_CFLAGS@ @CPPFLAGS@
#
# use the following on MIPS:
#CFLAGS= -systype bsd43 -DSYSTYPE_BSD43 -I$(INCLUDEDIR)
@@ -89,27 +89,18 @@ XCFLAGS=@PTHREAD_CFLAGS@ @TRE_CFLAGS@ @PCRE2_CFLAGS@ @CARES_CFLAGS@ @CFLAGS@ @HA
# you are not defining CMDLINE_CONFIG
IRCDMODE = 711
# Objects that are optional due to optional libraries:
URL=@URL@
# [CHANGEME]
# If you get a link-time error dealing with strtoul, comment out
# this line.
# STRTOUL= strtoul.o
STRTOUL=@STRTOUL@
# [CHANGEME]
# If you get crashes around a specific number of clients, and that
# client load comes close or a little over the system-defined value of
# FD_SETSIZE, override it here and see what happens. You may override
# the system FD_SETSIZE by setting the FD_SETSIZE Makefile variable to
# -DFD_SETSIZE=<some number>.
FD_SETSIZE=@FD_SETSIZE@
GEOIP_CLASSIC_OBJECTS=@GEOIP_CLASSIC_OBJECTS@
GEOIP_CLASSIC_LIBS=@GEOIP_CLASSIC_LIBS@
GEOIP_CLASSIC_CFLAGS=@GEOIP_CLASSIC_CFLAGS@
# Where is your openssl binary
OPENSSLPATH=@OPENSSLPATH@
CFLAGS=-I$(INCLUDEDIR) $(XCFLAGS) $(FD_SETSIZE)
LDFLAGS=@LDFLAGS_PRIVATELIBS@ @HARDEN_LDFLAGS@
CFLAGS=-I$(INCLUDEDIR) $(XCFLAGS)
XLDFLAGS=@LDFLAGS_PRIVATELIBS@ @HARDEN_LDFLAGS@ @LDFLAGS@
LDFLAGS=$(XLDFLAGS)
SHELL=/bin/sh
SUBDIRS=src
@@ -126,10 +117,13 @@ MAKEARGS = 'CFLAGS=${CFLAGS}' 'CC=${CC}' 'IRCDLIBS=${IRCDLIBS}' \
'RES=${RES}' 'BINDIR=${BINDIR}' 'INSTALL=${INSTALL}' \
'INCLUDEDIR=${INCLUDEDIR}' \
'RM=${RM}' 'CP=${CP}' 'TOUCH=${TOUCH}' \
'SHELL=${SHELL}' 'STRTOUL=${STRTOUL}' \
'SHELL=${SHELL}' \
'CRYPTOLIB=${CRYPTOLIB}' \
'CRYPTOINCLUDES=${CRYPTOINCLUDES}' \
'URL=${URL}'
'URL=${URL}' \
'GEOIP_CLASSIC_OBJECTS=${GEOIP_CLASSIC_OBJECTS}' \
'GEOIP_CLASSIC_LIBS=${GEOIP_CLASSIC_LIBS}' \
'GEOIP_CLASSIC_CFLAGS=${GEOIP_CLASSIC_CFLAGS}'
custommodule:
@if test -z "${MODULEFILE}"; then echo "Please set MODULEFILE when calling \`\`make custommodule''. For example, \`\`make custommodule MODULEFILE=callerid''." >&2; exit 1; fi
@@ -148,7 +142,7 @@ build: Makefile
done
@echo ''
@echo '* UnrealIRCd compiled successfully'
@echo '* YOU ARE NOT DONE YET! Run "make install" to install UnrealIRCd !'
@echo '* YOU ARE NOT DONE YET! Run "${MAKE} install" to install UnrealIRCd !'
@echo ''
clean:
@@ -165,7 +159,7 @@ cleandir: clean
rm -rf include/setup.h Makefile Settings
distclean: cleandir
rm -rf extras/*.bak extras/regexp extras/*.tar extras/c-ares
rm -rf extras/*.bak extras/*.tar extras/c-ares
rm -rf extras/c-ares-* extras/tre-*
rm -rf config.log config.settings *.pem ircd.* unrealircd
rm -rf Makefile config.status
@@ -177,57 +171,72 @@ depend:
done
install: all
$(INSTALL) -m 0700 -d @BINDIR@
$(INSTALL) -m 0700 src/ircd @BINDIR@/unrealircd
$(INSTALL) -m 0700 -d @DOCDIR@
$(INSTALL) -m 0600 doc/Authors doc/coding-guidelines doc/tao.of.irc @DOCDIR@
$(INSTALL) -m 0700 -d @CONFDIR@
$(INSTALL) -m 0600 doc/conf/*.default.conf @CONFDIR@
$(INSTALL) -m 0600 doc/conf/*.optional.conf @CONFDIR@
-@if [ ! -f "@CONFDIR@/spamfilter.conf" ] ; then \
$(INSTALL) -m 0600 doc/conf/spamfilter.conf @CONFDIR@ ; \
$(INSTALL) -m 0700 -d $(DESTDIR)@BINDIR@
$(INSTALL) -m 0700 src/ircd $(DESTDIR)@BINDIR@/unrealircd
$(INSTALL) -m 0700 src/unrealircdctl $(DESTDIR)@BINDIR@/unrealircdctl
$(INSTALL) -m 0700 extras/unrealircd-upgrade-script $(DESTDIR)@BINDIR@/unrealircd-upgrade-script
$(INSTALL) -m 0700 -d $(DESTDIR)@DOCDIR@
$(INSTALL) -m 0600 doc/Authors doc/coding-guidelines doc/tao.of.irc doc/KEYS doc/RELEASE-NOTES.md $(DESTDIR)@DOCDIR@
$(INSTALL) -m 0700 -d $(DESTDIR)@CONFDIR@
$(INSTALL) -m 0600 doc/conf/*.default.conf $(DESTDIR)@CONFDIR@
$(INSTALL) -m 0600 doc/conf/*.optional.conf $(DESTDIR)@CONFDIR@
-@if [ ! -f "$(DESTDIR)@CONFDIR@/modules.sources.list" ] ; then \
$(INSTALL) -m 0600 doc/conf/modules.sources.list $(DESTDIR)@CONFDIR@ ; \
fi
-@if [ ! -f "@CONFDIR@/badwords.conf" ] ; then \
$(INSTALL) -m 0600 doc/conf/badwords.conf @CONFDIR@ ; \
-@if [ ! -f "$(DESTDIR)@CONFDIR@/spamfilter.conf" ] ; then \
$(INSTALL) -m 0600 doc/conf/spamfilter.conf $(DESTDIR)@CONFDIR@ ; \
fi
-@if [ ! -f "@CONFDIR@/dccallow.conf" ] ; then \
$(INSTALL) -m 0600 doc/conf/dccallow.conf @CONFDIR@ ; \
-@extras/patches/patch_spamfilter_conf "$(DESTDIR)@CONFDIR@"
-@if [ ! -f "$(DESTDIR)@CONFDIR@/badwords.conf" ] ; then \
$(INSTALL) -m 0600 doc/conf/badwords.conf $(DESTDIR)@CONFDIR@ ; \
fi
$(INSTALL) -m 0700 -d @CONFDIR@/aliases
$(INSTALL) -m 0600 doc/conf/aliases/*.conf @CONFDIR@/aliases
$(INSTALL) -m 0700 -d @CONFDIR@/help
$(INSTALL) -m 0600 doc/conf/help/*.conf @CONFDIR@/help
$(INSTALL) -m 0700 -d @CONFDIR@/examples
$(INSTALL) -m 0600 doc/conf/examples/*.conf @CONFDIR@/examples
$(INSTALL) -m 0700 -d @CONFDIR@/ssl
$(INSTALL) -m 0600 doc/conf/ssl/curl-ca-bundle.crt @CONFDIR@/ssl
$(INSTALL) -m 0700 unrealircd @SCRIPTDIR@
$(INSTALL) -m 0700 -d @MODULESDIR@
$(INSTALL) -m 0700 src/modules/*.so @MODULESDIR@
$(INSTALL) -m 0700 -d @MODULESDIR@/usermodes
$(INSTALL) -m 0700 src/modules/usermodes/*.so @MODULESDIR@/usermodes
$(INSTALL) -m 0700 -d @MODULESDIR@/chanmodes
$(INSTALL) -m 0700 src/modules/chanmodes/*.so @MODULESDIR@/chanmodes
$(INSTALL) -m 0700 -d @MODULESDIR@/snomasks
$(INSTALL) -m 0700 src/modules/snomasks/*.so @MODULESDIR@/snomasks
$(INSTALL) -m 0700 -d @MODULESDIR@/extbans
$(INSTALL) -m 0700 src/modules/extbans/*.so @MODULESDIR@/extbans
$(INSTALL) -m 0700 -d @MODULESDIR@/cap
$(INSTALL) -m 0700 src/modules/cap/*.so @MODULESDIR@/cap
$(INSTALL) -m 0700 -d @MODULESDIR@/third
@#Ugly stuff to detect 0 files in this directory:
@+for f in src/modules/third/*.so; do \
[ -e $f ] && $(INSTALL) -m 0700 src/modules/third/*.so @MODULESDIR@/third || echo; \
done
$(INSTALL) -m 0700 -d @TMPDIR@
$(INSTALL) -m 0700 -d @CACHEDIR@
$(INSTALL) -m 0700 -d @PERMDATADIR@
$(INSTALL) -m 0700 -d @LOGDIR@
-@if [ ! -f "@CONFDIR@/ssl/server.cert.pem" ] ; then \
$(INSTALL) -m 0600 server.req.pem @CONFDIR@/ssl ; \
$(INSTALL) -m 0600 server.key.pem @CONFDIR@/ssl ; \
$(INSTALL) -m 0600 server.cert.pem @CONFDIR@/ssl ; \
-@if [ ! -f "$(DESTDIR)@CONFDIR@/dccallow.conf" ] ; then \
$(INSTALL) -m 0600 doc/conf/dccallow.conf $(DESTDIR)@CONFDIR@ ; \
fi
$(INSTALL) -m 0700 -d $(DESTDIR)@CONFDIR@/aliases
$(INSTALL) -m 0600 doc/conf/aliases/*.conf $(DESTDIR)@CONFDIR@/aliases
$(INSTALL) -m 0700 -d $(DESTDIR)@CONFDIR@/help
$(INSTALL) -m 0600 doc/conf/help/*.conf $(DESTDIR)@CONFDIR@/help
$(INSTALL) -m 0700 -d $(DESTDIR)@CONFDIR@/examples
$(INSTALL) -m 0600 doc/conf/examples/*.conf $(DESTDIR)@CONFDIR@/examples
$(INSTALL) -m 0700 unrealircd $(DESTDIR)@SCRIPTDIR@
$(INSTALL) -m 0700 -d $(DESTDIR)@MODULESDIR@
@rm -f $(DESTDIR)@MODULESDIR@/*.so 1>/dev/null 2>&1
$(INSTALL) -m 0700 src/modules/*.so $(DESTDIR)@MODULESDIR@
$(INSTALL) -m 0700 -d $(DESTDIR)@MODULESDIR@/usermodes
@rm -f $(DESTDIR)@MODULESDIR@/usermodes/*.so 1>/dev/null 2>&1
$(INSTALL) -m 0700 src/modules/usermodes/*.so $(DESTDIR)@MODULESDIR@/usermodes
$(INSTALL) -m 0700 -d $(DESTDIR)@MODULESDIR@/chanmodes
@rm -f $(DESTDIR)@MODULESDIR@/chanmodes/*.so 1>/dev/null 2>&1
$(INSTALL) -m 0700 src/modules/chanmodes/*.so $(DESTDIR)@MODULESDIR@/chanmodes
$(INSTALL) -m 0700 -d $(DESTDIR)@MODULESDIR@/extbans
@rm -f $(DESTDIR)@MODULESDIR@/extbans/*.so 1>/dev/null 2>&1
$(INSTALL) -m 0700 src/modules/extbans/*.so $(DESTDIR)@MODULESDIR@/extbans
$(INSTALL) -m 0700 -d $(DESTDIR)@MODULESDIR@/rpc
@rm -f $(DESTDIR)@MODULESDIR@/rpc/*.so 1>/dev/null 2>&1
$(INSTALL) -m 0700 src/modules/rpc/*.so $(DESTDIR)@MODULESDIR@/rpc
@#If the conf/ssl directory exists then rename it here to conf/tls
@#and add a symlink for backwards compatibility (so that f.e. certbot
@#doesn't randomly fail after an upgrade to U5).
-@if [ -d "$(DESTDIR)@CONFDIR@/ssl" ] ; then \
mv "$(DESTDIR)@CONFDIR@/ssl" "$(DESTDIR)@CONFDIR@/tls" ; \
ln -s "$(DESTDIR)@CONFDIR@/tls" "$(DESTDIR)@CONFDIR@/ssl" ; \
fi
$(INSTALL) -m 0700 -d $(DESTDIR)@CONFDIR@/tls
$(INSTALL) -m 0600 doc/conf/tls/curl-ca-bundle.crt $(DESTDIR)@CONFDIR@/tls
$(INSTALL) -m 0600 doc/conf/tls/tls.cnf $(DESTDIR)@CONFDIR@/tls
@# delete modules/cap directory, to avoid confusing with U4 to U5 upgrades:
rm -rf $(DESTDIR)@MODULESDIR@/cap
$(INSTALL) -m 0700 -d $(DESTDIR)@MODULESDIR@/third
@rm -f $(DESTDIR)@MODULESDIR@/third/*.so 1>/dev/null 2>&1
@#This step can fail with zero files, so we ignore exit status:
-$(INSTALL) -m 0700 src/modules/third/*.so $(DESTDIR)@MODULESDIR@/third
$(INSTALL) -m 0700 -d $(DESTDIR)@TMPDIR@
$(INSTALL) -m 0700 -d $(DESTDIR)@CACHEDIR@
$(INSTALL) -m 0700 -d $(DESTDIR)@PERMDATADIR@
$(INSTALL) -m 0700 -d $(DESTDIR)@LOGDIR@
@rm -f $(DESTDIR)@SCRIPTDIR@/source
ln -s @BUILDDIR@ $(DESTDIR)@SCRIPTDIR@/source
@echo ''
@echo '* UnrealIRCd is now installed.'
@@ -244,41 +253,20 @@ install: all
@echo '* To start/stop UnrealIRCd run: @SCRIPTDIR@/unrealircd"'
@echo ''
@echo '* Consult the documentation online at:'
@echo ' * https://www.unrealircd.org/docs/UnrealIRCd_4_documentation'
@echo ' * https://www.unrealircd.org/docs/'
@echo ' * https://www.unrealircd.org/docs/FAQ'
@echo '* You may also wish to install a cron job to ensure UnrealIRCd is always running:'
@echo ' * https://www.unrealircd.org/docs/Cron_job'
@echo ''
@echo '* To ensure UnrealIRCd automatically starts on system startup:'
@echo ' * Install a cron job: https://www.unrealircd.org/docs/Cron_job'
@echo ' * Or, use systemd: https://www.unrealircd.org/docs/Using_systemd_with_UnrealIRCd'
@echo ''
-@if [ "@SCRIPTDIR@/bin" = "@BINDIR@" ] ; then \
echo 'Again, be sure to change to the @SCRIPTDIR@ directory!' ; \
fi
### TODO: all the stuff below ;) ###
pem: src/ssl.cnf
@echo "Generating certificate request .. "
$(OPENSSLPATH) req -new \
-config src/ssl.cnf -sha256 -out server.req.pem \
-keyout server.key.pem -nodes
@echo "Generating self-signed certificate .. "
$(OPENSSLPATH) req -x509 -days 3650 -sha256 -in server.req.pem \
-key server.key.pem -out server.cert.pem
@echo "Generating fingerprint .."
$(OPENSSLPATH) x509 -subject -dates -sha256 -fingerprint -noout \
-in server.cert.pem
@echo "Setting o-rwx & g-rwx for files... "
chmod o-rwx server.req.pem server.key.pem server.cert.pem
chmod g-rwx server.req.pem server.key.pem server.cert.pem
@echo "Done!. If you want to encrypt the private key, run"
@echo "make encpem"
encpem: server.key.pem
@echo "Encrypting server key .."
$(OPENSSLPATH) rsa -in server.key.pem -out server.key.c.pem -des3
-@if [ -f server.key.c.pem ] ; then \
echo "Replacing unencrypted with encrypted .." ; \
cp server.key.c.pem server.key.pem ; \
rm -f server.key.c.pem ; \
fi
pem:
@echo "The command 'make pem' is no longer used to generate the TLS certificate."
@echo "Please run './unrealircd mkcert' instead."
Makefile: config.status Makefile.in
./config.status
+1465
View File
File diff suppressed because it is too large Load Diff
+42 -46
View File
@@ -1,57 +1,53 @@
[![Build Status - *NIX](https://travis-ci.org/unrealircd/unrealircd.svg?branch=unreal40)](https://travis-ci.org/unrealircd/unrealircd)
[![Build Status - Windows](https://ci.appveyor.com/api/projects/status/9kgectl2mfyia0s5/branch/unreal40?svg=true)](https://ci.appveyor.com/project/syzop/unrealircd/branch/unreal40)
[![Mastodon Follow](https://img.shields.io/mastodon/follow/110769722108208212?domain=https%3A%2F%2Ffosstodon.org&style=social&label=Follow)](https://fosstodon.org/@unrealircd)
[![Twitter Follow](https://img.shields.io/twitter/follow/Unreal_IRCd.svg?style=social&label=Follow)](https://twitter.com/Unreal_IRCd)
[![Linux CI](https://github.com/unrealircd/unrealircd/actions/workflows/linux-ci.yml/badge.svg)](https://github.com/unrealircd/unrealircd/actions/workflows/linux-ci.yml)
## About UnrealIRCd
UnrealIRCd is an Open Source IRC Server, serving thousands of networks since 1999.
UnrealIRCd is an Open Source IRC Server, serving thousands of networks since 1999.
It runs on Linux, OS X and Windows and is currently the most widely deployed IRCd
with a market share of over 50%. UnrealIRCd is a highly advanced IRCd with a strong
focus on modularity, an advanced and highly configurable configuration file.
Key features include SSL, cloaking, its advanced anti-flood and anti-spam systems,
swear filtering and module support. We are also particularly proud on our extensive
online documentation.
with a [market share of 37%](https://www.ircstats.org/servers). UnrealIRCd is a
highly advanced IRCd with a strong focus on modularity and security. It uses an
advanced and highly configurable configuration file. Other key features include:
full IRCv3 support, SSL/TLS, cloaking, JSON-RPC, advanced anti-flood and anti-spam
systems, GeoIP, remote includes, and lots of [other features](https://www.unrealircd.org/docs/About_UnrealIRCd).
We are also particularly proud on our extensive online documentation.
## Versions
* UnrealIRCd 6 is the *stable* series since December 2021. It is the only supported version.
* For full details of release scheduling and EOL dates, see
[UnrealIRCd releases](https://www.unrealircd.org/docs/UnrealIRCd_releases) on the wiki
## How to get started
Please consult our excellent online documentation at https://www.unrealircd.org/docs/
when setting up the IRCd!
Follow the installation guide on the wiki. See:
* [Installing from source for *NIX](https://www.unrealircd.org/docs/Installing_from_source)
* [Installation instructions for Windows](https://www.unrealircd.org/docs/Installing_(Windows))
### Step 1: Installation
#### Windows
Simply download the UnrealIRCd Windows version from www.unrealircd.org
Alternatively you can compile UnrealIRCd for Windows yourself. However this is not straightforward and thus not recommended.
#### *BSD/Linux/macOS
First you must compile the IRCd:
* Run `./Config`
* Run `make`
* Run `make install`
* Now change to the directory where you installed UnrealIRCd, e.g. `cd /home/xxxx/unrealircd`
### Step 2: Configuration
Configuration files are stored in the conf/ folder by default (eg: /home/xxxx/unrealircd/conf)
#### Create a configuration file
If you are new, then you need to create your own configuration file:
Copy conf/examples/example.conf to conf/ and call it unrealircd.conf.
Then open it in an editor and carefully modify it using the documentation and FAQ as a guide (see below).
### Step 3: Booting
#### Linux/*BSD/macOS
Run `./unrealircd start` in the directory where you installed UnrealIRCd.
#### Windows
Start -> All Programs -> UnrealIRCd -> UnrealIRCd
## Documentation & FAQ
You can find the **documentation** online at: https://www.unrealircd.org/docs/
## Documentation and Support
You can find all **documentation** online at: https://www.unrealircd.org/docs/
We also have a good **FAQ**: https://www.unrealircd.org/docs/FAQ
## Website, support, and other links ##
* https://www.unrealircd.org - Our main website
* https://forums.unrealircd.org - Support
If you are in need of support, you can pop up on [**#unreal-support** on `irc.unrealircd.org`](ircs://irc.unrealircd.org:6697/unreal-support)
or ask your question on the [forums](https://forums.unrealircd.org).
## Supported systems
We try to **support** all major *NIX systems: all Linux distros but also NetBSD, OpenBSD and macOS,
provided the OS version was released within the past ~5 years.
We use a private BuildBot instance to test each commit. The **tested** systems are (others are
likely to work too):
* Linux: Debian (10, 11, 12, 13), Ubuntu (18.04, 20.04, 22.04, 24.04, 26.04)
* FreeBSD: 15
* Windows: 11
UnrealIRCd is architecture-agnostic. Most of the BuildBot workers run on x64 but we
also have some on x86 and arm64 to ensure these work as well.
## Other links ##
* https://www.unrealircd.org - Main website
* https://bugs.unrealircd.org - Bug tracker
* ircs://irc.unrealircd.org:6697/unreal-support - IRC support
* https://fosstodon.org/@unrealircd - Mastodon
* https://twitter.com/Unreal_IRCd - Twitter
* [SECURITY.md](https://github.com/unrealircd/unrealircd/blob/unreal60_dev/SECURITY.md#security-policy) - How to report security issues
* [LICENSE](https://github.com/unrealircd/unrealircd/blob/unreal60_dev/LICENSE) - LICENSE: GPLv2 or later
* [Contributing](https://www.unrealircd.org/docs/Contributing) - How to help: report bugs, test, write or translate documentations, ..
+70
View File
@@ -0,0 +1,70 @@
# Security Policy
## Supported Versions
* The latest *stable* release of UnrealIRCd 6
See [UnrealIRCd releases](https://www.unrealircd.org/docs/UnrealIRCd_releases)
for information on older versions and End Of Life dates.
## Scope
In general, issues triggered by regular users involving memory safety issues
(such as OOB read/write or UAF), sensitive information disclosure, privilege elevation,
Denial of Service (e.g. a crash), or remote code execution fall within the scope of
this security policy.
Issues that require IRCOp rights, server-to-server traffic, or editing of config
files may still fall within scope, but are classified case by case depending on
the impact and circumstances.
Issues that require shell access as the same user running UnrealIRCd are not
considered security issues. See the
[full policy](https://www.unrealircd.org/docs/Policy:_Handling_of_security_issues)
for details.
## Use of AI or other tools
It is normal and acceptable to use tools for finding security vulnerabilities.
We use them ourselves as well: AI, static code analyzers, fuzzing. This is all fine.
If a tool flagged an issue then we ask only **one extra thing**: that you
**reproduce the issue** on your own local server. So: confirm the issue by
actually running UnrealIRCd with a reproducer (which usually means: by sending
IRC traffic to trigger the bug). This is because tools regularly flag something
as an issue but in practice it may be impossible to happen because of some extra
check somewhere or other requirements.
If you are trying to reproduce an issue, then we suggest running `./Config` and
answering `Yes` to the near-last question about AddressSanitizer (ASan),
especially for memory safety issues. Please include the reproducer and any
relevant ASan output in the bug report. ASan output is useful even if a normal
build does not visibly crash. It helps us a lot.
If you used AI, static code analyzers, fuzzing, or similar tools and fail to
follow the procedure above, expect us to ask you again to reproduce the issue.
If you refuse to do so, don't respond in a timely manner, or keep sending reports
without doing so after we asked, then we will close the bug report. For repeat
offenders, we may proceed with putting you on ignore, banning or deleting your
account, or similar. Giving a reproducer is not a big ask and is normal procedure
nowadays. It should be part of your standard workflow if you are a security
researcher.
## Reporting a Vulnerability
Please report issues on the [bug tracker](https://bugs.unrealircd.org) and in
the bug submit form **set the 'View Status' to 'private'**.
Do not report security issues as a Pull Request, on the forums or in a public
IRC channel such as #unreal-support. If you insist on e-mail then you can use
syzop@unrealircd.org or security@unrealircd.org. Again, the bug tracker is
preferred.
If you found a real issue but are *unsure* if it is a security issue, then
report it at the bug tracker as a 'private' bug anyway. Better safe than sorry.
Do not ask around in public channels or forums.
You should get a response or at least an acknowledgement soon. If you don't hear
back within 24 hours, then please try to contact us again.
## Full policy
See https://www.unrealircd.org/docs/Policy:_Handling_of_security_issues for full information.
-10
View File
@@ -1,10 +0,0 @@
version: 4.0.x-devbuild-{build}
environment:
matrix:
- APPVEYOR_BUILD_WORKER_IMAGE: "Visual Studio 2017"
TARGET: "Visual Studio 2017"
SHORTNAME: "vs2017"
init:
- cmd: git config --global core.autocrlf true
build_script:
- cmd: call extras\\build-tests\\windows\\build.bat
+995 -685
View File
File diff suppressed because it is too large Load Diff
+1518 -1444
View File
File diff suppressed because it is too large Load Diff
+343
View File
@@ -0,0 +1,343 @@
# pkg.m4 - Macros to locate and use pkg-config. -*- Autoconf -*-
# serial 12 (pkg-config-0.29.2)
dnl Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
dnl Copyright © 2012-2015 Dan Nicholson <dbn.lists@gmail.com>
dnl
dnl This program is free software; you can redistribute it and/or modify
dnl it under the terms of the GNU General Public License as published by
dnl the Free Software Foundation; either version 2 of the License, or
dnl (at your option) any later version.
dnl
dnl This program is distributed in the hope that it will be useful, but
dnl WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
dnl General Public License for more details.
dnl
dnl You should have received a copy of the GNU General Public License
dnl along with this program; if not, write to the Free Software
dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
dnl 02111-1307, USA.
dnl
dnl As a special exception to the GNU General Public License, if you
dnl distribute this file as part of a program that contains a
dnl configuration script generated by Autoconf, you may include it under
dnl the same distribution terms that you use for the rest of that
dnl program.
dnl PKG_PREREQ(MIN-VERSION)
dnl -----------------------
dnl Since: 0.29
dnl
dnl Verify that the version of the pkg-config macros are at least
dnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's
dnl installed version of pkg-config, this checks the developer's version
dnl of pkg.m4 when generating configure.
dnl
dnl To ensure that this macro is defined, also add:
dnl m4_ifndef([PKG_PREREQ],
dnl [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])])
dnl
dnl See the "Since" comment for each macro you use to see what version
dnl of the macros you require.
m4_defun([PKG_PREREQ],
[m4_define([PKG_MACROS_VERSION], [0.29.2])
m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1,
[m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])])
])dnl PKG_PREREQ
dnl PKG_PROG_PKG_CONFIG([MIN-VERSION])
dnl ----------------------------------
dnl Since: 0.16
dnl
dnl Search for the pkg-config tool and set the PKG_CONFIG variable to
dnl first found in the path. Checks that the version of pkg-config found
dnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is
dnl used since that's the first version where most current features of
dnl pkg-config existed.
AC_DEFUN([PKG_PROG_PKG_CONFIG],
[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
fi
if test -n "$PKG_CONFIG"; then
_pkg_min_version=m4_default([$1], [0.9.0])
AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
PKG_CONFIG=""
fi
fi[]dnl
])dnl PKG_PROG_PKG_CONFIG
dnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
dnl -------------------------------------------------------------------
dnl Since: 0.18
dnl
dnl Check to see whether a particular set of modules exists. Similar to
dnl PKG_CHECK_MODULES(), but does not set variables or print errors.
dnl
dnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
dnl only at the first occurrence in configure.ac, so if the first place
dnl it's called might be skipped (such as if it is within an "if", you
dnl have to call PKG_CHECK_EXISTS manually
AC_DEFUN([PKG_CHECK_EXISTS],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
if test -n "$PKG_CONFIG" && \
AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
m4_default([$2], [:])
m4_ifvaln([$3], [else
$3])dnl
fi])
dnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
dnl ---------------------------------------------
dnl Internal wrapper calling pkg-config via PKG_CONFIG and setting
dnl pkg_failed based on the result.
m4_define([_PKG_CONFIG],
[if test -n "$$1"; then
pkg_cv_[]$1="$$1"
elif test -n "$PKG_CONFIG"; then
PKG_CHECK_EXISTS([$3],
[pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes ],
[pkg_failed=yes])
else
pkg_failed=untried
fi[]dnl
])dnl _PKG_CONFIG
dnl _PKG_SHORT_ERRORS_SUPPORTED
dnl ---------------------------
dnl Internal check to see if pkg-config supports short errors.
AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
_pkg_short_errors_supported=yes
else
_pkg_short_errors_supported=no
fi[]dnl
])dnl _PKG_SHORT_ERRORS_SUPPORTED
dnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
dnl [ACTION-IF-NOT-FOUND])
dnl --------------------------------------------------------------
dnl Since: 0.4.0
dnl
dnl Note that if there is a possibility the first call to
dnl PKG_CHECK_MODULES might not happen, you should be sure to include an
dnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
AC_DEFUN([PKG_CHECK_MODULES],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
pkg_failed=no
AC_MSG_CHECKING([for $2])
_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
_PKG_CONFIG([$1][_LIBS], [libs], [$2])
m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
and $1[]_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.])
if test $pkg_failed = yes; then
AC_MSG_RESULT([no])
_PKG_SHORT_ERRORS_SUPPORTED
if test $_pkg_short_errors_supported = yes; then
$1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
else
$1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
fi
# Put the nasty error message in config.log where it belongs
echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
m4_default([$4], [AC_MSG_ERROR(
[Package requirements ($2) were not met:
$$1_PKG_ERRORS
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.
_PKG_TEXT])[]dnl
])
elif test $pkg_failed = untried; then
AC_MSG_RESULT([no])
m4_default([$4], [AC_MSG_FAILURE(
[The pkg-config script could not be found or is too old. Make sure it
is in your PATH or set the PKG_CONFIG environment variable to the full
path to pkg-config.
_PKG_TEXT
To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
])
else
$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
AC_MSG_RESULT([yes])
$3
fi[]dnl
])dnl PKG_CHECK_MODULES
dnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
dnl [ACTION-IF-NOT-FOUND])
dnl ---------------------------------------------------------------------
dnl Since: 0.29
dnl
dnl Checks for existence of MODULES and gathers its build flags with
dnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags
dnl and VARIABLE-PREFIX_LIBS from --libs.
dnl
dnl Note that if there is a possibility the first call to
dnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to
dnl include an explicit call to PKG_PROG_PKG_CONFIG in your
dnl configure.ac.
AC_DEFUN([PKG_CHECK_MODULES_STATIC],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
_save_PKG_CONFIG=$PKG_CONFIG
PKG_CONFIG="$PKG_CONFIG --static"
PKG_CHECK_MODULES($@)
PKG_CONFIG=$_save_PKG_CONFIG[]dnl
])dnl PKG_CHECK_MODULES_STATIC
dnl PKG_INSTALLDIR([DIRECTORY])
dnl -------------------------
dnl Since: 0.27
dnl
dnl Substitutes the variable pkgconfigdir as the location where a module
dnl should install pkg-config .pc files. By default the directory is
dnl $libdir/pkgconfig, but the default can be changed by passing
dnl DIRECTORY. The user can override through the --with-pkgconfigdir
dnl parameter.
AC_DEFUN([PKG_INSTALLDIR],
[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
m4_pushdef([pkg_description],
[pkg-config installation directory @<:@]pkg_default[@:>@])
AC_ARG_WITH([pkgconfigdir],
[AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
[with_pkgconfigdir=]pkg_default)
AC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
m4_popdef([pkg_default])
m4_popdef([pkg_description])
])dnl PKG_INSTALLDIR
dnl PKG_NOARCH_INSTALLDIR([DIRECTORY])
dnl --------------------------------
dnl Since: 0.27
dnl
dnl Substitutes the variable noarch_pkgconfigdir as the location where a
dnl module should install arch-independent pkg-config .pc files. By
dnl default the directory is $datadir/pkgconfig, but the default can be
dnl changed by passing DIRECTORY. The user can override through the
dnl --with-noarch-pkgconfigdir parameter.
AC_DEFUN([PKG_NOARCH_INSTALLDIR],
[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
m4_pushdef([pkg_description],
[pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
AC_ARG_WITH([noarch-pkgconfigdir],
[AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
[with_noarch_pkgconfigdir=]pkg_default)
AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
m4_popdef([pkg_default])
m4_popdef([pkg_description])
])dnl PKG_NOARCH_INSTALLDIR
dnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
dnl -------------------------------------------
dnl Since: 0.28
dnl
dnl Retrieves the value of the pkg-config variable for the given module.
AC_DEFUN([PKG_CHECK_VAR],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
_PKG_CONFIG([$1], [variable="][$3]["], [$2])
AS_VAR_COPY([$1], [pkg_cv_][$1])
AS_VAR_IF([$1], [""], [$5], [$4])dnl
])dnl PKG_CHECK_VAR
dnl PKG_WITH_MODULES(VARIABLE-PREFIX, MODULES,
dnl [ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND],
dnl [DESCRIPTION], [DEFAULT])
dnl ------------------------------------------
dnl
dnl Prepare a "--with-" configure option using the lowercase
dnl [VARIABLE-PREFIX] name, merging the behaviour of AC_ARG_WITH and
dnl PKG_CHECK_MODULES in a single macro.
AC_DEFUN([PKG_WITH_MODULES],
[
m4_pushdef([with_arg], m4_tolower([$1]))
m4_pushdef([description],
[m4_default([$5], [build with ]with_arg[ support])])
m4_pushdef([def_arg], [m4_default([$6], [auto])])
m4_pushdef([def_action_if_found], [AS_TR_SH([with_]with_arg)=yes])
m4_pushdef([def_action_if_not_found], [AS_TR_SH([with_]with_arg)=no])
m4_case(def_arg,
[yes],[m4_pushdef([with_without], [--without-]with_arg)],
[m4_pushdef([with_without],[--with-]with_arg)])
AC_ARG_WITH(with_arg,
AS_HELP_STRING(with_without, description[ @<:@default=]def_arg[@:>@]),,
[AS_TR_SH([with_]with_arg)=def_arg])
AS_CASE([$AS_TR_SH([with_]with_arg)],
[yes],[PKG_CHECK_MODULES([$1],[$2],$3,$4)],
[auto],[PKG_CHECK_MODULES([$1],[$2],
[m4_n([def_action_if_found]) $3],
[m4_n([def_action_if_not_found]) $4])])
m4_popdef([with_arg])
m4_popdef([description])
m4_popdef([def_arg])
])dnl PKG_WITH_MODULES
dnl PKG_HAVE_WITH_MODULES(VARIABLE-PREFIX, MODULES,
dnl [DESCRIPTION], [DEFAULT])
dnl -----------------------------------------------
dnl
dnl Convenience macro to trigger AM_CONDITIONAL after PKG_WITH_MODULES
dnl check._[VARIABLE-PREFIX] is exported as make variable.
AC_DEFUN([PKG_HAVE_WITH_MODULES],
[
PKG_WITH_MODULES([$1],[$2],,,[$3],[$4])
AM_CONDITIONAL([HAVE_][$1],
[test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"])
])dnl PKG_HAVE_WITH_MODULES
dnl PKG_HAVE_DEFINE_WITH_MODULES(VARIABLE-PREFIX, MODULES,
dnl [DESCRIPTION], [DEFAULT])
dnl ------------------------------------------------------
dnl
dnl Convenience macro to run AM_CONDITIONAL and AC_DEFINE after
dnl PKG_WITH_MODULES check. HAVE_[VARIABLE-PREFIX] is exported as make
dnl and preprocessor variable.
AC_DEFUN([PKG_HAVE_DEFINE_WITH_MODULES],
[
PKG_HAVE_WITH_MODULES([$1],[$2],[$3],[$4])
AS_IF([test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"],
[AC_DEFINE([HAVE_][$1], 1, [Enable ]m4_tolower([$1])[ support])])
])dnl PKG_HAVE_DEFINE_WITH_MODULES
+283 -11
View File
@@ -97,7 +97,7 @@ AC_DEFUN([CHECK_LIBCURL],
with the system-installed libcURL, this is a bad idea which may result in error
messages looking like:
\`\`[error] unrealircd.conf:9: include: error downloading '(http://example.net/ex.conf)': Could not resolve host: example.net (Successful completion)''
error downloading ... Could not resolve host: example.net (Successful completion)
Or UnrealIRCd might even crash.
@@ -130,9 +130,13 @@ AC_DEFUN([CHECK_LIBCURL],
LIBS="$LIBS_SAVEDA"
CFLAGS="$CFLAGS_SAVEDA"
URL="url.o"
AC_SUBST(URL)
dnl Finally, choose the cURL implementation of url.c
URL="url_curl.o"
],[
dnl Choose UnrealIRCds internal implementation of url.c
URL="url_unreal.o"
]) dnl AS_IF(enable_curl)
AC_SUBST(URL)
])
dnl the following 2 macros are based on CHECK_SSL by Mark Ethan Trostler <trostler@juniper.net>
@@ -145,7 +149,7 @@ AC_ARG_ENABLE(ssl,
[enable_ssl=no])
AS_IF([test $enable_ssl != "no"],
[
AC_MSG_CHECKING([for openssl])
AC_MSG_CHECKING([for OpenSSL])
for dir in $enable_ssl /usr/local/opt/openssl /usr/local/ssl /usr/lib/ssl /usr/ssl /usr/pkg /usr/sfw /usr/local /usr; do
ssldir="$dir"
if test -f "$dir/include/openssl/ssl.h"; then
@@ -169,19 +173,74 @@ AS_IF([test $enable_ssl != "no"],
AC_MSG_RESULT(not found)
echo ""
echo "Apparently you do not have both the openssl binary and openssl development libraries installed."
echo "Please install the needed binaries and libraries."
echo "The package is often called 'openssl-dev', 'openssl-devel' or 'libssl-dev'"
echo "After doing so re-run ./Config"
echo "The following packages are required:"
echo "1) The library package is often called 'openssl-dev', 'openssl-devel' or 'libssl-dev'"
echo "2) The binary package is usually called 'openssl'."
echo "NOTE: you or your system administrator needs to install the library AND the binary package."
echo "After doing so, simply re-run ./Config"
exit 1
else
CRYPTOLIB="-lssl -lcrypto";
if test ! "$ssldir" = "/usr" ; then
LDFLAGS="$LDFLAGS -L$ssldir/lib";
if test -d "$ssldir/lib64" ; then
LDFLAGS="$LDFLAGS -L$ssldir/lib64";
else
LDFLAGS="$LDFLAGS -L$ssldir/lib";
fi
dnl check if binary path exists
if test -f "$ssldir/bin/openssl"; then
OPENSSLPATH="$ssldir/bin/openssl";
fi
fi
dnl linking require -ldl?
AC_MSG_CHECKING([OpenSSL linking with -ldl])
SAVE_LIBS="$LIBS"
LIBS="$LIBS $CRYPTOLIB -ldl"
AC_TRY_LINK([#include <openssl/err.h>], [ERR_clear_error();],
[
AC_MSG_RESULT(yes)
CRYPTOLIB="$CRYPTOLIB -ldl"
],
[
AC_MSG_RESULT(no)
dnl linking require both -ldl and -lpthread?
AC_MSG_CHECKING([OpenSSL linking with -ldl and -lpthread])
LIBS="$SAVE_LIBS $CRYPTOLIB -ldl -lpthread"
AC_TRY_LINK([#include <openssl/err.h>], [ERR_clear_error();],
[
AC_MSG_RESULT(yes)
CRYPTOLIB="$CRYPTOLIB -ldl -lpthread"
],
[
AC_MSG_RESULT(no)
])
])
LIBS="$SAVE_LIBS"
fi
])
])
AC_DEFUN([CHECK_SSL_CTX_SET1_SIGALGS_LIST],
[
AC_MSG_CHECKING([for SSL_CTX_set1_sigalgs_list in SSL library])
AC_LANG_PUSH(C)
SAVE_LIBS="$LIBS"
LIBS="$LIBS $CRYPTOLIB"
AC_TRY_LINK([#include <openssl/ssl.h>],
[SSL_CTX *ctx = NULL; SSL_CTX_set1_sigalgs_list(ctx, "test");],
has_function=1,
has_function=0)
LIBS="$SAVE_LIBS"
AC_LANG_POP(C)
if test $has_function = 1; then
AC_MSG_RESULT([yes])
AC_DEFINE([HAS_SSL_CTX_SET1_SIGALGS_LIST], [], [Define if ssl library has SSL_CTX_set1_sigalgs_list])
else
AC_MSG_RESULT([no])
fi
])
AC_DEFUN([CHECK_SSL_CTX_SET1_CURVES_LIST],
[
AC_MSG_CHECKING([for SSL_CTX_set1_curves_list in SSL library])
@@ -190,14 +249,227 @@ SAVE_LIBS="$LIBS"
LIBS="$LIBS $CRYPTOLIB"
AC_TRY_LINK([#include <openssl/ssl.h>],
[SSL_CTX *ctx = NULL; SSL_CTX_set1_curves_list(ctx, "test");],
has_curves=1,
has_curves=0)
has_function=1,
has_function=0)
LIBS="$SAVE_LIBS"
AC_LANG_POP(C)
if test $has_curves = 1; then
if test $has_function = 1; then
AC_MSG_RESULT([yes])
AC_DEFINE([HAS_SSL_CTX_SET1_CURVES_LIST], [], [Define if ssl library has SSL_CTX_set1_curves_list])
else
AC_MSG_RESULT([no])
fi
])
AC_DEFUN([CHECK_SSL_CTX_SET1_GROUPS_LIST],
[
AC_MSG_CHECKING([for SSL_CTX_set1_groups_list in SSL library])
AC_LANG_PUSH(C)
SAVE_LIBS="$LIBS"
LIBS="$LIBS $CRYPTOLIB"
AC_TRY_LINK([#include <openssl/ssl.h>],
[SSL_CTX *ctx = NULL; SSL_CTX_set1_groups_list(ctx, "test");],
has_function=1,
has_function=0)
LIBS="$SAVE_LIBS"
AC_LANG_POP(C)
if test $has_function = 1; then
AC_MSG_RESULT([yes])
AC_DEFINE([HAS_SSL_CTX_SET1_GROUPS_LIST], [], [Define if ssl library has SSL_CTX_set1_groups_list])
else
AC_MSG_RESULT([no])
fi
])
AC_DEFUN([CHECK_SSL_GET_NEGOTIATED_GROUP],
[
AC_MSG_CHECKING([for SSL_get_negotiated_group in SSL library])
AC_LANG_PUSH(C)
SAVE_LIBS="$LIBS"
LIBS="$LIBS $CRYPTOLIB"
AC_TRY_LINK([#include <openssl/ssl.h>],
[SSL *ssl = NULL; SSL_get_negotiated_group(ssl);],
has_function=1,
has_function=0)
LIBS="$SAVE_LIBS"
AC_LANG_POP(C)
if test $has_function = 1; then
AC_MSG_RESULT([yes])
AC_DEFINE([HAS_SSL_GET_NEGOTIATED_GROUP], [], [Define if ssl library has SSL_get_negotiated_group])
else
AC_MSG_RESULT([no])
fi
])
AC_DEFUN([CHECK_SSL_CTX_SET_MIN_PROTO_VERSION],
[
AC_MSG_CHECKING([for SSL_CTX_set_min_proto_version in SSL library])
AC_LANG_PUSH(C)
SAVE_LIBS="$LIBS"
LIBS="$LIBS $CRYPTOLIB"
AC_TRY_LINK([#include <openssl/ssl.h>],
[SSL_CTX *ctx = NULL; SSL_CTX_set_min_proto_version(ctx, TLS1_VERSION);],
has_function=1,
has_function=0)
LIBS="$SAVE_LIBS"
AC_LANG_POP(C)
if test $has_function = 1; then
AC_MSG_RESULT([yes])
AC_DEFINE([HAS_SSL_CTX_SET_MIN_PROTO_VERSION], [], [Define if ssl library has SSL_CTX_set_min_proto_version])
else
AC_MSG_RESULT([no])
fi
])
AC_DEFUN([CHECK_SSL_CTX_SET_SECURITY_LEVEL],
[
AC_MSG_CHECKING([for SSL_CTX_set_security_level in SSL library])
AC_LANG_PUSH(C)
SAVE_LIBS="$LIBS"
LIBS="$LIBS $CRYPTOLIB"
AC_TRY_LINK([#include <openssl/ssl.h>],
[SSL_CTX *ctx = NULL; SSL_CTX_set_security_level(ctx, 1);],
has_function=1,
has_function=0)
LIBS="$SAVE_LIBS"
AC_LANG_POP(C)
if test $has_function = 1; then
AC_MSG_RESULT([yes])
AC_DEFINE([HAS_SSL_CTX_SET_SECURITY_LEVEL], [], [Define if ssl library has SSL_CTX_set_security_level])
else
AC_MSG_RESULT([no])
fi
])
AC_DEFUN([CHECK_ASN1_TIME_diff],
[
AC_MSG_CHECKING([for ASN1_TIME_diff in SSL library])
AC_LANG_PUSH(C)
SAVE_LIBS="$LIBS"
LIBS="$LIBS $CRYPTOLIB"
AC_TRY_LINK([#include <openssl/ssl.h>],
[int one, two; ASN1_TIME_diff(&one, &two, NULL, NULL);],
has_function=1,
has_function=0)
LIBS="$SAVE_LIBS"
AC_LANG_POP(C)
if test $has_function = 1; then
AC_MSG_RESULT([yes])
AC_DEFINE([HAS_ASN1_TIME_diff], [], [Define if ssl library has ASN1_TIME_diff])
else
AC_MSG_RESULT([no])
fi
])
AC_DEFUN([CHECK_X509_get0_notAfter],
[
AC_MSG_CHECKING([for X509_get0_notAfter in SSL library])
AC_LANG_PUSH(C)
SAVE_LIBS="$LIBS"
LIBS="$LIBS $CRYPTOLIB"
AC_TRY_LINK([#include <openssl/ssl.h>],
[X509_get0_notAfter(NULL);],
has_function=1,
has_function=0)
LIBS="$SAVE_LIBS"
AC_LANG_POP(C)
if test $has_function = 1; then
AC_MSG_RESULT([yes])
AC_DEFINE([HAS_X509_get0_notAfter], [], [Define if ssl library has X509_get0_notAfter])
else
AC_MSG_RESULT([no])
fi
])
AC_DEFUN([CHECK_X509_check_host],
[
AC_MSG_CHECKING([for X509_check_host in SSL library])
AC_LANG_PUSH(C)
SAVE_LIBS="$LIBS"
LIBS="$LIBS $CRYPTOLIB"
AC_TRY_LINK([#include <openssl/x509v3.h>],
[X509_check_host(NULL, NULL, 0, 0, NULL);],
has_function=1,
has_function=0)
LIBS="$SAVE_LIBS"
AC_LANG_POP(C)
if test $has_function = 1; then
AC_MSG_RESULT([yes])
AC_DEFINE([HAS_X509_check_host], [], [Define if ssl library has X509_check_host])
OPENSSL_HOSTNAME_VALIDATION_OBJ=""
else
AC_MSG_RESULT([no])
OPENSSL_HOSTNAME_VALIDATION_OBJ="openssl_hostname_validation.o"
fi
AC_SUBST(OPENSSL_HOSTNAME_VALIDATION_OBJ)
])
dnl For geoip-api-c
AC_DEFUN([CHECK_GEOIP_CLASSIC],
[
AC_ARG_ENABLE(geoip_classic,
[AC_HELP_STRING([--enable-geoip-classic=no/yes],[enable GeoIP Classic support])],
[enable_geoip_classic=$enableval],
[enable_geoip_classic=no])
AS_IF([test "x$enable_geoip_classic" = "xyes"],
[
dnl First see if the system provides it
has_system_geoip_classic="no"
PKG_CHECK_MODULES([GEOIP_CLASSIC], [geoip >= 1.6.0],
[has_system_geoip_classic=yes
AS_IF([test "x$PRIVATELIBDIR" != "x"], [rm -f "$PRIVATELIBDIR/"libGeoIP.*])],
[has_system_geoip_classic=no])
dnl Otherwise fallback to our own..
AS_IF([test "$has_system_geoip_classic" = "no"],[
dnl REMEMBER TO CHANGE WITH A NEW GEOIP LIBRARY RELEASE!
geoip_classic_version="1.6.12"
AC_MSG_RESULT(extracting GeoIP Classic library)
cur_dir=`pwd`
cd extras
dnl remove old directory to force a recompile...
dnl and remove its installation prefix just to clean things up.
rm -rf GeoIP-$geoip_classic_version geoip-classic
if test "x$ac_cv_path_GUNZIP" = "x" ; then
tar xfz geoip-classic.tar.gz
else
cp geoip-classic.tar.gz geoip-classic.tar.gz.bak
gunzip -f geoip-classic.tar.gz
cp geoip-classic.tar.gz.bak geoip-classic.tar.gz
tar xf geoip-classic.tar
fi
AC_MSG_RESULT(configuring GeoIP Classic library)
cd GeoIP-$geoip_classic_version
save_cflags="$CFLAGS"
save_ldflags="$LDFLAGS"
CFLAGS="$orig_cflags $HARDEN_LIB_CFLAGS"
LDFLAGS="$HARDEN_LIB_LDFLAGS"
export CFLAGS LDFLAGS
./configure --prefix=$cur_dir/extras/geoip-classic --libdir=$PRIVATELIBDIR --enable-shared --disable-static || exit 1
CFLAGS="$save_cflags"
LDFLAGS="$save_ldflags"
AC_MSG_RESULT(compiling GeoIP Classic library)
$ac_cv_prog_MAKER || exit 1
AC_MSG_RESULT(installing GeoIP Classic library)
rm -f "$PRIVATELIBDIR/"libGeoIP.so*
$ac_cv_prog_MAKER install || exit 1
dnl Try pkg-config first...
AS_IF([test -n "$ac_cv_path_PKGCONFIG"],
[GEOIP_CLASSIC_LIBS="`$ac_cv_path_PKGCONFIG --libs geoip.pc`"
GEOIP_CLASSIC_CFLAGS="`$ac_cv_path_PKGCONFIG --cflags geoip.pc`"])
dnl In case the system does not have pkg-config, fallback to hardcoded settings...
AS_IF([test -z "$GEOIP_CLASSIC_LIBS"],
[GEOIP_CLASSIC_LIBS="-L$PRIVATELIBDIR -lGeoIP"
GEOIP_CLASSIC_CFLAGS="-I$cur_dir/extras/geoip-classic/include"])
cd $cur_dir
])
AC_SUBST(GEOIP_CLASSIC_LIBS)
AC_SUBST(GEOIP_CLASSIC_CFLAGS)
GEOIP_CLASSIC_OBJECTS="geoip_classic.so"
AC_SUBST(GEOIP_CLASSIC_OBJECTS)
AC_DEFINE([GEOIP_ENGINE], ["geoip_classic"], [Classic GeoIP engine])
]) dnl AS_IF(enable_geoip_classic)
])
+2
View File
@@ -1,4 +1,6 @@
#!/bin/bash
echo "Regenerating 'configure' and headers..."
echo "NOTE: Normally only UnrealIRCd developers run this command!!"
cd "$(dirname "${0}")"
Vendored
+6324 -4928
View File
File diff suppressed because it is too large Load Diff
+497 -443
View File
File diff suppressed because it is too large Load Diff
+32
View File
@@ -0,0 +1,32 @@
_ _ _ ___________ _____ _
| | | | | |_ _| ___ \/ __ \ | |
| | | |_ __ _ __ ___ __ _| | | | | |_/ /| / \/ __| |
| | | | '_ \| '__/ _ \/ _ | | | | | / | | / _ |
| |_| | | | | | | __/ (_| | |_| |_| |\ \ | \__/\ (_| |
\___/|_| |_|_| \___|\__,_|_|\___/\_| \_| \____/\__,_|
Configuration Program
for UnrealIRCd 6.2.6-rc1
This program will help you to compile your IRC server, and ask you
questions regarding the compile-time settings of it during the process.
A short installation guide is available online at:
https://www.unrealircd.org/docs/Installing_from_source
Full documentation is available at:
https://www.unrealircd.org/docs/UnrealIRCd_6_documentation
--------------------------------------------------------------------------------------
The full release notes are available in doc/RELEASE-NOTES.md
For easier viewing, check out the latest online release notes at:
https://github.com/unrealircd/unrealircd/blob/unreal60_dev/doc/RELEASE-NOTES.md
UnrealIRCd 6 is compatible with the following services:
* anope 2.0.x (stable) with the "unreal4" protocol module - anope 2.0.7 or higher required
* anope 2.1.x (dev) with the "unrealircd" protocol module
* atheme with the "unreal4" protocol module - tested with version 7.2.9
--------------------------------------------------------------------------------------
-14
View File
@@ -1,14 +0,0 @@
Although UnrealIRCd is a free program, we do put a great deal of time,
effort, and money into keeping UnrealIRCd alive. If you like UnrealIRCd and
want to support us then please consider making a donation.
PayPal Donation Link: https://unrealircd.org/index/donations
If you don't want to use PayPal, or you want to donate something other than
money, then please contact Syzop (syzop@unrealircd.com).
All those who donate at least a certain minimum amount will have their name
and/or company listed in /CREDITS and will be listed on the website.
Thank you for your support,
The UnrealIRCd Team
+33
View File
@@ -0,0 +1,33 @@
pub rsa4096 2024-11-18 [SC] [expires: 2030-11-17]
36E6F65706E36B0937280299101001DAF48BB56D
uid UnrealIRCd releases and patches (for verification of software downloads only!) <releases@unrealircd.org>
-----BEGIN PGP PUBLIC KEY BLOCK-----
mQINBGc7EBEBEADDZzlLVArYr2kE9NlhnuUF31rW3wvZ4avjhzhmO6bL0I0RESZC
PrtiFVJyjcSScObOVONFSC2YQiLVpezkKX4AYoqfnsuWfHg3xlGqCY8Ip+V5XJ6v
8G5haFFEgTL10UtqzPNymygWmoEr11u3BUKIzAJAuec7dl7PyfGU2JDkl+NtWm31
WyKCMuK3TKaD8UjGd5PPQR4jA6k1Hn8kvUl53EmkJjRyJc1XVz4AjZFywyUENGJv
HVdVFOPDaKzIx6N6+2dm0ZxXIPOISycwEQuk1++E7NyOS5u+lzlFN7RAXR/5Ogv5
pZzdcsPXp0RHHVeM8qgV7kvRTG9xhfFcXjs9Hanp2siy80HWs56o7nNN2eQNA31W
5lfGIWaA3pY4rpBoiQc3IMGD+vkACfRFH468+cx50zP9gbqSaxUaj6Z0e/jBNf26
7MIEKUjVCunQjO0Lob346FTAvdnXEXCwwJdQFF2tkxnpUBs6sSXjJwVgsfrkizXS
X0qsX7DTn9QpF9Z+0czqdoyJuLLPOFx+6Xj7l2riBYyzMAa8c6odLXTReMaVxFN+
clIVMCrfYXuURb4QGKB0ewW/wZd1fgsPAV4D1qypFAnM0D+qsfpKFI1QQY7WEUcC
YVMkzjZHPWaBdRQf7KLXasx7/ouM5nIlZdRrPDrCXXiqAlA20aWqvZ8N1wARAQAB
tGhVbnJlYWxJUkNkIHJlbGVhc2VzIGFuZCBwYXRjaGVzIChmb3IgdmVyaWZpY2F0
aW9uIG9mIHNvZnR3YXJlIGRvd25sb2FkcyBvbmx5ISkgPHJlbGVhc2VzQHVucmVh
bGlyY2Qub3JnPokCVAQTAQoAPhYhBDbm9lcG42sJNygCmRAQAdr0i7VtBQJnOxAR
AhsDBQkLRzUABQsJCAcCBhUKCQgLAgQWAgMBAh4BAheAAAoJEBAQAdr0i7Vt1hoQ
ALCuqTuVqYOiwBsccS8Qt52l+8pOr0hcF49GM+eBM7Evq2tlwL4FOEyzbsO94yRH
qTxGg/0puYkF74+vZnS2Vlo/F90FTmypy4oVQr+K/dd11ZEVLEpNcdaXuj68vP4c
UCsUPmQyPGERCIlKMe1U+n6yQWgx7xLbuqlOuxcwKDddYa6hhToogUxBbdOZZrYl
I4LN38ztSr0xjp0b67gdrMgOByS/r1AOX61L4DL2/glGOCt4GpKWPj8bOrK+Y/eK
HRK72TezQ+XPFAqsXNmeaLBVVFM8L3fPBBEmVV5tULZ7+/3Qlyub78/OK3Y1/fV7
qFY1S0WnTWY5mBNtUSgF9bGK/UyySNtPFtihmyg0xGQ/cNwiH7QXp38LboEBDoTF
lRT42nX1Nw9KpIWqGPTowB4qhN7znAseYkuH1XtDJHm1OKQjUB8lyBupq3cXYUju
JJH4zfdpWeLWQktb3D8uQsvEBcIyaVRs8wlPdAQBZBL0cLvE0ACpcsbsua26ihzB
ZCGzYmdZvBPpRo2e5xzC9ur3VOQzHqsebFrRKzDD6PgYCgnqJ+03vMToGua9MVX+
FFd2BSLO3UGUPdZESNzik2cILyZPRucwGWnL4wh+v+eOP9ZS4QpACye38VkGWUVR
YqzzK4QaI3m1xrRbcuCXdiMymWnWV3yW6AU+eGB8aEDW
=p0TV
-----END PGP PUBLIC KEY BLOCK-----
-121
View File
@@ -1,121 +0,0 @@
UnrealIRCd 4.0.19-rc2 Release Notes
====================================
This is the second release candidate for UnrealIRCd 4.0.19. Please help
test this release and report all bugs to https://bugs.unrealircd.org/
Enhancements:
* New option to disable a module: blacklist-module "modulename";
This will cause any 'loadmodule' lines for that module to be ignored.
This is especially useful if you only want to disable a few modules
that are (normally) automatically loaded by conf/modules.default.conf.
https://www.unrealircd.org/docs/Blacklist-module_directive
* Next three new features have to do with SASL. More information on SASL
in general can be found at https://www.unrealircd.org/docs/SASL
* A new require sasl { } block which allows you to force users on the
specified hostmask to use SASL. Any unauthenticated users matching
the specified hostmask are are rejected.
See https://www.unrealircd.org/docs/Require_sasl_block
* New "soft kline" and "soft gline". These will not be applied to users
that are authenticated to services using SASL.
These are just GLINE/KLINE's but prefixed with a percent sign:
Example: /GLINE %*@10.* 0 Only SASL allowed from here
* New "soft" ban actions for spamfilter, blacklist, antirandom, etc.
Actions such as "soft-kline" and "soft-kill" will only be applied to
unauthenticated users. Users who are authenticated to services (SASL)
are exempt from the corresponding spamfilter/blacklist/antirandom/..
See https://www.unrealircd.org/docs/Actions for the full action list.
* WARNING: If your network also contains UnrealIRCd servers below v4.0.19
then it is not recommended to use global soft bans (such as soft gline
or any spamfilter with soft-xx actions). There won't be havoc, but the
bans won't be effective on parts of the network.
* The following extban modules are not new but are now enabled by default:
extbans/textban, extbans/timedban and extbans/msgbypass.
In case you don't like them, use blacklist-module as mentioned earlier.
Just as a reminder, they provide the following functionality:
* TextBan: +b ~T:block:*badword* to block sentences with 'badword'
* Timed bans: ~t:duration:mask
These are bans that are automatically removed by the server.
The duration is in minutes and the mask can be any ban mask.
Some examples:
* A 5 minute ban on a host:
+b ~t:5:*!*@host
* A 5 minute quiet ban on a host (unable to speak):
+b ~t:5:~q:*!*@host
* An invite exception for 24 hours (1440 minutes):
+I ~t:1440:*!*@host
* A temporary exempt ban for a services account:
+e ~t:1440:~a:Account
* Allows someone to speak through +m for the next 24hrs:
+e ~t:1440:~m:moderated:*!*@host
* And any other crazy ideas you can come up with...
* Ban exception ~m:type:mask to allow bypassing of message restrictions.
Valid types are: 'external' (bypass +n), moderated (bypass +m/+M),
'censor' (bypass +G), 'color' (bypass +S/+c) and 'notice' (bypass +T).
Some examples:
* Let LAN users bypass +m: +e ~m:moderated:*!*@192.168.*
* Let ops in #otherchan bypass +m: +e ~m:moderated:~c:@#otherchan
* Make GitHub commit bot bypass +n: +e ~m:external:*!*@ipmask
* Allow a services account to use color: +e ~m:color:~a:ColorBot
* Timedban support in +f [5t#b2]:10 (set 2 minute ban on text flood).
* AntiRandom: The module will now (by default) exempt WEBIRC gateways
from antirandom checking because they frequently cause false positives.
This new behavior can be disabled via:
set { antirandom { except-webirc no; }; };
* Server linking attempts and errors are now also put in the log file.
* A new module that provides WHOX support, an enhanced and more standard
version of WHO (NOTE: the command is still "WHO").
This allows, among other things, the client to request additional
information, such as which services account each channel member is using.
The module is currently experimental. To use it, add this to your conf:
loadmodule "m_whox";
Major issues fixed:
* Blacklist: Potential crash issue when concurrently checking DNSBL
for the WEBIRC gateway and the spoofed host.
* Blacklist: In case of multiple blacklists the 2nd/3rd/.. blacklists
were not always checked properly.
Minor issues fixed:
* Remote includes: ./Config didn't properly detect libcurl on Ubuntu 18
(and possibly other Linux distributions as well)
* Timeouts during server linking attempts were not displayed.
* Delayjoin: Halfops did not see JOIN's when channel mode +D was set.
* IRCOps with minimal privileges lost their user modes on MODE change.
* IRCOps could not override channel mode +z (when not using SSL/TLS)
* Channel names sometimes truncated if using accents or special chars.
* TLSv1.3 ciphersuite setting was changed to reflect OpenSSL's behavior.
There is now set::ssl::ciphersuites, specifically for TLSv1.3.
Note that the default is perfectly fine so at this point in time it
shouldn't need any adjustment (but the option is there...).
Removed:
* allow::options::sasl has been removed. Use the new and more flexible
require sasl { } block instead.
Other changes:
* Windows users may be prompted to install the Visual C++ redistributable
package for Visual Studio 2017. This is because we now build on VS 2017
instead of VS 2012.
* We now use standard formatted messages for all K-Lines, G-Lines and
any other bans that will cause the user to be disconnected.
For technical details see the banned_client() function.
* The except throttle { } block now also overrides any limitations from
set::max-unknown-connection-per-ip. Useful for WEBIRC/cgiirc gateways.
* Localhost connections are considered secure, so these can be used even
if you have a plaintext-policy of 'deny' or 'warn'. (This was already
the case for servers, but now also for users and opers)
* Allow slashes in vhost/chghost/sethost/.. (but not through DNS)
Module coders:
* Windows: Be aware that we now build with Visual Studio 2017. This means
3rd party modules should be compiled with VS 2017 (or VS 2015) as well.
Future versions:
* We intend to change the default plaintext oper policy from 'warn' to 'deny'
later this year. This will deny /OPER when used from a non-SSL connection.
For security, IRC Operators should really use SSL/TLS!
==[ CHANGES IN OLDER RELEASES ]==
For changes in previous UnrealIRCd releases see doc/RELEASE-NOTES.old or
https://raw.githubusercontent.com/unrealircd/unrealircd/unreal40/doc/RELEASE-NOTES.old
+2772
View File
File diff suppressed because it is too large Load Diff
-979
View File
@@ -1,979 +0,0 @@
See doc/RELEASE-NOTES for the latest release notes.
This file (doc/RELEASE-NOTES.old) contains the release notes
of OLDER releases for historical purposes.
==[ CHANGES BETWEEN 4.0.17 AND 4.0.18 ]==
Enhancements:
* Support for checking IPv6 addresses in DNS blacklists
* For SSL/TLS we now set the default ECDH(E) curves to be
X25519:secp521r1:secp384r1:prime256v1 if using a recent version of
OpenSSL/LibreSSL. This can be overridden via set::ssl::ecdh-curve.
* The blacklist module now checks WEBIRC users as well.
* You can now require SASL for all clients via the allow block via:
allow { ip *; class clients; maxperip 2; options { sasl; }; };
This can be useful for a special sasl-only server which, for example,
only permits proxies and tor clients. In a future release the feature
will be made more flexible so it can be used for other purposes
as well.
Major issues fixed:
* A number of (potential) security issues were fixed:
* Memory leaks: this could allow an attacker to slowly consume all
available memory and ultimately cause UnrealIRCd to crash.
* Out of bounds read: in practice this does not seem to be
exploitable due to the many restrictions that are imposed.
* Compile issues on macOS
* Bug in blacklist module which could have caused false negatives,
allowing bad guys in which should have been denied.
* The new optional feature 'set::cloak-method ip' caused identical cloaks
Minor issues fixed:
* When using '/REHASH -ssl' or './unrealircd reloadtls' it did not reload
the SSL certificate/key if you were using ssl-options in listen, sni or
link blocks. In short: it only reloaded the ones from set::ssl until now.
* m_ircops sent a conflicting numeric, confusing some clients.
* Starting UnrealIRCd through a non-interactive(!) ssh session could cause
the ssh session to hang.
* An upgrade issue with non-system cURL causing compile problems.
Other changes:
* The built-in time synchronization feature is now disabled by default.
TimeSynch was added back in 2006 when lots of operating systems did not
ship with time synchronization turned on by default. Since incorrect time
severely breaks IRC networks this was a major problem. Nowadays this is
completely different with most Linux distro's, OS X, Windows, etc. doing
time synchronization out of the box. Since UnrealIRCd's implementation is
less precise and lacks authentication it's best left over to the system.
You can still re-enable timesynch via:
set { timesynch { enabled yes; }; };
.. but you should really use NTP or similar for system-wide time
synchronization instead.
* For developers there's now the --with-werror compile option which will
add -Werror.
* Added a lot more Travis-CI tests: various LibreSSL/OpenSSL versions
and also test macOS. This to prevent us from releasing broken stuff.
* Various code cleanups to get rid of lots of needless casts and to
eliminate compiler warnings.
* Just as a reminder (this change was already in version 4.0.17):
UnrealIRCd will no longer give user mode +z to users on WEBIRC
gateways using SSL/TLS IRC, unless the WEBIRC gateway gives us
some assurance that the client<->webirc gateway connection is
also secure (eg: https).
This is the regular WEBIRC format:
WEBIRC password gateway hostname ip
This indicates a secure client connection (NEW):
WEBIRC password gateway hostname ip :secure
Naturally, WEBIRC gateways MUST NOT send the "secure" option if
the client is using http or some other insecure protocol.
Module coders:
* HOOKTYPE_CHANNEL_SYNCED prototype changed, the 'merge' and 'removetheirs'
is now no longer an 'unsigned short' but an 'int' instead.
* HOOKTYPE_MODE_DEOP prototype changed, the 'modechar' is now no longer
a 'char' but an 'int' instead.
* In addition to safestrdup() there's now also safestrldup() which allows
you to specify a maximum allocated length (so including the nul byte).
This is used in m_pass.c and m_topic.c.
* New hook HOOKTYPE_CAN_BYPASS_CHANNEL_MESSAGE_RESTRICTION
https://www.unrealircd.org/docs/Dev:Hook_API#HOOKTYPE_CAN_BYPASS_CHANNEL_MESSAGE_RESTRICTION
Future versions:
* We intend to change the default plaintext oper policy from 'warn' to 'deny'
later this year. This will deny /OPER when used from a non-SSL connection.
For security, IRC Operators should really use SSL/TLS!
==[ CHANGES BETWEEN 4.0.16.1 AND 4.0.17 ]==
Enhancements:
* Two optional modules. These are not loaded by default. To use them,
include modules.optional.conf, or add these loadmodule lines:
loadmodule "extbans/timedban";
loadmodule "extbans/msgbypass";
* Timed bans: ~t:duration:mask
These are bans that are automatically removed by the server.
The duration is in minutes and the mask can be any ban mask.
Some examples:
* A 5 minute ban on a host:
+b ~t:5:*!*@host
* A 5 minute quiet ban on a host (unable to speak):
+b ~t:5:~q:*!*@host
* An invite exception for 1440m/24hrs
+I ~t:1440:*!*@host
* A temporary exempt ban for a services account
+e ~t:1440:~a:Account
* Allows someone to speak through +m for the next 24hrs:
+e ~t:1440:~m:moderated:*!*@host
* And any other crazy ideas you can come up with...
* New ban exception ~m:type:mask which allows bypassing of message
restrictions. Valid types are: 'external' (bypass +n),
moderated (bypass +m/+M), 'censor' (bypass +G),
'color' (bypass +S/+c) and 'notice' (bypass +T).
Some examples:
* Let LAN users bypass +m: +e ~m:moderated:*!*@192.168.*
* Let ops in #otherchan bypass +m: +e ~m:moderated:~c:@#otherchan
* Make GitHub commit bot bypass +n: +e ~m:external:*!*@ipmask
* Allow a services account to use color: +e ~m:color:~a:ColorBot
* Timedban support in +f [5t#b2]:10 (set 2 minute ban on text flood).
This is only available if the previously mentioned extbans/timedban
module is loaded.
* Added experimental UTF8 support in set::allowed-nickchars
See https://www.unrealircd.org/docs/Nick_Character_Sets
Example: set { allowed-nickchars { latin-utf8; }; };
Important remarks:
* All your servers must be on UnrealIRCd 4.0.17 (or later)
* Most(?) services do not support this, so users using UTF8 nicknames
won't be able to register at NickServ.
* In set::allowed-nickchars you must either choose an utf8 language
or a non-utf8 character set. You cannot combine the two.
* You also cannot combine multiple scripts/alphabets, such as:
latin, greek, cyrillic and hebrew. You must choose one.
* If you are already using set::allowed-nickchars on your network
(eg: 'latin1') then be careful when migrating (to eg: 'latin-utf8'):
* Your clients may still assume non-UTF8
* If users registered nicks with accents or other special characters
at NickServ then they may not be able to access their account
after the migration to UTF8.
* There is no CASEMAPPING or "visually identical character"-checking.
Just like in the old (non-utf8) charsys this means there is no
lower/uppercase checking for allowed-nickchars nicks. So a nick with
"O with accent" can be online at the same time as "o with accent".
They are treated as two different users.
The identical character looking issue is particular noticeable in
cyrillic script where for example cyrillic "A" looks identical to
latin "A" and thus can be used to impersonate a user.
Improved CASEMAPPING and "visually similar character"-checking is
part of ongoing research at the IRCv3 working group.
* Ability to customize the reject connection messages:
set {
reject-message {
password-mismatch "Password mismatch";
too-many-connections "Too many connections from your IP";
server-full "This server is full.";
unauthorized "You are not authorized to connect to this server";
};
};
* Added optional AppArmor profile in extras/security/apparmor/unrealircd
See https://www.unrealircd.org/docs/Using_AppArmor_with_UnrealIRCd
Major issues fixed:
* Crash when using OperOverride (*NIX only)
* Crash if linking anope with the 'unreal' module from a non-localhost
SSL connection. This is rarely done but also acts as a reminder that
people should really use the 'unreal4' module in anope (2.0.3+).
Minor issues fixed:
* set::restrict-extendedbans was not effective for stacked bans
* linking if only using link::outgoing caused a 'server name mismatch'
Other:
* UnrealIRCd will no longer give user mode +z to users on WEBIRC
gateways using SSL/TLS IRC, unless the WEBIRC gateway gives us
some assurance that the client<->webirc gateway connection is
also secure (eg: https).
This is the regular WEBIRC format:
WEBIRC password gateway hostname ip
This indicates a secure client connection (NEW):
WEBIRC password gateway hostname ip :secure
Naturally, WEBIRC gateways MUST NOT send the "secure" option if
the client is using http or some other insecure protocol.
Module coders:
* New hook HOOKTYPE_CAN_BYPASS_CHANNEL_MESSAGE_RESTRICTION
https://www.unrealircd.org/docs/Dev:Hook_API#HOOKTYPE_CAN_BYPASS_CHANNEL_MESSAGE_RESTRICTION
==[ CHANGES BETWEEN 4.0.16 AND 4.0.16.1 ]==
An interim release with a couple of backported fixes:
* Fix hang in (outgoing) server linking
* Fix crash when linking anope over SSL from non-localhost
* '/SPAMFILTER del <id>' did not remove the spamfilter on other servers
* set::restrict-extendedbans was not always applied (when stacked)
* Update automated build scripts
==[ CHANGES BETWEEN 4.0.15 AND 4.0.16 ]==
This is a major release with lots of new features and changes.
Enhancements:
* There's now an easy method to remove spamfilters:
'/SPAMFILTER del' will show a list of spamfilters along
with the appropriate command to remove them (by id).
* CAP v3.2 support.
* CAP 'cap-notify': notify users of any CAP changes.
* CAP 'extended-join': show account and gecos in JOIN.
* CAP 'chghost': notify on user/host changes.
Note that if you use set::allow-userhost-change force-rejoin
then clients which support CAP 'chghost' will not see the
PART+JOIN+MODE sequence as it is unnecessary. They already receive
a "CHGHOST" message as part of CAP 'chghost' instead.
* Updated CAP 'sasl' to specification 3.2 (includes mechlist).
* Automatically discover SASL server if saslmechlist is sent by services
and set::sasl-server is not set by the administrator. This should
help to get more networks to support SASL automatically (if you
run up to date services, of course)
* We send "CAP DEL sasl" if set::sasl-server squits and a "CAP NEW"
message when the server returns (to cap-notify and CAPv3.2 clients).
* Added password::type 'spkifp'. It's similar to 'sslclientcertfp' but
is a hash based on the public TLS key rather than the certificate.
The benefit of this is that the 'spkifp' can stay the same even if
you get a new certificate from Let's Encrypt. Note that 'certbot'
does not re-use keys by default so you will still get a different
spkifp every 60-90 days. Consider using another (3rd party) client
or tell the certbot guys to finally implement --reuse-key at
https://github.com/certbot/certbot/issues/3788
* The command './unrealircd spkifp' will output the SPKI fingerprint
* New option set::handshake-delay will delay the handshake (when a
user is connecting) up to this amount of time.
* If you have any blacklist { } block then UnrealIRCd will set an
set::handshake-delay of 2 seconds by default. This will allow (most)
DNSBL checking to be finished before the user comes online, while
still allowing a smooth user experience.
If your DNS(BL) is slow then you could raise this setting slightly.
* You can now have multiple webirc { } blocks with the same mask.
This permits multiple blocks like..
webirc {
mask *;
password "....." { sslclientcertfp; };
};
..should you need it.
In other words: we don't stop matching upon an authentication failure.
* Move CONNECTTIMEOUT to set::handshake-timeout and document it at
https://www.unrealircd.org/docs/Set_block#set::handshake-timeout
* Move MAXUNKNOWNCONNECTIONSPERIP to set::max-unknown-connections-per-ip
https://www.unrealircd.org/docs/Set_block#set::max-unknown-connections-per-ip
* Add set { cloak-method ip; }; which will make cloaking only be done
on the IP and thus result in an XX.YY.ZZ.IP cloaked host.
This so you can have "IP cloaking" without disabling DNS lookups.
GLINES on hosts still work and IRCOps (and yourself) can still see
the host in /WHOIS.
* New option set { ban-include-username yes; }; which will make bans
placed by spamfilters (and some other systems) to be placed not on *@ip
but on user@ip. Note that this won't work for ZLINE/GZLINE since no
no ident/username lookups are done in such cases.
Major issues fixed:
* None
Minor issues fixed:
* Gracefully handle incorrect server-to-server messages. These no longer
cause UnrealIRCd to crash. Note that this does not mean you can now
go send random RAW messages from a trusted server connection. Doing so
can cause desynchs, KILLs and SQUITs. We just try not to crash anymore.
* A small memory leak upon 'DNS i' (IRCOp only command)
Removed:
* Various old config.h settings that didn't have any effect.
* A few config.h settings that should never be turned off have been
removed altogether (eg: NO_FLOOD_AWAY is now always on).
* The deprecated and unused commands "CAP CLEAR" and "CAP ACK".
Other changes:
* When linking servers and not having any certificate validation,
UnrealIRCd will give you specific instructions on how to use
password::spkifp or verify-certificate. This to fix a possible
Man-in-the-Middle attack. Note that you'll only see this message
when linking two servers that are 4.0.16+.
* When a user does a nick change from a registered nick you will
now see the user mode -r. Previously this happened invisibly.
* The default oper snomask now includes 'S' (spamfilter notices).
* The shipped PCRE2 library has been upgraded to 10.30
Module coders:
* API change for HOOKTYPE_PRE_INVITE:
(aClient *sptr, aClient *target, aChannel *chptr, int *override)
Modules must now send the error message instead of only returning
HOOK_DENY. Also check for operoverride and set *override=1.
* Please use the following procedure in case of an user/host change:
userhost_save_current(acptr);
/* now do what you need to do: like change username or hostname */
userhost_changed(acptr);
This function will take care of notifying other clients about
the userhost change, such as doing PART+JOIN+MODE if force-rejoin
is enabled, and sending :xx CHGHOST user host messages to
"CAP chghost" capable clients.
Services coders:
* If you provide SASL then please send the mechlist like this:
MD client your.services.server saslmechlist :EXTERNAL,PLAIN
* Don't forget to send an EOS (End Of Synch) as part of the handshake,
if you are not doing so already. It's important:
:your.services.server EOS
==[ CHANGES BETWEEN 4.0.14 AND 4.0.15 ]==
Major issues fixed:
* Fix remotely triggerable crash issue in handshake. This allows a user
to crash an UnrealIRCd server, even those with restrictions such as
password protected hubs.
* Fix another remotely triggerable crash issue. This one requires the
user to connect, join a channel and have channel operator privileges.
==[ CHANGES BETWEEN 4.0.13 AND 4.0.14 ]==
Enhancements:
* New set::plaintext-policy configuration settings. This defines what
happens to users/ircops/servers that are not using SSL/TLS.
The default settings are:
set {
plaintext-policy {
user allow; /* allow any user to connect */
oper warn; /* warn on /OPER if not using SSL/TLS */
server deny; /* deny servers without SSL/TLS, except localhost */
};
};
You can change each of the three classes to 'allow', 'warn' or 'deny'.
See: https://www.unrealircd.org/docs/Set_block#set::plaintext-policy
If your services do not run on localhost and link without SSL/TLS
then you may get an error during linking. In such a case check out:
https://www.unrealircd.org/docs/FAQ#ERROR:_Servers_need_to_use_SSL.2FTLS
* You can now ask UnrealIRCd to verify certificates of server links by:
link irc1.test.net {
[..]
verify-certificate yes;
};
This will verify the certificate of the link, making sure it is valid,
issued for the specified name (irc1.test.net) and given out by a
trusted Certificate Authority (like Let's Encrypt).
Obviously, if you use self-signed certificates then you can't use this.
* Introduce a concept called "link security level". This will rate the
security of your network from 0 to 2. Whenever security is degraded
due to a new server link UnrealIRCd will print a warning about it.
See https://www.unrealircd.org/docs/Link_security
This also adds a new command /LINKSECURITY (IRCop-only).
* The plaintext-policy and link-security is shown in "CAP LS".
Major issues fixed:
* None
Minor issues fixed:
* If you had a link block named irc1.example.net and did an outgoing
connect to that server, then the server could introduce himself under
a different name, such as irc1.other.net. Not a security issue, since
all authentication has to be passed, but this could cause confusing
autoconnect attempts.
* password::sslclientcert did not accept relative paths
* Compile problem with LibreSSL (regarding SSL_CTX_get0_param)
* set::modes-on-connect: was refusing certain (old) modes like +N
Other changes:
* The ssl options 'verify-certificate' and 'no-self-signed' have been
removed. Use link::verify-certificate instead. It makes no sense to
verify certificates or prevent self signed certificates elsewhere
such as in vhost or oper, since there is no hostname to match against.
* Weak cipher suites such as 3DES and RC4 are disabled by default but
previously you could still enable them through set::ssl::ciphers.
Now you can no longer, since there is no legitimate reason to do so.
* Update cipher suite to work with TLS 1.3. This ensures you can use
TLS 1.3 in UnrealIRCd 4.0.14+ when OpenSSL supports it (in the future).
* Bump MODDATA_MAX_CLIENT from 8 to 12: needed if you have a lot of
3rd party modules loaded. Also moved MODDATA_MAX_* to include/config.h
Module coders:
* You can now attach ModData to server objects as well (including &me).
* Please do not use UmodeDel, CmdoverrideDel and any other *Del()
functions from MOD_UNLOAD. These undocumented functions are unnecessary
since 2008 or so. UnrealIRCd takes care of unloading all module objects.
It can cause a crash if someone unloads the module in UnrealIRCd 4
(more specifically: double free if unloading modules which use ModData).
Attempts to use these functions in future UnrealIRCd versions may result
in a compile error.
==[ CHANGES BETWEEN 4.0.12 AND 4.0.13 ]==
Enhancements:
* Support for Strict Transport Security (draft/sts).
See: https://www.unrealircd.org/docs/SSL/TLS#Strict_Transport_Security
* Support for Server Name Indication (SNI):
See: https://www.unrealircd.org/docs/Sni_block
* Add conf/modules.optional.conf. This loads all additional modules
that are not in modules.default.conf (m_ircops, m_staff, nocodes,
textban, hideserver, antirandom and websocket)
Major issues fixed:
* 'simple' spamfilters ended up being 'posix' after server linking.
* User mode +Z (secureonly) not working properly across server links.
* REHASH from WebSocket connection would cause a crash (requires IRCOp
privileges)
Minor issues fixed:
* We now prevent /OPER for oper blocks with a non-existant operclass
* Bump MAXCONNECTIONS for Windows, allowing you to hold more clients.
* The 'ban too broad' checking was broken. This permitted glines such
as 192.168.0.0/1 being set. Now it rejects CIDR of /15 and lower.
To disable this safety measure you can (still) use:
set { options { allow-insane-bans; }; };
Other changes:
* The websocket module now no longer sends \r\n in the websocket
data and no longer requires it on incoming messages (but you
can still send it if you like). Also version bumped to 1.0.0.
* Mark all shipped modules as official (non-3rd-party)
* Verify certificate when submitting crash reports
* Support --without-privatelibdir for packagers
* CACERT has been removed from curl-ca-bundle
Module coders:
* CAP API changes:
* The cap->visible(void) callback is now cap->visible(aClient *)
* There is a new cap->parameter(aClient *) callback function,
see the cap/sts module for how it can be used.
* Various updates to subfunctions to pass 'sptr' (due to the above),
including clicap_find(sptr, ...)
* New CLICAP_FLAGS_ADVERTISE_ONLY flag (CAP cannot be REQ'd)
==[ CHANGES BETWEEN 4.0.11 AND 4.0.12 ]==
Enhancements:
* New user mode +Z: Only allow SSL/TLS users to private message you.
* Ability to hide all channels in /LIST that you cannot join due to
deny channel blocks: set { hide-list { deny-channel }; };
* The optional 'nocodes' module which you can load will make +S/+c
also block/strip bold, underline and italic text. (The latter is new)
* Add support for 'mask' in allow channel { } and deny channel { }
and add some support for negative 'mask'. Probably not very useful
on most networks with services since bans/AKICK do the same, but:
deny channel { channel "#help*"; };
allow channel { channel "#help-nolan"; mask !192.168.*; };
allow channel { channel "#help-lan"; mask 192.168.*; };
Major issues fixed:
* Crash issue if a module using ModData was unloading (not reloading)
* Vhosts were not always correctly synched across servers.
* The maximum number of clients that a server could accept was decreased
by one on every linking attempt if it was both: 1) an outgoing
SSL/TLS linking attempt; AND 2) the error was "Connection refused".
Minor issues fixed:
* Adjustments to channel mode +f were not always effective.
* If you have a vhost set and wish to remove it and change to a cloaked
host you can now safely use '/MODE yournick -t'. This feature was
rarely used so far and it previously had a bug which caused it to
still expose the real host/IP to others. This has been resolved.
* Channel mode +D (delayjoin): when people are de-oped we now part
'hidden' users to avoid a client desynch.
* Bump lag for remote MOTD requests to avoid flooding.
Other changes:
* More than 95% of the crashes reported to us are due to 3rd party
modules (and thus not bugs in our code). We now ask users to unload
any recently installed 3rd party modules first, see if the crash
issue persists, and only then submit a crash report to us.
* UnrealIRCd will now refuse to run as root
https://www.unrealircd.org/docs/Do_not_run_as_root
Module coders:
* Added two functions to search for user modes:
has_user_mode(acptr, 'i') // returns 1 / 0
find_user_mode('i') // returns the user mode (as 'long')
==[ UNREALIRCD 4 INTRODUCTION ]==
UnrealIRCd 4 is here!
We have been working hard over the past few years to replace the successful
3.2.x series with a more modern code base. At the same time we have been
incorporating requests from our bug tracker, ideas from ourselves and
many suggestions that came up during the UnrealIRCd survey from Q4 2013.
UnrealIRCd is far more modular and configurable than before. For a brief
overview of what's new in UnrealIRCd 4 have a look at:
https://www.unrealircd.org/docs/What's_new_in_UnrealIRCd_4
==[ DOCUMENTATION ]==
All documentation has been moved to our wiki:
* Documentation: https://www.unrealircd.org/docs/
* FAQ: https://www.unrealircd.org/docs/FAQ
Be sure not to use any other (older) documentation as it isn't fully
compatible with UnrealIRCd 4. In particular, do NOT use unreal32docs*html.
==[ UPGRADING FROM 3.2.x ]==
If you are upgrading from 3.2.x then there are three important things to know:
1) NEW FILE LOCATIONS
In UnrealIRCd 4 the location of the configuration files and other files have
been changed. On *NIX the directory where you compile the IRCd from
(previously 'Unreal3.2.X', now 'unrealircd-4.0.X') is no longer the same as
the directory where the IRCd will be running from.
By default the IRCd is installed to /home/yourusername/unrealircd on *NIX
On Windows UnrealIRCd will install to C:\Program Files (x86\UnrealIRCd 4
The new directory structure is as follows (both on Windows and *NIX):
conf/ contains all configuration files
logs/ for log files
modules/ all modules (.so files on *NIX, .dll files on Windows)
2) CONFIGURATION FILE CHANGES
There have also been changes in various configuration blocks and settings.
Don't worry, UnrealIRCd can convert your existing 3.2.x configuration files
to UnrealIRCd 4 format. There's no need to start from scratch.
Please read https://www.unrealircd.org/docs/Upgrading_from_3.2.x !!
3) THIRD PARTY MODULES
If you are using 3rd party modules then they will need an update to run on
UnrealIRCd 4. Due to the many core changes in UnrealIRCd 4 it was simply
impossible to make 3.2.x modules work out-of-the-box on 4.x.
Contact your developer for a new version or ask on our Modules forum where
someone may be kind enough to convert the module for you if you ask nicely:
https://forums.unrealircd.org/viewforum.php?f=52
==[ END OF THE 3.2.X SERIES ]==
UnrealIRCd 3.2.x is no longer supported after December 31, 2016.
See https://www.unrealircd.org/docs/UnrealIRCd_3.2.x_deprecated
==[ SUPPORT ]==
Before you seek support, please check our documentation and FAQ:
* https://www.unrealircd.org/docs/Main_Page
* https://www.unrealircd.org/docs/FAQ
For support you have two choices:
* Forums: https://forums.unrealircd.org/
* IRC: irc.unrealircd.org / #unreal-support
==[ CHANGES BETWEEN 4.0.10 AND 4.0.11 ]==
Major issues fixed:
* Fix crash issue that can be triggered by regular users
* Fix crash if TOPIC_NICK_IS_NUHOST is enabled (rarely enabled)
* Fix crash if services send an incorrect raw command
Minor issues fixed:
* Now properly support 'z' when used in set::modes-on-join
Other changes:
* Show a warning if you don't have any SSL listeners
==[ CHANGES BETWEEN 4.0.9 AND 4.0.10 ]==
Improvements:
* Added "websocket" module. This provides support for WebSocket (RFC6455),
allowing JavaScript (internet browsers) to connect directly to IRC
without the need of a "gateway". This module is experimental and not
loaded by default. See https://www.unrealircd.org/docs/WebSocket_support
for more information on the module. For a very crude client example check
https://www.unrealircd.org/files/dev/ws/websocket_unrealircd.html
This module was sponsored by Aberrant Software Inc.
* UnrealIRCd already has the ability to configure SSL settings via the
set::ssl block. Now you can also override these settings for a link block
and listen block. One possible use for this would be having a long-lived
self-signed certificate for server linking on a serversonly port, and
a short-lived certificate for your users on the other ports (such as
a certificate from Let's Encrypt).
Another example would be to force TLSv1.2 for server linking but not
for users. Etc. Etc.
General settings (already existed) are in the set::ssl block:
https://www.unrealircd.org/docs/Set_block#set::ssl::certificate
Per-port settings go via listen::ssl-options:
https://www.unrealircd.org/docs/Listen_block
Per-link block settings go via link::outgoing::ssl-options:
https://www.unrealircd.org/docs/Link_block
* You can now exempt IP's from (DNSBL) blacklist checking via:
except blacklist { mask 1.2.3.4; };
* All free modules from vulnscan.org (by Syzop) are now included in
UnrealIRCd itself. Note that only the "privdeaf" and "jumpserver" modules
are loaded by default. The others you will need to load explicitly.
The new modules are:
* extbans/textban - Channel specific word filter (+b ~T:censor:*badword*)
https://www.unrealircd.org/docs/Extended_Bans
* usermodes/privdeaf - Do not permit PM's from others (User Mode +D)
* jumpserver - Redirect users to another server during maintenance
www.unrealircd.org/docs/User_%26_Oper_commands#JUMPSERVER
* antirandom - Detect drones with random nicks / ident / etc.
https://www.unrealircd.org/docs/Set_block#set::antirandom
* hideserver - Hide servers in /MAP and /LINKS
(Note that this does not truly enhance security)
* m_ircops - Show which ircops are online (/IRCOPS command)
* m_staff - Show custom file (/STAFF command)
* nocodes - Makes chanmode +S/+c also strip/block bold and underline
Major issues fixed:
* Incorrect bans being added during server linking
* Compile fixes for Ubuntu 16 LTS / gcc 5.4.x
* Crash if you had an invalid crypt password in your unrealircd.conf
* Crash if you did not load the chanmodes/nocolor module or changed
the order in which modules were loaded
Minor issues fixed:
* Delayjoin (channel mode +D) sending QUITs for hidden users, double JOIN, ..
* You no longer need to place 'class' blocks before 'allow' blocks
* Some error messages were not throttled
* WHO now supports multi-prefix
* Date in Windows log file for the first few messages was always 1970.
For services and module coders:
* Services coders: "SVSMODE Nick +d" will now mark a client as deaf.
Don't confuse this with "SVSMODE Nick +d <svid>". The parameter
makes all the difference.
* Module coders: changed return value handling of HOOKTYPE_RAWPACKET_IN
-1 indicates to stop parsing (return) and 0 indicates don't parse but
proceed to next packet. If you kill a client in this hook then be
sure to return -1.
==[ CHANGES BETWEEN 4.0.8.4 AND 4.0.9 ]==
* Fix "ghost" bug which could cause annoyed users and a memory leak
in UnrealIRCd. For more information see
https://forums.unrealircd.org/viewtopic.php?f=1&t=8625
==[ CHANGES BETWEEN 4.0.8 AND 4.0.8.4 ]==
* Fix build on FreeBSD with clang / without gcc
* If using remote includes and system curl not available then
install it during ./Config and no longer use /home/xyz/curl.
* More fixes for self-compiled remote includes
* Fix build if --with-system-cares is specified explicitly (which
is unnecessary anyway, as system c-ares this is auto-detected).
* More build fixes for older GCC compilers
==[ CHANGES BETWEEN 4.0.7 AND 4.0.8 ]==
Improvements:
* *NIX: As part of defense-in-depth UnrealIRCd now compiles with
several hardening options by default. This makes several type of
exploits more difficult and in some cases even impossible.
Tech: this enables full RELRO (GOT and PLT being read-only),
everything compiled as PIE making ASLR possible, stack protector
canaries are added, etc.
* Windows: releases are now signed. If you download the UnrealIRCd
installer you will no longer see "Unknown publisher" but rather
"Open Source Developer, Bram Matthys". Similarly all the EXE and
DLL module files have been signed which should make it easy for
anti virus software to see if something is an official UnrealIRCd
release file or not.
Major issues fixed:
* Possible crash if you have several blacklist blocks
Minor issues fixed:
* User mode +d (deaf) did not work
Other changes:
* We've always printed big warnings when running UnrealIRCd as root.
In this version we still do, but in future versions we will simply
refuse to boot. https://www.unrealircd.org/docs/Do_not_run_as_root
* System c-ares is preferred over our own shipped c-ares
* System cURL is preferred over ~/curl (if it has AsynchDNS)
* Our shipped libraries are no longer built as static
* Now that shipped libraries are dynamic they need to be installed
somewhere (if used). The default location is ~/unrealircd/lib and
can be changed via --with-privatelibdir. (Although, if you are a
package builder then you will probably use --with-system-xxx and
then private libraries are not used at all)
==[ CHANGES BETWEEN 4.0.6 AND 4.0.7 ]==
Improvements:
* UnrealIRCd now ships with a default ciphersuite list to have more
secure SSL/TLS defaults (rather than relying on your OS/Distro).
You can still customize ciphersuites through set::ssl::ciphers.
Details: https://www.unrealircd.org/docs/SSL_Ciphers_and_protocols
* set::ssl::protocols allows you to specify which SSL/TLS protocols
are permitted. The default is (still): TLSv1,TLSv1.1,TLSv1.2.
* Windows: remote includes now support IPv6
Major issues fixed:
* FreeBSD: unstable SSL links to other servers
Minor issues fixed:
* It was impossible to set both +b ~r:xyz and +b ~R:xyz
Removed the following rarely used build-time options:
* CHROOTDIR: Never worked in 4.0.x anyway. You can use AppArmor,
SELinux, FreeBSD jails, etc. as an alternative.
* IRC_USER/IRC_GROUP: Since this only applies to users installing
UnrealIRCd system-wide you should use your system services to do
this as well, such as: systemd's User=xx or start-stop-daemon.
Other changes:
* PCRE2 and c-ares libraries updated to latest versions
==[ CHANGES BETWEEN 4.0.5 AND 4.0.6 ]==
Major issues fixed:
* Fix SASL security issue with AUTHENTICATE
==[ CHANGES BETWEEN 4.0.4 AND 4.0.5 ]==
Major issues fixed:
* Crash issue (read-after-free)
* Bans on IPv6 cloaked hosts had no effect
* Prevent flood from unknown connection (with bugfix)
==[ CHANGES BETWEEN 4.0.4 AND 4.0.3(.1) ]==
New:
* Italian /HELPOP translation (help.it.conf)
* set::options::no-connect-ssl-info to hide SSL-related connect info
Major issues fixed:
* GLINE/KLINE on usermask@ did not have any effect
* Crash if you have a listen block with port 0
* Infinite loop on invalid operclass::parent reference
Minor issues fixed:
* files { } block only worked with absolute paths
* delayjoin: hidden users were not always joined on +vhoaq
* Fix small memory leak
* Duplicate replies on /VERSION
* When doing /VERSION on IRC as an IRCOp it showed the compile-time
rather than runtime OpenSSL/LibreSSL version
Other changes:
* Documentation updates
* Prevent installation in the same directory as the source
==[ CHANGES BETWEEN 4.0.3 AND 4.0.3.1 ]==
* Fix compile problem on FreeBSD & OpenBSD
Note: there is no 4.0.3.1 release for Windows since there were no
changes for the Windows version.
==[ CHANGES BETWEEN 4.0.2 AND 4.0.3 ]==
Major issues fixed:
* Crash on RPING command (IRCOp-only!)
* Crash on Windows on failed outgoing server connect
* Crash if you had a link { } block with invalid syntax
Minor issues fixed:
* Windows: Remote includes did not support https
Other:
* Windows version compiled with Visual Studio 2012 rather than a mix
* Windows version now using LibreSSL
* Crash reporter produces more useful reports (important for us)
==[ CHANGES BETWEEN 4.0.1 AND 4.0.2 ]==
The 4.0.2 release comes with the following new features:
* Ability to hide quit messages from *LINEd users (set::hide-ban-reason)
* Blacklist hits are now sent to new snomask +b rather than all ircops
Major issues fixed:
* None
Minor issues fixed:
* prefix-quit was not working
* FreeBSD: fix kevent bug flood in error log
* Incorrect server description in /LINKS
* Logging to syslog was broken
* OS X: Update ./Config to use Homebrew OpenSSL by default
* Don't show UID to client in case of a SVSMODE
==[ CHANGES BETWEEN 4.0.0 AND 4.0.1 ]==
The 4.0.1 release comes with the following minor improvements:
* The blacklist module now supports %ip (=banned IP) in blacklist::reason.
* *NIX: You can use cron again, see https://www.unrealircd.org/docs/Cron_job
* /MODULE now lists only 3rd party modules by default so you don't get flooded.
* *NIX: Added './unrealircd reloadtls' to reload TLS certificate and keys.
Major issue fixed:
* Crash if you removed a listen { } block with active clients on that port
* MODEs set by a server (not by a user) were not always propagated
correctly accross the network. In practice this only affected /SAMODE
and possibly some services that don't send MODEs from ChanServ/BotServ.
Minor issues fixed:
* When doing /LIST under mIRC it would hide empty +P channels.
* Servers wouldn't link if link::outgoing::hostname was a CNAME.
* SSL Certificate fingerprint not communicated properly to servers/services.
* *NIX: ./unrealircd [stop|rehash] failed if not installed to ~/unrealircd.
* Windows: IRCd could crash after showing the config error screen on startup.
==[ CHANGES BETWEEN 3.2.X AND 4.X ]==
Below is a summary of the changes between UnrealIRCd 3.2.x and UnrealIRCd 4.
For a complete list of all 1100+ changes you can use 'git log' or have a
look at: https://github.com/unrealircd/unrealircd/commits/unreal40
==[ NEW ]==
* We moved a lot of functionality, including most channel modes, user
modes and all extended bans into 138 separate modules.
This makes it...
A) possible to fully customize what exact functionality you want to load.
You could even strip down UnrealIRCd to get something close to the
basic RFC1459 features from the 1990s. (No idea why you would want
that, but it's possible)
B) easier for coders to see all source code related to a specific feature
C) possible to fix bugs and just reload rather than restart the IRCd.
Have a look at modules.default.conf which contains the "default" set of
modules that you can load if you just want to load all functionality.
If you want to customize the list of modules to load then simply make
a copy of that file, give it a different name, and include that one
instead. Since the file is fully documented, you can just comment out
or delete the loadmodule lines of things you don't want to load.
* Oper permissions have changed completely: [A4+]
* All previous oper levels/ranks no longer exist (Netadmin, Admin, ..)
* oper::flags has been removed. Instead you must specify an operclass
in oper::operclass (for example, 'operclass netadmin').
* In operclass block(s) you define the privileges. You can now control
exactly what an IRCOp can and cannot do.
Have a look at operclass.default.conf which ships with UnrealIRCd,
it contains a number of default operclass blocks suitable for the
most common situations. See also the operclass block documentation:
https://www.unrealircd.org/docs/Operclass_block
* If you ask UnrealIRCd to convert your 3.2.x configuration file then
it will try to select a suitable operclass for the oper. This will
not always 100% match your current oper block rights, though.
* Channel Mode +A (Admin Only) has been removed. You can use the new
extended ban ~O:<operclass>. This allows you to, for example, create
an operclass 'netadmin' only channel: /MODE #chan +iI ~O:netadmin*
* set::hosts has been removed, use oper::vhost instead.
* Since oper levels have been removed you no longer see things like
"OperX is a Network Administrator" in /WHOIS by default.
If you want that, then you can set oper::swhois to
"is a Network Administrator" (or any other text).
* Entirely rewritten I/O and event loop. This allows the IRCd to scale
more easily to tens of thousands of clients by using kernel-evented I/O
mechanisms such as epoll and kqueue.
* Memory pooling has been added to improve memory allocation efficiency
and performance.
* On-connect DNSBL/RBL checking via the new blacklist block. [B1]
* The Windows version now has IPv6 support too. [B3]
* On all OS's we compile with IPv6 support enabled. You can still
disable IPv6 at runtime by setting set::options::disable-ipv6. [B3]
* The local nickname length can be modified without recompiling the IRCd
* Channel Mode +d: This will hide joins/parts for users who don't say
anything in a channel. Whenever a user speaks for the first time they
will appear to join. Chanops will still see everyone joining normally
as if there was no +d set.
* If you connect with SSL/TLS with a client certificate then your SSL
Fingerprint (SHA256 hash) can be seen by yourself and others through
/WHOIS. The fingerprint is also shared with all servers on the network.
* ExtBan ~S:<certificate fingerprint> for ban exceptions / invex. This
can be used like +iI ~S:000000000etc.
* bcrypt has been added as a password hashing algorithm and is now the
preferred algorithm [A3]
* './unreal mkpasswd' will now prompt you for the password to hash [A3]
* Protection against SSL renegotiation attacks [A3]
* When you link two servers the current timestamp is exchanged. If the
time differs more than 60 seconds then servers won't link and it will
show a message that you should fix your clock(s). This requires
version alpha3 (or later) on both ends of the link [A3]
* Configuration file converter that will upgrade your 3.2.x conf to 4.x.
On *NIX run './unreal upgrade-conf'. On Windows simply try to boot and
after the config errors screen UnrealIRCd offers the conversion. [A3]
* The IRCd can now better handle unknown channel modes which expect a
parameter. This can be useful in a scenario where you are slowly
upgrading all your servers.
* If you want to unset a vhost but keep cloaked then use /MODE yournick -t
* A "crash reporter" was added. When UnrealIRCd is started it will check
if a previous UnrealIRCd instance crashed and (after booting a new
instance) it will spit out a report and ask if you want to submit it
to the UnrealIRCd developers. Doing so will help us a lot as many bugs
are often not reported. Note that UnrealIRCd will always ask before
sending any information and never do so automatically. [B3]
* SSL: Support for ECDHE has been added to provide "forward secrecy". [B4]
==[ CHANGED ]==
* Numerics have been removed. Instead we now use SIDs (Server ID's) and
UIDs (User ID's). SIDs work very similar to server numerics and UIDs
help us to fix a number of lag-related race conditions / bugs.
* The module commands.so / commands.dll has been removed. All commands
(those that are modular) are now in their own module.
* Self-signed certificates are now generated using 4096 bits, a SHA256
hash and validity of 10 years. [A2]
* Building with SSL (OpenSSL) is now mandatory [A2]
* The link { } block has been restructured, see
https://www.unrealircd.org/docs/Upgrading_from_3.2.x#Link_block [A3]
* Better yet, check out our secure server linking tutorial:
https://www.unrealircd.org/docs/Tutorial:_Linking_servers
* If you have no set::throttle block you now get a default of 3:60 [A3]
* password entries in the conf no longer require specifying an auth-type
like password "..." { md5; };. UnrealIRCd will now auto-detect. [A3]
* You will now see a warning when you link to a non-SSL server. [A3]
* Previously we used POSIX Regular expressions in spamfilters and at
some other places. We have now moved to PCRE Regular expressions.
They look very similar, but PCRE is a lot faster.
For backwards-compatibility we still compile with both regex engines. [A3]
* Spamfilter command syntax has been changed, it now has an extra option
to indicate the matching method:
/SPAMFILTER [add|del|remove|+|-] [method] [type] ....
Where 'method' can be one of:
* -regex: this is the new fast PCRE2 regex engine
* -simple: supports just strings and ? and * wildcards (super fast)
* -posix: the old regex engine for compatibility with 3.2.x. [A3]
* If you have both 3.2.x and 4.x servers on your network then the
4.x server will only send spamfilters of type 'posix' to the 3.2.x
servers because 3.2.x servers don't support the other two types.
So in a mixed network you probably want to keep using 'posix' for
a while until all your servers are running UnrealIRCd 4. [A3]
* set::oper-only-stats now defaults to "*"
* oper::from::userhost and vhost::from::userhost are now called
oper::mask and vhost::mask. The usermask@ part is now optional and
it supports two syntaxes. For one entry you can use: mask 1.2.3.*;
For multiple entries the syntax is: mask { 192.168.*; 10.*; };
* Because having both allow::ip and allow::hostname in the same allow
block was highly confusing (it was an OR-match) you must now choose
between either allow::ip OR allow::hostname. [A3]
* cgiirc block is renamed to webirc and the syntax has changed [A4]
* set::pingpong-warning is removed, warning always off now [A4]
* More helpful configuration file parse error messages [A4]
* You can use '/OPER username' without password if you use SSL
certificate (fingerprint) authentication. The same is true for
'/VHOST username'. [A4]
* You must now always use 'make install' on *NIX [A4]
* Changed (default) directory structure entirely, see the section
titled 'CONFIGURATION CHANGES' about 100 lines up. [A4]
* badword quit { } is removed, we use badword channel for it. [A4]
* badwords.*.conf is now just one badwords.conf
* To load all default modules you now include modules.default.conf.
This file was called modules.conf in earlier alpha's.
The file has been split up in sections and a lot of comments have
been added to aid the user in deciding whether to load or not to
load each module. [A4]
* Snomask +s is now (always) IRCOp-only. [A4]
* Previously there was little logic behind what modes halfops could
set. Now the idea is as follows: halfops should be able to help out
in case of a flood but not be able to change any 'policy decission
modes' such as +G, +S, +c, +s. Due to this change halfops can now
set modes +beiklmntIMKNCR (was: +beikmntI). [A4]
* If no link::hub or link::leaf is specified then assume hub "*". [B1]
* SWHOIS (Special whois title) has been extended in a number of ways:
* We now "track" who or what set an swhois. This allows us to
remove the swhois received via oper/vhost on de-oper/de-vhost.
* You can now have multiple swhois lines
* Multiple oper::swhois and vhost::swhois items are supported. [B1]
* When trying to link two servers without link::outgoing::options::ssl
(which is not recommended) we try to use STARTTLS in order to
'upgrade' the connection to use SSL/TLS anyway. This can be disabled
via link::outgoing::options::insecure. [B2]
* SSLv3 has now been disabled for security. This also means you can only
link UnrealIRCd 4 with 3.2.10.3 and later because earlier versions
used SSLv3 instead of TLS due to an OpenSSL API mistake. [B4]
==[ MODULE CODERS / DEVELOPERS ]==
* A lot of technical documentation for module coders has been added
at https://www.unrealircd.org/docs/ describing things like how to
write a module from scratch, the User & Channel Mode System, Commands,
Command Overrides, Hooks, attaching custom-data to users/channels,
and more. [A2+]
* For commands: do not read from parv[0] anymore, doing so will lead
to a crash. Use sptr->name instead. This change is necessary as
the "name" in parv[0] could possibly point to a UID/SID rather than
a nick name. Thus, if you would send parv[0] to a non-UID or non-SID
capable server this would lead to serious issues (not found errors).
* Added MOD_OPT_PERM_RELOADABLE which permits reloading (eg: upgrades)
but disallows unloading of a module [A3]
* There have been *a lot* of source code cleanups (ALL)
* We now use the information from PROTOCTL CHANMODES= for parameter
skipping if the channel mode is unknown. Also, when channel modes
are loaded or unloaded we re-broadcast PROTOCTL CHANMODES=. [B1]
* The server protocol docs have been removed. The protocol is now
documented at https://www.unrealircd.org/docs/Server_protocol
See also https://www.unrealircd.org/docs/Server_protocol:Changes
for a list of changes between the 3.2 and 4.0 server protocol.
* GCC typechecking has been added to make sure your HookAdd... calls
are adding hook functions with the correct parameter (types).
==[ REMOVED / DROPPED ]==
* Numeric server IDs, see above. [A1]
* PROTOCTL TOKEN and SJB64 are no longer implemented. [A1]
* Ziplinks have been removed. [A1]
* WebTV support. [A3]
* Channel Mode +j was removed and replaced by the configuration setting
set::anti-flood::join-flood (default: 3 per 90 seconds). [B1]
* /CHATOPS: use /GLOBOPS instead which does the same
/ADCHAT & /NACHAT: gone as we don't have such oper levels anymore
Your opers should actually be in an #opers channel. If you also want
special classes of oper channels like #admins then use +iI ~O:*admin*
* User modes:
* +N (Network Administrator): see 'Oper permissions' under NEW as for why
* +a (Services Administrator): same
* +A (Server Administrator: same
* +C (Co Administrator): same
* +O (Local IRC Operator): same
* +h (HelpOp): all this did was add a line "is available for help" in
WHOIS. You can use a vhost block with vhost::swhois as a replacement
or for opers just add an oper::swhois item.
* +g (failops): we already have snomasks and the +o usermode for this
* +v (receive infected DCC SEND rejection notices): moved to snomask +D
+123 -143
View File
@@ -1,143 +1,123 @@
Rules about patches & modifications to UnrealIRCd
1. When making a change, always add a small description in the commit log.
Don't forget to mention the bug# and credit the reporter (if any).
2. If new files are made, it must contain proper copyright headers.
3. If you want to submit patches (f.e. if you don't have write access to
the repository), then submit them to https://bugs.unrealircd.org/
using "hg export" or "hg diff". Naturally include a clear description
of what the change does.
4. Each bug or feature should have a bug# so people can have a discussion
about it. This has a few implications (read!!):
* People must report bugs/feature requests to bugs.unrealircd.org and
not on IRC, e-mail, etc.
* That means other people can see the bug# and comment on it. This means
discussion is easy to read back for each issue and not spread between
several IRC logs.
Furthermore, by using the bugtracker instead of directly committing,
people could point out that there might be a better way to do things
than you originally thought, or it might be that other devs don't like
it at all.
* If a head coder has 'acknowledged' or 'confirmed' the bug or stated in
a comment that it's OK to implement, then a dev may take the issue.
The dev should change the status to 'assigned' and work on it, then
commit and change it to 'resolved', set 'fixed in version' to next
release, and add a comment pasting the relevant Changelog item and the
releaseid (.XYZ).
Of course other guidelines, like #7 and #8 still apply.
5. Do not commit changes that do not have an associated bug# and have not
had any discussion.
3.2.x: Small/tiny bugfixes that do not change any functionality, are
very unlikely to break anything and definitely don't require any prior
discussion may be exempted.
3.4.x: During the alpha & beta stage it is permitted to commit fixes
and code cleanups / restructuring without any discussion.
However in general, and in particular for new features, it is appreciated
if there has been prior discussion on bugs.unrealircd.org (or by mail).
6. Regarding reidenting, restructuring or other major code cleanups: please
discuss before doing so. The other devs might not agree with you on the
particular cleanup you have in mind which would result in another
clean-up-the-cleanup commit.
You may, however reindent and clean up individual sections when you are
working on fixing a particular bug# or implementing a new feature. In fact
you're encouraged to do so if the code is confusing without it. However,
obey the style of Unreal's code (mostly outlined in this document)
and do not introduce yet another (new) style. Also, be careful with doing
any cleanup: if you're unsure in any way about the use of something,
or something that looks redundant on first sight, then look more
carefully... it might indeed be useless and/or redundant, but it might
also be a subtle thing that can create great bugs when 'cleaned up'.
7. Prior to a 3.2.x release: be very careful with any restructuring of a
subsystem or doing any major commits that may break things. Stuff like
this can be perfectly fine if there are many months to go, but are not
good to do a month before release. The head coder may impose additional
restrictions during such a period.
8. During the Release Candidate stage (from RC1 until the final release)
only the head coder may commit directly, all others should ask and
present their patch before committing. Yes, even if you are changing
only 1 line of code or text.
9. UnrealIRCd should compile on all supported operating systems and
platforms, using GCC 3 or higher on *NIX, and Visual Studio 2008 or
higher on Windows. This means you cannot blindly use all C99 extensions.
10. Coders must test their code before committing.
11. /*
* These kind of comments
*/
NOT
// These kind of comments
12. if (something == 1)
{
moo; /* comment */
/* This does what what what */
cow(go(moo));
}
NOT
if (something == 1) {
}
13. Do not touch version.c.SH or version.h, unless you are a head coder
if you need a credit in, contact us
14. Protocol changes must be discussed before making patches for it.
15. We do NOT rip people off. If we use other people's code, it MUST be
properly credited.
16. We generally use tabsize 4 and 8. In any case, use tabs and NOT spaces.
Some code is old and horrible and has a mix of tabs and spaces used for
spacing, that's something we do not want to have ;)
17. Be careful about overflows. Do not do any unchecked string copies.
Instead of strcpy, strcat and sprintf/ircsprintf, use the following
functions: strlcpy, strlcat, snprintf/ircnsprintf.
If you are copying/writing character-by-character or word-by-word in a
loop, be very sure about your size counting. Sometimes it's possible
to avoid such code alltogether by just calling strlcat each time.
18. Speed. When optimizing or writing code, keep in mind that readability and
stability comes FIRST, and after that comes speed. So we'd rather prefer some
readable code (even if difficult) over some odd highly optimized routine which
nobody understands, is difficult to extend, and might have several bugs.
As mentioned earlier: use ircsnprintf, not snprintf (this is because
ircsnprintf is optimized for simple strings like the ones we use).
ircsnprintf calls snprintf when it finds a (non-simple) format specifier it
can't handle. Simple format specifiers do not have prefixes other than
h and l.
19. Initialize your structs and use the proper memory calls.
In UnrealIRCd we use MyMalloc, MyMallocEx and MyFree (so not malloc/free).
MyMalloc usually maps to malloc, and MyMallocEx is a malloc plus filling
the memory area (eg: the struct) with zero's (a la calloc).
Use of MyMallocEx is suggested. In general you should not be using MyMalloc.
"But MyMalloc is faster!" you might say. This is true, but using MyMallocEx
has very little speed impact and enormous benefits: people tend to forget
to set certain fields in the struct to NULL, or much more common: when
someone later on (eg: 1 year later) adds a field to a struct, there could
be several places he/she needs to update to make sure x->something is NULL
after allocating a new struct. Bad idea.
Little speed impact, huge stability benefits, easy decision ;).
20. Comment your code! This should speak for itself...
Put comments wherever you think they are needed, to aid any further coders
with reading your code.. and, in fact, it will aid yourself as well if you
would look back at your code 2 years later.
If there's some obscure pitfall, DO mention it! Don't just "hope" a next
author will see it like you did.
21. Use enums whenever possible, rather than #define constants. Besides making
things more clean, it also aids debugging.
Rules about patches & modifications to UnrealIRCd
1. When making a change, always add a small description in the commit log.
Don't forget to mention the bug# and credit the reporter (if any).
2. If new files are made, they must contain proper copyright headers.
3. Each bug or feature should have a bug# so people can have a discussion
about it. This has a few implications (read!!):
* People must report bugs/feature requests to bugs.unrealircd.org and
not on IRC, e-mail, etc.
* That means other people can see the bug# and comment on it. This means
discussion is easy to read back for each issue and not spread between
several IRC logs.
Furthermore, by using the bugtracker instead of directly committing,
people could point out that there might be a better way to do things
than you originally thought, or it might be that other devs don't like
it at all.
* If a head coder has 'acknowledged' or 'confirmed' the issue or stated
in a comment that it's OK to implement, then any dev may take the issue.
The dev should change the status to 'assigned' and work on it, then
commit and change it to 'resolved', set 'fixed in version' to the
correct release, and add a comment pasting the relevant commit log.
Of course other guidelines, in particular rule #7, still applies.
4. If you don't have direct write access to the repository then you can
submit changes as as PR on github. It is very much preferred to also
have a bugs.unrealircd.org entry for it as well (see previous item).
5. For the stable branch, in general, only commit changes that have an
associated bugid# and/or were discussed.
For branches currently in development (alpha/beta) there's more freedom
and if you think the change will be small and is fine without a
discussion then feel free to commit.
6. Regarding reidenting, restructuring or other major code cleanups: please
discuss before doing so. The other devs might not agree with you on the
particular cleanup you have in mind which would result in another
clean-up-the-cleanup commit.
You may, however reindent and clean up individual sections when you are
working on fixing a particular bug# or implementing a new feature. In fact
you're encouraged to do so if the code is confusing without it. However,
obey the style of Unreal's code (mostly outlined in this document)
and do not introduce yet another (new) style. Also, be careful with doing
any cleanup: if you're unsure in any way about the use of something,
or something that looks redundant on first sight, then look more
carefully... it might indeed be useless and/or redundant, but it might
also be a subtle thing that can create great bugs when 'cleaned up'.
7. During the Release Candidate stage (from RC1 until the final release)
only the head coder may commit directly, all others should ask and
present their patch before committing. Yes, even if you are changing
only 1 line of code or text.
9. UnrealIRCd should compile on all supported operating systems and
platforms, using GCC 3 or higher on *NIX, and Visual Studio 2008 or
higher on Windows. This means you cannot blindly use all C99 extensions.
10. Coders must test their code before committing.
11. /*
* These kind of comments
*/
NOT
// These kind of comments
12. if (something == 1)
{
moo; /* comment */
/* This does what what what */
cow(go(moo));
}
NOT
if (something == 1) {
}
13. Do not touch version.c.SH or version.h, unless you are a head coder.
If you need a credit in, contact us
14. Protocol changes must be discussed before making patches for it.
15. We do NOT rip people off. If we use other people's code, it MUST be
properly credited.
16. We use tabsize 8 and we use tabs AND NOT SPACES.
Some code is old and horrible and has a mix of tabs and spaces used for
spacing, that's something we do not want to have ;)
17. Be careful about overflows. Do not do any unchecked string copies.
Instead of strcpy, strcat and sprintf/ircsprintf, use the following
functions: strlcpy, strlcat, snprintf/ircnsprintf.
If you are copying/writing character-by-character or word-by-word in a
loop, eg using *p++ = x; then be very sure about your size counting.
Often it's better to avoid such code altogether, by simply using
strlcat for everything.
18. Speed. When optimizing or writing code, keep in mind that readability and
stability comes FIRST, and after that comes speed. So we'd rather prefer some
readable code (even if difficult) over some odd highly optimized routine which
nobody understands, is difficult to extend, and might have several bugs.
As mentioned earlier: use ircsnprintf, not snprintf (this is because
ircsnprintf is optimized for simple strings like the ones we use).
ircsnprintf calls snprintf when it finds a (non-simple) format specifier it
can't handle. Simple format specifiers do not have prefixes other than
h and l.
19. Initialize your structs and use the proper memory calls.
In UnrealIRCd we use safe_alloc, safe_free, safe_strdup and safe_strldup.
Do NOT use malloc, calloc or strdup.
20. Comment your code! This should speak for itself...
Put comments wherever you think they are needed, to aid any further coders
with reading your code.. and, in fact, it will aid yourself as well if you
would look back at your code 2 years later.
If there's some obscure pitfall, DO mention it! Don't just "hope" a next
author will see it like you did.
21. Use enums whenever possible, rather than #define constants. Besides making
things more clean, it also aids debugging.
+9 -9
View File
@@ -5,39 +5,39 @@ alias identify {
target chanserv;
type services;
parameters "IDENTIFY %1-";
};
}
format "^[^#]" {
target nickserv;
type services;
parameters "IDENTIFY %1-";
};
}
type command;
};
}
alias services {
format "^#" {
target chanserv;
type services;
parameters "%1-";
};
}
format "^[^#]" {
target nickserv;
type services;
parameters "%1-";
};
}
type command;
};
}
alias register {
format "^#" {
target chanserv;
type services;
parameters "REGISTER %1-";
};
}
format "^[^#]" {
target nickserv;
type services;
parameters "REGISTER %1-";
};
}
type command;
};
}
+12 -13
View File
@@ -1,18 +1,17 @@
/* Anope Aliases */
alias nickserv { type services; };
alias ns { target nickserv; type services; };
alias chanserv { type services; };
alias cs { target chanserv; type services; };
alias memoserv { type services; spamfilter yes; };
alias ms { target memoserv; type services; spamfilter yes; };
alias operserv { type services; };
alias os { target operserv; type services; };
alias helpserv { type services; };
alias botserv { type services; };
alias bs { target botserv; type services; };
alias hostserv { type services; };
alias hs { target hostserv; type services; };
alias nickserv { type services; }
alias ns { target nickserv; type services; }
alias chanserv { type services; }
alias cs { target chanserv; type services; }
alias memoserv { type services; spamfilter yes; }
alias ms { target memoserv; type services; spamfilter yes; }
alias operserv { type services; }
alias os { target operserv; type services; }
alias botserv { type services; }
alias bs { target botserv; type services; }
alias hostserv { type services; }
alias hs { target hostserv; type services; }
include "aliases/aliases.conf";
+21 -21
View File
@@ -1,26 +1,26 @@
/* Atheme Aliases */
alias nickserv { type services; };
alias ns { target nickserv; type services; };
alias chanserv { type services; };
alias cs { target chanserv; type services; };
alias memoserv { type services; spamfilter yes; };
alias ms { target memoserv; type services; spamfilter yes; };
alias operserv { type services; };
alias os { target operserv; type services; };
alias helpserv { type services; };
alias botserv { type services; };
alias bs { target botserv; type services; };
alias hostserv { type services; };
alias hs { target hostserv; type services; };
alias saslserv { type services; };
alias sss { target saslserv; type services; };
alias gameserv { type services; };
alias gms { target gameserv; type services; };
alias groupserv { type services; };
alias grs { target groupserv; type services; };
alias alis { type services; };
alias ls { target alis; type services; };
alias nickserv { type services; }
alias ns { target nickserv; type services; }
alias chanserv { type services; }
alias cs { target chanserv; type services; }
alias memoserv { type services; spamfilter yes; }
alias ms { target memoserv; type services; spamfilter yes; }
alias operserv { type services; }
alias os { target operserv; type services; }
alias helpserv { type services; }
alias botserv { type services; }
alias bs { target botserv; type services; }
alias hostserv { type services; }
alias hs { target hostserv; type services; }
alias saslserv { type services; }
alias sss { target saslserv; type services; }
alias gameserv { type services; }
alias gms { target gameserv; type services; }
alias groupserv { type services; }
alias grs { target groupserv; type services; }
alias alis { type services; }
alias ls { target alis; type services; }
include "aliases/aliases.conf";
+25 -25
View File
@@ -1,33 +1,33 @@
/* Auspice Aliases */
/* Uncomment this, if you have enabled "MassServ, W and X" in auspice */
# alias massserv { type services; };
# alias ma { target massserv; type services; };
# alias W { type services; };
# alias X { type services; };
# alias massserv { type services; }
# alias ma { target massserv; type services; }
# alias W { type services; }
# alias X { type services; }
/* Uncomment this, if you have enabled "WebServ" in auspice */
# alias webserv { type services; };
# alias ws { target webserv; type services; };
# alias webserv { type services; }
# alias ws { target webserv; type services; }
alias agent { type services; };
alias adminserv { type services; };
alias as { target adminserv; type services; };
alias botserv { type services; };
alias bs { target botserv; type services; };
alias chanserv { type services; };
alias cs { target chanserv; type services; };
alias helpserv { type services; };
alias hs { target helpserv; type services; };
alias hostserv { type services; };
alias ho { target hostserv; type services; };
alias memoserv { type services; spamfilter yes; };
alias ms { target memoserv; type services; spamfilter yes; };
alias nickserv { type services; };
alias ns { target nickserv; type services; };
alias operserv { type services; };
alias os { target operserv; type services; };
alias rootserv { type services; };
alias rs { target rootserv; type services; };
alias agent { type services; }
alias adminserv { type services; }
alias as { target adminserv; type services; }
alias botserv { type services; }
alias bs { target botserv; type services; }
alias chanserv { type services; }
alias cs { target chanserv; type services; }
alias helpserv { type services; }
alias hs { target helpserv; type services; }
alias hostserv { type services; }
alias ho { target hostserv; type services; }
alias memoserv { type services; spamfilter yes; }
alias ms { target memoserv; type services; spamfilter yes; }
alias nickserv { type services; }
alias ns { target nickserv; type services; }
alias operserv { type services; }
alias os { target operserv; type services; }
alias rootserv { type services; }
alias rs { target rootserv; type services; }
include "aliases/aliases.conf";
+8 -8
View File
@@ -1,12 +1,12 @@
/* Cygnus Aliases */
alias nickserv { type services; };
alias ns { target nickserv; type services; };
alias chanserv { type services; };
alias cs { target chanserv; type services; };
alias memoserv { type services; spamfilter yes; };
alias ms { target memoserv; type services; spamfilter yes; };
alias rootserv { type services; };
alias rs { target rootserv; type services; };
alias nickserv { type services; }
alias ns { target nickserv; type services; }
alias chanserv { type services; }
alias cs { target chanserv; type services; }
alias memoserv { type services; spamfilter yes; }
alias ms { target memoserv; type services; spamfilter yes; }
alias rootserv { type services; }
alias rs { target rootserv; type services; }
include "aliases/aliases.conf";
+12 -12
View File
@@ -1,16 +1,16 @@
/* Epona Aliases */
alias nickserv { type services; };
alias ns { target nickserv; type services; };
alias chanserv { type services; };
alias cs { target chanserv; type services; };
alias memoserv { type services; spamfilter yes; };
alias ms { target memoserv; type services; spamfilter yes; };
alias operserv { type services; };
alias os { target operserv; type services; };
alias helpserv { type services; };
alias hs { target helpserv; type services; };
alias botserv { type services; };
alias bs { target botserv; type services; };
alias nickserv { type services; }
alias ns { target nickserv; type services; }
alias chanserv { type services; }
alias cs { target chanserv; type services; }
alias memoserv { type services; spamfilter yes; }
alias ms { target memoserv; type services; spamfilter yes; }
alias operserv { type services; }
alias os { target operserv; type services; }
alias helpserv { type services; }
alias hs { target helpserv; type services; }
alias botserv { type services; }
alias bs { target botserv; type services; }
include "aliases/aliases.conf";
+10 -10
View File
@@ -1,14 +1,14 @@
/* Generic Aliases */
alias nickserv { type services; };
alias ns { target nickserv; type services; };
alias chanserv { type services; };
alias cs { target chanserv; type services; };
alias memoserv { type services; spamfilter yes; };
alias ms { target memoserv; type services; spamfilter yes; };
alias operserv { type services; };
alias os { target operserv; type services; };
alias helpserv { type services; };
alias hs { target helpserv; type services; };
alias nickserv { type services; }
alias ns { target nickserv; type services; }
alias chanserv { type services; }
alias cs { target chanserv; type services; }
alias memoserv { type services; spamfilter yes; }
alias ms { target memoserv; type services; spamfilter yes; }
alias operserv { type services; }
alias os { target operserv; type services; }
alias helpserv { type services; }
alias hs { target helpserv; type services; }
include "aliases/aliases.conf";
+2 -2
View File
@@ -1,4 +1,4 @@
/* Generic StatServ Aliases */
alias statserv { type stats; };
alias ss { target statserv; type stats; };
alias statserv { type stats; }
alias ss { target statserv; type stats; }
+13 -13
View File
@@ -1,17 +1,17 @@
/* IRCServices Aliases */
alias nickserv { type services; };
alias ns { target nickserv; type services; };
alias chanserv { type services; };
alias cs { target chanserv; type services; };
alias memoserv { type services; spamfilter yes; };
alias ms { target memoserv; type services; spamfilter yes; };
alias operserv { type services; };
alias os { target operserv; type services; };
alias helpserv { type services; };
alias hs { target helpserv; type services; };
alias irciihelp { type services; };
alias statserv { type services; };
alias ss { target statserv; type services; };
alias nickserv { type services; }
alias ns { target nickserv; type services; }
alias chanserv { type services; }
alias cs { target chanserv; type services; }
alias memoserv { type services; spamfilter yes; }
alias ms { target memoserv; type services; spamfilter yes; }
alias operserv { type services; }
alias os { target operserv; type services; }
alias helpserv { type services; }
alias hs { target helpserv; type services; }
alias irciihelp { type services; }
alias statserv { type services; }
alias ss { target statserv; type services; }
include "aliases/aliases.conf";
+4 -4
View File
@@ -1,6 +1,6 @@
/* OperStats Aliases */
alias operserv { type stats; };
alias os { target operserv; type stats; };
alias statserv { type stats; };
alias ss { target statserv; type stats; };
alias operserv { type stats; }
alias os { target operserv; type stats; }
alias statserv { type stats; }
alias ss { target statserv; type stats; }
+19 -20
View File
@@ -5,7 +5,6 @@
NOTE: Those words are not meant to insult you (the user)
but is meant to be a list of words so that the +G channel/user mode
will work properly. You can easily modify this file at your will.
If you got words to add to this file, please mail badwords@tspre.org
@@ -30,22 +29,22 @@
*/
badword all { word "pussy"; };
badword all { word "fuck"; };
badword all { word "whore"; };
badword all { word "slut"; };
badword all { word "shit"; };
badword all { word "asshole"; };
badword all { word "bitch"; };
badword all { word "cunt"; };
badword all { word "vagina"; };
badword all { word "penis"; };
badword all { word "jackass"; };
badword all { word "*fucker*"; };
badword all { word "faggot"; };
badword all { word "fag"; };
badword all { word "horny"; };
badword all { word "dickhead"; };
badword all { word "sonuvabitch"; };
badword all { word "*fuck*"; };
badword all { word "tits"; };
badword all { word "pussy"; }
badword all { word "fuck"; }
badword all { word "whore"; }
badword all { word "slut"; }
badword all { word "shit"; }
badword all { word "asshole"; }
badword all { word "bitch"; }
badword all { word "cunt"; }
badword all { word "vagina"; }
badword all { word "penis"; }
badword all { word "jackass"; }
badword all { word "*fucker*"; }
badword all { word "faggot"; }
badword all { word "fag"; }
badword all { word "horny"; }
badword all { word "dickhead"; }
badword all { word "sonuvabitch"; }
badword all { word "*fuck*"; }
badword all { word "tits"; }
+20 -20
View File
@@ -17,26 +17,26 @@
*/
/* first.. deny everything, then allow known-good stuff... */
deny dcc { filename "*"; reason "Possible executable content"; soft yes; };
deny dcc { filename "*"; reason "Possible executable content"; soft yes; }
/* common image formats */
allow dcc { filename "*.jpg"; soft yes; };
allow dcc { filename "*.jpeg"; soft yes; };
allow dcc { filename "*.gif"; soft yes; };
allow dcc { filename "*.png"; soft yes; };
allow dcc { filename "*.bmp"; soft yes; };
allow dcc { filename "*.jpg"; soft yes; }
allow dcc { filename "*.jpeg"; soft yes; }
allow dcc { filename "*.gif"; soft yes; }
allow dcc { filename "*.png"; soft yes; }
allow dcc { filename "*.bmp"; soft yes; }
/* audio / video (but not scripted/playlists!) */
allow dcc { filename "*.mp1"; soft yes; };
allow dcc { filename "*.mp2"; soft yes; };
allow dcc { filename "*.mp3"; soft yes; };
allow dcc { filename "*.mpg"; soft yes; };
allow dcc { filename "*.mpeg"; soft yes; };
allow dcc { filename "*.m1v"; soft yes; };
allow dcc { filename "*.m2v"; soft yes; };
allow dcc { filename "*.vob"; soft yes; };
allow dcc { filename "*.wav"; soft yes; };
allow dcc { filename "*.mp1"; soft yes; }
allow dcc { filename "*.mp2"; soft yes; }
allow dcc { filename "*.mp3"; soft yes; }
allow dcc { filename "*.mpg"; soft yes; }
allow dcc { filename "*.mpeg"; soft yes; }
allow dcc { filename "*.m1v"; soft yes; }
allow dcc { filename "*.m2v"; soft yes; }
allow dcc { filename "*.vob"; soft yes; }
allow dcc { filename "*.wav"; soft yes; }
/* text / misc */
allow dcc { filename "*.txt"; soft yes; };
allow dcc { filename "*.log"; soft yes; };
allow dcc { filename "*.pdf"; soft yes; };
allow dcc { filename "*.c"; soft yes; };
allow dcc { filename "*.cpp"; soft yes; };
allow dcc { filename "*.txt"; soft yes; }
allow dcc { filename "*.log"; soft yes; }
allow dcc { filename "*.pdf"; soft yes; }
allow dcc { filename "*.c"; soft yes; }
allow dcc { filename "*.cpp"; soft yes; }
+457 -173
View File
@@ -1,23 +1,28 @@
/* Configuration file for UnrealIRCd 4.0
/* Configuration file for UnrealIRCd 6
*
* Simply copy this file to your conf/ directory, call it
* 'unrealircd.conf' and walk through it line by line (edit it!)
* Simply copy this file to your conf/ directory and call it 'unrealircd.conf'
*
* Important: All lines, except the opening { line, end with an ;
* including };. This is very important, if you miss a ; somewhere then
* the configuration file parser will complain and your file will not
* If you are in a hurry then you can CTRL+F for: CHANGE THIS
* The items that must be changed are indicated with those two words.
* However, we actually recommend going through the file line by line
* and edit it where needed, so you can see all the basic items and
* what they are set to.
*
* BEFORE YOU PROCEED:
* Important: all lines, except { and } end with an ;
* This is very important, if you miss a ; somewhere then the
* configuration file parser will complain and the file will not
* be processed correctly!
* If this is your first experience with an UnrealIRCd configuration
* file then we really recommend you to read a little about the syntax,
* this only takes a few minutes and will help you a lot:
* https://www.unrealircd.org/docs/Configuration#Configuration_file_syntax
*
* UnrealIRCd 4 documentation (very extensive!):
* https://www.unrealircd.org/docs/UnrealIRCd_4_documentation
* UnrealIRCd 6 documentation (very extensive!):
* https://www.unrealircd.org/docs/UnrealIRCd_6_documentation
*
* Frequently Asked Questions:
* https://www.unrealircd.org/docs/FAQ
*
*/
/* This is a comment, all text here is ignored (comment type #1) */
@@ -42,34 +47,43 @@ include "modules.default.conf";
* - help/help.conf for our on-IRC /HELPOP system
* - badwords.conf for channel and user mode +G
* - spamfilter.conf as an example for spamfilter usage
* (commented out)
* - operclass.default.conf contains some good operclasses which
* you can use in your oper blocks.
*/
include "help/help.conf";
include "badwords.conf";
include "spamfilter.conf";
//include "spamfilter.conf";
include "operclass.default.conf";
include "snomasks.default.conf";
/* Load the default cloaking module (2021 onwards): */
loadmodule "cloak_sha256";
/* Or load the old module from UnrealIRCd 3.2/4/5 instead: */
//loadmodule "cloak_md5";
// CHANGE THIS (the 'name' and the 'info'):
/* This is the me { } block which basically says who we are.
* It defines our server name, some information line and an unique "sid".
* The server id (sid) must start with a digit followed by two digits or
* letters. The sid must be unique for your IRC network (each server should
* have it's own sid).
* have it's own sid). It is common to use 001 for the first server.
*/
me {
name "irc.foonet.com";
info "FooNet Server";
name "irc.example.org";
info "ExampleNET Server";
sid "001";
};
}
// CHANGE THIS:
/* The admin { } block defines what users will see if they type /ADMIN.
* It normally contains information on how to contact the administrator.
*/
admin {
"Bob Smith";
"bob";
"widely@used.name";
};
"email@example.org";
}
/* Clients and servers are put in class { } blocks, we define them here.
* Class blocks consist of the following items:
@@ -86,7 +100,7 @@ class clients
maxclients 1000;
sendq 200k;
recvq 8000;
};
}
/* Special class for IRCOps with higher limits */
class opers
@@ -95,7 +109,7 @@ class opers
maxclients 50;
sendq 1M;
recvq 8000;
};
}
/* Server class with good defaults */
class servers
@@ -103,33 +117,33 @@ class servers
pingfreq 60;
connfreq 15; /* try to connect every 15 seconds */
maxclients 10; /* max servers */
sendq 5M;
};
sendq 20M;
}
/* Allow blocks define which clients may connect to this server.
* This allows you to add a server password or restrict the server to
* specific IP's only. You also configure the maximum connections
* specific IPs only. You also configure the maximum connections
* allowed per IP here.
* See also: https://www.unrealircd.org/docs/Allow_block
*/
/* Allow everyone in, but only 3 connections per IP */
allow {
ip *@*;
mask *;
class clients;
maxperip 3;
};
}
/* Example of a special allow block on a specific IP:
* Requires users on that IP to connect with a password. If the password
* is correct then it permits 20 connections on that IP.
*/
allow {
ip *@192.0.2.1;
class clients;
password "somesecretpasswd";
maxperip 20;
};
// allow {
// mask 192.0.2.1;
// class clients;
// password "somesecretpasswd";
// maxperip 20;
// }
/* Oper blocks define your IRC Operators.
* IRC Operators are people who have "extra rights" compared to others,
@@ -143,13 +157,25 @@ allow {
* https://www.unrealircd.org/docs/Oper_block
*/
/* Here is an example oper block for 'bobsmith' with password 'test'.
* You MUST change this!!
/* Here is an example oper block for 'bobsmith'
* YOU MUST CHANGE THIS!! (the oper name and the password)
*/
oper bobsmith {
class opers;
mask *@*;
password "test";
/* Technically you can put oper passwords in plaintext in the conf but
* this is HIGHLY DISCOURAGED. Instead you should generate a password hash:
* On *NIX, run: ./unrealircd mkpasswd
* On Windows, run: "C:\Program Files\UnrealIRCd 6\bin\unrealircdctl" mkpasswd
* .. and then paste the result below:
*/
password "$argon2id..etc..";
/* See https://www.unrealircd.org/docs/Authentication_types for
* more information, including even better authentication types
* such as 'certfp', and how to generate hashes on Windows.
*/
/* Oper permissions are defined in an 'operclass' block.
* See https://www.unrealircd.org/docs/Operclass_block
* UnrealIRCd ships with a number of default blocks, see
@@ -157,8 +183,8 @@ oper bobsmith {
*/
operclass netadmin;
swhois "is a Network Administrator";
vhost netadmin.mynet.org;
};
vhost netadmin.example.org;
}
/* Listen blocks define the ports where the server should listen on.
* In other words: the ports that clients and servers may use to
@@ -166,40 +192,44 @@ oper bobsmith {
*
* Syntax:
* listen {
* {
* ip <ip>;
* port <port>;
* options {
* <options....>;
* };
* };
* }
* }
*/
/* Standard IRC port 6667 */
/* Standard IRC port 6667:
* Insecure plaintext (NOT for production servers)
* This listen block is here only for quick testing.
* Delete or comment out this listen block on production servers
* and use TLS on port 6697 instead.
*/
listen {
ip *;
port 6667;
};
}
/* Standard IRC SSL/TLS port 6697 */
listen {
ip *;
port 6697;
options { ssl; };
};
options { tls; }
}
/* Special SSL/TLS servers-only port for linking */
listen {
ip *;
port 6900;
options { ssl; serversonly; };
};
options { tls; serversonly; }
}
/* NOTE: If you are on an IRCd shell with multiple IP's and you use
* the above listen { } blocks then you will likely get an
* 'Address already in use' error and the ircd won't start.
* This means you MUST bind to a specific IP instead of '*' like:
* listen { ip 1.2.3.4; port 6667; };
* listen { ip 1.2.3.4; port 6667; }
* Of course, replace the IP with the IP that was assigned to you.
*/
@@ -207,50 +237,54 @@ listen {
* Link blocks allow you to link multiple servers together to form a network.
* See https://www.unrealircd.org/docs/Tutorial:_Linking_servers
*/
link hub.mynet.org
{
incoming {
mask *@something;
};
outgoing {
bind-ip *; /* or explicitly an IP */
hostname hub.mynet.org;
port 6900;
options { ssl; };
};
/* We use the SPKI fingerprint of the other server for authentication.
* Run './unrealircd spkifp' on the other side to get it.
* NOTE: requires UnrealIRCd 4.0.16 or later.
*/
password "AABBCCDDEEFFGGHHIIJJKKLLMMNNOOPPQQRRSSTTUUV=" { spkifp; };
class servers;
};
//link hub.example.org
//{
// incoming {
// mask *@something;
// }
//
// outgoing {
// bind-ip *; /* or explicitly an IP */
// hostname hub.example.org;
// port 6900;
// options { tls; }
// }
//
// /* We use the SPKI fingerprint of the other server for authentication.
// * Open a shell on the OTHER SERVER and run the command to get the fingerprint:
// * On *NIX, run: ./unrealircd spkifp
// * On Windows, run: "C:\Program Files\UnrealIRCd 6\bin\unrealircdctl" spkifp
// */
// password "AABBCCDDEEFFGGHHIIJJKKLLMMNNOOPPQQRRSSTTUUV=" { spkifp; }
//
// class servers;
//}
/* The link block for services is usually much simpler.
* For more information about what Services are,
* see https://www.unrealircd.org/docs/Services
*/
link services.mynet.org
{
incoming {
mask 127.0.0.1;
};
password "changemeplease";
class servers;
};
//link services.example.org
//{
// incoming {
// mask 127.0.0.1;
// }
//
// password "changemeplease";
//
// class servers;
//}
/* U-lines give other servers (even) more power/commands.
* If you use services you must add them here.
* NEVER put the name of an UnrealIRCd server here!!!
* If you use services you MUST add them here. You must add the
* services server name in ulines { } in the config file on
* every UnrealIRCd server on your network.
* IMPORTANT: Never put the name of an UnrealIRCd server here,
* it's only for Services!
*/
ulines {
services.mynet.org;
};
//ulines {
// services.example.org;
//}
/* Here you can add a password for the IRCOp-only /DIE and /RESTART commands.
* This is mainly meant to provide a little protection against accidental
@@ -259,27 +293,51 @@ ulines {
drpass {
restart "restart";
die "die";
};
}
/* The log block defines what should be logged and to what file.
* See also https://www.unrealircd.org/docs/Log_block
*/
/* This is a good default, it logs almost everything */
log "ircd.log" {
flags {
oper;
connects;
server-connects;
kills;
errors;
sadmin-commands;
chg-commands;
oper-override;
tkl;
spamfilter;
};
};
/* This is a good default, it logs everything except
* debug stuff and join/part/kick.
*/
log {
source {
all;
!debug;
!join.LOCAL_CLIENT_JOIN;
!join.REMOTE_CLIENT_JOIN;
!part.LOCAL_CLIENT_PART;
!part.REMOTE_CLIENT_PART;
!kick.LOCAL_CLIENT_KICK;
!kick.REMOTE_CLIENT_KICK;
}
destination {
file "ircd.log" { maxsize 100M; }
}
}
/* In addition to regular logging, also add a JSON log file.
* This includes lots of information about every event so is great
* for auditing purposes and is machine readable. It is, however
* less readable for humans.
*/
log {
source {
all;
!debug;
!join.LOCAL_CLIENT_JOIN;
!join.REMOTE_CLIENT_JOIN;
!part.LOCAL_CLIENT_PART;
!part.REMOTE_CLIENT_PART;
!kick.LOCAL_CLIENT_KICK;
!kick.REMOTE_CLIENT_KICK;
}
destination {
file "ircd.json.log" { maxsize 250M; type json; }
}
}
/* With "aliases" you can create an alias like /SOMETHING to send a message to
* some user or bot. They are usually used for services.
@@ -290,43 +348,43 @@ log "ircd.log" {
include "aliases/anope.conf";
/* Ban nick names so they cannot be used by regular users */
ban nick {
mask "*C*h*a*n*S*e*r*v*";
reason "Reserved for Services";
};
// ban nick {
// mask "*C*h*a*n*S*e*r*v*";
// reason "Reserved for Services";
// }
/* Ban ip.
* Note that you normally use /KLINE, /GLINE and /ZLINE for this.
*/
ban ip {
mask 195.86.232.81;
reason "Hate you";
};
// ban ip {
// mask 195.86.232.81;
// reason "Hate you";
// }
/* Ban server - if we see this server linked to someone then we delink */
ban server {
mask eris.berkeley.edu;
reason "Get out of here.";
};
// ban server {
// mask eris.berkeley.edu;
// reason "Get out of here.";
// }
/* Ban user - just as an example, you normally use /KLINE or /GLINE for this */
ban user {
mask *tirc@*.saturn.bbn.com;
reason "Idiot";
};
// ban user {
// mask *tirc@*.saturn.bbn.com;
// reason "Idiot";
// }
/* Ban realname allows you to ban clients based on their 'real name'
* or 'gecos' field.
*/
ban realname {
mask "Swat Team";
reason "mIRKFORCE";
};
// ban realname {
// mask "Swat Team";
// reason "mIRKFORCE";
// }
ban realname {
mask "sub7server";
reason "sub7";
};
// ban realname {
// mask "sub7server";
// reason "sub7";
// }
/* Ban and TKL exceptions. Allows you to exempt users / machines from
* KLINE, GLINE, etc.
@@ -335,84 +393,136 @@ ban realname {
* even if you accidentally place a *LINE ban on yourself.
*/
/* except ban protects you from KLINE and ZLINE */
except ban {
mask *@192.0.2.1;
// you may add more mask entries here..
};
/* except ban with type 'all' protects you from GLINE, GZLINE, QLINE, SHUN */
// except ban {
// mask *@192.0.2.1;
// type all;
// }
/* except tkl with type 'all' protects you from GLINE, GZLINE, QLINE, SHUN */
except tkl {
mask *@192.0.2.1;
type all;
};
/* This allows IRCCloud connections in without maxperip restrictions
* and also exempt them from connect-flood throttling.
*/
except ban {
mask *.irccloud.com;
type { maxperip; connect-flood; }
}
/* With deny dcc blocks you can ban filenames for DCC */
deny dcc {
filename "*sub7*";
reason "Possible Sub7 Virus";
};
// deny dcc {
// filename "*sub7*";
// reason "Possible Sub7 Virus";
// }
/* deny channel allows you to ban a channel (mask) entirely */
deny channel {
channel "*warez*";
reason "Warez is illegal";
class "clients";
};
// deny channel {
// channel "*warez*";
// reason "Warez is illegal";
// class "clients";
// }
/* VHosts (Virtual Hosts) allow users to acquire a different host.
* See https://www.unrealircd.org/docs/Vhost_block
*/
/* Example vhost which you can use. On IRC type: /VHOST test test
* NOTE: only people with an 'unrealircd.com' host may use it so
* be sure to change the vhost::mask before you test.
*/
vhost {
vhost i.hate.microsefrs.com;
mask *@unrealircd.com;
login "test";
password "test";
};
// vhost {
// vhost i.hate.microsefrs.com;
// mask *@*;
// login "test";
// password "test";
// }
/* Blacklist blocks will query an external DNS Blacklist service
* whenever a user connects, to see if the IP address is known
* to cause drone attacks, is a known hacked machine, etc.
* Documentation: https://www.unrealircd.org/docs/Blacklist_block
* Or just have a look at the blocks below.
*/
/* DroneBL, probably the most popular blacklist used by IRC Servers.
* See https://dronebl.org/ for their documentation and the
* meaning of the reply types. At time of writing we use types:
* 3: IRC Drone, 5: Bottler, 6: Unknown spambot or drone,
* 7: DDoS Drone, 8: SOCKS Proxy, 9: HTTP Proxy, 10: ProxyChain,
* 11: Web Page Proxy, 12: Open DNS Resolver, 13: Brute force attackers,
* 14: Open Wingate Proxy, 15: Compromised router / gateway,
* 16: Autorooting worms.
*/
blacklist dronebl {
dns {
name dnsbl.dronebl.org;
type record;
reply { 3; 5; 6; 7; 8; 9; 10; 11; 12; 13; 14; 15; 16; }
}
action gline;
ban-time 24h;
reason "Proxy/Drone detected. Check https://dronebl.org/lookup?ip=$ip for details.";
}
/* EFnetRBL, see https://rbl.efnetrbl.org/ for documentation
* and the meaning of the reply types.
* At time of writing: 1 is open proxy, 4 is TOR, 5 is drones/flooding.
*
* NOTE: If you want to permit TOR proxies on your server, then
* you need to remove the '4;' below in the reply section.
*/
blacklist efnetrbl {
dns {
name rbl.efnetrbl.org;
type record;
reply { 1; 4; 5; }
}
action gline;
ban-time 24h;
reason "Proxy/Drone/TOR detected. Check https://rbl.efnetrbl.org/?i=$ip for details.";
}
/* You can include other configuration files */
/* include "klines.conf"; */
/* Network configuration */
set {
network-name "MYNet";
default-server "irc.mynet.org";
services-server "services.mynet.org";
stats-server "stats.mynet.org";
// CHANGE THIS, ALL 4 ITEMS:
network-name "ExampleNET";
default-server "irc.example.org";
services-server "services.example.org";
stats-server "stats.example.org";
/* Normal defaults */
help-channel "#Help";
hiddenhost-prefix "Clk";
cloak-prefix "Clk";
prefix-quit "Quit";
/* Cloak keys should be the same at all servers on the network.
* They are used for generating masked hosts and should be kept secret.
* The keys should be 3 random strings of 50-100 characters
* YOU MUST CHANGE THIS!
* The keys should be 3 random strings of 80 characters each (or more).
* and must consist of lowcase (a-z), upcase (A-Z) and digits (0-9).
* HINT: On *NIX, you can run './unrealircd gencloak' in your shell to let
* UnrealIRCd generate 3 random strings for you.
* On *NIX, you can run './unrealircd gencloak' in your shell to let
* UnrealIRCd generate 3 random strings for you.
* On Windows, you can run "C:\Program Files\UnrealIRCd 6\bin\unrealircdctl" gencloak
*/
cloak-keys {
"aoAr1HnR6gl3sJ7hVz4Zb7x4YwpW";
"Oozahho1raezoh0iMee4ohvegaifahv5xaepeitaich9tahdiquaid0geecipahdauVaij3zieph4ahi";
"and another one";
"and another one";
};
};
}
}
/* Server specific configuration */
set {
kline-address "set.this.to.email.address"; /* e-mail or URL shown when a user is banned */
// FINALLY, YOU MUST CHANGE THIS NEXT ITEM:
kline-address 'set.this.to.email.address'; /* e-mail or URL shown when a user is banned */
modes-on-connect "+ixw"; /* when users connect, they will get these user modes */
modes-on-oper "+xwgs"; /* when someone becomes IRCOp they'll get these modes */
modes-on-oper "+xws"; /* when someone becomes IRCOp they'll get these modes */
modes-on-join "+nt"; /* default channel modes when a new channel is created */
oper-auto-join "#opers"; /* IRCOps are auto-joined to this channel */
options {
hide-ulines; /* hide U-lines in /MAP and /LINKS */
show-connect-info; /* show "looking up your hostname" messages on connect */
};
}
maxchannelsperuser 10; /* maximum number of channels a user may /JOIN */
@@ -427,15 +537,26 @@ set {
/* static-part does the same for /PART */
/* static-part yes; */
/* Which /STATS to restrict to opers only. We suggest to leave it to * (ALL) */
oper-only-stats "*";
/* Anti flood protection */
/* Flood protection */
anti-flood {
nick-flood 3:60; /* 3 nick changes per 60 seconds (the default) */
connect-flood 3:60; /* 3 connection attempts per 60 seconds (the default) */
away-flood 4:120; /* 4 times per 2 minutes you may use /AWAY (default) */
};
/* There are lots of settings for this and most have good defaults.
* See https://www.unrealircd.org/docs/Anti-flood_settings
*/
channel {
/* For channel-specific anti-flood settings, see
* https://www.unrealircd.org/docs/Channel_anti-flood_settings
* In UnrealIRCd 6.2.0+ the default is profile "normal".
* Chanops can override this via "MODE #channel +F relaxed"
* or "+F off". If you are afraid of too many false positives
* then you could set this to "relaxed" instead. Note that
* doing so would reduce protection for everyone. Another
* option is to set it here to "off" to disable this default
* channel protection entirely (not recommended).
*/
default-profile normal;
}
}
/* Settings for spam filter */
spamfilter {
@@ -443,8 +564,171 @@ set {
ban-reason "Spam/Advertising"; /* default reason */
virus-help-channel "#help"; /* channel to use for 'viruschan' action */
/* except "#help"; channel to exempt from Spamfilter */
};
};
}
/* Restrict certain commands.
* See https://www.unrealircd.org/docs/Set_block#set::restrict-commands
*/
restrict-commands {
list {
except {
connect-time 60; /* after 60 seconds you can use LIST */
identified yes; /* or immediately, if you are identified to services */
reputation-score 24; /* or if you have a reputation score of 24 or more */
}
}
invite {
except {
connect-time 120;
identified yes;
reputation-score 24;
}
}
/* In addition to the ability to restrict any command,
* such as shown above. There are also 4 special types
* that you can restrict. These are "private-message",
* "private-notice", "channel-message" and "channel-notice".
* They are commented out (disabled) in this example:
*/
//private-message {
// except { connect-time 10; }
//}
//private-notice {
// except { connect-time 10; }
//}
}
}
/* RECOMMENDED:
* Everyone should be using IRC over SSL/TLS on port 6697. However, to use
* it properly, you have to get a "real" certificate instead of the
* self-signed default certificate that was generated by the installer.
* The Let's Encrypt initiative allows you to get a free certificate that is
* issued by a trusted Certificate Authority. Instructions are at:
* https://www.unrealircd.org/docs/Using_Let's_Encrypt_with_UnrealIRCd
*
* When you follow that guide you will have a "dual certificate" setup:
* set::tls:
* Your trusted CA certificate, served to clients on port 6697.
* (key and certificate change and renew every xx days automatically)
* set::server-linking::tls-options
* A long-lived self-signed certificate for server linking, with
* a stable 'spkifp' signature that you use in link blocks.
* This certificate is used automatically in "serversonly" listen blocks
* (port 6900 in this configuration file) and automatically used for all
* link { } blocks.
*
*/
//set {
// tls {
// certificate "/etc/letsencrypt/live/irc.example.org/fullchain.pem";
// key "/etc/letsencrypt/live/irc.example.org/privkey.pem";
// }
// server-linking {
// tls-options {
// certificate "tls/server.cert.pem";
// key "tls/server.key.pem";
// }
// }
//}
/*
* The following will configure connection throttling of "unknown users".
*
* When UnrealIRCd detects a high number of users connecting from IP addresses
* that have not been seen before, then connections from new IP's are rejected
* above the set rate. For example at 10:60 only 10 users per minute can connect
* that have not been seen before. Known IP addresses can always get in,
* regardless of the set rate. Same for users who login using SASL.
*
* See also https://www.unrealircd.org/docs/Connthrottle for details.
* Or just keep reading the default configuration settings below:
*/
set {
connthrottle {
/* First we configure which users are exempt from the
* restrictions. These users are always allowed in!
* By default these are users on IP addresses that have
* a score of 24 or higher. A score of 24 means that the
* IP was connected to this network for at least 2 hours
* in the past month (or minimum 1 hour if registered).
* We also allow users who are identified to services via
* SASL to bypass the restrictions.
*/
except {
reputation-score 24;
identified yes;
/* for more options, see
* https://www.unrealircd.org/docs/Mask_item
*/
}
/* New users are all users that do not belong in the
* known-users group. They are considered "new" and in
* case of a high number of such new users connecting
* they are subject to connection rate limiting.
* By default the rate is 20 new local users per minute
* and 30 new global users per minute.
*/
new-users {
local-throttle 20:60;
global-throttle 30:60;
}
/* For IPv6 users, on top of 'maxperip' (which limits
* connections per /64), connthrottle also limits how
* many unknown users can be online from wider IPv6
* prefixes (/56, /48, /32). This is an additional
* security measure, separate from the rate-throttle
* above. People in the security-group "known-users"
* bypass this, as well as set::connthrottle::except.
* The defaults below should fit most networks unchanged.
* Uncomment to tune. Set a cidr-xx item to max 0;
* to disable it.
*/
//ipv6-unknown-users-limit {
// cidr-56 { max 8; }
// cidr-48 { max 32; }
// cidr-32 { max 256; }
//}
/* This configures when this module will NOT be active.
* The default settings will disable the module when:
* - The reputation module has been running for less than
* a week. If running less than 1 week then there is
* insufficient data to consider who is a "known user".
* - The server has just been booted up (first 3 minutes).
*/
disabled-when {
reputation-gathering 1w;
start-delay 3m;
}
}
}
/* CHANNEL HISTORY:
* UnrealIRCd has channel mode +H which can be used by users to read back
* channel history, such as from before they joined. For general information
* on this feature, see https://www.unrealircd.org/docs/Channel_history
*
* The history limits can be configured via set::history. The defaults are
* probably already good for you, but if you are on a low-memory system
* or have thousands of channels then you may want to double check. See
* https://www.unrealircd.org/docs/Set_block#set::history for the options.
*
* In addition to that, you can have "persistent channel history", which
* means channel history is stored encrypted on disk so it is preserved
* between IRC server restarts, see
* https://www.unrealircd.org/docs/Set_block#Persistent_channel_history
* The persistent history feature is NOT enabled by default because you
* need to configure a secret { } block for it. The following is a simple
* example with passwords stored directly in the configuration file.
* To get better security, read https://www.unrealircd.org/docs/Secret_block
* on alternative ways so you don't store passwords directly in the config.
*/
//secret historydb { password "somepassword"; }
//set { history { channel { persist yes; db-secret "historydb"; } } }
/* Finally, you may wish to have a MOTD (Message of the Day), this can be
* done by creating an 'ircd.motd' text file in your conf/ directory.
@@ -454,7 +738,7 @@ set {
/*
* Problems or need more help?
* 1) https://www.unrealircd.org/docs/UnrealIRCd_4_documentation
* 1) https://www.unrealircd.org/docs/
* 2) https://www.unrealircd.org/docs/FAQ <- answers 80% of your questions!
* 3) If you are still having problems then you can get support:
* - Forums: https://forums.unrealircd.org/
+659
View File
@@ -0,0 +1,659 @@
/* Archivo de configuración para UnrealIRCd 6
*
* Simplemente copie este archivo a su directorio conf/, llámelo
* 'unrealircd.conf' y revíselo línea por línea (¡edítelo!)
*
* Importante: Todas las líneas, excepto { y } terminan con ;
* Esto es muy importante, si pierde un ; en algún lugar entonces el
* el analizador del archivo de configuración se quejará y el archivo no
* ser procesado correctamente!
* Si esta es tu primera experiencia con una configuración de UnrealIRCd
* entonces te recomendamos que leas un poco sobre la sintaxis,
* esto solo toma unos minutos y te ayudará mucho:
* https://www.unrealircd.org/docs/Configuration#Configuration_file_syntax
*
* Documentación de UnrealIRCd 6 (¡muy extensa!):
* https://www.unrealircd.org/docs/UnrealIRCd_6_documentation
*
* Preguntas frecuentes:
* https://www.unrealircd.org/docs/FAQ
*
*/
/* Esto es un comentario, todo el texto aquí es ignorado (tipo de comentario #1) */
// Esto también es un comentario, esta línea se ignora (tipo de comentario #2)
# Esto también es un comentario, nuevamente esta línea se ignora (tipo de comentario #3)
/* UnrealIRCd hace un uso intensivo de los módulos. Los módulos le permiten completamente
* personaliza el conjunto de características que deseas habilitar en UnrealIRCd.
* Ver: https://www.unrealircd.org/docs/Modules
*
* Al usar el incluir a continuación, le indicamos al IRCd que lea el archivo
* 'modules.default.conf' que cargará más de 150 módulos
* enviado con UnrealIRCd. En otras palabras: esto simplemente cargará
* todas las funciones disponibles en UnrealIRCd.
* Si está configurando UnrealIRCd por primera vez, le sugerimos
* utilizar esta. Luego, cuando todo esté funcionando, puedes venir
* volver más tarde para personalizar la lista (si lo desea).
*/
include "modules.default.conf";
/* Ahora incluyamos algunos otros archivos también:
* - help/help.conf para nuestro sistema on-IRC /HELPOP
* - badwords.conf para canal y modo de usuario +G
* - spamfilter.conf como ejemplo para el uso de spamfilter
* (Comentado)
* - operclass.default.conf contiene algunas buenas operclasses que
* puedes usar en tus bloques operativos.
*/
include "help/help.conf";
include "badwords.conf";
//include "spamfilter.conf";
include "operclass.default.conf";
include "snomasks.default.conf";
/* Cargar el módulo de encubrimiento predeterminado (2021 en adelante): */
loadmodule "cloak_sha256";
/* O cargue el módulo antiguo de UnrealIRCd 3.2/4/5 en su lugar: */
//loadmodule "cloak_md5";
/* Este es el bloque yo { } que básicamente dice quiénes somos.
* Define el nombre de nuestro servidor, alguna línea de información y un "sid" único.
* La identificación del servidor (sid) debe comenzar con un dígito seguido de dos dígitos o
* cartas. El sid debe ser único para su red IRC (cada servidor debe
* tener su propio sid).
*/
me {
name "irc.example.org";
info "ExampleNET Server";
sid "001";
}
/* El bloque admin { } define lo que verán los usuarios si escriben /ADMIN.
* Normalmente contiene información sobre cómo contactar con el administrador.
*/
admin {
"Bob Smith";
"bob";
"email@example.org";
}
/* Los clientes y servidores se colocan en bloques de clase { }, los definimos aquí.
* Los bloques de clase constan de los siguientes elementos:
* - pingfreq: con qué frecuencia hacer ping a un usuario/servidor (en segundos)
* - connfreq: con qué frecuencia intentamos conectarnos a este servidor (en segundos)
* - sendq: el tamaño máximo de cola para una conexión
* - recvq: máxima cola de recepción de una conexión (control de inundación)
*/
/* Clase de cliente con buenos valores predeterminados */
class clients
{
pingfreq 90;
maxclients 1000;
sendq 200k;
recvq 8000;
}
/* Clase especial para IRCOps con límites más altos */
class opers
{
pingfreq 90;
maxclients 50;
sendq 1M;
recvq 8000;
}
/* Clase de servidor con buenos valores predeterminados */
class servers
{
pingfreq 60;
connfreq 15; /* intenta conectarte cada 15 segundos */
maxclients 10; /* maximo de servidores */
sendq 20M;
}
/* Permitir que los bloques definan qué clientes pueden conectarse a este servidor.
* Esto le permite agregar una contraseña de servidor o restringir el servidor a
* IP específicas solamente. También configuras las conexiones máximas
* permitido por IP aquí.
* Ver también: https://www.unrealircd.org/docs/Allow_block
*/
/* Permitir el ingreso de todos, pero solo 3 conexiones por IP */
allow {
mask *;
class clients;
maxperip 3;
}
/* Los bloques Oper definen sus operadores IRC.
* Los operadores de IRC son personas que tienen "derechos adicionales" en comparación con otros,
* por ejemplo, pueden /MATAR a otras personas, iniciar la vinculación del servidor,
* /ÚNETE a los canales aunque estén prohibidos, etc.
*
* Para obtener más información sobre cómo convertirse en un IRCOp y cómo ser administrador
* tareas, ver: https://www.unrealircd.org/docs/IRCOp_guide
*
* Para obtener detalles sobre el propio bloque oper { }, consulte
* https://www.unrealircd.org/docs/Oper_block
*/
/* Aquí hay un bloque de operación de ejemplo para 'bobsmith'.
* ¡DEBES cambiar esto!
*/
oper bobsmith {
class opers;
mask *@*;
/* Technically you can put oper passwords in plaintext in the conf but
* this is HIGHLY DISCOURAGED. Instead you should generate a password hash:
* On *NIX, run: ./unrealircd mkpasswd
* On Windows, run: "C:\Program Files\UnrealIRCd 6\bin\unrealircdctl" mkpasswd
* .. and then paste the result below:
*/
password "$argon2id..etc..";
/* See https://www.unrealircd.org/docs/Authentication_types for
* more information, including even better authentication types
* such as 'certfp', and how to generate hashes on Windows.
*/
/* Los permisos de operación se definen en un bloque 'operclass'.
* Ver https://www.unrealircd.org/docs/Operclass_block
* UnrealIRCd se envía con una serie de bloques predeterminados, consulte
* el artículo para una lista completa. Elegimos 'netadmin' aquí.
*/
operclass netadmin;
swhois "is a Network Administrator";
vhost netadmin.example.org;
}
/* Los bloques de escucha definen los puertos donde el servidor debe escuchar.
* En otras palabras: los puertos que los clientes y servidores pueden usar para
* conectarse a este servidor.
*
* Sintaxis:
* listen {
* ip <ip>;
* port <port>;
* options {
* <options....>;
* }
* }
*/
/* Puerto IRC estándar 6667
* Insecure plaintext (NOT for production servers)
* This listen block is here only for quick testing.
* Delete or comment out this listen block on production servers
* and use TLS on port 6697 instead.
*/
listen {
ip *;
port 6667;
}
/* Puerto IRC estándar 6697 */
listen {
ip *;
port 6697;
options { tls; }
}
/* Puerto especial solo para servidores SSL/TLS para vincular */
listen {
ip *;
port 6900;
options { tls; serversonly; }
}
/* NOTA: Si está en una shell IRCd con múltiples IP y usa
* los bloques de escucha anteriores { } entonces probablemente obtendrás un
* Error 'Dirección ya en uso' y el ircd no se iniciará.
* Esto significa que DEBE vincularse a una IP específica en lugar de '*' como:
* escucha { ip 1.2.3.4; puerto 6667; }
* Por supuesto, reemplaza la IP con la IP que te fue asignada.
*/
/*
* Los bloques de enlace le permiten vincular varios servidores para formar una red.
* Ver https://www.unrealircd.org/docs/Tutorial:_Linking_servers
*/
link hub.ejemplo.org
{
incoming {
mask *@algo;
}
outgoing {
bind-ip *; /* o explícitamente una IP */
hostname hub.ejemplo.org;
port 6900;
options { tls; }
}
/* Usamos la huella digital SPKI del otro servidor para la autenticación.
* Ejecute './unrealircd spkifp' en el otro lado del linkeo para obtenerlo.
* ( Windows: "C:\Program Files\UnrealIRCd 6\bin\unrealircdctl" spkifp )
*/
password "AABBCCDDEEFFGGHHIIJJKKLLMMNNOOPPQQRRSSTTUUV=" { spkifp; }
class servers;
}
/* El bloque de enlace para servicios suele ser mucho más simple.
* Para más información sobre qué son los Servicios,
* ver https://www.unrealircd.org/docs/Services
*/
link services.ejemplo.org
{
incoming {
mask 127.0.0.1;
}
password "cambiameporfavor";
class servers;
}
/* Las líneas U dan a otros servidores (incluso) más poder/comandos.
* Si usas servicios debes agregarlos aquí.
* ¡NUNCA pongas el nombre de un servidor UnrealIRCd aquí!
*/
ulines {
services.ejemnplo.org;
}
/* Aquí puede agregar una contraseña para los comandos /DIE y /RESTART exclusivos de IRCOp.
* Esto está destinado principalmente a proporcionar un poco de protección contra accidentes
* reinicios y muertes del servidor.
*/
drpass {
restart "restart";
die "die";
}
/* El bloque de registro define qué debe registrarse y en qué archivo.
* Ver también https://www.unrealircd.org/docs/Log_block
*/
/* Este es un buen valor predeterminado, registra todo excepto
* cosas de depuración y unión/parte/kick.
*/
log {
source {
all;
!debug;
!join.LOCAL_CLIENT_JOIN;
!join.REMOTE_CLIENT_JOIN;
!part.LOCAL_CLIENT_PART;
!part.REMOTE_CLIENT_PART;
!kick.LOCAL_CLIENT_KICK;
!kick.REMOTE_CLIENT_KICK;
}
destination {
file "ircd.log" { maxsize 100M; }
}
}
/* In addition to regular logging, also add a JSON log file.
* This includes lots of information about every event so is great
* for auditing purposes and is machine readable. It is, however
* less readable for humans.
*/
log {
source {
all;
!debug;
!join.LOCAL_CLIENT_JOIN;
!join.REMOTE_CLIENT_JOIN;
!part.LOCAL_CLIENT_PART;
!part.REMOTE_CLIENT_PART;
!kick.LOCAL_CLIENT_KICK;
!kick.REMOTE_CLIENT_KICK;
}
destination {
file "ircd.json.log" { maxsize 250M; type json; }
}
}
/* Con "aliases" puedes crear un alias como /ALGO para enviar un mensaje a
* algún usuario o bot. Suelen utilizarse para servicios.
*
* Tenemos una cantidad de archivos de alias preestablecidos, consulte el directorio alias/.
* A modo de ejemplo, aquí incluimos todos los alias utilizados para los servicios de anope.
*/
include "aliases/anope.conf";
/* Prohibir los apodos para que no puedan ser utilizados por usuarios regulares */
ban nick {
mask "*C*h*a*n*S*e*r*v*";
reason "Reservado para Servicios";
}
/* Baneo por ip.
* Tenga en cuenta que normalmente usa /KLINE, /GLINE y /ZLINE para esto.
*/
ban ip {
mask 195.86.232.81;
reason "Te odio";
}
/* Baneo del servidor: si vemos que este servidor está vinculado a alguien, lo desvinculamos */
ban server {
mask eris.berkeley.edu;
reason "Sal de aquí.";
}
/* Baneo de usuario: solo como ejemplo, normalmente usa /KLINE o /GLINE para esto */
ban user {
mask *tirc@*.saturn.bbn.com;
reason "Idiot";
}
/* Baneo del nombre real le permite prohibir clientes en función de su 'nombre real'
* o campo 'gecos'.
*/
ban realname {
mask "Equipo Swat";
reason "mIRKFORCE";
}
ban realname {
mask "sub7server";
reason "sub7";
}
/* Excepciones de baneo y TKL. Le permite eximir a los usuarios/máquinas de
* KLINE, GLINE, etc.
* Si es un IRCOp con una IP estática (y no hay personas que no sean de confianza en esa IP)
* entonces te sugerimos que te añadas aquí. Así siempre puedes entrar
* incluso si accidentalmente colocas una prohibición de *LINE en ti mismo.
*/
/* excepto el baneo con el tipo 'todos' (all) te proteja de GLINE, GZLINE, QLINE, SHUN */
except ban {
mask *@192.0.2.1;
type all;
}
/* This allows IRCCloud connections in without maxperip restrictions
* and also exempt them from connect-flood throttling.
*/
except ban {
mask *.irccloud.com;
type { maxperip; connect-flood; }
}
/* Con los bloques de denegación de DCC puede prohibir los nombres de archivo para DCC */
deny dcc {
filename "*sub7*";
reason "Posible Sub7 Virus";
}
/* denegar canal le permite prohibir un canal (máscara) por completo */
deny channel {
channel "*warez*";
reason "Warez es ilegal";
class "clients";
}
/* Los VHosts (hosts virtuales) permiten a los usuarios adquirir un host diferente.
* Ver https://www.unrealircd.org/docs/Vhost_block
*/
/* Ejemplo de vhost que puede usar. En el tipo de IRC: prueba de prueba /VHOST
* NOTA: solo las personas con un host 'unrealircd.com' pueden usarlo para
* asegúrese de cambiar el vhost::mask antes de probar.
*/
vhost {
vhost odio.microsefrs.com;
mask *@unrealircd.com;
login "test";
password "test";
}
/* Los bloques de la lista negra consultarán un servicio de lista negra de DNS externo
* cada vez que un usuario se conecta, para ver si se conoce la dirección IP
* para causar ataques de drones, es una máquina pirateada conocida, etc.
* Documentación: https://www.unrealircd.org/docs/Blacklist_block
* O simplemente eche un vistazo a los bloques a continuación.
*/
/* DroneBL, probablemente la lista negra más popular utilizada por los servidores IRC.
* Ver https://dronebl.org/ para su documentación y el
* significado de los tipos de respuesta. Al momento de escribir usamos tipos:
* 3: IRC Drone, 5: Embotellador, 6: Spambot o drone desconocido,
* 7: Drone DDoS, 8: Proxy SOCKS, 9: Proxy HTTP, 10: ProxyChain,
* 11: Proxy de página web, 12: Open DNS Resolver, 13: Atacantes de fuerza bruta,
* 14: Proxy Wingate abierto, 15: Enrutador / puerta de enlace comprometidos,
* 16: Gusanos autoenraizadores.
*/
blacklist dronebl {
dns {
name dnsbl.dronebl.org;
type record;
reply { 3; 5; 6; 7; 8; 9; 10; 11; 12; 13; 14; 15; 16; }
}
action gline;
ban-time 24h;
reason "Proxy/Drone Detectado. Chequea https://dronebl.org/lookup?ip=$ip para más detalles.";
}
/* EFnetRBL, consulte https://rbl.efnetrbl.org/ para obtener la documentación
* y el significado de los tipos de respuesta.
* Al momento de escribir: 1 es proxy abierto, 4 es TOR, 5 es drones/inundaciones.
*
* NOTA: Si desea permitir proxies TOR en su servidor, entonces
* necesita eliminar el '4;' abajo en la sección de respuesta.
*/
blacklist efnetrbl {
dns {
name rbl.efnetrbl.org;
type record;
reply { 1; 4; 5; }
}
action gline;
ban-time 24h;
reason "Proxy/Drone/TOR detected. Check https://rbl.efnetrbl.org/?i=$ip for details.";
}
/* Puede incluir otros archivos de configuración */
/* include "klines.conf"; */
/* Configuración de la red */
set {
network-name "EjemploNET";
default-server "irc.ejemplo.org";
services-server "services.ejemplo.org";
stats-server "stats.ejemplo.org";
help-channel "#Ayuda";
cloak-prefix "Clk";
prefix-quit "Quit";
/* Las claves de ocultación deben ser las mismas en todos los servidores de la red.
* Se utilizan para generar hosts enmascarados y deben mantenerse en secreto.
* Las claves deben ser 3 cadenas aleatorias de 80 caracteres cada una (o más).
* y debe constar de minúsculas (a-z), mayúsculas (A-Z) y dígitos (0-9).
* SUGERENCIA: En *NIX, puede ejecutar './unrealircd gencloak' en su shell para dejar
* UnrealIRCd genera 3 cadenas aleatorias para ti.
* On Windows, you can run "C:\Program Files\UnrealIRCd 6\bin\unrealircdctl" gencloak
*/
cloak-keys {
"Oozahho1raezoh0iMee4ohvegaifahv5xaepeitaich9tahdiquaid0geecipahdauVaij3zieph4ahi";
"y otra llave";
"y otra llave";
}
}
/* Configuración específica del servidor */
set {
kline-address 'agrega.una.dirección.de.correo-electrónico'; /* correo electrónico o URL que se muestra cuando un usuario está baneado */
modes-on-connect "+ixw"; /* cuando los usuarios se conecten, obtendrán estos modos de usuario */
modes-on-oper "+xws"; /* cuando alguien se convierte en IRCOp obtendrá estos modos */
modes-on-join "+nt"; /* modos de canal predeterminados cuando se crea un nuevo canal */
oper-auto-join "#opers"; /* Los IRCOps se unen automáticamente a este canal */
options {
hide-ulines; /* ocultar líneas U en /MAP y /LINKS */
show-connect-info; /* mostrar mensajes de "buscando su nombre de host" al conectarse */
}
maxchannelsperuser 10; /* número máximo de canales que un usuario puede /JOIN */
/* El tiempo mínimo que un usuario debe estar conectado antes de que se le permita
* use un mensaje SALIR. Con suerte, esto ayudará a detener el spam.
*/
anti-spam-quit-message-time 10s;
/* O simplemente establezca una salida estática, lo que significa que se ignora cualquier razón /QUIT */
/* static-quit "Salida del cliente"; */
/* static-part hace lo mismo para /PART */
/* static-part yes; */
/* Protección contra inundaciones:
* Hay muchas configuraciones para esto y la mayoría tiene buenos valores predeterminados.
* Ver https://www.unrealircd.org/docs/Set_block#set::anti-flood
*/
anti-flood {
}
/* Configuración del filtro de spam */
spamfilter {
ban-time 1d; /* duración predeterminada de una prohibición de *LINE establecida por spamfilter */
ban-reason "Spam/Publicidad"; /* razón por defecto */
virus-help-channel "#Ayuda"; /* canal a usar para la acción 'viruschan' */
/* except "#Ayuda"; canal para eximir de Spamfilter */
}
/* Restringir ciertos comandos.
* Ver https://www.unrealircd.org/docs/Set_block#set::restrict-commands
*/
restrict-commands {
list {
except {
connect-time 60;
identified yes;
reputation-score 24;
}
}
invite {
except {
connect-time 120;
identified yes;
reputation-score 24;
}
}
/* Además de la capacidad de restringir cualquier comando,
* como se muestra arriba. También hay 4 tipos especiales.
* que puedes restringir. Estos son "mensajes privados",
* "aviso privado", "mensaje de canal" y "aviso de canal".
* Están comentados (deshabilitados) en este ejemplo:
*/
//private-message {
// except {
// connect-time 10;
// }
//}
//private-notice {
// except {
// connect-time 10;
// }
//}
}
}
/*
* Lo siguiente configurará la limitación de conexión de "usuarios desconocidos".
*
* Cuando UnrealIRCd detecta una gran cantidad de usuarios que se conectan desde direcciones IP
* que no se han visto antes, entonces se rechazan las conexiones de nuevas IP
* por encima de la tarifa establecida. Por ejemplo a las 10:60 solo se pueden conectar 10 usuarios por minuto
* que no se han visto antes. Las direcciones IP conocidas siempre pueden entrar,
* independientemente de la tarifa establecida. Lo mismo para los usuarios que inician sesión con SASL.
*
* Ver también https://www.unrealircd.org/docs/Connthrottle para más detalles.
* O simplemente siga leyendo los ajustes de configuración predeterminados a continuación:
*/
set {
connthrottle {
/* Primero debemos configurar lo que llamamos "usuarios conocidos".
* De forma predeterminada, estos son usuarios en direcciones IP que tienen
* una puntuación de 24 o superior. Una puntuación de 24 significa que el
* La IP estuvo conectada a esta red durante al menos 2 horas
* en el último mes (o mínimo 1 hora si está registrado).
* La opción sasl-bypass es otra configuración. Significa
* que los usuarios que se autentican en los servicios a través de SASL
* también se consideran usuarios conocidos.
* Usuarios en el grupo de "usuarios conocidos" (ya sea por reputación
* o por SASL) siempre están permitidas en este módulo.
*/
except {
reputation-score 24;
identified yes;
}
/* Los nuevos usuarios son todos los usuarios que no pertenecen al
* grupo de usuarios conocidos. Se consideran "nuevos" y en
* caso de un alto número de tales nuevos usuarios que se conectan
* están sujetos a limitación de velocidad de conexión.
* Por defecto la tarifa es de 20 nuevos usuarios locales por minuto
* y 30 nuevos usuarios globales por minuto.
*/
new-users {
local-throttle 20:60;
global-throttle 30:60;
}
/* Esto configura cuando este módulo NO estará activo.
* La configuración predeterminada deshabilitará el módulo cuando:
* - El módulo de reputación se ha estado ejecutando durante menos de
* una semana. Si se ejecuta menos de 1 semana, entonces hay
* datos insuficientes para considerar quién es un "usuario conocido".
* - El servidor acaba de iniciarse (primeros 3 minutos).
*/
disabled-when {
reputation-gathering 1w;
start-delay 3m;
}
}
}
/* HISTORIAL DE UN CANAL:
* UnrealIRCd tiene el modo de canal +H que los usuarios pueden usar para volver a leer
* los mensajes del canal, antes de que se unieran. Para información general
* en esta función, lee https://www.unrealircd.org/docs/Channel_history
*
* El historial del canal puede ser configurado vía set::history. Los valores predeterminados
* son probablemente buenos para ti, pero si está en un sistema con poca memoria
* o tiene miles de canales, entonces es posible que debas volver a verificar. Lee
* https://www.unrealircd.org/docs/Set_block#set::history para las opciones.
*
* Además de eso, puedes tener "persistent channel history", cual
* significa que el historial del canal se almacena encriptado en el disco
* para que se conserve entre reinicios del servidor IRC, lee
* https://www.unrealircd.org/docs/Set_block#Persistent_channel_history
* La función de historial persistente NO está habilitada de manera predeterminada
* porque usted necesita configurar un bloque de secreto { } para ello. Un sencillo
* ejemplo con contraseñas almacenadas directamente en el archivo de configuración.
* Para obtener una mejor seguridad, lee https://www.unrealircd.org/docs/Secret_block
* las diferentes alternativas para que no almacenes contraseñas directamente en la configuración.
*/
//secret historydb { password "somepassword"; }
//set { history { channel { persist yes; db-secret "historydb"; } } }
/* Finalmente, es posible que desee tener un MOTD (Mensaje del día), esto puede ser
* se hace creando un archivo de texto 'ircd.motd' en su directorio conf/.
* Este archivo se mostrará a tus usuarios al conectarse.
* Para obtener más información, consulte https://www.unrealircd.org/docs/MOTD_and_Rules
*/
/*
* Problemas o necesita más ayuda?
* 1) https://www.unrealircd.org/docs/
* 2) https://www.unrealircd.org/docs/Main_Page/es <- ¡responde el 80% de tus preguntas!
* 3) Si aún tiene problemas, puede obtener soporte:
* - Foros: https://forums.unrealircd.org/
* - IRC: irc.unrealircd.org (SSL en el puerto 6697) / #unreal-support
* ¡Tenga en cuenta que primero le pedimos que lea la documentación y las preguntas frecuentes!
*/
+304 -99
View File
@@ -1,4 +1,4 @@
/* Fichier de configuration pour UnrealIRCd 4.0
/* Fichier de configuration pour UnrealIRCd 6
*
* Copiez ce fichier dans le répertoire conf/, renommez le
* 'unrealircd.conf' et parcourez-le ligne par ligne (modifiez le !)
@@ -13,8 +13,8 @@
* beaucoup :
* https://www.unrealircd.org/docs/Configuration#Configuration_file_syntax
*
* Documentation pour UnrealIRCd 4 (très complète !) :
* https://www.unrealircd.org/docs/UnrealIRCd_4_documentation/fr
* Documentation pour UnrealIRCd 6 (très complète !) :
* https://www.unrealircd.org/docs/UnrealIRCd_6_documentation/fr
*
* Foire Aux Questions :
* https://www.unrealircd.org/docs/FAQ
@@ -49,8 +49,14 @@ include "modules.default.conf";
*/
include "help/help.conf";
include "badwords.conf";
include "spamfilter.conf";
//include "spamfilter.conf";
include "operclass.default.conf";
include "snomasks.default.conf";
/* Load the default cloaking module (2021 onwards): */
loadmodule "cloak_sha256";
/* Or load the old module from UnrealIRCd 3.2/4/5 instead: */
//loadmodule "cloak_md5";
/* Le bloc me { } indique qui est le serveur.
* Il définit le nom du serveur, une ligne d'informations et un identifiant
@@ -59,10 +65,10 @@ include "operclass.default.conf";
* (chaque serveur doit avoir un sid différent).
*/
me {
name "irc.foonet.com";
info "Serveur FooNet";
name "irc.example.org";
info "Serveur ExampleNET";
sid "001";
};
}
/* Le bloc admin { } définit ce que les utilisateurs verront en faisant
* /ADMIN. C'est généralement des infos de contact de l'administrateur.
@@ -70,8 +76,8 @@ me {
admin {
"Bob Smith";
"bob";
"adresse.email@foonet.com";
};
"adresse.email@example.org";
}
/* Les clients et serveurs sont placés dans des classes, que nous
* définissons dans ces blocs class { }.
@@ -92,7 +98,7 @@ class clients
maxclients 1000;
sendq 200k;
recvq 8000;
};
}
/* Classe spéciale pour des IRCOps avec des limites plus hautes */
class opers
@@ -101,7 +107,7 @@ class opers
maxclients 50;
sendq 1M;
recvq 8000;
};
}
/* Classe pour des serveurs */
class servers
@@ -110,7 +116,7 @@ class servers
connfreq 15; /* essayer de se connecter toutes les 15 sec */
maxclients 10; /* nombre max de serveurs */
sendq 5M;
};
}
/* Les blocs allow définissent quels clients peuvent se connecter au
* serveur. Ils vous permettent d'ajouter un mot de passe ou de restreindre
@@ -121,21 +127,21 @@ class servers
/* Accepter tout le monde, mais seulement 5 connexions par IP */
allow {
ip *@*;
mask *;
class clients;
maxperip 5;
};
}
/* Exemple de bloc allow spécial pour une IP donnée :
* Les utilisateurs sur cette IP doivent se connecter avec un mot de passe.
* S'il est correct, alors autoriser 20 connexions sur cette IP.
*/
allow {
ip *@192.0.2.1;
mask 192.0.2.1;
class clients;
password "unmotdepassesecret";
maxperip 20;
};
}
/* Les blocs oper définissent vos Opérateurs IRC.
* Les Opérateurs IRC sont des utilisateurs avec des "droits en plus"
@@ -145,14 +151,25 @@ allow {
* Voir aussi : https://www.unrealircd.org/docs/Oper_block
*/
/* Voici un exemple de bloc oper pour 'bobsmith' avec le mot de
* passe 'test'.
/* Voici un exemple de bloc oper pour 'bobsmith'.
* Vous DEVEZ le modifier !!
*/
oper bobsmith {
class opers;
mask *@*;
password "test";
/* Technically you can put oper passwords in plaintext in the conf but
* this is HIGHLY DISCOURAGED. Instead you should generate a password hash:
* On *NIX, run: ./unrealircd mkpasswd
* On Windows, run: "C:\Program Files\UnrealIRCd 6\bin\unrealircdctl" mkpasswd
* .. and then paste the result below:
*/
password "$argon2id..etc..";
/* See https://www.unrealircd.org/docs/Authentication_types for
* more information, including even better authentication types
* such as 'certfp', and how to generate hashes on Windows.
*/
/* Les permissions Oper sont définies dans un bloc 'operclass'.
* Voir https://www.unrealircd.org/docs/Operclass_block
* UnrealIRCd est fourni avec des classes par défaut, voir la doc
@@ -160,43 +177,47 @@ oper bobsmith {
*/
operclass netadmin;
swhois "est un Administrateur du Réseau";
vhost netadmin.mynet.org;
};
vhost netadmin.example.org;
}
/* Les blocs listen définissent les ports sur lesquels le serveur écoute.
* C'est-à-dire les ports que les clients et les serveurs utilisent pour
* se connecter à ce serveur.
*
* Syntaxe :
* listen
* {
* listen {
* ip <adresse ip>;
* port <numéro de port>;
* options {
* <options....>;
* };
* };
* }
* }
*/
/* Port standard pour IRC 6667 */
/* Port standard pour IRC 6667
* Insecure plaintext (NOT for production servers)
* This listen block is here only for quick testing.
* Delete or comment out this listen block on production servers
* and use TLS on port 6697 instead.
*/
listen {
ip *;
port 6667;
};
}
/* Port standard pour IRC sur SSL/TLS 6697 */
listen {
ip *;
port 6697;
options { ssl; };
};
options { tls; }
}
/* Port SSL/TLS spécial pour la connexion entre serveurs */
listen {
ip *;
port 6900;
options { ssl; serversonly; };
};
options { tls; serversonly; }
}
/* NOTE : Si vous utilisez un serveur IRC avec plusieurs IP et que vous
* utilisez les blocs listen ci-dessus, vous aurez peut-être une
@@ -212,23 +233,23 @@ listen {
* pour former un réseau IRC.
* Voir https://www.unrealircd.org/docs/Tutorial:_Linking_servers
*/
link hub.mynet.org
link hub.example.org
{
incoming {
mask *@something;
};
}
outgoing {
bind-ip *; /* ou une IP précise */
hostname hub.mynet.org;
hostname hub.example.org;
port 6900;
options { ssl; };
};
options { tls; }
}
password "00:11:22:33:44:55:66:77:88:99:AA:BB:CC:DD:EE:FF"; /* Empreinte SSL de l'autre serveur */
class servers;
};
}
/* Les U-lines donnent encore plus de pouvoir à certains serveurs.
* Si vous utilisez des Services, vous devez les indiquer ici.
@@ -237,8 +258,8 @@ link hub.mynet.org
* https://www.unrealircd.org/docs/Services )
*/
ulines {
services.mynet.org;
};
services.example.org;
}
/* Ici vous pouvez indiquer un mot de passe pour les commandes /DIE et
* /RESTART, qui sont restreintes aux IRCops.
@@ -248,27 +269,49 @@ ulines {
drpass {
restart "restart";
die "die";
};
}
/* Le bloc log indique ce qui doit être journalisé et dans quel fichier.
* Voir aussi https://www.unrealircd.org/docs/Log_block
*/
/* Ceci est une bonne valeur par défaut, elle journalise presque tout */
log "ircd.log" {
flags {
oper;
connects;
server-connects;
kills;
errors;
sadmin-commands;
chg-commands;
oper-override;
tkl;
spamfilter;
};
};
log {
source {
all;
!debug;
!join.LOCAL_CLIENT_JOIN;
!join.REMOTE_CLIENT_JOIN;
!part.LOCAL_CLIENT_PART;
!part.REMOTE_CLIENT_PART;
!kick.LOCAL_CLIENT_KICK;
!kick.REMOTE_CLIENT_KICK;
}
destination {
file "ircd.log" { maxsize 100M; }
}
}
/* In addition to regular logging, also add a JSON log file.
* This includes lots of information about every event so is great
* for auditing purposes and is machine readable. It is, however
* less readable for humans.
*/
log {
source {
all;
!debug;
!join.LOCAL_CLIENT_JOIN;
!join.REMOTE_CLIENT_JOIN;
!part.LOCAL_CLIENT_PART;
!part.REMOTE_CLIENT_PART;
!kick.LOCAL_CLIENT_KICK;
!kick.REMOTE_CLIENT_KICK;
}
destination {
file "ircd.json.log" { maxsize 250M; type json; }
}
}
/* Avec des "alias", vous pouvez créer un alias comme /UNTRUC pour envoyer
* un message à un utilisateur ou à un bot. Ils sont souvent utilisés pour
@@ -286,7 +329,7 @@ include "aliases/anope.conf";
ban nick {
mask "*C*h*a*n*S*e*r*v*";
reason "Réservé aux Services";
};
}
/* Bannir une IP.
* NB : vous pouvez aussi utiliser /KLINE, /GLINE et /ZLINE pour ça.
@@ -294,7 +337,7 @@ ban nick {
ban ip {
mask 195.86.232.81;
reason "Je vous hais !";
};
}
/* Bannir un serveur - si ce serveur est connecté au réseau, nous nous
* déconnecterons
@@ -302,7 +345,7 @@ ban ip {
ban server {
mask eris.berkeley.edu;
reason "Va-t-en d'ici.";
};
}
/* Bannir un utilisateur - juste pour l'exemple, on utilise normalement
* /KLINE or /GLINE pour ça
@@ -310,18 +353,18 @@ ban server {
ban user {
mask *tirc@*.saturn.bbn.com;
reason "Idiot";
};
}
/* Bannir un realname (ou 'gecos') */
ban realname {
mask "Swat Team";
reason "mIRKFORCE";
};
}
ban realname {
mask "sub7server";
reason "sub7";
};
}
/* Exceptions de ban et TKL. Vous permet d'exempter des utilisateurs des
* KLINE, GLINE, etc ...
@@ -331,17 +374,19 @@ ban realname {
* accidentellement.
*/
/* except ban vous protège des KLINE et ZLINE */
/* except ban avec le type 'all' vous protège des GLINE, GZLINE, QLINE, SHUN */
except ban {
mask *@192.0.2.1;
// vous pouvez ajouter d'autres lignes mask à la suite
};
/* except tkl avec le type 'all' vous protège des GLINE, GZLINE, QLINE, SHUN */
except tkl {
mask *@192.0.2.1;
type all;
};
}
/* This allows IRCCloud connections in without maxperip restrictions
* and also exempt them from connect-flood throttling.
*/
except ban {
mask *.irccloud.com;
type { maxperip; connect-flood; }
}
/* Avec un bloc deny dcc vous pouvez interdire des noms de fichiers dans
* les échanges DCC
@@ -349,14 +394,14 @@ except tkl {
deny dcc {
filename "*sub7*";
reason "Possible virus Sub7";
};
}
/* deny channel vous permet d'interdire des masques de noms de salons */
deny channel {
channel "*warez*";
reason "Le warez est illegal";
class "clients";
};
}
/* Les VHosts (Virtual Hosts - Hôtes Virtuels) permettent aux utilisateurs
* d'avoir un nom d'hôte différent.
@@ -372,48 +417,94 @@ vhost {
mask *@unrealircd.com;
login "test";
password "test";
};
}
/* Les blocs de liste noire interrogeront un service de liste noire DNS externe
* chaque fois qu'un utilisateur se connecte, pour voir si l'adresse IP est connue
* pour provoquer des attaques de drones, est une machine piratée connue, etc..
* Documentation: https://www.unrealircd.org/docs/Blacklist_block
* Ou regardez simplement les blocs ci-dessous.
*/
/* DroneBL, probablement la liste noire la plus populaire utilisée par les serveurs IRC.
* Voir https://dronebl.org/ pour leur documentation et les
* significations des types de réponse. AAu moment de la rédaction, nous utilisons des types:
* 3: IRC Drone, 5: Bottler, 6: Unknown spambot or drone,
* 7: DDoS Drone, 8: SOCKS Proxy, 9: HTTP Proxy, 10: ProxyChain,
* 11: Web Page Proxy, 12: Open DNS Resolver, 13: Brute force attackers,
* 14: Open Wingate Proxy, 15: Compromised router / gateway,
* 16: Autorooting worms.
*/
blacklist dronebl {
dns {
name dnsbl.dronebl.org;
type record;
reply { 3; 5; 6; 7; 8; 9; 10; 11; 12; 13; 14; 15; 16; }
}
action gline;
ban-time 24h;
reason "Proxy/Drone detected. Check https://dronebl.org/lookup?ip=$ip for details.";
}
/* EFnetRBL, voir https://rbl.efnetrbl.org/ pour la documentation
* et la signification des types de réponse.
* Au moment de la rédaction: 1 is open proxy, 4 is TOR, 5 is drones/flooding.
*
* REMARQUE: Si vous souhaitez autoriser les proxys TOR sur votre serveur, alors
* vous devez supprimer le '4;' ci-dessous dans la section de réponse.
*/
blacklist efnetrbl {
dns {
name rbl.efnetrbl.org;
type record;
reply { 1; 4; 5; }
}
action gline;
ban-time 24h;
reason "Proxy/Drone/TOR detected. Check https://rbl.efnetrbl.org/?i=$ip for details.";
}
/* Vous pouvez inclure d'autres fichiers de configuration */
/* include "klines.conf"; */
/* Configuration du réseau */
set {
network-name "MYNet";
default-server "irc.mynet.org";
services-server "services.mynet.org";
stats-server "stats.mynet.org";
network-name "ExampleNET";
default-server "irc.example.org";
services-server "services.example.org";
stats-server "stats.example.org";
help-channel "#Help";
hiddenhost-prefix "Clk";
cloak-prefix "Clk";
prefix-quit "Quit";
/* Les clés de cloaking doivent être identiques sur tous les serveurs
* d'un réseau. Elles sont utilisées pour générer les noms d'hôtes
* masqués et doivent être gardées secrètes. Les clés doivent être
* 3 chaînes de 5 à 100 caractères aléatoires (entre 10 et 20 suffisent)
* et ne comporter que des minuscules (a-z), des majuscules (A-Z) et des
* chiffres (0-9). (voir l'exemple)
* NB : sur *NIX, vous pouvez exécuter './unreal gencloak' sur votre
* serveur pour que Unreal génère 3 clés aléatoires pour vous.
* 3 chaînes de 80 caractères aléatoires et ne comporter que des
* minuscules (a-z), des majuscules (A-Z) et des chiffres (0-9).
* (voir l'exemple)
* NB : sur *NIX, vous pouvez exécuter './unrealircd gencloak' sur votre
* serveur pour que Unrealircd génère 3 clés aléatoires pour vous.
* On Windows, use "C:\Program Files\UnrealIRCd 6\bin\unrealircdctl" gencloak
*/
cloak-keys {
"aoAr1HnR6gl3sJ7hVz4Zb7x4YwpW";
"Oozahho1raezoh0iMee4ohvegaifahv5xaepeitaich9tahdiquaid0geecipahdauVaij3zieph4ahi";
"et une autre";
"et une troisième";
};
};
}
}
/* Configuration spécifique au serveur */
set {
kline-address "indiquez.une.adresse.email"; /* e-mail ou URL indiquée lorsqu'un utilisateur est banni */
kline-address 'indiquez.une.adresse.email'; /* e-mail ou URL indiquée lorsqu'un utilisateur est banni */
modes-on-connect "+ixw"; /* modes utilisateur ajoutés lorsqu'un utilisateur se connecte */
modes-on-oper "+xwgs"; /* modes utilisateur ajoutés lorsqu'un utilisateur devient IRCOp */
modes-on-oper "+xws"; /* modes utilisateur ajoutés lorsqu'un utilisateur devient IRCOp */
oper-auto-join "#opers"; /* salon que les IRCOps joignent automatiquement */
options {
hide-ulines; /* cacher les U-lines de /MAP et /LINKS */
show-connect-info; /* afficher les messages "looking up your hostname" à la connexion */
};
}
maxchannelsperuser 10; /* nombre max de salons par utilisateur */
@@ -430,17 +521,11 @@ set {
/* static-part fait la même chose pour /PART */
/* static-part yes; */
/* Quelles /STATS sont restreintes aux Opérateurs. Nous vous
* conseillons de laisser '*' (toutes)
/* Protections anti-flood.
* Voir: https://www.unrealircd.org/docs/Set_block#set::anti-flood
*/
oper-only-stats "*";
/* Protections anti-flood */
anti-flood {
nick-flood 3:60; /* 3 changements de nick par 60 secondes */
connect-flood 3:60; /* 3 tentatives de connexions par 60 seconds */
away-flood 4:120; /* 4 utilisation de /AWAY par 2 minutes */
};
}
/* Paramètres de Spamfilter */
spamfilter {
@@ -448,12 +533,132 @@ set {
ban-reason "Spam/Publicité"; /* raison par defaut */
virus-help-channel "#help"; /* salon par défaut pour l'action 'viruschan' */
/* except "#help"; salon à exempter de Spamfilter */
};
};
}
/* Restreindre certaines commandes.
* Voir https://www.unrealircd.org/docs/Set_block#set::restrict-commands
*/
restrict-commands {
list {
except {
connect-time 60; /* après 60 secondes, vous pouvez utiliser LIST */
identified yes; /* ou immédiatement, si vous êtes identifié aux services */
reputation-score 24; /* ou si vous avez un score de réputation de 24 ou plus */
}
}
invite {
except {
connect-time 120;
identified yes;
reputation-score 24;
}
}
/* En plus de la possibilité de restreindre toute commande,
* tel qu'illustré ci-dessus. Il existe également 4 types spéciaux
* que vous pouvez restreindre. Ceux-ci sont "private-message",
* "private-notice", "channel-message" and "channel-notice".
* Ils sont commentés (désactivés) dans cet exemple :
*/
//private-message {
// except { connect-time 10; }
//}
//private-notice {
// except { connect-time 10; }
//}
}
}
/*
* Ce qui suit configurera la limitation de connexion de "unknown users".
*
* Quand UnrealIRCd détecte un nombre élevé d'utilisateurs se connectant à partir d'adresses IP
* qui n'ont pas été vus auparavant, les connexions des nouvelles IP sont rejetées
* au-dessus du taux fixé. Par exemple à 10:60 seuls 10 utilisateurs par minute peuvent se connecter
* qui n'ont pas été vus auparavant. Les adresses IP connues peuvent toujours entrer,
* quel que soit le tarif fixé. Idem pour les utilisateurs qui se connectent avec SASL.
*
* Voir également https://www.unrealircd.org/docs/Connthrottle pour les détails.
* Ou continuez simplement à lire les paramètres de configuration par défaut ci-dessous:
*/
set {
connthrottle {
/* Nous configurons d'abord quels utilisateurs sont exemptés de la
* restrictions. Ces utilisateurs sont toujours autorisés!
* Par défaut, ce sont des utilisateurs sur des adresses IP qui ont
* un score de 24 ou plus. Un score de 24 signifie que l'IP
* était connecté à ce réseauk pendant au moins 2 heures
* au cours du mois passé (ou minimum 1h si inscrit).
* Nous permettons également aux utilisateurs qui sont identifiés aux services via
* SASL contourner les restrictions.
*/
except {
reputation-score 24;
identified yes;
/* pour plus d'options, voir restrictions
* https://www.unrealircd.org/docs/Mask_item
*/
}
/* Les nouveaux utilisateurs sont tous les utilisateurs qui n'appartiennent pas au
* groupe d'utilisateurs connus. Ils sont considérés comme "nouveaux" et dans
* le cas d'un nombre élevé de ces nouveaux utilisateurs se connectant
* ils sont soumis à une limitation du débit de connexion.
* Par défaut, le taux est de 20 nouveaux utilisateurs locaux par minute
* et 30 nouveaux utilisateurs global par minute.
*/
new-users {
local-throttle 20:60;
global-throttle 30:60;
}
/* Ceci configure quand ce module ne sera PAS actif.
* Les paramètres par défaut désactiveront le module lors que:
* - Le module de réputation fonctionne depuis moins d'une
* semaine. Si vous courez moins d'une semaine, il y a
* données insuffisantes pour déterminer qui est un "utilisateur connu".
* - Le serveur vient d'être démarré (3 premières minutes).
*/
disabled-when {
reputation-gathering 1w;
start-delay 3m;
}
}
}
/* HISTORIQUE DES CANAUX:
* UnrealIRCd a le mode canal +H qui peut être utilisé par les utilisateurs pour relire
* historique de la chaîne, comme avant leur adhésion. Pour des informations générales
* sur cette fonctionnalité, voir https://www.unrealircd.org/docs/Channel_history
*
* Les limites de l'historique peuvent être configurées via set::history.
* Les valeurs par défaut sont probablement déjà bien pour toi, mais si vous êtes sur un
* système à faible mémoire ou ayant des milliers de canaux, vous voudrez peut-être re vérifier.
* Voir https://www.unrealircd.org/docs/Set_block#set::history pour les options.
*
* En plus de cela, vous pouvez avoir "persistent channel history", qui
* signifie que l'historique des chaînes est stocké crypté sur le disque
* afin qu'il soit préservé entre les redémarrages du serveur IRC, voir
* https://www.unrealircd.org/docs/Set_block#Persistent_channel_history
* La fonction d'historique persistant n'est PAS activée par défaut car vous
* devez de configurer un bloque de secret { }. Ce qui suit est un simple
* exemple avec des mots de passe stockés directement dans le fichier de configuration.
* Pour une meilleure sécurité, voir https://www.unrealircd.org/docs/Secret_block
* sur des moyens alternatifs pour ne pas stocker les mots de passe directement dans la configuration.
*/
//secret historydb { password "somepassword"; }
//set { history { channel { persist yes; db-secret "historydb"; } } }
/* Enfin, vous souhaiterez peut-être avoir un MOTD (Le message du jour), cela peut être
* fait en créant un archive de text 'ircd.motd' dans votre répertoire conf/.
* Ce fichier sera montré à vos utilisateurs lors de la connexion.
* Pour plus d'informations, voir https://www.unrealircd.org/docs/MOTD_and_Rules
*/
/*
* Un problème ou besoin d'aide supplémentaire ?
* 1) https://www.unrealircd.org/docs/UnrealIRCd_4_documentation/fr
* 1) https://www.unrealircd.org/docs/
* 2) https://www.unrealircd.org/docs/FAQ <- répond à 80% des questions !
* 3) Si vous avez toujours des problèmes, vous pouvez aller sur
* irc.unrealircd.org #unreal-support,
+684
View File
@@ -0,0 +1,684 @@
/* Arquivo de configuração para o UnrealIRCd 6
* OBSERVAÇÃO: Este arquivo utiliza a tradução Português do Brasil (pt-br).
*
* Apenas copie este arquivo para seu diretório conf/ e renomeie-o para 'unrealircd.conf'
*
* Se você estiver com pressa, pode CTRL+F (localizar) pelo termo ALTERAR ISTO
* Os pontos que obrigatoriamente devem ser alterados estão indicados por essas duas palavras.
* No entanto, recomendamos que você revise este arquivo linha por linha
* e o altere conforme necessário, para que possa ver todos os pontos básicos e seus valores.
*
* ANTES DE PROSSEGUIR:
* Importante: Todas as linhas, exceto { e } terminam com ;
* Isto é muito importante, visto que se você esquecer um ; em algum lugar,
* a checagem do arquivo de configuração irá criticar e o arquivo não será processado!
* Se esta é sua primeira experiência com o arquivo de configuração do UnrealIRCd
* então nós recomendamos fortemente que você se dedique um pouco para ler sobre a sintaxe,
* isto levará apenas alguns minutos e o ajudará consideravelmente:
* https://www.unrealircd.org/docs/Configuration#Configuration_file_syntax
*
* Documentação completa do UnrealIRCd 6 (bem extensa!):
* https://www.unrealircd.org/docs/UnrealIRCd_6_documentation
*
* Questões Frequentes:
* https://www.unrealircd.org/docs/FAQ
*/
/* Este é um comentário, todo o texto aqui será ignorado (comentário de tipo #1) */
// Este também é um comentário, e esta linha será ignorada (comentário de tipo #2)
# Este também é um comentário, e novamente esta linha será ignorada (comentário de tipo #3)
/* O UnrealIRCd faz um intenso uso dos Módulos, que permitem que você personalize completamente
* o conjunto de recursos que você deseja habilitar no UnrealIRCd.
* Veja: https://www.unrealircd.org/docs/Modules
*
* Utilizando o include abaixo, nós instruímos o IRCd a ler o arquivo
* 'modules.default.conf' que carregará mais de 150 módulos
* que vem com o UnrealIRCd. Em outras palavras: Isso simplesmente irá carregar
* todos os recursos disponíveis no UnrealIRCd.
* Se você está configurando o UnrealIRCd pela primeira vez, nós sugerimos que você
* o use. Então, quando tudo estiver configurado e rodando, você poderá retornar
* e personalizar a lista (se você desejar).
*/
include "modules.default.conf";
/* Agora vamos incluir alguns outros arquivos de configuração também:
* - help/help.conf para nosso sistema de ajuda /HELPOP
* - badwords.conf para os modos de usuário e canal +G
* - spamfilter.conf como um exemplo para filtragem de spam
* (comentado)
* - operclass.default.conf contém algumas boas classes de operadores que
* você pode usar em seus blocos de operadores.
*/
include "help/help.conf";
include "badwords.conf";
//include "spamfilter.conf";
include "operclass.default.conf";
include "snomasks.default.conf";
/* Carrega por padrão o módulo de cloaking em SHA256 (implementado em 2021): */
loadmodule "cloak_sha256";
/* Ou carrega o antigo módulo de clocking em MD5 que veio do UnrealIRCd 3.2/4/5: */
//loadmodule "cloak_md5";
// ALTERAR ISTO (o 'name' e 'info')
/* Este é o bloco me { } que basicamente diz quem somos.
* Ele define o nome do nosso servidor, algumas linhas informativas e um "sid" único.
* O id do servidor (sid) precisa iniciar com um dígito numérico seguido por dois dígitos numéricos
* ou alfanuméricos de A à Z. O sid precisa ser único para a sua rede de IRC (cada servidor
* deve ter seu próprio sid). É comum utilizar 001 para seu primeiro servidor.
*/
me {
name "irc.exemplo.org";
info "Servidor ExemploNET";
sid "001";
}
// ALTERAR ISTO:
/* O bloco admin { } define quem os usuário verão quando eles digitarem /ADMIN.
* Normalmente contém infomações de como eles podem contatar o administrador.
*/
admin {
"Bob Smith";
"bob";
"email@exemplo.org";
}
/* Clientes e servidores são colocados no bloco class { }, e os definimos aqui.
* Blocos Class consistem nos seguintes itens:
* - pingfreq: com que frequência será efetuado ping em um usuário / servidor (em segundos)
* - connfreq: quantas vezes tentamos nos conectar a este servidor (em segundos)
* - sendq: o tamanho máximo da fila para uma conexão
* - recvq: o recebimento máximo da fila para uma conexão (controle de flood)
*/
/* Classe Client padrão, com valores de limites aceitáveis */
class clients
{
pingfreq 90;
maxclients 1000;
sendq 200k;
recvq 8000;
}
/* Uma classe Especial para IRCOps com valores de limites mais altos */
class opers
{
pingfreq 90;
maxclients 50;
sendq 1M;
recvq 8000;
}
/* Classe Server padrão, com valores de limites aceitáveis */
class servers
{
pingfreq 60;
connfreq 15; /* tenta se conectar a cada 15 segundos */
maxclients 10; /* máximo de servidores */
sendq 20M;
}
/* Blocos allow definem quais classe clients podem se conectar a este servidor.
* Isto permite que você adicione uma senha ao servidor ou restrinja o acesso ao servidor
* apenas por IPs específicos. Você também pode configurar o máximo de conexões
* permitidas por IP.
* Veja também: https://www.unrealircd.org/docs/Allow_block
*/
/* Permite todos entrarem, mas apenas 3 conexões simultâneas por IP */
allow {
mask *;
class clients;
maxperip 3;
}
/* Exemplo de um bloco especial allow em um IP específico:
* Requer que usuários neste IP conectem por uma senha. Se a senha
* estiver correta, então permite 20 conexões simultâneas deste IP.
*/
//allow {
// mask 192.0.2.1;
// class clients;
// password "alguma_senha_secreta";
// maxperip 20;
//}
/* Blocos oper definem os Operadores de IRC.
* Operadores de IRC são pessoas com "privilégios extras" comparado a outros,
* eles podem por exemplo dar /KILL (derrubar) outras pessoas, iniciar uma conexão com server,
* dar /JOIN (entrar) em canais ainda que eles estejam banidos, etc.
*
* Para mais informações sobre como se tornar um IRCOp e como executar
* tarefas administrativas, veja: https://www.unrealircd.org/docs/IRCOp_guide
*
* Para obter mais detalhes sobre o bloco oper { } , veja
* https://www.unrealircd.org/docs/Oper_block
*/
/* Aqui está um exemplo de um bloco oper para o 'bobsmith'
* VOCÊ DEVE ALTERAR ISTO!! (o nome do operador e a senha)
*/
oper bobsmith {
class opers;
mask *@*;
/* Tecnicamente você pode deixar as senhas de oper em texto puro no arquivo de configuração, mas
* isto é ALTAMENTE DESENCORAJADO. No lugar disso, você deve gerar uma senha hasheada:
* No *NIX, execute: ./unrealircd mkpasswd
* No Windows, execute: "C:\Program Files\UnrealIRCd 6\bin\unrealircdctl" mkpasswd
* ... e então cole a senha no campo abaixo:
*/
password "$argon2id..etc..";
/* Veja https://www.unrealircd.org/docs/Authentication_types para
* mais informações, incluindo formas melhores de autenticação
* como por exemplo o 'certfp', e como gerar hashes no Windows.
*/
/* Permissões de oper são definidos no bloco 'operclass'.
* Veja https://www.unrealircd.org/docs/Operclass_block
* O UnrealIRCd vem com um número padrão de blocos, leia
* o artigo acima para ver a lista completa. Nós escolhemos o 'netadmin' aqui.
*/
operclass netadmin;
swhois "é o Administrador da Rede";
vhost netadmin.exemplo.org;
}
/* Blocos listen definem as portas onde o servidor irá escutar.
* Em outras palavras: as portas que os clientes e servidores podem usar
* para se conectar a este servidor.
*
* Sintaxe:
* listen {
* ip <ip>;
* port <port>;
* options {
* <options....>;
* }
* }
*/
/* Porta padrão 6667 do IRC
* Insecure plaintext (NOT for production servers)
* This listen block is here only for quick testing.
* Delete or comment out this listen block on production servers
* and use TLS on port 6697 instead.
*/
listen {
ip *;
port 6667;
}
/* Porta padrão 6697 do IRC sob tunel SSL/TLS */
listen {
ip *;
port 6697;
options { tls; }
}
/* Porta especial padrão para uso de servidores sob tunel SSL/TLS para vincular a outros servidores */
listen {
ip *;
port 6900;
options { tls; serversonly; }
}
/* OBSERVAÇÃO: Se você está em uma shell IRCd com múltiplos IPs e você usa
* os blocos listen { } acima, então você provavelmente receberá o erro
* 'Address already in use' e o IRCd não iniciará.
* Isto significa que você DEVE colocar em escuta um IP específico no lugar do '*', como por exemplo:
* listen { ip 1.2.3.4; port 6667; }
* Claro, substituindo o IP pelo IP que foi fornecido a você.
*/
/*
* Blocos link permitem que você vincule múltiplos servidores uns aos outros para formar uma rede.
* Veja https://www.unrealircd.org/docs/Tutorial:_Linking_servers
*/
//link hub.exemplo.org
//{
// incoming {
// mask *@alguma_coisa;
// }
//
// outgoing {
// bind-ip *; /* ou especificar um IP */
// hostname hub.exemplo.org;
// port 6900;
// options { tls; }
// }
//
// /* Nós usamos a impressão digital SPKI do outro servidor para autenticação.
// * Abra uma shell no OUTRO SERVIDOR e execute o comando abaixo para obter a impressão digital:
// * No *NIX, execute: ./unrealircd spkifp
// * No Windows, execute: "C:\Program Files\UnrealIRCd 6\bin\unrealircdctl" spkifp
// */
// password "AABBCCDDEEFFGGHHIIJJKKLLMMNNOOPPQQRRSSTTUUV=" { spkifp; }
//
// class servers;
//}
/* O Bloco link para o services é muito mais simples.
* Para mais informações sobre o que são o Services,
* leia https://www.unrealircd.org/docs/Services
*/
//link services.exemplo.org
//{
// incoming {
// mask 127.0.0.1;
// }
//
// password "me_altere_por_favor";
//
// class servers;
//}
/* U-lines dão a outros servidores (ainda) mais poderes/comandos.
* Se você usa o services, você DEVE adicioná-los aqui. Você deve adicionar o
* nome do servidor do services no bloco ulines { } no arquivo de configuração
* em todo servidor UnrealIRCd da sua rede.
* IMPORTANTE: Jamais insira o nome do servidor do UnrealIRCd aqui,
* é apenas para o Services!
*/
//ulines {
// services.exemplo.org;
//}
/* Aqui você pode adicionar uma senha (apenas para IRCOps) para os comandos /DIE e /RESTART.
* Isto para que se tenha uma pouco mais de proteção contra reinicio acidental
* do servidor e ele seja derrubado inadvertidante.
*/
drpass {
restart "reiniciar";
die "matar";
}
/* O bloco log define o que deve ser registrado (logado) e em qual arquivo.
* Leia também https://www.unrealircd.org/docs/Log_block
*/
/* Este é um bom padrão, ele registra tudo, exceto
* coisas de depuração e comandos join/part/kick.
*/
log {
source {
all;
!debug;
!join.LOCAL_CLIENT_JOIN;
!join.REMOTE_CLIENT_JOIN;
!part.LOCAL_CLIENT_PART;
!part.REMOTE_CLIENT_PART;
!kick.LOCAL_CLIENT_KICK;
!kick.REMOTE_CLIENT_KICK;
}
destination {
file "ircd.log" { maxsize 100M; }
}
}
/* Além do log regular, também adicionamos um arquivo de log em JSON.
* Isso inclui muitas informações sobre cada evento, sendo ótimo
* para fins de auditoria e legível por máquinas. No entanto,
* é menos legível para humanos.
*/
log {
source {
all;
!debug;
!join.LOCAL_CLIENT_JOIN;
!join.REMOTE_CLIENT_JOIN;
!part.LOCAL_CLIENT_PART;
!part.REMOTE_CLIENT_PART;
!kick.LOCAL_CLIENT_KICK;
!kick.REMOTE_CLIENT_KICK;
}
destination {
file "ircd.json.log" { maxsize 250M; type json; }
}
}
/* Com o "aliases" você pode criar um atalho como /ALGUMACOISA para enviar uma mensagem para
* algum usuário ou bot. Eles são usados normalmente por services.
*
* Nós temos um arquivo com um número pré-definido de atalhos, confira o diretório alias/ .
* Como exemplo, aqui nós incluímos todos os atalhos utilizados pelo services anope.
*/
include "aliases/anope.conf";
/* Bane nicks para que eles não sejam utilizados por usuários comuns */
//ban nick {
// mask "*C*h*a*n*S*e*r*v*";
// reason "Reservado para Services";
//}
/* Bane um IP
* Observe que você normalmente usa /KLINE, /GLINE e /ZLINE para isto.
*/
//ban ip {
// mask 195.86.232.81;
// reason "Te odeio";
//}
/* Bane um servidor - se observarmos este servidor vinculado a alguém, então o expulsaremos */
//ban server {
// mask pedro.usp.br;
// reason "Caia fora daqui.";
//}
/* Bane um usuário - mas você normalmente usa /KLINE ou /GLINE para isso */
//ban user {
// mask *usuariotroll@*.saturn.bbn.com;
// reason "Idiota";
//}
/* Este tipo de banimento permite que clientes sejam banidos com base no seu nome real (realname)
* ou campo 'gecos'.
*/
//ban realname {
// mask "Time Swat";
// reason "FORCAOSTENSIVA";
//}
//ban realname {
// mask "sub7server";
// reason "sub7";
//}
/* Exceções de banimento e TKL. Permite que você crie exceções a usuários/IPs a um
* KLINE, GLINE, etc.
* Se você é um IRCOp com IP estático (e não há ninguém não confiável utilizando este IP),
* então nós sugerimos que você seja adicionado aqui. Desta forma, você sempre poderá entrar
* mesmo se acidentalmente você colocar um *LINE em si mesmo.
*/
/* Exceções de banimento de tipo 'all' protegem você de GLINE, GZLINE, QLINE, SHUN */
//except ban {
// mask *@192.0.2.1;
// type all;
//}
/* Isto permite que clientes do IRCCloud não tenham restrição de IP por conexão
* e também cria exceção a eles de flood por conexão.
*/
except ban {
mask *.irccloud.com;
type { maxperip; connect-flood; }
}
/* deny dcc permite você possa banir nomes de arquivos transferidos por DCC */
//deny dcc {
// filename "*sub7*";
// reason "Possível Virus Sub7";
//}
/* deny channel permite a você banir um canal (por máscara) */
//deny channel {
// channel "*warez*";
// reason "Warez é ilegal";
// class "clients";
//}
/* VHosts (Hosts Virtuais) permite aos usuários adquirirem um vhost diferente.
* Veja https://www.unrealircd.org/docs/Vhost_block
*/
/* Exemplo de vhost que você pode usar. No IRC digite: /VHOST teste teste
* OBSERVAÇÃO: apenas pessoas com o host 'unrealircd.com' podem usá-lo, então
* tenha certeza de modificar o vhost::mask antes de seu teste.
*/
//vhost {
// vhost eu.odeio.microsefrs.com;
// mask *@unrealircd.com;
// login "teste";
// password "teste";
//}
/* Blocos blacklist irão consultar um serviço externo de blacklist
* sempre que um usuário se conectar, para saber se seu endereço de IP é conhecido
* por ataques de drone, como uma máquina hackeada, etc.
* Documentação: https://www.unrealircd.org/docs/Blacklist_block
* Ou apenas dê uma olhada nos blocos abaixo.
*/
/* DroneBL é provavelmente o serviço de blacklist mais popular usada por servidores de IRC.
* Veja https://dronebl.org/ para ler a documentação e
* o significado dos tipos de resposta. No momento em que este arquivo foi escrito, nós usamos os tipos:
* 3: IRC Drone, 5: Flooder, 6: Drone ou bot de spam desconhecido,
* 7: Drone de DDoS, 8: Proxy SOCKS, 9: Proxy HTTP, 10: ProxyChain,
* 11: Proxy de página web, 12: Resolvedor de DNS aberto, 13: Atacantes de força bruta,
* 14: Proxy Wingate público, 15: Roteador/Gateway comprometido,
* 16: Virus que tentam conseguir root.
*/
blacklist dronebl {
dns {
name dnsbl.dronebl.org;
type record;
reply { 3; 5; 6; 7; 8; 9; 10; 11; 12; 13; 14; 15; 16; }
}
action gline;
ban-time 24h;
reason "Proxy/Drone detectado. Confira https://dronebl.org/lookup?ip=$ip para detalhes.";
}
/* EFnetRBL, veja https://rbl.efnetrbl.org/ para ler a documentação
* e o significado dos tipos de resposta.
* No momento em que este arquivo foi escrito: 1 é proxy público, 4 é TOR, 5 é drones/flooders.
*
* OBSERVAÇÃO: Se você deseja permitir proxies TOR no seu servidor, então
* você precisa remover o '4;' abaixo da seção reply.
*/
blacklist efnetrbl {
dns {
name rbl.efnetrbl.org;
type record;
reply { 1; 4; 5; }
}
action gline;
ban-time 24h;
reason "Proxy/Drone/TOR detectado. Confira https://rbl.efnetrbl.org/?i=$ip para detalhes.";
}
/* Você pode incluir outros arquivos de configuração */
/* include "klines.conf"; */
/* Configuração da Rede */
set {
// ALTERAR ISTO, todos os 4 itens abaixo
network-name "ExemploNET";
default-server "irc.exemplo.org";
services-server "services.exemplo.org";
stats-server "stats.exemplo.org";
/* Valores Padrão */
help-channel "#ajuda";
cloak-prefix "Clk";
prefix-quit "Saindo";
/* Chaves cloak devem ser a mesma em todos os servidores da rede.
* Eles são usados para geração de hosts mascarados e devem ser mantidos em segredo.
* VOCÊ PRECISA ALTERAR ISTO!
* As chaves devem ser 3 strings (ou mais) de 80 caracteres randômicos
* e devem se constituir de letras minúsculas (a-z), maiúsculas (A-Z) e números (0-9).
* No *NIX, você pode executar './unrealircd gencloak' na sua shell para que o
* UnrealIRCd gere 3 strings randômicas para você.
* No Windows, você pode executar "C:\Program Files\UnrealIRCd 6\bin\unrealircdctl" gencloak
*/
cloak-keys {
"Oozahho1raezoh0iMee4ohvegaifahv5xaepeitaich9tahdiquaid0geecipahdauVaij3zieph4ahi";
"adicione a outra";
"adicione a outra";
}
}
/* Configurações específicas do servidor */
set {
// POR ÚLTIMO, VOCÊ PRECISA ALTERAR ISTO:
kline-address 'definir.seu.endereco.de.email'; /* e-mail ou URL exibido quando um usuário é banido */
modes-on-connect "+ixw"; /* quando os usuários conectam, esses modos de usuário é atribuído a eles */
modes-on-oper "+xws"; /* quado alguém se torna IRCOp, esses modos de usuário é atribuído a ele */
modes-on-join "+nt"; /* modos de canal padrão, quando um novo canal é criado */
oper-auto-join "#opers"; /* IRCOps entram automaticamente neste canal */
options {
hide-ulines; /* esconde U-lines do /MAP e /LINKS */
show-connect-info; /* exibe a mensagem "looking up your hostname" ao se conectar */
}
maxchannelsperuser 10; /* número máximo de canais que um usuário pode entrar com /JOIN */
/* O tempo mínimo que um usuário precisa estar conectado antes de ser permitido
* utilizar a mensagem de QUIT. Isto irá ajudar no combate a SPAM.
*/
anti-spam-quit-message-time 10s;
/* Ou simplesmente defina um quit estático, de forma que qualquer motivo de /QUIT seja ignorado */
/* static-quit "Cliente saindo"; */
/* static-part faz com que o mesmo acima aconteça ao comando /PART */
/* static-part yes; */
/* Proteção contra Flood:
* Há uma série de configurações para isso, e a maioria delas tem bons padrões.
* Veja https://www.unrealircd.org/docs/Set_block#set::anti-flood
*/
anti-flood {
}
/* Configurações para filtragem de SPAM */
spamfilter {
ban-time 1d; /* duração padrão de um ban *LINE definido pelo filtro de spam */
ban-reason "Spam/Propaganda"; /* motivo padrão */
virus-help-channel "#help"; /* canal utilizado para usar em uma ação de 'virus de canal' */
/* except "#help"; exceção de canal ao filtro de spam */
}
/* Restringindo certos comandos
* Veja https://www.unrealircd.org/docs/Set_block#set::restrict-commands
*/
restrict-commands {
list {
except {
connect-time 60; /* após 60 segundos, o usuário pode usar o comando /LIST */
identified yes; /* ou imediatamente, se estiver identificado ao services */
reputation-score 24; /* ou se tiver um score de reputação maior ou igual a 24 */
}
}
invite {
except {
connect-time 120;
identified yes;
reputation-score 24;
}
}
/* Somando a possibilidade de restringir qualquer comando,
* também existem 4 tipos especiais
* que você pode restringir. Eles são "private-message",
* "private-notice", "channel-message" e "channel-notice".
* Eles estão todos comentados neste exemplo:
*/
//private-message {
// except { connect-time 10; }
//}
//private-notice {
// except { connect-time 10; }
//}
}
}
/*
* A seguir será configurado o limite de conexão para "unknown users".
*
* Quando o UnrealIRCd detecta um número elevado de usuários conectando de um endereço IP
* que nunca viu antes, então conexões do novo IP são rejeitadas quando estiverem
* acima da taxa abaixo especificada. Por exemplo, na taxa 10:60 apenas 10 usuários por minuto podem conectar
* por este IP que nunca foi visto antes. Endereços de IP conhecidos sempre podem entrar,
* independente da taxa definida. O mesmo para usuários que se conectam via SASL.
*
* Leia também https://www.unrealircd.org/docs/Connthrottle para detalhes.
* Ou apenas continue lendo a configuração abaixo:
*/
set {
connthrottle {
/* Primeiro nós configuramos quais usuários serão excluídos
* das restrições. Estes usuários sempre conseguirão acessar.
* Por padrão, entra como exceção usuários identificados com o services
* com um score igual ou maior a 24. Um score 24 significa que
* este IP foi conectado a esta rede por pelo menos 2 horas em algum momento
* no mês passado (ou no mínimo por 1 hora se registrado).
* Nós também permitimos usuários que se identificaram através do services via
* SASL para passar por cima destas restrições.
*/
except {
reputation-score 24;
identified yes;
/* Para mais informações, leia
* https://www.unrealircd.org/docs/Mask_item
*/
}
/* Novos usuários são todos os usuários que não pertencem
* ao grupo known-users. Eles são considerados "novos" e no
* caso de um número elevado de novos usuários se conectando,
* eles serão sujeiros ao limite de taxa de conexão.
* Por padrão a taxa é 20 novos usuários locais por minuto
* e 30 novos usuários globais por minuto.
*/
new-users {
local-throttle 20:60;
global-throttle 30:60;
}
/* Esta seção configura quando este módulo não será ativado.
* As configurações padrão desabilitarão o módulo quando:
* - O módulo reputation esteja em execução a menos de
* uma semana. Se estiver rodando há menos de 1 semana, então ainda temos
* dados insuficientes para considerar quem é um "known user" (usuário conhecido).
* - O servidor acabou de ser inicializado (primeiros 3 minutos).
*/
disabled-when {
reputation-gathering 1w;
start-delay 3m;
}
}
}
/* HISTÓRICO DE CANAL:
* UnrealIRCd possui modo de canal +H que pode ser usado pelos usuários para recuperar
* o histórico do canal antes deles terem entrado. Para informações gerais
* sobre esta funcionalidade, leia https://www.unrealircd.org/docs/Channel_history
*
* Os limites do histórico podem ser configurados pelo set::history. Os padrões são
* provavelmente bons para você, mas se você estiver em um sistema com pouca memória
* ou tem centenas de canais, então você pode querer verificar esses padrões novamente. Leia
* https://www.unrealircd.org/docs/Set_block#set::history
* para ver as opções disponíveis.
*
* Além disso, você pode definir um "histórico de canal persistente", o que
* significa que o histórico do canal é armazenado de modo criptografado no disco e é preservado
* entre os reinícios do servidor. Leia
* https://www.unrealircd.org/docs/Set_block#Persistent_channel_history
* A funcionalidade de histórico persistente NÃO é habilitado por padrão porque você
* precisa configurar o Bloco secret { } para ele antes. A seguir um exemplo simples
* de senhas armazenadas diretamente no arquivo de configuração:
* Para obter uma melhor segurança, leia https://www.unrealircd.org/docs/Secret_block
* como formas alternativas para não armazenar senhas diretamente no arquivo de configuração.
*/
//secret historydb { password "algumasenha"; }
//set { history { channel { persist yes; db-secret "historydb"; } } }
/* Finalmente, você pode querer ter um MOTD (Mensagem do Dia), isto pode ser
* feito criando um arquivo de texto 'ircd.motd' no seu diretório conf/ .
* O texto dentro deste arquivo será exibido aos usuários ao se conectarem.
* Para mais informações, veja https://www.unrealircd.org/docs/MOTD_and_Rules
*/
/*
* Problemas ou precisa de ajuda?
* 1) https://www.unrealircd.org/docs/
* 2) https://www.unrealircd.org/docs/FAQ <- responde a 80% das suas perguntas!
* 3) Se ainda assim você está enfrentando problemas, você pode obter ajuda em:
* - Fóruns: https://forums.unrealircd.org/
* - IRC: irc.unrealircd.org (SSL na porta 6697) / #unreal-support
* Observe que pedimos que você leia a documentação e as perguntas frequentes (FAQ) primeiro!
*/
+386 -158
View File
@@ -1,21 +1,29 @@
/* UnrealIRCd 4.0 için yapılandırma dosyası
/* UnrealIRCd 6 için yapılandırma dosyası
*
* Türkçe Çeviri: Diablo - (Serkan Sepetçi)
* İletişim: irc.trirc.com:6667 - diablo@unrealircd.org
* İletişim: irc.turkirc.net:6667 - diablo@unrealircd.org
*
* Biz buna basit bir 'unrealircd.conf' dosyası diyoruz.
* Bu dosyası satır satır editleyip conf/ dizinine kopyalayınız. (düzenleyin!)
* Bu dosyayı conf/ dizininize kopyalayın ve 'unrealircd.conf' olarak adlandırın.
*
* Önemli: Satırların hepsi, açılış başına { satır sonuna ;
* }; dahil edin. Bu çok önemli, eğer siz ayrıştırıcıyı ;
* eksik koyarsanız yapılandırma dosyası hata verecek
* ve dosya doğru işlemde olmayacaktır!
* Bu sizin UnrealIRCd yapılandırması ile ilk deneyiminiz ise
* dosyayı okumanız için birkaç dakika ayırmanızı öneniriz,
* bu size bilgi edinmeniz açısından yardımcı olacaktır:
* Aceleniz varsa CTRL+F tuşlarına basıp şunu yapabilirsiniz: BUNU DEĞİŞTİRİN
* Değiştirilmesi gereken maddeler bu iki kelimeyle belirtilir.
* Ancak aslında dosyayı satır satır incelemenizi ve gereken yerde
* düzenlemenizi öneririz. Böylece tüm temel öğeleri ve bunların nasıl
* ayarlandığını görebilirsiniz.
*
* DEVAM ETMEDEN ÖNCE:
* Önemli: { ve } dışındaki tüm satırlar ; ile biter
* Bu çok önemlidir. Eğer bir şeyi yanlış yaparsanız,
* yapılandırma dosyası ayrıştırıcısı hata verecek ve
* dosya doğru şekilde çalışmayacaktır!
*
* Eğer bu UnrealIRCd yapılandırma dosyasıyla ilk deneyiminizse
* sözdizimi hakkında biraz okumanızı öneririz.
* bu yalnızca birkaç dakika sürer ve size çok yardımcı olacaktır:
* https://www.unrealircd.org/docs/Configuration#Configuration_file_syntax
*
* UnrealIRCd 4 belgeleme (çok geniş!):
* https://www.unrealircd.org/docs/UnrealIRCd_4_documentation
* UnrealIRCd 6 belgeleri (çok kapsamlı!):
* https://www.unrealircd.org/docs/UnrealIRCd_6_documentation
*
* Sıkça Sorulan Sorular:
* https://www.unrealircd.org/docs/FAQ
@@ -44,34 +52,43 @@ include "modules.default.conf";
* - help/help.conf /HELPOP sistemi
* - badwords.conf kanal ve kullanıcı modu için +G
* - spamfilter.conf için örnek olarak spamfilter kullanımı
* (yorumlandı)
* - operclass.default.conf oper bloklarında kullanabileceğiniz
* oper sınıflarını görüntüler.
*/
include "help/help.conf";
include "badwords.conf";
include "spamfilter.conf";
//include "spamfilter.conf";
include "operclass.default.conf";
include "snomasks.default.conf";
/* Varsayılan gizleme modülünü yükleyin (2021'den itibaren): */
loadmodule "cloak_sha256";
/* Veya eski modülü UnrealIRCd 3.2/4/5'ten yükleyin: */
//loadmodule "cloak_md5";
// BUNU DEĞİŞTİRİN ('ad' ve 'bilgi'):
/* me { } bloğu genelde kim olduğumuzu belirtir.
* Sunucumuz için isim, birkaç satır bazı bilgileri belirler "sid".
* Sunucu kimliği (sid) iki basamağı veya harf tarafından izlenen bir rakam ile
* başlamalıdır. Sid IRC ağı için benzersiz olmalıdır (her sunucu için
* kendi sid olmalıdır).
* kendi sid olmalıdır). İlk sunucu için 001 kullanılması uygundur.
*/
me {
name "irc.foonet.com";
info "FooNet Server";
name "irc.example.org";
info "ExampleNET Server";
sid "001";
};
}
// BUNU DEĞİŞTİRİN:
/* admin { } bloğu /ADMIN sorgusunda kullanıcılara görüntülenecek metni belirler.
* Normalde yöneticiye ulaşma konusunda bilgi içerir.
*/
admin {
"Bob Smith";
"bob";
"widely@used.name";
};
"email@example.org";
}
/* Kullanıcılar ve sunucular için class { } bloğu belirtilir.
* Class blokları aşağıdaki işlemlerden oluşur:
@@ -88,7 +105,7 @@ class clients
maxclients 1000;
sendq 200k;
recvq 8000;
};
}
/* IRCOp'lar için varsaylan yüksek limitli özel class ayarları */
class opers
@@ -97,7 +114,7 @@ class opers
maxclients 50;
sendq 1M;
recvq 8000;
};
}
/* Sunucular için varsayılan class ayarları */
class servers
@@ -105,8 +122,8 @@ class servers
pingfreq 60;
connfreq 15; /* Her 15 saniyede bir bağlanmayı dener */
maxclients 10; /* maksimum kullanıcı */
sendq 5M;
};
sendq 20M;
}
/* Allow blockları sunucunuza kimlerin bağlanabileceğini belirtir.
* Bir sunucu şifresi eklenebilir veya belirlitilen bir IP adresi için
@@ -115,23 +132,23 @@ class servers
* Görmeniz için: https://www.unrealircd.org/docs/Allow_block
*/
/* IP başına sadece 5 bağlantı izini verir */
/* IP başına sadece 3 bağlantı izini verir */
allow {
ip *@*;
mask *;
class clients;
maxperip 3;
};
}
/* Örnek olarak özel bir IP bloğu izini:
* Bu IP bir şifre ile bağlantı yapması olduğunu gerektirir.
* Şifre doğru ise o zaman bu IP 20 bağlantıya izin verecektir.
*/
allow {
ip *@192.0.2.1;
class clients;
password "somesecretpasswd";
maxperip 20;
};
// allow {
// mask 192.0.2.1;
// class clients;
// password "somesecretpasswd";
// maxperip 20;
// }
/* Oper bloğu, IRC Operatorleri tanımlar.
* IRC Operatörler, diğer kullanıcılara göre "ekstra haklara" sahip kullanıcılardır.
@@ -145,57 +162,76 @@ allow {
* https://www.unrealircd.org/docs/Oper_block
*/
/* Örnek bir oper bloğu için 'bobsmith' ile şifresi 'test'.
* Bunu değiştirmeniz GEREKİR!!
/* İşte 'bobsmith' için örnek bir oper bloğu
* BUNU DEĞİŞTİRMELİSİN!! (oper adı ve şifre)
*/
oper bobsmith {
class opers;
mask *@*;
password "test";
/* Teknik olarak oper şifrelerini conf'a düz metin olarak koyabilirsiniz, ancak bu
* KESİNLİKLE ÖNERİLEN bir durum değildir. Bunun yerine bir şifre karması oluşturmalısınız:
* *NIX'te şunu çalıştırın: ./unrealircd mkpasswd
* Windows'ta şunu çalıştırın: "C:\Program Files\UnrealIRCd 6\bin\unrealircdctl" mkpasswd
* .. ve ardından sonucu aşağıya yapıştırın:
*/
password "$argon2id..etc..";
/* 'Certfp' gibi daha iyi kimlik doğrulama türleri ve Windows'ta
* karmaların nasıl oluşturulacağı da dahil olmak üzere daha fazla bilgi için
* https://www.unrealircd.org/docs/Authentication_types adresine bakın.
*/
/* Oper izinleri bir "operclass 'bloğunda tanımlanır.
* Görmeniz için: https://www.unrealircd.org/docs/Operclass_block
* UnrealIRCd varsayılan bloklar makalesi için,
* tam listesine bakınız. Buradan 'netadmin' seçiyoruz.
*/
operclass netadmin;
swhois "is a Network Administrator";
vhost netadmin.mynet.org;
};
vhost netadmin.example.org;
}
/* Listen blokları sunucu portu için gereken bağlantı noktalarını tanımlar.
* Diğer bir deyişle: Bu portlar kullanıcılar ve serverlar için
* sunucuya bağlantı kurmasını sağlar.
*
* Kullanımı:
* listen
* {
* listen {
* ip <ip numarası>;
* port <port numarası>;
* options {
* <seçenekler....>;
* };
* };
* }
* }
*/
/* Standard IRC port 6667 */
/* Standard IRC port 6667
* Insecure plaintext (NOT for production servers)
* This listen block is here only for quick testing.
* Delete or comment out this listen block on production servers
* and use TLS on port 6697 instead.
*/
listen {
ip *;
port 6667;
};
}
/* Standard IRC SSL/TLS port 6697 */
listen {
ip *;
port 6697;
options { ssl; };
};
options { tls; }
}
/* Özel SSL/TLS sadece sunucuları bağlamak için port */
listen {
ip *;
port 6900;
options { ssl; serversonly; };
};
options { tls; serversonly; }
}
/* DiKKAT: Eğer bir çok IP barındıran bir IRCd Shell kullanıyorsanız
* logunuzda olası 'Address already in use' hatasını alacaksınız
@@ -209,50 +245,51 @@ listen {
* Link blockları bir ağ oluşturmak için birden fazla sunucu bağlamaya izin verir.
* Görmek için: https://www.unrealircd.org/docs/Tutorial:_Linking_servers
*/
link hub.mynet.org
link hub.example.org
{
incoming {
mask *@something;
};
}
outgoing {
bind-ip *; /* veya açıkça bir IP */
hostname hub.mynet.org;
hostname hub.example.org;
port 6900;
options { ssl; };
};
options { tls; }
}
/* Kimlik doğrulaması için diğer sunucunun SPKI parmak izini kullanıyoruz.
* Kullanmamız için diğer tarafda './unrealircd spkifp' uygulayıp çalıştırıyoruz.
* NOT: UnrealIRCd 4.0.16 veya üzeri versiyonları gerektirir.
* *NIX'te şunu çalıştırın: ./unrealircd spkifp
* Windows'ta şunu çalıştırın: "C:\Program Files\UnrealIRCd 6\bin\unrealircdctl" spkifp
*/
password "AABBCCDDEEFFGGHHIIJJKKLLMMNNOOPPQQRRSSTTUUV=" { spkifp; };
password "AABBCCDDEEFFGGHHIIJJKKLLMMNNOOPPQQRRSSTTUUV=" { spkifp; }
class servers;
};
}
/* Servis'ler için bağlantı bloğu genellikle çok daha basittir.
* Servis'lerin ne olduğu hakkında daha fazla bilgi için,
* https://www.unrealircd.org/docs/Services
*/
link services.mynet.org
link services.example.org
{
incoming {
mask 127.0.0.1;
};
}
password "changemeplease";
class servers;
};
}
/* U-lines satırları sunuculara daha güç/komut kazandırır.
* Eğer hizmetlerini kullanmak istiyorsanız onları buraya eklemeniz gerekir.
* ASLA buraya (normal) UnrealIRCd sunucunun adını yazmayınız!!!
* ÖNEMLİ: ASLA buraya (normal) UnrealIRCd sunucunun adını yazmayınız!!!
*/
ulines {
services.mynet.org;
};
services.example.org;
}
/* Bu blok /DIE ve /RESTART için şifre tanımlamanızı sağlar. Sadece IRCOp'lar içindir.
* Bu genelde kazara sunucuyu yeniden başlatma ve kapanmasına karşı biraz
@@ -261,27 +298,50 @@ ulines {
drpass {
restart "restart";
die "die";
};
}
/* Bu log bloğu hangi dosyaya ve nelerin olması gerektiğini tanımlar.
* Görmeniz için: https://www.unrealircd.org/docs/Log_block
*/
/* Varsayılan ayarlar, neredeyse her şeyi kaydedecektir */
log "ircd.log" {
flags {
oper;
connects;
server-connects;
kills;
errors;
sadmin-commands;
chg-commands;
oper-override;
tkl;
spamfilter;
};
};
/* Bu iyi bir varsayılandır, hata ayıklama ve
* join/part/kick dışındaki her şeyi günlüğe kaydeder.
*/
log {
source {
all;
!debug;
!join.LOCAL_CLIENT_JOIN;
!join.REMOTE_CLIENT_JOIN;
!part.LOCAL_CLIENT_PART;
!part.REMOTE_CLIENT_PART;
!kick.LOCAL_CLIENT_KICK;
!kick.REMOTE_CLIENT_KICK;
}
destination {
file "ircd.log" { maxsize 100M; }
}
}
/* Düzenli günlük kaydına ek olarak bir JSON günlük dosyası ekleyin.
* Bu her olayla ilgili birçok bilgi içerir dolayısıyla denetim amaçları
* için mükemmeldir ve makine tarafından okunabilir. Ancak insanlar için daha az okunabilir.
*/
log {
source {
all;
!debug;
!join.LOCAL_CLIENT_JOIN;
!join.REMOTE_CLIENT_JOIN;
!part.LOCAL_CLIENT_PART;
!part.REMOTE_CLIENT_PART;
!kick.LOCAL_CLIENT_KICK;
!kick.REMOTE_CLIENT_KICK;
}
destination {
file "ircd.json.log" { maxsize 250M; type json; }
}
}
/* Bazı kullanıcılara veya botlara bir mesaj göndermek için "aliases"
* takma ad oluşturmanızı sağlar. Genellikle servisler için kullanılır.
@@ -292,43 +352,43 @@ log "ircd.log" {
include "aliases/anope.conf";
/* Ban nick bloğu bir nickin sunucuda kullanımını yasaklamanıza olanak sağlar */
ban nick {
mask "*C*h*a*n*S*e*r*v*";
reason "Servisler için ayrılmış";
};
// ban nick {
// mask "*C*h*a*n*S*e*r*v*";
// reason "Servisler için ayrılmış";
// }
/* Ban ip.
* Normalde bunun için /KLINE, /GLINE ve /ZLINE kullanıldığını unutmayınız.
*/
ban ip {
mask 195.86.232.81;
reason "Senden nefret ediyorum";
};
// ban ip {
// mask 195.86.232.81;
// reason "Senden nefret ediyorum";
// }
/* Ban server - bir sunucunun bağlanmasını devredışı kılar */
ban server {
mask eris.berkeley.edu;
reason "Defol git buradan.";
};
// ban server {
// mask eris.berkeley.edu;
// reason "Defol buradan.";
// }
/* Ban user - normalde /KLINE veya /GLINE kullanıldığını unutmayınız */
ban user {
mask *tirc@*.saturn.bbn.com;
reason "Salak";
};
// ban user {
// mask *tirc@*.saturn.bbn.com;
// reason "Aptal";
// }
/* Ban realname bloğu bir kullanıcıyı, GECOS kısmı esas alınarak
* banlamanıza olanak sağlar.
*/
ban realname {
mask "Swat Team";
reason "mIRKFORCE";
};
// ban realname {
// mask "Swat Team";
// reason "mIRKFORCE";
// }
ban realname {
mask "sub7server";
reason "sub7";
};
// ban realname {
// mask "sub7server";
// reason "sub7";
// }
/* Ban ve TKL istisnaları. Kullanıcıları / makineleri gözetmeksizin
* KLINE, GLINE, gibi banlardan muaf tutmanıza olanak sağlar.
@@ -337,30 +397,32 @@ ban realname {
* bir *LINE ban koyarsanız bile yinede muaf tutulacaksınız.
*/
/* except ban bloğu, sizi KLINE ve ZLINE gibi banlardan koruyacaktır */
except ban {
mask *@192.0.2.1;
// burada daha fazla mask girdileri ekleyebilirsiniz..
};
/* except ban bloğu, sizi 'tüm' GLINE, GZLINE, QLINE, SHUN gibi banlardan koruyacaktır */
// except ban {
// mask *@192.0.2.1;
// type all;
// }
/* except tkl bloğu, sizi 'tüm' GLINE, GZLINE, QLINE, SHUN gibi banlardan koruyacaktır */
except tkl {
mask *@192.0.2.1;
type all;
};
/* This allows IRCCloud connections in without maxperip restrictions
* and also exempt them from connect-flood throttling.
*/
except ban {
mask *.irccloud.com;
type { maxperip; connect-flood; }
}
/* Deny dcc bloğu, sunucu üzerinden DCC yoluyla dosya gönderilmesine izin vermeyecektir */
deny dcc {
filename "*sub7*";
reason "Olası Sub7 Virüsü";
};
// deny dcc {
// filename "*sub7*";
// reason "Possible Sub7 Virus";
// }
/* Deny channel bloğu, kullanıcıların belirtilen kanallara girmesini engeller */
deny channel {
channel "*warez*";
reason "Warez is illegal";
class "clients";
};
// deny channel {
// channel "*warez*";
// reason "Warez is illegal";
// class "clients";
// }
/* VHosts (Virtual Hosts) bloğu, kullanıcının yeni bir host alabilmesine olanak sağlar.
* Görmeniz için; https://www.unrealircd.org/docs/Vhost_block
@@ -370,51 +432,101 @@ deny channel {
* DiKKAT: Güvenlik açısından aşağıdaki vhost::mask yönergesinde
* maske 'unrealircd.com' olarak belirlenmiştir.
*/
vhost {
vhost i.hate.microsefrs.com;
mask *@unrealircd.com;
login "test";
password "test";
};
// vhost {
// vhost i.hate.microsefrs.com;
// mask *@unrealircd.com;
// login "test";
// password "test";
// }
/* Blacklist blokları, bir kullanıcı bağlandığında IP adresinin drone saldırılarına
* neden olduğunu, bilinen bir saldırıya uğramış bir makine olup olmadığını görmek
* için harici bir DNS Kara Liste hizmetinden sorgulayacaktır.
* Belgeleme: https://www.unrealircd.org/docs/Blacklist_block
* veya aşağıdaki bloklar satırına bakınız.
*/
/* DroneBL, muhtemelen IRC Sunucuları tarafından kullanılan en popüler kara liste.
* Belgeler ve cevap (reply) tiplerin anlamlarını görmek için https://dronebl.org/
* adresine bakınız. Bu zamanda aşağıdaki cevap (reply) tiplerini kullanıyoruz:
* 3: IRC Drone, 5: Bottler, 6: Unknown spambot or drone,
* 7: DDoS Drone, 8: SOCKS Proxy, 9: HTTP Proxy, 10: ProxyChain,
* 11: Web Page Proxy, 12: Open DNS Resolver, 13: Brute force attackers,
* 14: Open Wingate Proxy, 15: Compromised router / gateway,
* 16: Autorooting worms.
*/
blacklist dronebl {
dns {
name dnsbl.dronebl.org;
type record;
reply { 3; 5; 6; 7; 8; 9; 10; 11; 12; 13; 14; 15; 16; }
}
action gline;
ban-time 24h;
reason "Proxy/Drone belirlendi. Ayrıntılar için https://dronebl.org/lookup?ip=$ip adresine bakınız.";
}
/* EFnetRBL, belgeler ve cevap (reply) tiplerini görmek için https://rbl.efnetrbl.org/
* adresine bakınız.
* Yazma sırasında: 1 is open proxy, 4 is TOR, 5 is drones/flooding.
*
* NOT: Sunucunuzda TOR proxy'lerine izin vermek istiyorsanız,
* cevap (reply) tiplerinden '4;' öğesini kaldırmanız gerekiyor.
*/
blacklist efnetrbl {
dns {
name rbl.efnetrbl.org;
type record;
reply { 1; 4; 5; }
}
action gline;
ban-time 24h;
reason "Proxy/Drone/TOR tespit edildi. Ayrıntılar için https://rbl.efnetrbl.org/?i=$ip adresine bakınız.";
}
/* Diğer yapılandırma dosyalarını dahil edebilirsiniz */
/* include "klines.conf"; */
/* Ağ yapılandırması */
set {
network-name "MYNet";
default-server "irc.mynet.org";
services-server "services.mynet.org";
stats-server "stats.mynet.org";
// BU 4 ÖĞENİN TÜMÜNÜ DEĞİŞTİRİN:
network-name "ExampleNET";
default-server "irc.example.org";
services-server "services.example.org";
stats-server "stats.example.org";
/* Normal varsayılanlar */
help-channel "#Help";
hiddenhost-prefix "Clk";
cloak-prefix "Clk";
prefix-quit "Quit";
/* Gizleme anahtarları ağ üzerindeki bütün sunucularda aynı olmalı.
* Bu anahtarlar maskeli hostlar yaratmak ve bunları saklamak için kullanılır.
* Anahtarlar 5-100 karakterlik (10-20 karakter yeterli) 3 rastgele diziden oluşmalı ve
* küçük harf (a-z), büyük harf (A-Z) ve rakamlardan (0-9) meydana gelmelidirler.. [ilk örneğe bakınız].
* IPUCU: './unreal gencloak' Unreal sizin için rastgele 3 adet dizin oluşturur.
* Anahtarlar 80 karakterlik 3 rastgele diziden oluşmalı ve küçük harf (a-z),
* büyük harf (A-Z) ve rakamlardan (0-9) meydana gelmelidirler.. [ilk örneğe bakınız].
* IPUCU: './unrealircd gencloak' Unrealircd sizin için rastgele 3 adet dizin oluşturur.
* Bunu NIX üzerinde çalıştırabilirsiniz.
* On Windows, use "C:\Program Files\UnrealIRCd 6\bin\unrealircdctl" gencloak
*/
cloak-keys {
"aoAr1HnR6gl3sJ7hVz4Zb7x4YwpW";
"Oozahho1raezoh0iMee4ohvegaifahv5xaepeitaich9tahdiquaid0geecipahdauVaij3zieph4ahi";
"ve diğeri";
"ve diğeri";
};
};
}
}
/* Sunucunun kendine özgü yapılandırması */
set {
kline-address "set.this.to.email.address"; /* bir kullanıcı banlandığında e-mail yada URL satırı gösterir */
// SON OLARAK, BU SONRAKİ ÖĞEYİ DEĞİŞTİRMENİZ GEREKİR:
kline-address 'set.this.to.email.address'; /* bir kullanıcı banlandığında e-mail yada URL satırı gösterir */
modes-on-connect "+ixw"; /* kullanıcılar bağlandığında, bu modları alacaktır */
modes-on-oper "+xwgs"; /* Birisi IRC Operatör olduğunda bu modları alacaktır */
modes-on-oper "+xws"; /* Birisi IRC Operatör olduğunda bu modları alacaktır */
modes-on-join "+nt"; /* yeni bir kanal oluşturulduğunda varsayılan kanal modlarını alacaktır */
oper-auto-join "#opers"; /* IRCoplar bu kanala otomatik olarak giriş yapacaktır */
options {
hide-ulines; /* U-lines satırları /MAP ve /LINKS komutunda gözükmez */
show-connect-info; /* sunucuya bağlanırken "looking up your hostname" mesajı görüntülenecektir */
};
}
maxchannelsperuser 10; /* bir kullanıcının maksimum girebileceği kanal sayısı */
@@ -429,15 +541,12 @@ set {
/* static-part /PART komutu ile aynı işi görür */
/* static-part yes; */
/* /STATS komutunu operler için kısıtlar. Önerilen * (TÜMÜ) */
oper-only-stats "*";
/* Anti flood Koruması */
/* Flood Koruması:
* Bunun için birçok ayarları vardır ve çoğu iyi varsayılanlara sahiptir.
* Görmeniz için: https://www.unrealircd.org/docs/Set_block#set::anti-flood
*/
anti-flood {
nick-flood 3:60; /* Her 60 saniyede 3 nick değişikliği (varsayılan) */
connect-flood 3:60; /* Her 60 saniyede 3 bağlantı girişi izni (varsayılan) */
away-flood 4:120; /* Her 2 dakikada 4 kez /AWAY kullanımı izni (varsayılan) */
};
}
/* Spam filter Ayarları */
spamfilter {
@@ -445,17 +554,136 @@ set {
ban-reason "Spam/Advertising"; /* varsayılan sebep */
virus-help-channel "#help"; /* 'viruschan' eylemi için kullanılacak kanal */
/* except "#help"; Spamfilter'den muaf tutulacak kanal */
};
};
/* Son olarak, bir MOTD (Günün Mesajı) oluşturabilirsiniz, bu
* conf/ dizininde 'ircd.motd' metin dosyası oluşturarak yapabilirsiniz.
* Bu dosyanın içeriği bağlantı kuran kullanıcılara gösterilecektir.
* Daha fazla bilgi için https://www.unrealircd.org/docs/MOTD_and_Rules bölümünü inceleyiniz.
*/
}
/* Belirli komutları kısıtlayın.
* See https://www.unrealircd.org/docs/Set_block#set::restrict-commands
*/
restrict-commands {
list {
except {
connect-time 60;
identified yes;
reputation-score 24;
}
}
invite {
except {
connect-time 120;
identified yes;
reputation-score 24;
}
}
/* Yukarıda gösterildiği gibi herhangi bir komutu kısıtlama
* yeteneğine sahiptir. Ayrıca kısıtlayabileceğiniz 4
* özel tip vardır. Bunlar "private-message",
* "private-notice", "channel-message" ve "channel-notice".
* Bu örnekte olduğu gibi (kapalı) yorumlanmıştır:
*/
//private-message {
// except { connect-time 10; }
//}
//private-notice {
// except { connect-time 10; }
//}
}
}
/*
* Sorununuza veya daha fazla yardımamı ihtiyacınız var?
* 1) https://www.unrealircd.org/docs/UnrealIRCd_4_documentation
* Aşağıdaki ayar "bilinmeyen kullanıcılar" için bağlantı kısıtlamasını yapılandıracaktır.
*
* UnrealIRCd, IP adreslerinden bağlanan çok sayıda kullanıcı tespit ettiğinde
* daha önce görülmemişse, yeni IP'lerden gelen bağlantılar ayarlanan
* hızın üzerinde reddedilir. örneğin 10:60'ta dakikada sadece 10 kullanıcı daha önce
* görülmemiş şekilde bağlanabilir. Bilinen IP adresleri, ayarlanan orandan bağımsız olarak
* her zaman girebilir. SASL kullanarak giriş yapan kullanıcılar için de aynıdır.
*
* Ayrıntılar için https://www.unrealircd.org/docs/Connthrottle adresine bakınız.
* Veya aşağıdaki varsayılan yapılandırma ayarlarını okumaya devam edin:
*/
set {
connthrottle {
/* ilk önce "bilinen kullanıcılar" dediğimiz şeyi yapılandırmalıyız.
* Varsayılan olarak bunlar, IP adresleri üzerinde 24 veya
* daha yüksek puana sahip kullanıcılardır. 24 puan IP'nin geçen ay
* en az 2 saat (veya kayıtlıysa en az 1 saat) boyunca bu sunucuya
* bağlı olduğu anlamına gelir.
* Sasl-bypass seçeneği başka bir ayardır. Bu ayar
* SASL aracılığıyla hizmetlere kimlik doğrulaması yapan
* kullanıcıların da bilinen kullanıcılar olarak kabul edildiği anlamına gelir.
* "known-users" grubundaki kullanıcılar (herhangi bir reputation
* veya SASL) modülleri tarafından her zaman izin verilir.
*/
except {
reputation-score 24;
identified yes;
/* daha fazla seçenek için bkz.
* https://www.unrealircd.org/docs/Mask_item
*/
}
/* Yeni kullanıcılar, aşağıdakilere ait olmayan tüm
* bilinen-kullanıcılar grubundandır. Bunlar "yeni" ve
* bu tür yeni kullanıcıların çok sayıda bağlanması durumunda
* bağlantı hızı sınırlamasına tabidirler.
* Varsayılan bu oran dakikada 20 yeni yerel kullanıcı
* ve dakikada 30 yeni global kullanıcı olarak belirlenmiştir.
*/
new-users {
local-throttle 20:60;
global-throttle 30:60;
}
/* Bu modülün ne zaman aktif OLMAYACAĞINI yapılandırır.
* Varsayılan ayarlar, şu durumlarda modülü devre dışı bırakacaktır:
* - Reputation modülü 1 haftadan kısa bir süredir çalışıyor ise.
* 1 haftadan az çalışıyorsa, kimin "bilinen kullanıcı"
* olduğunu düşünmek için yeterli veri yoktur.
* - Sunucu yeni açıldı (ilk 3 dakika).
*/
disabled-when {
reputation-gathering 1w;
start-delay 3m;
}
}
}
/* KANAL GEÇMİŞİ:
* UnrealIRCd, kullanıcılar tarafından bir kanala katılmadan önce
* kanal geçmişini okumak için, kullanılabilen +H kanal moduna sahip olmalıdır.
* Bu özellik hakkında bilgi için bkz. https://www.unrealircd.org/docs/Channel_history
*
* Geçmiş limitleri set::history aracılığıyla yapılandırılabilir. Varsayılan ayarlar
* muhtemelen sizin için zaten iyidir, ancak düşük bellekli bir sistemdeyseniz veya
* binlerce kanalınız varsa, iki kez kontrol etmek isteyebilirsiniz. Seçenekler için
* https://www.unrealircd.org/docs/Set_block#set::history adresine bakın.
*
* Buna ek olarak "kalıcı kanal geçmişine" sahip olabilirsiniz. Bu kanal
* geçmişinin diskte şifreli olarak depolandığı ve böylece IRC sunucusu yeniden
* başlatılması halinde korunması anlamına gelir.
* bkz. https://www.unrealircd.org/docs/Set_block#Persistent_channel_history
* Kalıcı geçmiş özelliği varsayılan olarak ETKİNLEŞTİRİLMEMİŞTİR bunun için
* bir secret { } bloğu yapılandırmanız gerekir. Aşağıdaki yapılandırma dosyasında
* saklanan parolalar doğrudan bunlara basit bir örnektir.
* Daha iyi güvenlik elde etmek için https://www.unrealircd.org/docs/Secret_block
* adresini okuyun böylece şifreleri doğrudan yapılandırmada saklamazsınız.
*/
//secret historydb { password "somepassword"; }
//set { history { channel { persist yes; db-secret "historydb"; } } }
/* Son olarak, bir MOTD'ye (Günün Mesajı) sahip olmak isteyebilirsiniz, bunu
* conf/ dizininizde bir 'ircd.motd' metin dosyası oluşturarak yapabilirsiniz.
* Bu dosya bağlantıda kullanıcılarınıza gösterilecektir.
* Daha fazla bilgi için bkz. https://www.unrealircd.org/docs/MOTD_and_Rules
*/
/*
* Sorun mu yaşıyorsunuz veya daha fazla yardıma mı ihtiyacınız var?
* 1) https://www.unrealircd.org/docs/
* 2) https://www.unrealircd.org/docs/FAQ <- sorularınızın %80 ini kapsamakta!
* 3) Eğer probleminiz hala devam ediyorsa:
* - Forums: https://forums.unrealircd.org/
+579 -367
View File
File diff suppressed because it is too large Load Diff
+151 -187
View File
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+428 -388
View File
File diff suppressed because it is too large Load Diff
+149 -197
View File
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+570 -522
View File
File diff suppressed because it is too large Load Diff
+701 -473
View File
File diff suppressed because it is too large Load Diff
+259 -130
View File
@@ -1,4 +1,5 @@
/* This file will load (nearly) all modules available on UnrealIRCd.
/* [6.2.6-rc1]
* This file will load (nearly) all modules available on UnrealIRCd.
* So all commands, channel modes, user modes, etc..
*
* If you want to have all UnrealIRCd functionality, then include this
@@ -10,141 +11,169 @@
* 1) Keep the include for modules.default.conf as usual and make use
* of blacklist-module "xyz"; to selectively disable modules.
* See https://www.unrealircd.org/docs/Blacklist-module_directive
* This is the highly recommended approach of doing customizations!
* 2) OR, make a copy of this file (eg: name it modules.custom.conf)
* and edit it. Then include that file from your unrealircd.conf
* instead of this one.
* The downside of option #2 is that you will need to track changes
* in the original modules.default.conf with each new UnrealIRCd
* release to make sure you don't miss any new functionality (as new
* important modules may be added you need to add them to your conf).
* You don't have this problem with option #1.
* The problem with this option #2 is that you need to track ALL
* changes in UnrealIRCd, that means: every loadmodule line that
* we add or remove in each and every release. If you don't do this
* or forget one little loadmodule line then you will end up with:
* * Missing functionality (that could have been useful)
* * Breaking of existing functionality, like the (in)famous example
* of when the existing svslogin command got split off in a separate
* new svslogin module and people who didn't load that new module
* would have services who would not set users as 'logged in'.
* Or the existing anti connect-flood feature being split off into
* the 'connect-flood' module, so your server suddenly being
* vulnerable to connect flooding because you failed to load it.
* So please do know what you are doing if you choose option #2.
* Again, best is to go for option #1 and opt-out.
*/
/*** Cloaking (for user mode +x) ***/
loadmodule "cloak";
/*** Commands ***/
// User commands (MINIMAL)
// These provide just the minimal set of IRC commands that are
// required by RFC1459 along with WATCH and MAP.
loadmodule "m_admin";
loadmodule "m_away";
loadmodule "m_invite";
loadmodule "m_ison";
loadmodule "m_join";
loadmodule "m_kick";
loadmodule "m_links";
loadmodule "m_list";
loadmodule "m_lusers";
loadmodule "m_map";
loadmodule "m_message";
loadmodule "m_mode";
loadmodule "m_motd";
loadmodule "m_names";
loadmodule "m_nick";
loadmodule "m_part";
loadmodule "m_pass";
loadmodule "m_pingpong";
loadmodule "m_protoctl";
loadmodule "m_quit";
loadmodule "m_rules";
loadmodule "m_topic";
loadmodule "m_user";
loadmodule "m_userhost";
loadmodule "m_watch";
loadmodule "m_who";
loadmodule "m_whois";
loadmodule "m_whowas";
loadmodule "admin";
loadmodule "away";
loadmodule "invite";
loadmodule "ison";
loadmodule "join";
loadmodule "kick";
loadmodule "links";
loadmodule "list";
loadmodule "lusers";
loadmodule "map";
loadmodule "message";
loadmodule "mode";
loadmodule "motd";
loadmodule "names";
loadmodule "nick";
loadmodule "part";
loadmodule "pass";
loadmodule "pingpong";
loadmodule "protoctl";
loadmodule "quit";
loadmodule "rules";
loadmodule "topic";
loadmodule "user";
loadmodule "userhost";
loadmodule "watch";
loadmodule "whox";
loadmodule "whois";
loadmodule "whowas";
// User commands (EXTENDED)
// These are commands that provide extended functionality.
loadmodule "m_botmotd";
loadmodule "m_cap";
loadmodule "m_cycle";
loadmodule "m_dccallow";
loadmodule "m_help";
loadmodule "m_knock";
loadmodule "m_lag";
loadmodule "m_sasl";
loadmodule "m_setname";
loadmodule "m_silence";
loadmodule "m_starttls";
loadmodule "m_time";
loadmodule "m_userip";
loadmodule "m_vhost";
loadmodule "botmotd";
loadmodule "cap";
loadmodule "cycle";
loadmodule "dccallow";
loadmodule "help";
loadmodule "knock";
loadmodule "lag";
loadmodule "sasl";
loadmodule "setname";
loadmodule "silence";
loadmodule "starttls";
loadmodule "time";
loadmodule "userip";
loadmodule "vhost";
loadmodule "history";
// IRC Operator commands
// Note: several of these like m_kill are also server-to-server commands
// Note: several of these like kill are also server-to-server commands
// which are required if you link to other servers.
loadmodule "m_addmotd";
loadmodule "m_addomotd";
loadmodule "m_chghost";
loadmodule "m_chgident";
loadmodule "m_chgname";
loadmodule "m_close";
loadmodule "m_connect";
loadmodule "m_squit";
loadmodule "m_dccdeny";
loadmodule "m_globops";
loadmodule "m_kill"; /* also server-to-server */
loadmodule "m_locops";
loadmodule "m_mkpasswd";
loadmodule "m_oper";
loadmodule "m_opermotd";
loadmodule "m_sajoin";
loadmodule "m_samode";
loadmodule "m_sapart";
loadmodule "m_sdesc";
loadmodule "m_sethost";
loadmodule "m_setident";
loadmodule "m_stats";
loadmodule "m_tkl"; /* also server-to-server */
loadmodule "m_trace";
loadmodule "m_tsctl";
loadmodule "m_undccdeny";
loadmodule "m_unsqline";
loadmodule "m_wallops";
loadmodule "addmotd";
loadmodule "addomotd";
loadmodule "chghost";
loadmodule "chgident";
loadmodule "chgname";
loadmodule "close";
loadmodule "connect";
loadmodule "squit";
loadmodule "dccdeny";
loadmodule "globops";
loadmodule "kill"; /* also server-to-server */
loadmodule "locops";
loadmodule "mkpasswd";
loadmodule "oper";
loadmodule "operinfo"; /* not really a command but for whois */
loadmodule "opermotd";
loadmodule "sajoin";
loadmodule "samode";
loadmodule "sapart";
loadmodule "sdesc";
loadmodule "sethost";
loadmodule "setident";
loadmodule "stats";
loadmodule "tkl"; /* also server-to-server */
loadmodule "tline";
loadmodule "trace";
loadmodule "tsctl";
loadmodule "unsqline";
loadmodule "jumpserver";
// Server-to-server commands
// Don't remove these, unless you never link to other servers.
loadmodule "m_eos";
loadmodule "m_md";
loadmodule "m_netinfo";
loadmodule "m_server";
loadmodule "m_sjoin";
loadmodule "m_sqline";
loadmodule "m_swhois";
loadmodule "m_umode2";
loadmodule "eos";
loadmodule "md";
loadmodule "netinfo";
loadmodule "server";
loadmodule "sjoin";
loadmodule "sqline";
loadmodule "swhois";
loadmodule "umode2";
loadmodule "sinfo";
loadmodule "require-module";
loadmodule "slog";
loadmodule "creationtime";
loadmodule "sreply";
loadmodule "unreal_server_compat";
// Services commands
// You could disable these if you don't use Services
// https://www.unrealircd.org/docs/Services
loadmodule "m_sendsno";
loadmodule "m_sendumode";
loadmodule "m_svsfline";
loadmodule "m_svsjoin";
loadmodule "m_svskill";
loadmodule "m_svslusers";
loadmodule "m_svsmode";
loadmodule "m_svsmotd";
loadmodule "m_svsnick";
loadmodule "m_svsnline";
loadmodule "m_svsnolag";
loadmodule "m_svsnoop";
loadmodule "m_svspart";
loadmodule "m_svssilence";
loadmodule "m_svssno";
loadmodule "m_svswatch";
loadmodule "sendsno";
loadmodule "sendumode";
loadmodule "svsjoin";
loadmodule "svskill";
loadmodule "svslusers";
loadmodule "svsmode";
loadmodule "svsmotd";
loadmodule "svsnick";
loadmodule "svsnline";
loadmodule "svsnolag";
loadmodule "svsnoop";
loadmodule "svspart";
loadmodule "svssilence";
loadmodule "svssno";
loadmodule "svswatch";
loadmodule "svso";
loadmodule "svslogin";
/*** Channel modes ***/
loadmodule "chanmodes/chanowner"; /* +q */
loadmodule "chanmodes/chanadmin"; /* +a */
loadmodule "chanmodes/chanop"; /* +o */
loadmodule "chanmodes/halfop"; /* +h */
loadmodule "chanmodes/voice"; /* +v */
loadmodule "chanmodes/key"; /* +k */
loadmodule "chanmodes/limit"; /* +l */
loadmodule "chanmodes/inviteonly"; /* +i */
loadmodule "chanmodes/secret"; /* +s */
loadmodule "chanmodes/private"; /* +p */
loadmodule "chanmodes/moderated"; /* +m */
loadmodule "chanmodes/noexternalmsgs"; /* +n */
loadmodule "chanmodes/topiclimit"; /* +t */
loadmodule "chanmodes/floodprot"; /* +f */
loadmodule "chanmodes/nocolor"; /* +c */
loadmodule "chanmodes/noctcp"; /* +C */
loadmodule "chanmodes/stripcolor"; /* +S */
loadmodule "chanmodes/isregistered"; /* +r */
loadmodule "chanmodes/issecure"; /* +Z */
loadmodule "chanmodes/permanent"; /* +P */
loadmodule "chanmodes/link"; /* +L */
@@ -159,9 +188,11 @@ loadmodule "chanmodes/nonickchange"; /* +N */
loadmodule "chanmodes/nokick"; /* +Q */
loadmodule "chanmodes/regonlyspeak"; /* +M */
loadmodule "chanmodes/secureonly"; /* +z */
loadmodule "chanmodes/history"; /* +H */
/*** User modes ***/
loadmodule "usermodes/wallops"; /* +w (listen to /WALLOPS messages) */
loadmodule "usermodes/bot"; /* +B (mark yourself as a bot) */
loadmodule "usermodes/servicebot"; /* +S (service bot) */
loadmodule "usermodes/noctcp"; /* +T (block CTCP's) */
@@ -170,41 +201,139 @@ loadmodule "usermodes/showwhois"; /* +W (show if someone does /WHOIS) */
loadmodule "usermodes/privacy"; /* +p (privacy, hide channels in /WHOIS) */
loadmodule "usermodes/nokick"; /* +q (unkickable oper) */
loadmodule "usermodes/regonlymsg"; /* +R (only registered users may private message you) */
loadmodule "usermodes/secureonlymsg"; /* +Z (only SSL/TLS users may private message you) */
loadmodule "usermodes/secureonlymsg"; /* +Z (only TLS users may private message you) */
loadmodule "usermodes/privdeaf"; /* +D (don't let other user PM you) */
/*** Server notice masks */
loadmodule "snomasks/dccreject"; /* +D (rejected DCC's) */
/*** Extended Bans ***/
loadmodule "extbans/join"; /* +b ~j (prevent only joins) */
loadmodule "extbans/quiet"; /* +b ~q (prevent only messaging) */
loadmodule "extbans/nickchange"; /* +b ~n (prevent only nick changes) */
loadmodule "extbans/realname"; /* +b ~r (ban by real name) */
loadmodule "extbans/regnick"; /* +b ~R (ban/exempt if using registered nick) */
loadmodule "extbans/account"; /* +b ~a (ban/exempt if logged in with services account) */
loadmodule "extbans/inchannel"; /* +b ~c (ban/exempt if in channel) */
loadmodule "extbans/operclass"; /* +b ~O (ban/exempt by operclass) */
loadmodule "extbans/certfp"; /* +b ~S (ban/exempt by certfp) */
loadmodule "extbans/textban"; /* +b ~T (censor or block text) */
loadmodule "extbans/msgbypass"; /* +e ~m (bypass message restrictions) */
loadmodule "extbans/timedban"; /* +b ~t (timed bans / temporary bans) */
loadmodule "extbans/join"; /* +b ~join (old ~j mode, prevent only joins) */
loadmodule "extbans/quiet"; /* +b ~quiet (old ~q mode, prevent only messaging) */
loadmodule "extbans/nickchange"; /* +b ~nickchange (old ~n mode, prevent only nick changes) */
loadmodule "extbans/realname"; /* +b ~realname (old ~r mode, ban by real name) */
loadmodule "extbans/account"; /* +b ~account (old ~a mode, ban/exempt if logged in with services account) */
loadmodule "extbans/inchannel"; /* +b ~channel (old, ~c mode, ban/exempt if in channel) */
loadmodule "extbans/operclass"; /* +b ~operclass (old ~O mode, ban/exempt by operclass) */
loadmodule "extbans/certfp"; /* +b ~certfp (old ~S mode, ban/exempt by certfp) */
loadmodule "extbans/textban"; /* +b ~text (old ~T mode, censor or block text) */
loadmodule "extbans/timedban"; /* +b ~time (old ~t mode, timed bans / temporary bans) */
loadmodule "extbans/partmsg"; /* +b ~partmsg (old ~p mode, hide part/quit message) */
loadmodule "extbans/securitygroup"; /* +b ~security-group (old ~G mode, security group) */
loadmodule "extbans/country"; /* +b ~country (country via geoip) */
loadmodule "extbans/msgbypass"; /* +e ~msgbypass (old ~m mode, bypass message restrictions) */
loadmodule "extbans/flood"; /* +e ~flood (flood exemption for chanmode +f/+F) */
loadmodule "extbans/asn"; /* +b ~asn (ASN via geoip) */
loadmodule "extbans/inherit"; /* +b ~inherit (inherit bans from another channel) */
/*** CAP modules ***/
loadmodule "cap/sts"; /* strict transport policy (set::ssl::sts-policy) */
loadmodule "cap/plaintext-policy"; /* plaintext-policy announce */
loadmodule "cap/link-security"; /* link-security announce */
/*** IRCv3 extensions ***/
loadmodule "account-notify"; /* send ACCOUNT message upon services account login */
loadmodule "message-tags"; /* add tags to messages, required for various IRCv3 features */
loadmodule "batch"; /* also required for several IRCv3 features */
loadmodule "server-time"; /* adds server timestamp to various messages */
loadmodule "message-ids"; /* adds unique msgid to various messages */
loadmodule "account-tag"; /* adds services account information to messages */
loadmodule "echo-message"; /* shows clients if their messages are altered/filtered */
loadmodule "labeled-response"; /* correlate requests and responses easily */
loadmodule "bot-tag"; /* indicate the message comes from a bot (draft/bot) */
loadmodule "typing-indicator"; /* typing indicator in PM and channels (+typing) */
loadmodule "channel-context";
loadmodule "reply-tag"; /* indicate to which message you are responding (+draft/reply) */
loadmodule "clienttagdeny"; /* informs clients about supported client-only message tags */
loadmodule "sts"; /* strict transport policy (set::tls::sts-policy) */
loadmodule "link-security"; /* link-security announce */
loadmodule "plaintext-policy"; /* plaintext-policy announce */
loadmodule "chathistory"; /* CHATHISTORY client command, 005 and a CAP (draft) */
loadmodule "monitor"; /* MONITOR command with functionality similar to WATCH */
loadmodule "extended-monitor"; /* add away status, gecos and userhost changes to MONITOR (draft) */
loadmodule "standard-replies"; /* Standard Replies */
loadmodule "no-implicit-names"; /* Opt out of receiving implicit NAMES when joining a channel */
loadmodule "extended-isupport"; /* draft/extended-isupport */
loadmodule "multiline"; /* draft/multiline */
/*** RPC modules ***/
// There's a JSON-RPC interface that can be used to communicate with UnrealIRCd
// outside of IRC. See https://www.unrealircd.org/docs/JSON-RPC for more info.
// Or, more technical, for a list of all JSON-RPC Methods, have a look at
// https://www.unrealircd.org/docs/JSON-RPC:Technical_documentation
// (Don't just look at the list of rpc/* modules below, occasionaly some rpc
// functionality is together in a regular module which has no rpc/* prefix)
//
// By loading the following modules, we enable RRPC for intra-server JSON-RPC,
// so calls like modules.list work properly accross the network. It DOES NOT
// enable the webserver, nor does it listen on any RPC socket. For that, you
// need to include "conf/rpc.modules.default.conf";
loadmodule "rpc/rpc";
loadmodule "rpc/stats";
loadmodule "rpc/user";
loadmodule "rpc/server";
loadmodule "rpc/channel";
loadmodule "rpc/server_ban";
loadmodule "rpc/server_ban_exception";
loadmodule "rpc/name_ban";
loadmodule "rpc/spamfilter";
loadmodule "rpc/log";
loadmodule "rpc/whowas";
loadmodule "rpc/message";
loadmodule "rpc/security_group";
/*** Other ***/
// These are modules that don't fit in any of the previous sections
loadmodule "certfp"; /* SSL certificate fingerprint in /WHOIS (& more) */
loadmodule "ssl_antidos"; /* prevent SSL DoS (renegotiate floods) */
loadmodule "m_nopost"; /* Block POST commands (Firefox XPS IRC Attack) */
loadmodule "ident_lookup"; /* Ident lookups if set::options::identd-check is set*/
loadmodule "certfp"; /* TLS certificate fingerprint in /WHOIS (& more) */
loadmodule "tls_cipher"; /* Store and retrieve TLS cipher of local and remote clients */
loadmodule "tls_antidos"; /* prevent TLS DoS (renegotiate floods) */
loadmodule "connect-flood"; /* throttling against connection flooding */
loadmodule "max-unknown-connections-per-ip"; /* limit number of connections in 'unknown state' */
loadmodule "webirc"; /* WEBIRC command. See webirc block. */
loadmodule "blacklist"; /* Blacklist support (DNSBL). See blacklist block. */
loadmodule "jointhrottle"; /* set::anti-flood::join-flood (previously chanmode +j) */
loadmodule "charsys"; /* Provides set::allowed-nickchars (must always be loaded!) */
loadmodule "authprompt"; /* Authentication prompt, see set::authentication-prompt */
loadmodule "history_backend_mem"; /* History storage backend (used by chanmodes/history) */
loadmodule "tkldb"; /* Write TKLines to .db file */
loadmodule "channeldb"; /* Write channel settings to .db file (+P channels only) */
loadmodule "rmtkl"; /* Easily remove *-Lines in bulk with /RMTKL */
loadmodule "restrict-commands"; /* Provides set::restrict-commands settings */
loadmodule "reputation"; /* used by Connthrottle and others, see next */
loadmodule "connthrottle"; /* see https://www.unrealircd.org/docs/Connthrottle */
loadmodule "userip-tag"; /* unrealircd.org/userip tag for ircops (IP address) */
loadmodule "userhost-tag"; /* unrealircd.org/userhost tag for ircops (real host) */
loadmodule "geoip-tag"; /* unrealircd.org/geoip tag for ircops (country) */
loadmodule "json-log-tag"; /* unrealircd.org/json-log tag and CAP for ircops */
loadmodule "issued-by-tag"; /* unrealircd.org/issued-by tag for servers and ircops */
loadmodule "real-quit-reason"; /* unrealircd.org/real-quit-reason for servers only */
loadmodule "targetfloodprot"; /* set::anti-flood::target-flood protection */
loadmodule "watch-backend"; /* used by watch and other modules */
loadmodule "geoip_base"; /* needed for ALL geoip functions */
loadmodule "websocket_common"; /* helper functions for websocket (internal) */
loadmodule "spamreport"; /* Spam reporting to a blacklist */
loadmodule "crule"; /* Rules in spamfilter::rule and deny link::rule */
loadmodule "maxperip"; /* allow::maxperip restrictions */
loadmodule "utf8functions"; /* Various UTF8 helper functions */
loadmodule "utf8only"; /* UTF8ONLY via set::utf8-only */
loadmodule "portinfo"; /* storing local_port and server_port of users */
loadmodule "isupport"; /* ISUPPORT / numeric 005 handling */
@if !defined(NO_DEFAULT_GEOIP)
@if $GEOIP_ENGINE != "none"
loadmodule "$GEOIP_ENGINE";
@endif
@if module-loaded("geoip_classic")
set {
geoip-classic {
ipv4-database "https://geoip.unrealircd.org/classic/GeoIP.dat" { url-refresh 14d; url-fail warn; }
ipv6-database "https://geoip.unrealircd.org/classic/GeoIPv6.dat" { url-refresh 14d; url-fail warn; }
asn-ipv4-database "https://geoip.unrealircd.org/classic/GeoIPASNum.dat" { url-refresh 14d; url-fail warn; }
asn-ipv6-database "https://geoip.unrealircd.org/classic/GeoIPASNumv6.dat" { url-refresh 14d; url-fail warn; }
}
}
@endif
@if module-loaded("geoip_mmdb")
set {
geoip-mmdb {
database "https://geoip.unrealircd.org/mmdb/GeoIP.mmdb" { url-refresh 14d; url-fail warn; }
asn-database "https://geoip.unrealircd.org/mmdb/GeoIP-ASN.mmdb" { url-refresh 14d; url-fail warn; }
}
}
@endif
@endif
+159 -57
View File
@@ -15,12 +15,14 @@
// This add the /IRCOPS command: A more visual way for users
// to see which IRCOps are online.
loadmodule "m_ircops";
loadmodule "ircops";
// This adds the /STAFF command: This command simply displays
// a text file that you can configure here:
loadmodule "m_staff";
set { staff-file "network.staff"; };
loadmodule "staff";
@if module-loaded("staff")
set { staff-file "network.staff"; }
@endif
/*** Channel modes ***/
@@ -36,7 +38,8 @@ loadmodule "nocodes";
// The hideserver module will hide /MAP and /LINKS to regular users.
// It does not truly enhance security as server names can still be
// seen at other places.
loadmodule "hideserver";
// Comment out the following line to enable this:
// loadmodule "hideserver";
// The antirandom module will kill or *line users that have a nick,
// ident and/or realname that is considered "random".
@@ -46,28 +49,29 @@ loadmodule "hideserver";
// the module may consider a sequence of characters "random" even though
// it is a perfectly pronounceable word in your language.
loadmodule "antirandom";
@if module-loaded("antirandom")
set {
antirandom {
/* THRESHOLD:
* This is pretty much the most important setting of all.
* For every randomly looking ident the user gets a certain amount of
* 'points', if this value reaches 'threshold' then the appropriate
* This is the most important setting of all.
* For every randomly looking item the user gets a certain amount of
* 'points'. If the points reach the 'threshold' then the appropriate
* action is taken (killed, *lined, see later on).
* lower = more randomly looking users will be catched (but also more
* innocent users)
* higher = less chance of innocent users getting killed, but also less
* chance on bots getting catched.
* lower = more randomly looking users will be caught
* (but also more innocent users).
* higher = less chance of innocent users getting killed
* (but also less chance on bots getting caught).
* <2: DON'T!!
* 4: Works good, probably a few more innocent kills but if you got
* quite a bot problem then this might be a useful setting.
* 4: Works good, probably a few more innocent kills, but if you have a
* big problem with drone attacks then this might be a good setting.
* 5: Works well with few innocent kills, probably good to begin with.
* 6: If you want to be a tad more careful
* >6: For the paranoid. Module can still be quite effective, though :)
*/
threshold 7;
threshold 6;
/* BAN-ACTION:
* Action to take whenever the user is catched as random, options:
* Action to take whenever the user is caught as random, options:
* warn, kill, gline, gzline, kline, zline, shun, tempshun
*/
ban-action kill;
@@ -82,66 +86,164 @@ set {
ban-time 4h;
/* BAN-REASON:
* The ban (or kill) reason to use.
* You might want to put in an entry to a FAQ or an email address
* where users can mail if they have been catched and don't know what to do.
* NOTE: One of the various reasons that ""innocent users"" are catched is
* if they just randomly type in info for their nick, ident, or realname.
* The ban or kill reason to use.
* Tip: you might want to put in an entry to a FAQ or an email address where
* users can mail if they have been caught and don't know what to do.
* NOTE: One of the various reasons that "innocent users" are blocked is when
* they randomly type in info for their nick, ident, or realname.
*/
ban-reason "You look like a bot. Be sure to fill in your nick/ident/realname properly.";
/* CONVERT-TO-LOWERCASE:
* Convert nicks, idents, and realnames to lowercase before doing random checks?
* This has not been tested extensively for false positives, but might be (very)
* helpful to catch GnStA5FYhiTH51TUkf style random nicks as random.
* Useful to catch GnStA5FYhiTH51TUkf style random nicks as random.
* Enabled by default.
*/
convert-to-lowercase yes;
/* FULLSTATUS-ON-LOAD:
* If enabled, then upon loading it will check all users that are currently
* connected and give a status report about who it would have killed.
* Note that it doesn't actually kill any currently connected users, it is for
* informative purposes only.
* This can be (very) useful if you use the module for the first time.
* But you probably want to disable it after a while, since once the module
* is actively dealing with randomly looking persons, it shouldn't report any
* users anymore on load and then this check only eats useless CPU on /REHASH.
* Enabled by default.
*/
fullstatus-on-load yes;
/* SHOW-FAILEDCONNECTS:
* This will send out a notice whenever a randomly looking user has been catched
* during connecting. Obviously this can be pretty noisy.
* This will send out a notice whenever a randomly looking user has been caught
* during connecting. This can be pretty noisy.
* Especially recommended to enable during the first few days you use this module.
*/
show-failedconnects yes;
/* EXCEPT-HOSTS:
* Hostmasks on this list are matched against the IP and hostname of the connecting
* user. If it matches then we do not check if the nick/ident/realname is random.
* NOTE: Use the REAL host or IP here, not any cloaked hosts!
/* EXCEPT:
* Don't do antirandom checks for these users.
*/
except-hosts {
mask 192.168.*;
mask 127.*;
};
except {
/* Exempt WEBIRC gateways because these frequently
* cause false positives. So the default is yes.
*/
webirc yes;
/* EXCEPT-WEBIRC:
* This will make antirandom not check connections from WEBIRC gateways.
* ( see https://www.unrealircd.org/docs/WebIRC_block )
* It seems WEBIRC connections frequently cause false positives so the
* default is 'yes'.
*/
except-webirc yes;
};
};
/* Exempt LAN users */
ip { 192.168.*; 127.*; }
// Or by hostname:
//mask { *.example.net; }
/* You can also exempt security groups: */
// security-group known-users;
/* For all options, see https://www.unrealircd.org/docs/Mask_item */
}
}
}
@endif
// This module will send a HTTP 301 redirect to any client which sends
// a HTTP request to us. This is commented out by default:
//loadmodule "webredir";
//set {
// webredir {
// url 'https://...';
// }
//}
// Load the webserver module, needed for websocket (see next)
loadmodule "webserver";
// This adds websocket support. For more information, see:
// https://www.unrealircd.org/docs/WebSocket_support
loadmodule "websocket";
// This adds support for WHOX
// This is currently experimental!
loadmodule "m_whox";
// This module will detect and stop spam containing characters of
// mixed "scripts", where (for example) some characters are in
// Latin script and other characters are in Cyrillic script.
loadmodule "antimixedutf8";
@if module-loaded("antimixedutf8")
set {
antimixedutf8 {
/* Take action at this 'score' (lower = more sensitive)
*
* A score of 2 or 3 will catch a lot but also
* catch innocent users who are not using a pure
* Latin script, such as Russian people who
* commonly use a mix of Latin and Cyrillic.
*
* A score of 8 is a safe default.
*/
score 8;
/* Action to take, see:
* https://www.unrealircd.org/docs/Actions
*/
ban-action block;
/* Block/kill/ban reason (sent to user) */
ban-reason "Mixed character spam";
/* Duration of ban (does not apply to block/kill) */
ban-time 4h; // For other types
/* Except these users - see
* https://www.unrealircd.org/docs/Mask_item for options.
*/
//commented out by default:
//except {
// security-group known-users;
// webirc yes;
//}
}
}
@endif
// This module will add support for /EXTJWT command,
// used for generating authorization tokens for external services.
// The feature is based on a specification described here:
// https://github.com/ircv3/ircv3-specifications/pull/341
// Please create your configuration block based on the example below.
// Do not uncomment the example.
//
// Supported JWT methods: NONE (not recommended), HS256, HS384, HS512,
// ES256, ES384, ES512, RS256, RS384, RS512
// Method NONE does not use any cryptography to sign the token. This
// is only useful for checking whether the service works when initially
// setting it up. HS* methods use a password that must be shared with
// the verification service. ES* and RS* methods use public-private key
// pairs, so the verification service, knowing your public key, can't
// generate own valid tokens.
//
// For methods requiring a key, place it in your "conf" directory.
//
// Use following shell commands to create keys if needed:
// To generate RS256, RS384 or RS512 private key (for UnrealIRCd):
// openssl genrsa -out privkey.pem 4096
// To generate matching public key (for the external service to verify
// the token):
// openssl rsa -in privkey.pem -pubout > pubkey.pem
//
// To generate ES256, ES384 or ES512 private key (for UnrealIRCd):
// openssl ecparam -genkey -name secp521r1 -noout -out privkey.pem
// To generate matching public key (for the external service to verify
// the token):
// openssl ec -in privkey.pem -pubout -out pubkey.pem
//
// In all cases, substitute your preferred file names for "pubkey.pem"
// and "privkey.pem".
//loadmodule "extjwt";
//extjwt {
// /* The configuration below is used when no service name is
// * provided by the user command.
// */
// method "HS256"; /* described above */
// expire-after 30; /* seconds */
// secret "somepassword"; /* required for HS* methods */
// /* Optional service blocks for generating different tokens.
// * Add as many of these as you need.
// */
// service "service1" {
// method "ES512";
// //secret "anotherpassword"; /* required for HS* method */
// key "es512.pem"; /* required for ES* and RS* methods */
// //verify-url 'https://example.com/verify/?t=%s'; /* URL for your validation service - optional; use single quotes here! */
// expire-after 60; /* seconds, will be inherited from main if not given */
// };
// /* Another service block. */
// service "service2" {
// method "RS256";
// key "RS256.pem";
// };
//};
+21
View File
@@ -0,0 +1,21 @@
#
# This file contains the list of repositories that are used
# by the './unrealircd module' command.
# Note that 3rd party modules are NOT written by the UnrealIRCd team.
# Use such modules at your own risk. In case of problems, contact
# the module author. For more information, see:
# https://www.unrealircd.org/docs/Module_manager
#
#
# This is the unrealircd-contrib repository which is added by default in
# UnrealIRCd to make it easy for users to install 3rd party modules.
# If you are a module coder and want to add your module to this repository
# as well, then read the rules and procedure at:
# https://www.unrealircd.org/docs/Rules_for_3rd_party_modules_in_unrealircd-contrib
#
https://modules.unrealircd.org/modules.list
# You can add more repositories here. However, do note that all
# URLs MUST start with https://
+76 -96
View File
@@ -6,159 +6,139 @@
*
* The operclass block is extensively documented at:
* https://www.unrealircd.org/docs/Operclass_block
* And the permissions itself (operclass::permissions) at:
* https://www.unrealircd.org/docs/Operclass_permissions
*
* DO NOT EDIT THIS FILE! IT WILL BE OVERWRITTEN DURING NEXT UPGRADE!!
* Instead, if you want to change the privileges in an operclass block,
* Instead, if you want to change the permissions in an operclass block,
* you should copy the definition, or this entire file, to either your
* unrealircd.conf or some other file (eg: operclass.conf) that you
* you will include from your unrealircd.conf.
* will include from your unrealircd.conf.
* Then edit it, and while doing so don't forget to change the name
* of your custom operclass block(s), so operclass <name>.
*/
/* Local IRC Operator */
operclass locop {
privileges {
privacy;
permissions {
chat;
channel;
client;
channel { operonly; override { flood; } }
client { see; }
immune;
self;
notice { local; };
server { opermotd; info; close; module; dns; rehash; };
route { local; };
kill { local; };
tkl {
self { getbaddcc; opermodes; set; }
server { opermotd; info; close; module; dns; rehash { local; } }
route { local; }
kill { local; }
server-ban {
kline;
zline { local; };
};
trace { local; invisible-users; };
map;
};
};
zline { local; }
}
}
}
/* Global IRC Operator */
operclass globop {
privileges {
privacy;
permissions {
chat;
channel;
channel { operonly; see; override { flood; } }
client;
immune;
notice;
self;
server { opermotd; info; close; remote; module; dns; rehash; };
self { getbaddcc; opermodes; set; }
server { opermotd; info; close; module; dns; rehash;
remote; tsctl { view; } }
route;
kill;
tkl { shun; zline; kline; gline; };
trace;
who;
override { see; };
map;
};
};
server-ban { dccdeny; shun; zline; kline; gline; }
}
}
/* Server administrator */
operclass admin {
privileges {
privacy;
permissions {
chat;
channel;
channel { operonly; see; override { flood; } }
client;
immune;
notice;
self;
server { opermotd; info; close; remote; module; dns; addline; rehash; description; addmotd; addomotd; tsctl; };
self { getbaddcc; opermodes; set; }
server { opermotd; info; close; module; dns; rehash;
remote; description; addmotd;
addomotd; tsctl { view; } }
route;
kill;
tkl { shun; zline; kline; gline; };
spamfilter;
trace;
who;
override { see; };
map;
};
};
server-ban;
}
}
/* Services Admin */
operclass services-admin {
privileges {
privacy;
permissions {
chat;
channel;
channel { operonly; see; override { flood; } }
client;
immune;
notice;
self;
server { opermotd; info; close; remote; module; dns; addline; rehash; description; addmotd; addomotd; tsctl; };
self { getbaddcc; opermodes; set; }
server { opermotd; info; close; module; dns; rehash;
remote; description; addmotd;
addomotd; tsctl { view; } }
route;
kill;
tkl { shun; zline; kline; gline; };
spamfilter;
trace;
who;
sajoin;
sapart;
samode;
override { see; };
};
};
server-ban;
sacmd;
services;
}
}
/* Network Administrator */
operclass netadmin {
privileges {
privacy;
permissions {
chat;
channel;
channel { operonly; see; override { flood; } }
client;
immune;
notice;
self;
server { opermotd; info; close; remote; module; dns; addline; rehash; description; addmotd; addomotd; tsctl; };
kill;
tkl { shun; zline; kline; gline; };
self { getbaddcc; opermodes; set; }
server { opermotd; info; close; module; dns; rehash;
remote; description; addmotd;
addomotd; tsctl; }
route;
spamfilter;
trace;
who;
sajoin;
sapart;
samode;
servicebot { deop; kill; };
override { see; };
map;
};
};
kill;
server-ban;
sacmd;
services;
}
}
/* Same as 'globop' operclass, but with OperOverride capabilities added */
operclass globop-with-override {
parent globop;
privileges {
override;
};
};
permissions {
channel { operonly; see; override; }
self { getbaddcc; opermodes; set; unkickablemode; }
}
}
/* Same as 'admin' operclass, but with OperOverride capabilities added */
operclass admin-with-override {
parent admin;
privileges {
override;
};
};
permissions {
channel { operonly; see; override; }
self { getbaddcc; opermodes; set; unkickablemode; }
}
}
/* Same as 'services-admin' operclass, but with OperOverride capabilities added */
operclass services-admin-with-override {
parent services-admin;
privileges {
override;
};
};
permissions {
channel { operonly; see; override; }
self { getbaddcc; opermodes; set; unkickablemode; }
}
}
/* Same as 'netadmin' operclass, but with OperOverride capabilities added */
operclass netadmin-with-override {
parent netadmin;
privileges {
override;
};
};
permissions {
channel { operonly; see; override; }
self { getbaddcc; opermodes; set; unkickablemode; }
}
}
+39
View File
@@ -0,0 +1,39 @@
/* This file defines a number of default rpc-class blocks which you can
* use in your rpc-user blocks (via rpc-user::rpc-class).
*
* This file is normally included via rpc.modules.default.conf, or you
* can do so from your unrealircd.conf through:
* include "rpc-class.default.conf";
*
* The rpc-class block is documented at:
* https://www.unrealircd.org/docs/Rpc-class_block
*
* DO NOT EDIT THIS FILE! IT WILL BE OVERWRITTEN DURING NEXT UPGRADE!!
* DO NOT EDIT THIS FILE! IT WILL BE OVERWRITTEN DURING NEXT UPGRADE!!
* DO NOT EDIT THIS FILE! IT WILL BE OVERWRITTEN DURING NEXT UPGRADE!!
* If you want to tweak rpc-class { } blocks, simply define your own
* and optionally use 'parent read-only' or the like if you want to inherit.
* Do not edit the build-in rpc-classes from below ('full' and 'read-only').
*/
rpc-class full {
permissions {
all;
}
}
rpc-class read-only {
permissions {
rpc;
stats;
log;
user { list; get; }
whowas { get; }
server { list; get; }
channel { list; get; }
server_ban { list; get; }
server_ban_exception { list; get; }
spamfilter { list; get; }
name_ban { list; get; }
}
}
+65
View File
@@ -0,0 +1,65 @@
/* This file will load all UnrealIRCd modules needed for JSON-RPC,
* this allows remote (web) endpoints to query and control UnrealIRCd.
* To actually use it, you would also need one or more rpc-user blocks
* and one or more special listen blocks, see the documentation at
* https://www.unrealircd.org/docs/JSON-RPC.
*
* You can include this file from your unrealircd.conf, using:
* include "rpc.modules.default.conf";
*
* DO NOT EDIT THIS FILE! IT WILL BE OVERWRITTEN DURING NEXT UPGRADE!!
* If you want to customize the modules to load you have two options:
* 1) Keep the include for rpc.modules.default.conf as usual and make use
* of blacklist-module "xyz"; to selectively disable modules.
* See https://www.unrealircd.org/docs/Blacklist-module_directive
* 2) OR, make a copy of this file (eg: name it rpc.modules.custom.conf)
* and edit it. Then include that file from your unrealircd.conf
* instead of this one.
* The downside of option #2 is that you will need to track changes
* in the original rpc.modules.default.conf with each new UnrealIRCd
* release to make sure you don't miss any new functionality (as new
* important modules may be added you need to add them to your conf).
* You don't have this problem with option #1.
*/
/* The RPC modules are loaded in modules.default.conf nowadays,
* so we only need to load the web server and add the default
* local RPC UNIX socket socket.
*/
/* These are required for RPC to work */
loadmodule "webserver";
loadmodule "websocket_common";
/* And a RPC listen socket */
@if !defined($NO_DEFAULT_RPC_SOCKET)
listen {
file "rpc.socket";
options { rpc; }
}
@endif
/* And a memory log block */
@if !defined($NO_DEFAULT_LOG_MEMORY_BLOCK)
log {
source {
all;
!debug;
!join.LOCAL_CLIENT_JOIN;
!join.REMOTE_CLIENT_JOIN;
!part.LOCAL_CLIENT_PART;
!part.REMOTE_CLIENT_PART;
!kick.LOCAL_CLIENT_KICK;
!kick.REMOTE_CLIENT_KICK;
}
destination {
memory {
max-lines 1000;
max-time 7d;
}
}
}
@endif
/* Also load the default rpc-class { } blocks */
include "rpc-class.default.conf";
+270
View File
@@ -0,0 +1,270 @@
/* Default snomask configuration.
*
* DO NOT EDIT THIS FILE! IT WILL BE OVERWRITTEN DURING NEXT UPGRADE!!
* If you want to customize it, make a copy of this file
* (eg: name it snomasks.custom.conf) and edit it.
* Then include that file from your unrealircd.conf instead of this one.
*/
/* Server bans snomask - 'b' */
log {
source {
tkl.BAN_REALNAME;
tkl.TKL_ADD;
tkl.TKL_DEL;
tkl.TKL_ADD_TEMPSHUN;
tkl.TKL_DEL_TEMPSHUN;
tkl.TKL_EXPIRE;
tkl.RMTKL_COMMAND;
}
destination {
snomask b;
}
}
/* Blacklist snomask: 'B' */
log {
source {
blacklist;
}
destination {
snomask B;
}
}
/* Local client connects snomask - 'c' */
log {
source {
connect.LOCAL_CLIENT_CONNECT;
connect.LOCAL_CLIENT_DISCONNECT;
}
destination {
snomask c;
}
}
/* Remote client connects snomask - 'C' */
log {
source {
connect.REMOTE_CLIENT_CONNECT;
connect.REMOTE_CLIENT_DISCONNECT;
}
destination {
snomask C;
}
}
/* DCC rejections snomask - 'd' */
log {
source {
dcc;
}
destination {
snomask d;
}
}
/* Debug snomask (not recommended) - 'D' */
log {
source {
debug;
}
destination {
snomask D;
}
}
/* Floods snomask - 'f' */
log {
source {
flood;
}
destination {
snomask f;
}
}
/* Join, parts, kicks - 'j' */
log {
source {
join.LOCAL_CLIENT_JOIN;
join.REMOTE_CLIENT_JOIN;
part.LOCAL_CLIENT_PART;
part.REMOTE_CLIENT_PART;
kick.LOCAL_CLIENT_KICK;
kick.REMOTE_CLIENT_KICK;
}
destination {
snomask j;
}
}
/* Kill snomask */
log {
source {
kill;
}
destination {
snomask k;
}
}
/* Local nick changes snomask - 'n' */
log {
source {
nick.LOCAL_NICK_CHANGE;
}
destination {
snomask n;
}
}
/* Remote nick changes snomask - 'N' */
log {
source {
nick.REMOTE_NICK_CHANGE;
}
destination {
snomask N;
}
}
/* Deny nick (QLINE) rejections snomask - 'q' */
log {
source {
nick.QLINE_NICK_LOCAL_ATTEMPT;
nick.QLINE_NICK_REMOTE;
}
destination {
snomask q;
}
}
/* Spamfilter hits snomask - 'S' */
log {
source {
tkl.SPAMFILTER_MATCH;
}
destination {
snomask S;
}
}
/* IRCOp overriding in channels (OperOverride) - 'o' */
log {
source {
operoverride;
}
destination {
snomask o;
}
}
/* IRCOp changing user properties or forcing users to do things - 'O' */
log {
source {
chgcmds;
sacmds;
}
destination {
snomask O;
}
}
/* VHOST usage - 'v' */
log {
source {
vhost;
}
destination {
snomask v;
}
}
/* JSON-RPC usage - 'R' */
log {
source {
rpc;
}
destination {
snomask R;
}
}
/* Spam reports - 'r' */
log {
source {
spamreport;
}
destination {
snomask r;
}
}
/* Connection-limit rejections (maxperip / connthrottle) - 'x' */
log {
source {
connthrottle.CONNTHROTTLE_IPV6_LIMIT;
maxperip.MAXPERIP_LIMIT;
}
destination {
snomask x;
}
}
/* Snomask s (server notices) - the "catch all" snomask for all other things */
log {
source {
link;
oper;
!debug;
nomatch;
}
destination {
snomask s;
}
}
/* These log sources are sent to all servers (globally).
* These are generally two categories:
* 1) Things that affect the network as a whole, eg linking
* 2) Things that otherwise cannot be logged by a remote server
* that may interest ircops. Eg: a spamfilter match,
* since that would otherwise not be propagated.
*/
log {
source {
/* All link messages affect the network so
* these should be global. Except for the
* link connecting... and timeout while
* connecting.. messages, which can be noisy.
*/
link;
!link.LINK_CONNECTING;
!link.LINK_CONNECT_TIMEOUT;
!link.SERVER_LINKED_REMOTE;
!link.SERVER_LINKED;
/* All oper up/downs */
oper;
/* Flood messages, important to keep an eye on, network-wide */
flood;
/* TEMPSHUN: these are otherwise missing for snomask 'b' */
tkl.TKL_ADD_TEMPSHUN;
tkl.TKL_DEL_TEMPSHUN;
/* Spamfilter matches: needed for snomask 'S' */
tkl.SPAMFILTER_MATCH;
/* Critical issue: */
tls.TLS_CERT_EXPIRING;
/* SAMODE: needed for snomask 'o' */
samode.SAMODE_COMMAND;
/* Blacklist hits */
blacklist;
/* Central blocklist hits and errors */
central-blocklist;
/* Never any debug messages */
!debug;
}
destination {
remote;
}
}
+128 -206
View File
@@ -1,232 +1,154 @@
/*
* This an example spamfilter file, it contains several
* real and useful spamfilters. This should give you an
* idea of how powerful spamfilter can be in real-life
* situations.
* This configuration file contains example spamfilter rules.
* They are real rules that were useful a long time ago.
* Since 2005 these rules are no longer maintained.
* The main purpose nowadays is to serve as an example
* to give you an idea of how powerful spamfilters can
* be in real-life situations.
*
* $Id$
* Documentation on spamfilter is available at:
* https://www.unrealircd.org/docs/Spamfilter
*/
/* Guidelines on the 'action' field:
* As a general rule we use 'action block' for any newly added
* spamfilters at first, later on (after knowing about false
* positives) we might change some to viruschan/kill/gline/etc..
/* General notes:
* 1) We use match 'xyz' instead of match "xyz". When using single quotes
* you don't risk it being interpreted as an URL for remote includes.
* 2) If you want to use a \ in a spamfilter, or in fact anywhere in the
* configuration file, then you need to escape this to \\ instead.
*/
/* First some spamfilters with match-type 'simple'.
* The only matchers available are * and ?
* PRO's: very fast, easy matching: everyone can do this.
* CON's: limited ability to fine-tune spamfilters
*/
spamfilter {
match-type posix;
match "\x01DCC (SEND|RESUME)[ ]+\"(.+ ){20}";
target { private; channel; };
action kill;
reason "mIRC 6.0-6.11 exploit attempt";
};
spamfilter {
match-type posix;
match "\x01DCC (SEND|RESUME).{225}";
target { private; channel; };
action kill;
reason "Possible mIRC 6.12 exploit attempt";
};
spamfilter {
match-type posix;
match "Come watch me on my webcam and chat /w me :-\) http://.+:\d+/me\.mpg";
match-type simple;
match 'Come watch me on my webcam and chat /w me :-) http://*:*/me.mpg';
target private;
action gline;
reason "Infected by fyle trojan: see http://www.sophos.com/virusinfo/analyses/trojfylexa.html";
};
}
/* This signature uses a \ which has to escaped to \\ in the configuration file */
spamfilter {
match-type posix;
match "Speed up your mIRC DCC Transfer by up to 75%.*www\.freewebs\.com/mircupdate/mircspeedup\.exe";
target private;
action gline;
reason "Infected by mirseed trojan: see http://www.sophos.com/virusinfo/analyses/trojmirseeda.html";
};
spamfilter {
match-type posix;
match "^http://www\.angelfire\.com/[a-z0-9]+/[a-z0-9]+/[a-z_]+\.jpg <- .*!";
target private;
action block;
reason "Infected by fagot worm: see http://www.f-secure.com/v-descs/fagot.shtml";
};
spamfilter {
match-type posix;
match "^FREE PORN: http://free:porn@([0-9]{1,3}\.){3}[0-9]{1,3}:8180$";
target private;
action gline;
reason "Infected by aplore worm: see http://www.f-secure.com/v-descs/aplore.shtml";
};
spamfilter {
match-type posix;
match "^!login Wasszup!$";
target channel;
action gline;
reason "Attempting to login to a GTBot";
};
spamfilter {
match-type posix;
match "^!login grrrr yeah baby!$";
target channel;
action gline;
reason "Attempting to login to a GTBot";
};
spamfilter {
match-type posix;
match "^!packet ([0-9]{1,3}\.){3}[0-9]{1,3} [0-9]{1,15}";
target channel;
action gline;
reason "Attempting to use a GTBot";
};
spamfilter {
match-type posix;
match "^!icqpagebomb ([0-9]{1,15} ){2}.+";
target channel;
action gline;
reason "Attempting to use a GTBot";
};
spamfilter {
match-type posix;
match "^!pfast [0-9]{1,15} ([0-9]{1,3}\.){3}[0-9]{1,3} [0-9]{1,5}$";
target channel;
action gline;
reason "Attempting to use a GTBot";
};
spamfilter {
match-type posix;
match "^!portscan ([0-9]{1,3}\.){3}[0-9]{1,3} [0-9]{1,5} [0-9]{1,5}$";
target channel;
action gline;
reason "Attempting to use a GTBot";
};
spamfilter {
match-type posix;
match "^.u(dp)? ([0-9]{1,3}\.){3}[0-9]{1,3} [0-9]{1,15} [0-9]{1,15} [0-9]{1,15}( [0-9])*$";
target channel;
action gline;
reason "Attempting to use an SDBot";
};
spamfilter {
match-type posix;
match "^.syn ((([0-9]{1,3}\.){3}[0-9]{1,3})|([a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+\.[a-zA-Z0-9_.-]+)) [0-9]{1,5} [0-9]{1,15} [0-9]{1,15}";
target { channel; private; };
action gline;
reason "Attempting to use a SpyBot";
};
spamfilter {
match-type posix;
match "^porn! porno! http://.+\/sexo\.exe";
target private;
action gline;
reason "Infected by soex trojan: see http://www.trendmicro.com/vinfo/virusencyclo/default5.asp?VName=TROJ%5FSOEX.A";
};
spamfilter {
match-type posix;
match "(^wait a minute plz\. i am updating my site|.*my erotic video).*http://.+/erotic(a)?/myvideo\.exe$";
target private;
action gline;
reason "Infected by some trojan (erotica?)";
};
spamfilter {
match-type posix;
match "^STOP SPAM, USE THIS COMMAND: //write nospam \$decode\(.+\) \| \.load -rs nospam \| //mode \$me \+R$";
target private;
action gline;
reason "Infected by nkie worm: see http://www.trojaninfo.com/nkie/nkie.htm";
};
spamfilter {
match-type posix;
match "^FOR MATRIX 2 DOWNLOAD, USE THIS COMMAND: //write Matrix2 \$decode\(.+=,m\) \| \.load -rs Matrix2 \| //mode \$me \+R$";
target private;
action gline;
reason "Infected by nkie worm: see http://www.trojaninfo.com/nkie/nkie.htm";
};
spamfilter {
match-type posix;
match "^hey .* to get OPs use this hack in the chan but SHH! //\$decode\(.*,m\) \| \$decode\(.*,m\)$";
target private;
action gline;
reason "Infected by nkie worm: see http://www.trojaninfo.com/nkie/nkie.htm";
};
spamfilter {
match-type posix;
match ".*(http://jokes\.clubdepeche\.com|http://horny\.69sexy\.net|http://private\.a123sdsdssddddgfg\.com).*";
target private;
action gline;
reason "Infected by LOI trojan";
};
/* This is a 'general sig' which might have a tad more false positives, hence just 'block' is used */
spamfilter {
match-type posix;
match "C:\\WINNT\\system32\\[][0-9a-z_-{|}`]+\.zip";
match-type simple;
match 'C:\\WINNT\\system32\\*.zip';
target dcc;
action block;
reason "Infected by Gaggle worm?";
};
}
spamfilter {
match-type posix;
match "C:\\WINNT\\system32\\(notes|videos|xxx|ManualSeduccion|postal|hechizos|images|sex|avril)\.zip";
target dcc;
action dccblock;
reason "Infected by Gaggle worm";
};
spamfilter {
match-type posix;
match "http://.+\.lycos\..+/[iy]server[0-9]/[a-z]{4,11}\.(gif|jpg|avi|txt)";
target { private; quit; };
action block;
reason "Infected by Gaggle worm";
};
spamfilter {
match-type posix;
match "^Free porn pic.? and movies (www\.sexymovies\.da\.ru|www\.girlporn\.org)";
match-type simple;
match 'Speed up your mIRC DCC Transfer by up to 75%*www.freewebs.com/mircupdate/mircspeedup.exe';
target private;
action block;
reason "Unknown virus. Site causes Backdoor.Delf.lq infection";
};
action gline;
reason "Infected by mirseed trojan: see http://www.sophos.com/virusinfo/analyses/trojmirseeda.html";
}
spamfilter {
match-type posix;
match "^LOL! //echo -a \$\(\$decode\(.+,m\),[0-9]\)$";
target channel;
action block;
reason "$decode exploit";
};
match-type simple;
match 'STOP SPAM, USE THIS COMMAND: //write nospam $decode(*) | .load -rs nospam | //mode $me +R';
target private;
action gline;
reason "Infected by nkie worm: see http://www.trojaninfo.com/nkie/nkie.htm";
}
/*
spamfilter {
regex "//write \$decode\(.+\|.+load -rs";
target { private; channel; };
reason "Generic $decode exploit";
action block;
};
*/
/* Now spamfilters of type 'regex'.
* These use powerful regular expressions (Perl/PCRE style)
* You may have to learn more about "regex" first before you
* can use them. For example the dot ('.') has special meaning.
*/
/* This regex shows a pattern which requires 20 paramaters,
* such as "x x x x x x x x x x x x x x x x x x x x"
*/
spamfilter {
match-type posix;
match "^Want To Be An IRCOp\? Try This New Bug Type: //write \$decode\(.+=.?,m\) \| \.load -rs \$decode\(.+=.?,m\)$";
match-type regex;
match '\x01DCC (SEND|RESUME)[ ]+\"(.+ ){20}';
target { private; channel; }
action kill;
reason "mIRC 6.0-6.11 exploit attempt";
}
/* Similarly, this regex shows a pattern that matches
* against at least 225 characters in length.
*/
spamfilter {
match-type regex;
match '\x01DCC (SEND|RESUME).{225}';
target { private; channel; }
action kill;
reason "Possible mIRC 6.12 exploit attempt";
}
/* Earlier you saw an example of a $decode exploit which used
* match-type 'simple' and - indeed - the filter was quite simple.
* The following uses a regex with a similar example.
* Regular expressions are very powerful but here you can see
* that it actually complicates writing a filter quite a bit.
* With regex in this filter we need to escape the ( and all
* the dots, question marks, etc. if we want to match these
* characters in literal text.
*/
spamfilter {
match-type regex;
match '^Want To Be An IRCOp\? Try This New Bug Type: //write \$decode\(.+=.?,m\) \| \.load -rs \$decode\(.+=.?,m\)$';
target private;
action block;
reason "Spamming users with an mIRC trojan. Type '/unload -rs newb' to remove the trojan.";
};
}
spamfilter {
match-type regex;
match '^http://www\.angelfire\.com/[a-z0-9]+/[a-z0-9]+/[a-z_]+\.jpg <- .*!';
target private;
action block;
reason "Infected by fagot worm: see http://www.f-secure.com/v-descs/fagot.shtml";
}
/* This shows a regex which specifically matches an entire line by
* the use of ^ and $
*/
spamfilter {
match-type regex;
match '^!login Wasszup!$';
target channel;
action gline;
reason "Attempting to login to a GTBot";
}
/* An example of how to match against an IP address in text (IPv4 only) */
spamfilter {
match-type regex;
match '^!packet ([0-9]{1,3}\.){3}[0-9]{1,3} [0-9]{1,15}';
target channel;
action gline;
reason "Attempting to use a GTBot";
}
/* A slightly more complex example with a partial OR matcher (|) */
spamfilter {
match-type regex;
match '(^wait a minute plz\. i am updating my site|.*my erotic video).*http://.+/erotic(a)?/myvideo\.exe$';
target private;
action gline;
reason "Infected by some trojan (erotica?)";
}
/* In regex a \ is special and needs to be escaped to \\
* However in this configuration file, \ is also special and
* needs to be escaped to \\ as well.
* The result is that we need double escaping:
* To match a \ you need to write \\\\ in the configuration file.
*/
spamfilter {
match-type regex;
match 'C:\\\\WINNT\\\\system32\\\\(notes|videos|xxx|ManualSeduccion|postal|hechizos|images|sex|avril)\.zip';
target dcc;
action dccblock;
reason "Infected by Gaggle worm";
}
File diff suppressed because it is too large Load Diff
+2 -8
View File
@@ -1,12 +1,9 @@
# create RSA certs - Server
RANDFILE = ssl.rnd
[ req ]
default_bits = 4096
encrypt_key = yes
# Note: RSA bits is ignored, as we use ECC now
default_bits = 2048
distinguished_name = req_dn
x509_extensions = cert_type
[ req_dn ]
countryName = Country Name
@@ -28,6 +25,3 @@ organizationalUnitName_default = IRCd
0.commonName = Common Name (Full domain of your server)
1.commonName_value = localhost
[ cert_type ]
nsCertType = server
+4 -4
View File
@@ -18,14 +18,14 @@ by this server"
Currently UnrealIRCd supports several tokens that are included in numeric 005. A list of
all tokens, their respective value and a brief description are listed below.
Unreal attempts to follow the proposed ISupport standard as much as possible. Unreal only
ignores the standard in one regard, the TARGMAX token. This token is believed to be
UnrealIRCd attempts to follow the proposed ISupport standard as much as possible. UnrealIRCd
only ignores the standard in one regard, the TARGMAX token. This token is believed to be
impractical and technically impossible to correctly implement due to existing limitations
in the standard. Therefore, this token is not currently supported.
Unreal does additionally provide a few tokens which are not specified in the standard, these
UnrealIRCd does additionally provide a few tokens which are not specified in the standard, these
include: HCN, AWAYLEN, WATCH, SILENCE, EXTBAN, ELIST, CMDS, NAMESX, UHNAMES, and WATCHOPTS.
Unreal also maintains a few legacy tokens such as MAXCHANNELS and WALLCHOPS to ensure
UnrealIRCd also maintains a few legacy tokens such as MAXCHANNELS and WALLCHOPS to ensure
compatibility until the ISupport standard is more widely accepted by clients.
Token Value Default Value Description
+1 -1
View File
@@ -1,6 +1,6 @@
==[ Translations ]===========================================================
In UnrealIRCd 4 we support the following translations:
In UnrealIRCd we support the following translations:
* on-line documentation at https://www.unrealircd.org/docs/ (wiki!)
* help.conf
* example.conf
Binary file not shown.
+155
View File
@@ -0,0 +1,155 @@
<?xml version="1.0" encoding="utf-8"?>
<RuleSet Name="UnrealIRCd rules - based off Microsoft Native Minimum Rules" Description="These rules focus on the most critical problems in your native code, including potential security holes and application crashes. It is recommended to include this rule set in any custom rule set you create for your native projects." ToolsVersion="10.0">
<Localization ResourceAssembly="Microsoft.VisualStudio.CodeAnalysis.RuleSets.Strings.dll" ResourceBaseName="Microsoft.VisualStudio.CodeAnalysis.RuleSets.Strings.Localized">
<Name Resource="NativeMinimumRules_Name" />
<Description Resource="NativeMinimumRules_Description" />
</Localization>
<Rules AnalyzerId="Microsoft.Analyzers.NativeCodeAnalysis" RuleNamespace="Microsoft.Rules.Native">
<!-- Many false positives <Rule Id="C6001" Action="Warning" /> -->
<!-- Many false positives <Rule Id="C6011" Action="Warning" /> -->
<Rule Id="C6029" Action="Warning" />
<Rule Id="C6053" Action="Warning" />
<Rule Id="C6059" Action="Warning" />
<Rule Id="C6063" Action="Warning" />
<Rule Id="C6064" Action="Warning" />
<Rule Id="C6066" Action="Warning" />
<Rule Id="C6067" Action="Warning" />
<Rule Id="C6101" Action="Warning" />
<Rule Id="C6200" Action="Warning" />
<Rule Id="C6201" Action="Warning" />
<Rule Id="C6270" Action="Warning" />
<Rule Id="C6271" Action="Warning" />
<Rule Id="C6272" Action="Warning" />
<Rule Id="C6273" Action="Warning" />
<Rule Id="C6274" Action="Warning" />
<Rule Id="C6276" Action="Warning" />
<Rule Id="C6277" Action="Warning" />
<Rule Id="C6284" Action="Warning" />
<Rule Id="C6290" Action="Warning" />
<Rule Id="C6291" Action="Warning" />
<Rule Id="C6302" Action="Warning" />
<Rule Id="C6303" Action="Warning" />
<Rule Id="C6305" Action="Warning" />
<Rule Id="C6306" Action="Warning" />
<Rule Id="C6328" Action="Warning" />
<!-- <Rule Id="C6385" Action="Warning" /> more false positives -->
<!-- <Rule Id="C6386" Action="Warning" /> the analysis this one does - or lack thereof - is particularly dumb pffff -->
<!-- <Rule Id="C6387" Action="Warning" /> more null/0 false positives -->
<Rule Id="C6500" Action="Warning" />
<Rule Id="C6501" Action="Warning" />
<Rule Id="C6503" Action="Warning" />
<Rule Id="C6504" Action="Warning" />
<Rule Id="C6505" Action="Warning" />
<Rule Id="C6506" Action="Warning" />
<Rule Id="C6508" Action="Warning" />
<Rule Id="C6509" Action="Warning" />
<Rule Id="C6510" Action="Warning" />
<Rule Id="C6511" Action="Warning" />
<Rule Id="C6513" Action="Warning" />
<Rule Id="C6514" Action="Warning" />
<Rule Id="C6515" Action="Warning" />
<Rule Id="C6516" Action="Warning" />
<Rule Id="C6517" Action="Warning" />
<Rule Id="C6518" Action="Warning" />
<Rule Id="C6522" Action="Warning" />
<Rule Id="C6525" Action="Warning" />
<Rule Id="C6527" Action="Warning" />
<Rule Id="C6530" Action="Warning" />
<Rule Id="C6540" Action="Warning" />
<Rule Id="C6551" Action="Warning" />
<Rule Id="C6552" Action="Warning" />
<Rule Id="C6701" Action="Warning" />
<Rule Id="C6702" Action="Warning" />
<Rule Id="C6703" Action="Warning" />
<Rule Id="C6704" Action="Warning" />
<Rule Id="C6705" Action="Warning" />
<Rule Id="C6706" Action="Warning" />
<!-- CppCoreCheck -->
<!-- Span/View over temporary -->
<Rule Id="C26449" Action="Warning" />
<!-- Arithmetic overflow -->
<Rule Id="C26450" Action="Warning" />
<Rule Id="C26451" Action="Warning" />
<Rule Id="C26452" Action="Warning" />
<Rule Id="C26453" Action="Warning" />
<Rule Id="C26454" Action="Warning" />
<!-- Unitialized Member -->
<Rule Id="C26495" Action="Warning" />
<Rule Id="C28021" Action="Warning" />
<!-- <Rule Id="C28182" Action="Warning" /> false positives for dereferencing null ptr -->
<Rule Id="C28202" Action="Warning" />
<Rule Id="C28203" Action="Warning" />
<Rule Id="C28205" Action="Warning" />
<Rule Id="C28206" Action="Warning" />
<Rule Id="C28207" Action="Warning" />
<Rule Id="C28210" Action="Warning" />
<Rule Id="C28211" Action="Warning" />
<Rule Id="C28212" Action="Warning" />
<Rule Id="C28213" Action="Warning" />
<Rule Id="C28214" Action="Warning" />
<Rule Id="C28215" Action="Warning" />
<Rule Id="C28216" Action="Warning" />
<Rule Id="C28217" Action="Warning" />
<Rule Id="C28218" Action="Warning" />
<Rule Id="C28219" Action="Warning" />
<Rule Id="C28220" Action="Warning" />
<Rule Id="C28221" Action="Warning" />
<Rule Id="C28222" Action="Warning" />
<Rule Id="C28223" Action="Warning" />
<Rule Id="C28224" Action="Warning" />
<Rule Id="C28225" Action="Warning" />
<Rule Id="C28226" Action="Warning" />
<Rule Id="C28227" Action="Warning" />
<Rule Id="C28228" Action="Warning" />
<Rule Id="C28229" Action="Warning" />
<Rule Id="C28230" Action="Warning" />
<Rule Id="C28231" Action="Warning" />
<Rule Id="C28232" Action="Warning" />
<Rule Id="C28233" Action="Warning" />
<Rule Id="C28234" Action="Warning" />
<Rule Id="C28235" Action="Warning" />
<Rule Id="C28236" Action="Warning" />
<Rule Id="C28237" Action="Warning" />
<Rule Id="C28238" Action="Warning" />
<Rule Id="C28239" Action="Warning" />
<Rule Id="C28240" Action="Warning" />
<Rule Id="C28241" Action="Warning" />
<Rule Id="C28243" Action="Warning" />
<Rule Id="C28245" Action="Warning" />
<Rule Id="C28246" Action="Warning" />
<Rule Id="C28250" Action="Warning" />
<!-- <Rule Id="C28251" Action="Warning" /> this may be real but it's damn annoying: inconsistent annotation for function -->
<Rule Id="C28252" Action="Warning" />
<Rule Id="C28253" Action="Warning" />
<Rule Id="C28254" Action="Warning" />
<Rule Id="C28262" Action="Warning" />
<Rule Id="C28263" Action="Warning" />
<Rule Id="C28267" Action="Warning" />
<Rule Id="C28272" Action="Warning" />
<Rule Id="C28273" Action="Warning" />
<Rule Id="C28275" Action="Warning" />
<Rule Id="C28279" Action="Warning" />
<Rule Id="C28280" Action="Warning" />
<Rule Id="C28282" Action="Warning" />
<Rule Id="C28285" Action="Warning" />
<Rule Id="C28286" Action="Warning" />
<Rule Id="C28287" Action="Warning" />
<Rule Id="C28288" Action="Warning" />
<Rule Id="C28289" Action="Warning" />
<Rule Id="C28290" Action="Warning" />
<Rule Id="C28291" Action="Warning" />
<Rule Id="C28300" Action="Warning" />
<Rule Id="C28301" Action="Warning" />
<Rule Id="C28302" Action="Warning" />
<Rule Id="C28303" Action="Warning" />
<Rule Id="C28304" Action="Warning" />
<Rule Id="C28305" Action="Warning" />
<Rule Id="C28308" Action="Warning" />
<Rule Id="C28309" Action="Warning" />
<Rule Id="C28350" Action="Warning" />
<Rule Id="C28351" Action="Warning" />
</Rules>
</RuleSet>
Binary file not shown.
+29 -25
View File
@@ -10,20 +10,41 @@ if [ "$1" != "" ]; then
BUILDCONFIG="$*"
fi
export MAKE="make -j3"
export CPPFLAGS="-DFAKELAG_CONFIGURABLE"
if [[ "$OSTYPE" == "freebsd"* ]]; then
export MAKE="gmake -j4"
else
export MAKE="make -j4"
fi
# -DRAWCMDLOGGING was dropped, but can be useful for debugging
export CPPFLAGS="$CPPFLAGS -DFAKELAG_CONFIGURABLE -DNOREMOVETMP -DTESTSUITE"
# !! skipped for now: extras/build-tests/nix/select-config $BUILDCONFIG !!
# !! temporary use this:
cp extras/build-tests/nix/configs/default ./config.settings
if [ "$USE_SHIPPED_LIBS" = "1" ]; then
echo 'EXTRAPARA="--enable-werror --without-system-pcre2 --without-system-argon2 --without-system-sodium --without-system-cares --without-system-jansson"' >>config.settings
fi
# If SSLDIR is set the environment, this overrides config.settings
# Used for example in the openssl3 build tests.
if [ "$SSLDIR" != "" ]; then
echo 'SSLDIR="'"$SSLDIR"'"' >>config.settings
fi
extras/build-tests/nix/select-config $BUILDCONFIG
# Read config.settings, this makes a couple of variables available to us.
. ./config.settings
if [ "$SSLDIR" != "" ]; then
# In case we build local openssl/libressl
export LD_LIBRARY_PATH="$SSLDIR/lib"
fi
./Config -quick || (tail -n 5000 config.log; echo '*** now tre:'; tail -n 5000 extras/tre-0.8.0-git/config.log; echo '** end of tre config.log **'; exit 1)
./Config -quick || (tail -n 5000 config.log; exit 1)
$MAKE
yes ''|make pem
make install
(echo 'Y'; yes '')|./unrealircd mkcert
$MAKE || exit 1
$MAKE install || exit 1
./unrealircd module install third/dumpcmds || exit 1
set +x
echo ""
@@ -37,22 +58,5 @@ else
ldd ~/unrealircd/bin/unrealircd
fi
if [ "$BUILDCONFIG" = "local-curl" ]; then
# We broke the system significantly earlier that build tests
# won't work (eg: 'git' is uninstallable). Don't bother
# running the tests. I don't expect a 'local-curl' specific
# bug anyway.
exit 0
fi
if [[ "$OSTYPE" == "darwin"* ]]; then
# 'rake' doesn't work. have to figure that one out..
echo "Not running test on OS X for now"
exit 0
fi
echo ""
echo ""
echo "Now running UnrealIRCd test framework..."
set -x
extras/build-tests/nix/run-tests
# This was only the 'building' part, so give a hint...
echo "You can now run extras/build-tests/nix/run-tests"
+11 -10
View File
@@ -1,3 +1,9 @@
# These are the settings saved from running './Config'.
# Note that it is not recommended to edit config.settings by hand!
# Chances are you misunderstand what a variable does or what the
# supported values are. You better just re-run the ./Config script
# and answer appropriately there, to get a correct config.settings
# file.
#
BASEPATH=$HOME/unrealircd
BINDIR=$HOME/unrealircd/bin
@@ -8,22 +14,17 @@ LOGDIR=$HOME/unrealircd/logs
CACHEDIR=$HOME/unrealircd/cache
DOCDIR=$HOME/unrealircd/doc
TMPDIR=$HOME/unrealircd/tmp
LIBDIR=$HOME/unrealircd/lib
PREFIXAQ="1"
MAXSENDQLENGTH="3000000"
MAXCONNECTIONS="1024"
PRIVATELIBDIR=$HOME/unrealircd/lib
MAXCONNECTIONS_REQUEST="auto"
NICKNAMEHISTORYLENGTH="2000"
GEOIP="classic"
DEFPERM="0600"
SSLDIR=""
REMOTEINC=""
CURLDIR=""
SHOWLISTMODES="1"
TOPICNICKISNUH=""
SHUNNOTICES=""
NOOPEROVERRIDE=""
DISABLEUSERMOD=""
OPEROVERRIDEVERIFY=""
DISABLEEXTBANSTACKING=""
GENCERTIFICATE="0"
#EXTRAPARA="--enable-werror"
SANITIZER="asan"
EXTRAPARA="--enable-werror"
ADVANCED=""
+100
View File
@@ -0,0 +1,100 @@
#!/bin/bash
# hardening-check.sh <ircd_dir>
# Example: ./hardening-check.sh ~/unrealircd
# Exit codes: 0 = pass, 1 = fail
#
# This is used by BuildBot to make sure we use RELRO and CFI and such.
# Requirements: 'checksec' and 'readelf'
# It is AI-generated code (Claude Opus 4.6) but seems to work well,
# also verified to fail with a deliberately "bad" library.
# We only check libraries that we control, not system libs that are
# out of our control. Similarly, FreeBSD doesn't support CFI (CET)
# at the moment so we ignore it there, again.. out of our control.
if [ -z "$1" ]; then
echo "Usage: $0 <unrealircd-directory>"
exit 1
fi
IRCD_DIR="$1"
FAIL=0
# Collect all binaries to check
files=("$IRCD_DIR/bin/unrealircd")
while IFS= read -r f; do
files+=("$f")
done < <(find "$IRCD_DIR/lib" -name '*.so*' -type f)
# --- checksec: Full RELRO, Canary, NX, FORTIFY ---
for f in "${files[@]}"; do
out=$(checksec --format=csv --file="$f" 2>/dev/null)
name=$(basename "$f")
if ! echo "$out" | grep -qi "Full RELRO"; then
echo "FAIL: $name — missing Full RELRO"
FAIL=1
fi
if ! echo "$out" | grep -qi "Canary found"; then
echo "FAIL: $name — missing stack canary"
FAIL=1
fi
if ! echo "$out" | grep -qi "NX enabled"; then
echo "FAIL: $name — missing NX"
FAIL=1
fi
# FORTIFY column: check for "Yes" but not in other fields
fortify=$(echo "$out" | awk -F',' '{print $8}')
if [ "$fortify" != "Yes" ]; then
echo "WARN: $name — no FORTIFY (may be OK for small libs)"
fi
done
# --- CFI: CET on x86_64, BTI/PAC on aarch64 (Linux only) ---
if [ "$(uname -s)" = "Linux" ]; then
ARCH=$(uname -m)
if [ "$ARCH" = "x86_64" ]; then
for f in "${files[@]}"; do
name=$(basename "$f")
props=$(readelf -n "$f" 2>/dev/null | grep "x86 feature:")
if [ -z "$props" ]; then
echo "FAIL: $name — no CET property note"
FAIL=1
else
if ! echo "$props" | grep -q "IBT"; then
echo "FAIL: $name — missing IBT"
FAIL=1
fi
if ! echo "$props" | grep -q "SHSTK"; then
echo "FAIL: $name — missing SHSTK"
FAIL=1
fi
fi
done
elif [ "$ARCH" = "aarch64" ]; then
for f in "${files[@]}"; do
name=$(basename "$f")
props=$(readelf -n "$f" 2>/dev/null | grep "aarch64 feature:")
if [ -z "$props" ]; then
echo "FAIL: $name — no BTI/PAC property note"
FAIL=1
else
if ! echo "$props" | grep -q "BTI"; then
echo "FAIL: $name — missing BTI"
FAIL=1
fi
if ! echo "$props" | grep -q "PAC"; then
echo "FAIL: $name — missing PAC"
FAIL=1
fi
fi
done
fi
fi
if [ "$FAIL" -eq 1 ]; then
echo "HARDENING CHECK FAILED"
exit 1
else
echo "All hardening checks passed."
exit 0
fi
+27 -49
View File
@@ -9,57 +9,35 @@ set -e
# Verbose:
set -x
# Install packages
if [[ "$OSTYPE" == "darwin"* ]]; then
brew install git || true
brew install python || true
gem install bundler || true
gem install rake || true
gem install rspec || true
else
sudo apt-get install git python rake -y
sudo gem install bundler
fi
# Install 'ircfly'
git clone https://github.com/unrealircd/ircfly.git
cd ircfly
bundle install
bundle exec rake build
if [[ "$OSTYPE" == "darwin"* ]]; then
bundle exec rake install
else
sudo rake install
fi
cd ..
# Install 'cipherscan'
git clone https://github.com/mozilla/cipherscan
# Kill old instances
killall -9 unrealircd || true
# Install 'unrealircd-tests'
git clone https://github.com/unrealircd/unrealircd-tests.git
rm -rf unrealircd-tests/
git clone -q --branch unreal60 https://github.com/unrealircd/unrealircd-tests.git unrealircd-tests
cd unrealircd-tests
bundle install
mv config.yaml.example config.yaml
# Start the IRC servers
cp ircdconfig/* ~/unrealircd/conf/
cd ~/unrealircd
bin/unrealircd -f irc1.conf
bin/unrealircd -f irc2.conf
cd -
# Do cipherscan test
sleep 2
cd ../cipherscan
./cipherscan --no-colors 127.0.0.1:5900
#./cipherscan --json 127.0.0.1:5900 >.........
sleep 5
cd -
# Back in unrealircd-tests, run the tests!
if [[ "$OSTYPE" == "darwin"* ]]; then
bundle exec rake
else
rake
# FreeBSD has various issues with the tests from us and others,
# better set a flag to keep it simple:
if uname -a|grep -q FreeBSD; then
NOSERVICES=1
fi
# Run the test framework, testing both services:
if [ "$NOSERVICES" = 1 ]; then
./run -services none $RUNTESTFLAGS || exit 1
else
# Linux tests both with anope and atheme services:
./run -services anope $RUNTESTFLAGS || exit 1
./run -services atheme $RUNTESTFLAGS || exit 1
fi
# Database writing/reading tests
## unencrypted:
./run -services none -boot tests/db/writing/* || exit 1
./run -services none -keepdbs -boot tests/db/reading/* || exit 1
## encrypted:
./run -services none -include db_crypted.conf -boot tests/db/writing/* || exit 1
./run -services none -include db_crypted.conf -keepdbs -boot tests/db/reading/* || exit 1
echo "If you also want to run the SSL/TLS tests, see extras/tests/tls/tls-tests"
+16
View File
@@ -0,0 +1,16 @@
#!/bin/bash
#
# This is a simple wrapper script that will run the tests
# When finished, either due to succes or failure,
# it will kill the ircd
#
# Also, it makes sure the job times out (is killed)
# in case it misbehaves
#
set +ex
timeout --kill-after=5 900 bash -c '
extras/build-tests/nix/run-tests
EX="$?"
killall -9 valgrind valgrind.bin memcheck memcheck-amd64-linux memcheck-x86-linux ircd unrealircd val 1>/dev/null 2>&1
exit $EX'
exit $?
+18 -12
View File
@@ -4,22 +4,28 @@
# It is not meant to be used by end-users
#
function fail()
{
echo "select-config failed: $*"
exit 1
}
function build_ssl {
DIR="$2"
URL="$1/$2.tar.gz"
savewd="$PWD"
cd ~
wget "$URL" || exit 1
tar xzvf $DIR.tar.gz
tar xzf $DIR.tar.gz
cd "$DIR"
(./configure --prefix=$HOME/ssl || ./config --prefix=$HOME/ssl -fPIC) || exit 1
(make -j2 && make install) || exit 1
(./configure --prefix=$HOME/ssl 1>/dev/null 2>&1 || ./config --prefix=$HOME/ssl -fPIC 1>/dev/null 2>&1 ) || fail "build_ssl: configure/config failed"
(make -j2 1>/dev/null 2>&1 && make install 1>/dev/null 2>&1) || fail "build_ssl: make failed"
cd "$savewd"
echo "SSLDIR=$HOME/ssl" >>config.settings
}
if [ ! -d extras ]; then
echo "This tool is supposed to be run from the source root, so ~/unrealircd-4.0.x or similar"
echo "This tool is supposed to be run from the source root, so ~/unrealircd-5.0.x or similar"
exit 1
fi
@@ -82,18 +88,18 @@ do
fi
echo 'REMOTEINC=1' >>config.settings
echo "CURLDIR=`pwd`/extras/curl" >>config.settings
elif [ "$1" = "libressl-25" ]; then
build_ssl https://ftp.openbsd.org/pub/OpenBSD/LibreSSL libressl-2.5.5
elif [ "$1" = "libressl-26" ]; then
build_ssl https://ftp.openbsd.org/pub/OpenBSD/LibreSSL libressl-2.6.4
elif [ "$1" = "libressl-27" ]; then
build_ssl https://ftp.openbsd.org/pub/OpenBSD/LibreSSL libressl-2.7.2
build_ssl https://ftp.openbsd.org/pub/OpenBSD/LibreSSL libressl-2.7.5
elif [ "$1" = "libressl-28" ]; then
build_ssl https://ftp.openbsd.org/pub/OpenBSD/LibreSSL libressl-2.8.3
elif [ "$1" = "libressl-29" ]; then
build_ssl https://ftp.openbsd.org/pub/OpenBSD/LibreSSL libressl-2.9.0
elif [ "$1" = "openssl-102" ]; then
build_ssl https://www.openssl.org/source openssl-1.0.2o
build_ssl https://www.openssl.org/source openssl-1.0.2q
elif [ "$1" = "openssl-110" ]; then
build_ssl https://www.openssl.org/source openssl-1.1.0h
build_ssl https://www.openssl.org/source openssl-1.1.0j
elif [ "$1" = "openssl-111" ]; then
build_ssl https://www.openssl.org/source openssl-1.1.1-pre7
build_ssl https://www.openssl.org/source openssl-1.1.1a
else
echo "Unknown option $1"
exit 1
+89 -26
View File
@@ -1,43 +1,65 @@
rem Build script for appveyor
echo on
rem Temporarily hardcoded:
set TARGET=Visual Studio 2019
set SHORTNAME=vs2019
rem Initialize Visual Studio variables
if "%TARGET%" == "Visual Studio 2017" call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars32.bat"
if "%TARGET%" == "Visual Studio 2017" call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat"
if "%TARGET%" == "Visual Studio 2019" call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat"
rem Installing tools
cinst unrar -y
cinst unzip -y
cinst wget -y
cinst innosetup -y
wget https://www.unrealircd.org/files/dev/win/dlltool.exe
rem only for appveyor:
rem cinst unrar -y
rem cinst unzip -y
rem cinst innosetup -y
rem Installing UnrealIRCd dependencies
cd \projects
mkdir unrealircd-deps
cd unrealircd-deps
wget https://www.unrealircd.org/files/dev/win/SetACL.exe
wget https://www.unrealircd.org/files/dev/win/libs/unrealircd-libraries-devel.zip
unzip unrealircd-libraries-devel.zip
mkdir unrealircd-6-libs
cd unrealircd-6-libs
curl -fsS -o unrealircd-libraries-6-devel.zip https://www.unrealircd.org/files/dev/win/libs/unrealircd-libraries-6-devel.zip
unzip unrealircd-libraries-6-devel.zip
copy dlltool.exe \users\user\worker\unreal6-w10\build /y
cd \projects\unrealircd
rem for appveyor, use: cd \projects\unrealircd
cd \users\user\worker\unreal6-w10\build
rem Install 'unrealircd-tests'
cd ..
rd /q/s unrealircd-tests
git clone -q --branch unreal60 https://github.com/unrealircd/unrealircd-tests.git unrealircd-tests
if %ERRORLEVEL% NEQ 0 EXIT /B 1
cd build
rem Now the actual build
call extras\build-tests\windows\compilecmd\%SHORTNAME%.bat
rem The above command will fail, due to missing symbol file
rem However the symbol file can only be generated after the above command
rem So... we create the symbolfile...
nmake -f makefile.win32 SYMBOLFILE
rem And we re-run the exact same command:
call extras\build-tests\windows\compilecmd\%SHORTNAME%.bat
rem - First this, otherwise JOM will fail
IF NOT EXIST src\version.c nmake -f Makefile.windows CONF
rem - Then build most of UnrealIRCd.exe etc
call extras\build-tests\windows\compilecmd\%SHORTNAME%.bat UNREALSVC.EXE UnrealIRCd.exe unrealircdctl.exe
rem - It will fail due to missing symbolfile, which we create here..
rem it needs to run with SLOW=1 because JOM doesn't understand things otherwise..
SET SLOW=1
call extras\build-tests\windows\compilecmd\%SHORTNAME%.bat SYMBOLFILE
SET SLOW=0
rem - Then we finalize building UnrealIRCd.exe: should be no error
call extras\build-tests\windows\compilecmd\%SHORTNAME%.bat UNREALSVC.EXE UnrealIRCd.exe unrealircdctl.exe
if %ERRORLEVEL% NEQ 0 EXIT /B 1
rem - Build all the modules (DLL files): should be no error
call extras\build-tests\windows\compilecmd\%SHORTNAME%.bat MODULES
if %ERRORLEVEL% NEQ 0 EXIT /B 1
rem Convert c:\dev to c:\projects\unrealircd-deps
rem Compile dependencies for unrealircd-tests -- this doesn't belong here though..
copy ..\unrealircd-tests\serverconfig\unrealircd\modules\fakereputation.c src\modules\third /Y
call extras\build-tests\windows\compilecmd\%SHORTNAME%.bat CUSTOMMODULE MODULEFILE=fakereputation
if %ERRORLEVEL% NEQ 0 EXIT /B 1
rem Convert c:\dev to c:\projects\unrealircd-6-libs
rem TODO: should use environment variable in innosetup script?
sed -i "s/c:\\\\dev/c:\\\\projects\\\\unrealircd-deps/gi" src\win32\unrealinst.iss
sed -i "s/c:\\dev\\unrealircd-6-libs/c:\\projects\\unrealircd-6-libs/gi" src\windows\unrealinst.iss
rem Build installer file
"c:\Program Files (x86)\Inno Setup 5\iscc.exe" /Q- src\win32\unrealinst.iss
"c:\Program Files (x86)\Inno Setup 5\iscc.exe" /Q- src\windows\unrealinst.iss
if %ERRORLEVEL% NEQ 0 EXIT /B 1
rem Show some proof
@@ -45,6 +67,47 @@ ren mysetup.exe unrealircd-dev-build.exe
dir unrealircd-dev-build.exe
sha256sum unrealircd-dev-build.exe
rem Kill any old instances, just to be sure
taskkill -im unrealircd.exe -f
sleep 2
rem Just a safety measure so we don't end up testing
rem some old version...
del "C:\Program Files\UnrealIRCd 6\bin\unrealircd.exe"
echo Running installer...
start /WAIT unrealircd-dev-build.exe /VERYSILENT /LOG=setup.log
if %ERRORLEVEL% NEQ 0 goto installerfailed
rem Upload artifact
appveyor PushArtifact unrealircd-dev-build.exe
rem appveyor PushArtifact unrealircd-dev-build.exe
rem if %ERRORLEVEL% NEQ 0 EXIT /B 1
cd ..\unrealircd-tests
dir
rem All tests except db:
"C:\Program Files\Git\bin\bash.exe" ./runwin
if %ERRORLEVEL% NEQ 0 EXIT /B 1
rem Test unencrypted db's:
"C:\Program Files\Git\bin\bash.exe" ./runwin -boot tests/db/writing/*
if %ERRORLEVEL% NEQ 0 EXIT /B 1
"C:\Program Files\Git\bin\bash.exe" ./runwin -keepdbs -boot tests/db/reading/*
if %ERRORLEVEL% NEQ 0 EXIT /B 1
rem Test encrypted db's:
"C:\Program Files\Git\bin\bash.exe" ./runwin -include db_crypted.conf -boot tests/db/writing/*
if %ERRORLEVEL% NEQ 0 EXIT /B 1
"C:\Program Files\Git\bin\bash.exe" ./runwin -include db_crypted.conf -keepdbs -boot tests/db/reading/*
if %ERRORLEVEL% NEQ 0 EXIT /B 1
goto end
:installerfailed
type setup.log
echo INSTALLATION FAILED
EXIT /B 1
:end
@@ -1,18 +0,0 @@
rem Build command for Visual Studio 2017
nmake -f makefile.win32 ^
LIBRESSL_INC_DIR="c:\projects\unrealircd-deps\libressl\include" ^
LIBRESSL_LIB_DIR="c:\projects\unrealircd-deps\libressl\lib" ^
SSLLIB="crypto-43.lib ssl-45.lib" ^
USE_REMOTEINC=1 ^
LIBCURL_INC_DIR="c:\projects\unrealircd-deps\curl-ssl\include" ^
LIBCURL_LIB_DIR="c:\projects\unrealircd-deps\curl-ssl\builds\libcurl-vc-x86-release-dll-ssl-dll-ipv6-sspi-obj-lib" ^
CARES_LIB_DIR="c:\projects\unrealircd-deps\c-ares\msvc\cares\dll-release" ^
CARES_INC_DIR="c:\projects\unrealircd-deps\c-ares" ^
CARESLIB="cares.lib" ^
TRE_LIB_DIR="c:\projects\unrealircd-deps\tre\win32\release" ^
TRE_INC_DIR="c:\projects\unrealircd-deps\tre" ^
TRELIB="tre.lib" ^
PCRE2_INC_DIR="c:\projects\unrealircd-deps\pcre2\include" ^
PCRE2_LIB_DIR="c:\projects\unrealircd-deps\pcre2\lib" ^
PCRE2LIB="pcre2-8.lib" %*
@@ -0,0 +1,40 @@
rem Build command for Visual Studio 2019
rem Default to quick parallel builds
SET BUILDCOMMAND="jom"
SET BUILDARGS="/j32"
IF NOT %SLOW%. == 1. goto cont
rem In case of SET SLOW=1 we use slow nmake
SET BUILDCOMMAND="nmake"
SET BUILDARGS=""
:cont
echo BUILDCOMMAND IS: %BUILDCOMMAND%
echo BUILDARGS IS: %BUILDARGS%
%BUILDCOMMAND% %BUILDARGS% -f makefile.windows ^
SSL_INC_DIR="c:\projects\unrealircd-6-libs\openssl\include" ^
SSL_LIB_DIR="c:\projects\unrealircd-6-libs\openssl\lib" ^
SSLLIB="libcrypto.lib libssl.lib" ^
USE_REMOTEINC=1 ^
LIBCURL_INC_DIR="c:\projects\unrealircd-6-libs\curl\include" ^
LIBCURL_LIB_DIR="c:\projects\unrealircd-6-libs\curl\lib" ^
CARES_LIB_DIR="c:\projects\unrealircd-6-libs\c-ares\msvc\cares\dll-release" ^
CARES_INC_DIR="c:\projects\unrealircd-6-libs\c-ares\include" ^
CARESLIB="cares.lib" ^
PCRE2_INC_DIR="c:\projects\unrealircd-6-libs\pcre2\include" ^
PCRE2_LIB_DIR="c:\projects\unrealircd-6-libs\pcre2\lib" ^
PCRE2LIB="pcre2-8.lib" ^
ARGON2_LIB_DIR="c:\projects\unrealircd-6-libs\argon2\vs2015\build" ^
ARGON2_INC_DIR="c:\projects\unrealircd-6-libs\argon2\include" ^
ARGON2LIB="Argon2RefDll.lib" ^
SODIUM_LIB_DIR="c:\projects\unrealircd-6-libs\libsodium\bin\x64\Release\v142\dynamic" ^
SODIUM_INC_DIR="c:\projects\unrealircd-6-libs\libsodium\src\libsodium\include" ^
SODIUMLIB="libsodium.lib" ^
JANSSON_LIB_DIR="c:\projects\unrealircd-6-libs\jansson\lib" ^
JANSSON_INC_DIR="c:\projects\unrealircd-6-libs\jansson\include" ^
JANSSONLIB="jansson.lib" ^
GEOIPCLASSIC_LIB_DIR="c:\projects\unrealircd-6-libs\GeoIP\libGeoIP" ^
GEOIPCLASSIC_INC_DIR="c:\projects\unrealircd-6-libs\GeoIP\libGeoIP" ^
GEOIPCLASSICLIB="GeoIP.lib" %*
Binary file not shown.
-98
View File
@@ -1,98 +0,0 @@
#!/bin/sh
URL="https://www.unrealircd.org/files/curl-latest.tar.gz"
OUTF="curl-latest.tar.gz"
OUTD="curl-latest"
ARESPATH="`pwd`/extras/c-ares"
UNREALDIR="`pwd`"
CARESVERSION="1.13.0"
LIBDIR="$1"
if [ "x$1" = "x" ]; then
echo "You should (no longer) run this program directly."
echo "It will be invoked by ./Config"
exit 1
fi
if [ ! -f src/parse.c ]; then
if [ -f ../src/parse.c ]; then
cd ..
else
echo "Please run this program from your UnrealIRCd directory"
echo "(usually $HOME/unrealircd-4.0.X or something like that)"
exit 1
fi
fi
wget --version 1>/dev/null 2>&1
if [ "$?" = 0 ]; then
FETCHER="wget"
else
fetch --version 1>/dev/null 2>&1
if [ "$?" = 0 ]; then
FETCHER="fetch"
else
lynx --version 1>/dev/null 2>&1
if [ "$?" = 0 ]; then
FETCHER="lynx"
else
echo "ERROR: unable to find wget/fetch/lynx, please install at least one of these programs"
exit 1
fi
fi
fi
if [ ! -d tmp ]; then
mkdir tmp || exit 1
fi
cd tmp || exit 1
rm -f "$OUTF"
if [ "$FETCHER" = "wget" ]; then
wget -O "$OUTF" "$URL"
elif [ "$FETCHER" = "lynx" ]; then
lynx -dump "$URL" >"$OUTF"
elif [ "$FETCHER" = "fetch" ]; then
cd tmp #todo: find out the cmd line parameter ;)
fetch "$URL"
fi
if [ "$?" != 0 ]; then
echo "ERROR: Something went wrong while trying to download $URL"
exit 1
fi
rm -rf "$OUTD" # remove old directory prior to extracting
tar xzf "$OUTF" || exit 1
if [ "`eval echo -n 'a'`" = "-n a" ] ; then
c="\c"
else
n="-n"
fi
if [ ! -d "$ARESPATH/lib" ]; then
echo "c-ares has not been build yet, let's do that now..."
cd ../extras/
tar xzf c-ares.tar.gz || exit 1
cd c-ares-$CARESVERSION || exit 1
./configure --prefix=$ARESPATH || exit 1
(make && make install) || exit 1
cd ../../tmp/
echo "c-ares built."
echo ""
fi
# We assume curl has been packaged in a way it will extract to "$OUTD"/
cd "$OUTD" || exit 1
echo "Building and installing libcurl"
CPPFLAGS="-I$ARESPATH/include" ./configure --prefix=$UNREALDIR/extras/curl --libdir=$LIBDIR --enable-shared \
--disable-thread --enable-ares=$ARESPATH --disable-ipv6
cp -R $ARESPATH/lib ares
make && make install
#cp $ARESPATH/lib/libcares.a $HOME/curl/lib
# that isn't needed anymore as the lib is already in unreal...
+18
View File
@@ -0,0 +1,18 @@
Welcome to the doxygen-generated documentation for the UnrealIRCd 6.x API.
This is intended **for developers only!**
If you are creating a 3rd party module for UnrealIRCd or are interested
in contributing to UnrealIRCd then this is the right place.
Here you should be able to find a lot of information on the data structures
and functions available to you when coding for UnrealIRCd.
## Wiki documentation ##
* Be sure to check the [Module API](https://www.unrealircd.org/docs/Dev:Module_API) article on the wiki
as well, which provides a better *overview* of the module API
## Doxygen docs ##
* [Functions and structs ordered by purpose](modules.html) - **this contains most of the module API!**
* [The most common structs](group__CommonStructs.html) - like Client, User, Server, Channel, etc.
* [All structs](classes.html) - in a simple alphabetical index
* [Browse by source file](dir_68267d1309a1af8e8297ef4c3efbcdba.html) - see all src/*.c files and their (documented) functions.
File diff suppressed because it is too large Load Diff
+4
View File
@@ -0,0 +1,4 @@
code {
border: 1px solid #C4CFE5;
background-color: #FBFCFD;
}
+56
View File
@@ -0,0 +1,56 @@
<!-- HTML header for doxygen 1.8.13-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen $doxygenversion"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<!--BEGIN PROJECT_NAME--><title>$projectname Module API: $title</title><!--END PROJECT_NAME-->
<!--BEGIN !PROJECT_NAME--><title>$title</title><!--END !PROJECT_NAME-->
<link href="$relpath^tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="$relpath^jquery.js"></script>
<script type="text/javascript" src="$relpath^dynsections.js"></script>
$treeview
$search
$mathjax
<link href="$relpath^$stylesheet" rel="stylesheet" type="text/css" />
$extrastylesheet
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<!--BEGIN TITLEAREA-->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<!--BEGIN PROJECT_LOGO-->
<td id="projectlogo"><img alt="Logo" src="$relpath^$projectlogo"/></td>
<!--END PROJECT_LOGO-->
<!--BEGIN PROJECT_NAME-->
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">$projectname
<!--BEGIN PROJECT_NUMBER-->&#160;<span id="projectnumber">Module API $projectnumber</span><!--END PROJECT_NUMBER-->
</div>
<!--BEGIN PROJECT_BRIEF--><div id="projectbrief">$projectbrief</div><!--END PROJECT_BRIEF-->
</td>
<!--END PROJECT_NAME-->
<!--BEGIN !PROJECT_NAME-->
<!--BEGIN PROJECT_BRIEF-->
<td style="padding-left: 0.5em;">
<div id="projectbrief">$projectbrief</div>
</td>
<!--END PROJECT_BRIEF-->
<!--END !PROJECT_NAME-->
<!--BEGIN DISABLE_INDEX-->
<!--BEGIN SEARCHENGINE-->
<td>$searchbox</td>
<!--END SEARCHENGINE-->
<!--END DISABLE_INDEX-->
</tr>
</tbody>
</table>
</div>
<!--END TITLEAREA-->
<!-- end header part -->
Binary file not shown.
Binary file not shown.
Binary file not shown.
+40
View File
@@ -0,0 +1,40 @@
#!/bin/sh
#
# This script tries to upgrade spamfilter.conf from an old
# version that uses 'posix' spamfilters to a bit more recent
# version with examples using 'regex' spamfilters.
# This so fewer users end up with a headache when upgrading
# to UnrealIRCd 4.2.3+.
#
if [ -f spamfilter.conf.patch ]; then
F="`pwd`/spamfilter.conf.patch"
elif [ -f extras/patches/spamfilter.conf.patch ]; then
F="`pwd`/extras/patches/spamfilter.conf.patch"
else
echo "WARNING: spamfilter.conf.patch not found"
exit 0
fi
if [ ! -f "$F" ]; then
echo "WARNING: spamfilter.conf.patch not found in round two"
exit 0
fi
if [ "$1" = "" ]; then
echo "ERROR: No target confdir specified."
exit 0
fi
if [ ! -f "$1/spamfilter.conf" ]; then
echo "WARNING: no spamfilter.conf found in $1 -- strange"
exit 0
fi
cd "$1" || exit 1
cat "$F"|patch -p0 --dry-run -N 1>/dev/null 2>&1
if [ "$?" = 0 ]; then
# Patch succeeded, patch now!
echo "Upgrading examples in your spamfilter.conf..."
cat "$F"|patch -p0 -N
fi
+328
View File
@@ -0,0 +1,328 @@
--- spamfilter.conf.old 2015-06-27 18:29:01.084559805 +0200
+++ spamfilter.conf 2019-04-04 18:29:38.390647262 +0200
@@ -1,232 +1,154 @@
/*
- * This an example spamfilter file, it contains several
- * real and useful spamfilters. This should give you an
- * idea of how powerful spamfilter can be in real-life
- * situations.
+ * This configuration file contains example spamfilter rules.
+ * They are real rules that were useful a long time ago.
+ * Since 2005 these rules are no longer maintained.
+ * The main purpose nowadays is to serve as an example
+ * to give you an idea of how powerful spamfilters can
+ * be in real-life situations.
*
- * $Id$
+ * Documentation on spamfilter is available at:
+ * https://www.unrealircd.org/docs/Spamfilter
*/
-/* Guidelines on the 'action' field:
- * As a general rule we use 'action block' for any newly added
- * spamfilters at first, later on (after knowing about false
- * positives) we might change some to viruschan/kill/gline/etc..
+/* General note:
+ * If you want to use a \ in a spamfilter, or in fact
+ * anywhere in the configuration file, then you need
+ * to escape this to \\ instead.
*/
-spamfilter {
- match-type posix;
- match "\x01DCC (SEND|RESUME)[ ]+\"(.+ ){20}";
- target { private; channel; };
- action kill;
- reason "mIRC 6.0-6.11 exploit attempt";
-};
-spamfilter {
- match-type posix;
- match "\x01DCC (SEND|RESUME).{225}";
- target { private; channel; };
- action kill;
- reason "Possible mIRC 6.12 exploit attempt";
-};
+/* First some spamfilters with match-type 'simple'.
+ * The only matchers available are * and ?
+ * PRO's: very fast, easy matching: everyone can do this.
+ * CON's: limited ability to fine-tune spamfilters
+ */
spamfilter {
- match-type posix;
- match "Come watch me on my webcam and chat /w me :-\) http://.+:\d+/me\.mpg";
+ match-type simple;
+ match "Come watch me on my webcam and chat /w me :-) http://*:*/me.mpg";
target private;
action gline;
reason "Infected by fyle trojan: see http://www.sophos.com/virusinfo/analyses/trojfylexa.html";
};
+/* This signature uses a \ which has to escaped to \\ in the configuration file */
spamfilter {
- match-type posix;
- match "Speed up your mIRC DCC Transfer by up to 75%.*www\.freewebs\.com/mircupdate/mircspeedup\.exe";
- target private;
- action gline;
- reason "Infected by mirseed trojan: see http://www.sophos.com/virusinfo/analyses/trojmirseeda.html";
-};
-
-spamfilter {
- match-type posix;
- match "^http://www\.angelfire\.com/[a-z0-9]+/[a-z0-9]+/[a-z_]+\.jpg <- .*!";
- target private;
+ match-type simple;
+ match "C:\\WINNT\\system32\\*.zip";
+ target dcc;
action block;
- reason "Infected by fagot worm: see http://www.f-secure.com/v-descs/fagot.shtml";
+ reason "Infected by Gaggle worm?";
};
spamfilter {
- match-type posix;
- match "^FREE PORN: http://free:porn@([0-9]{1,3}\.){3}[0-9]{1,3}:8180$";
+ match-type simple;
+ match "Speed up your mIRC DCC Transfer by up to 75%*www.freewebs.com/mircupdate/mircspeedup.exe";
target private;
action gline;
- reason "Infected by aplore worm: see http://www.f-secure.com/v-descs/aplore.shtml";
-};
-
-spamfilter {
- match-type posix;
- match "^!login Wasszup!$";
- target channel;
- action gline;
- reason "Attempting to login to a GTBot";
-};
-
-spamfilter {
- match-type posix;
- match "^!login grrrr yeah baby!$";
- target channel;
- action gline;
- reason "Attempting to login to a GTBot";
-};
-
-spamfilter {
- match-type posix;
- match "^!packet ([0-9]{1,3}\.){3}[0-9]{1,3} [0-9]{1,15}";
- target channel;
- action gline;
- reason "Attempting to use a GTBot";
-};
-
-spamfilter {
- match-type posix;
- match "^!icqpagebomb ([0-9]{1,15} ){2}.+";
- target channel;
- action gline;
- reason "Attempting to use a GTBot";
+ reason "Infected by mirseed trojan: see http://www.sophos.com/virusinfo/analyses/trojmirseeda.html";
};
spamfilter {
- match-type posix;
- match "^!pfast [0-9]{1,15} ([0-9]{1,3}\.){3}[0-9]{1,3} [0-9]{1,5}$";
- target channel;
+ match-type simple;
+ match "STOP SPAM, USE THIS COMMAND: //write nospam $decode(*) | .load -rs nospam | //mode $me +R";
+ target private;
action gline;
- reason "Attempting to use a GTBot";
+ reason "Infected by nkie worm: see http://www.trojaninfo.com/nkie/nkie.htm";
};
-spamfilter {
- match-type posix;
- match "^!portscan ([0-9]{1,3}\.){3}[0-9]{1,3} [0-9]{1,5} [0-9]{1,5}$";
- target channel;
- action gline;
- reason "Attempting to use a GTBot";
-};
-spamfilter {
- match-type posix;
- match "^.u(dp)? ([0-9]{1,3}\.){3}[0-9]{1,3} [0-9]{1,15} [0-9]{1,15} [0-9]{1,15}( [0-9])*$";
- target channel;
- action gline;
- reason "Attempting to use an SDBot";
-};
+/* Now spamfilters of type 'regex'.
+ * These use powerful regular expressions (Perl/PCRE style)
+ * You may have to learn more about "regex" first before you
+ * can use them. For example the dot ('.') has special meaning.
+ */
+/* This regex shows a pattern which requires 20 paramaters,
+ * such as "x x x x x x x x x x x x x x x x x x x x"
+ */
spamfilter {
- match-type posix;
- match "^.syn ((([0-9]{1,3}\.){3}[0-9]{1,3})|([a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+\.[a-zA-Z0-9_.-]+)) [0-9]{1,5} [0-9]{1,15} [0-9]{1,15}";
- target { channel; private; };
- action gline;
- reason "Attempting to use a SpyBot";
+ match-type regex;
+ match "\x01DCC (SEND|RESUME)[ ]+\"(.+ ){20}";
+ target { private; channel; };
+ action kill;
+ reason "mIRC 6.0-6.11 exploit attempt";
};
+/* Similarly, this regex shows a pattern that matches
+ * against at least 225 characters in length.
+ */
spamfilter {
- match-type posix;
- match "^porn! porno! http://.+\/sexo\.exe";
- target private;
- action gline;
- reason "Infected by soex trojan: see http://www.trendmicro.com/vinfo/virusencyclo/default5.asp?VName=TROJ%5FSOEX.A";
+ match-type regex;
+ match "\x01DCC (SEND|RESUME).{225}";
+ target { private; channel; };
+ action kill;
+ reason "Possible mIRC 6.12 exploit attempt";
};
+/* Earlier you saw an example of a $decode exploit which used
+ * match-type 'simple' and - indeed - the filter was quite simple.
+ * The following uses a regex with a similar example.
+ * Regular expressions are very powerful but here you can see
+ * that it actually complicates writing a filter quite a bit.
+ * With regex in this filter we need to escape the ( and all
+ * the dots, question marks, etc. if we want to match these
+ * characters in literal text.
+ */
spamfilter {
- match-type posix;
- match "(^wait a minute plz\. i am updating my site|.*my erotic video).*http://.+/erotic(a)?/myvideo\.exe$";
+ match-type regex;
+ match "^Want To Be An IRCOp\? Try This New Bug Type: //write \$decode\(.+=.?,m\) \| \.load -rs \$decode\(.+=.?,m\)$";
target private;
- action gline;
- reason "Infected by some trojan (erotica?)";
+ action block;
+ reason "Spamming users with an mIRC trojan. Type '/unload -rs newb' to remove the trojan.";
};
spamfilter {
- match-type posix;
- match "^STOP SPAM, USE THIS COMMAND: //write nospam \$decode\(.+\) \| \.load -rs nospam \| //mode \$me \+R$";
+ match-type regex;
+ match "^http://www\.angelfire\.com/[a-z0-9]+/[a-z0-9]+/[a-z_]+\.jpg <- .*!";
target private;
- action gline;
- reason "Infected by nkie worm: see http://www.trojaninfo.com/nkie/nkie.htm";
+ action block;
+ reason "Infected by fagot worm: see http://www.f-secure.com/v-descs/fagot.shtml";
};
+/* This shows a regex which specifically matches an entire line by
+ * the use of ^ and $
+ */
spamfilter {
- match-type posix;
- match "^FOR MATRIX 2 DOWNLOAD, USE THIS COMMAND: //write Matrix2 \$decode\(.+=,m\) \| \.load -rs Matrix2 \| //mode \$me \+R$";
- target private;
+ match-type regex;
+ match "^!login Wasszup!$";
+ target channel;
action gline;
- reason "Infected by nkie worm: see http://www.trojaninfo.com/nkie/nkie.htm";
+ reason "Attempting to login to a GTBot";
};
+/* An example of how to match against an IP address in text (IPv4 only) */
spamfilter {
- match-type posix;
- match "^hey .* to get OPs use this hack in the chan but SHH! //\$decode\(.*,m\) \| \$decode\(.*,m\)$";
- target private;
+ match-type regex;
+ match "^!packet ([0-9]{1,3}\.){3}[0-9]{1,3} [0-9]{1,15}";
+ target channel;
action gline;
- reason "Infected by nkie worm: see http://www.trojaninfo.com/nkie/nkie.htm";
+ reason "Attempting to use a GTBot";
};
+/* A slightly more complex example with a partial OR matcher (|) */
spamfilter {
- match-type posix;
- match ".*(http://jokes\.clubdepeche\.com|http://horny\.69sexy\.net|http://private\.a123sdsdssddddgfg\.com).*";
+ match-type regex;
+ match "(^wait a minute plz\. i am updating my site|.*my erotic video).*http://.+/erotic(a)?/myvideo\.exe$";
target private;
action gline;
- reason "Infected by LOI trojan";
-};
-
-/* This is a 'general sig' which might have a tad more false positives, hence just 'block' is used */
-spamfilter {
- match-type posix;
- match "C:\\WINNT\\system32\\[][0-9a-z_-{|}`]+\.zip";
- target dcc;
- action block;
- reason "Infected by Gaggle worm?";
+ reason "Infected by some trojan (erotica?)";
};
+/* In regex a \ is special and needs to be escaped to \\
+ * However in this configuration file, \ is also special and
+ * needs to be escaped to \\ as well.
+ * The result is that we need double escaping:
+ * To match a \ you need to write \\\\ in the configuration file.
+ */
spamfilter {
- match-type posix;
- match "C:\\WINNT\\system32\\(notes|videos|xxx|ManualSeduccion|postal|hechizos|images|sex|avril)\.zip";
+ match-type regex;
+ match "C:\\\\WINNT\\\\system32\\\\(notes|videos|xxx|ManualSeduccion|postal|hechizos|images|sex|avril)\.zip";
target dcc;
action dccblock;
reason "Infected by Gaggle worm";
};
-
-spamfilter {
- match-type posix;
- match "http://.+\.lycos\..+/[iy]server[0-9]/[a-z]{4,11}\.(gif|jpg|avi|txt)";
- target { private; quit; };
- action block;
- reason "Infected by Gaggle worm";
-};
-
-spamfilter {
- match-type posix;
- match "^Free porn pic.? and movies (www\.sexymovies\.da\.ru|www\.girlporn\.org)";
- target private;
- action block;
- reason "Unknown virus. Site causes Backdoor.Delf.lq infection";
-};
-
-spamfilter {
- match-type posix;
- match "^LOL! //echo -a \$\(\$decode\(.+,m\),[0-9]\)$";
- target channel;
- action block;
- reason "$decode exploit";
-};
-
-/*
-spamfilter {
- regex "//write \$decode\(.+\|.+load -rs";
- target { private; channel; };
- reason "Generic $decode exploit";
- action block;
-};
-*/
-
-spamfilter {
- match-type posix;
- match "^Want To Be An IRCOp\? Try This New Bug Type: //write \$decode\(.+=.?,m\) \| \.load -rs \$decode\(.+=.?,m\)$";
- target private;
- action block;
- reason "Spamming users with an mIRC trojan. Type '/unload -rs newb' to remove the trojan.";
-};
Binary file not shown.
-98
View File
@@ -1,98 +0,0 @@
# Makefile for regex.
#
# Copyright (C) 1992, 1993 Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
version = 0.12
# You can define CPPFLAGS on the command line. Aside from system-specific
# flags, you can define:
# -DREGEX_MALLOC to use malloc/realloc/free instead of alloca.
# -DDEBUG to enable the compiled pattern disassembler and execution
# tracing; code runs substantially slower.
# -DEXTRACT_MACROS to use the macros EXTRACT_* (as opposed to
# the corresponding C procedures). If not -DDEBUG, the macros
# are used.
CPPFLAGS =
# Likewise, you can override CFLAGS to optimize, use -Wall, etc.
CFLAGS = -g
# Ditto for LDFLAGS and LOADLIBES.
LDFLAGS =
LOADLIBES =
srcdir = @srcdir@
VPATH = @srcdir@
CC = @CC@
DEFS = @DEFS@
SHELL = /bin/sh
subdirs = moo
default all:: regex.o
.PHONY: default all
regex.o: regex.c regex.h
$(CC) $(CFLAGS) $(CPPFLAGS) $(DEFS) -I. -I$(srcdir) -c $<
clean mostlyclean::
rm -f *.o
distclean:: clean
rm -f Makefile config.status
extraclean:: distclean
rm -f patch* *~* *\#* *.orig *.rej *.bak core a.out
configure: configure.in
autoconf
config.status: configure
sh configure --no-create
Makefile: Makefile.in config.status
sh config.status
makeargs = $(MFLAGS) CPPFLAGS='$(CPPFLAGS)' CFLAGS='$(CFLAGS)' CC='$(CC)' \
DEFS='$(DEFS)' LDFLAGS='$(LDFLAGS)' LOADLIBES='$(LOADLIBES)'
default all install \
mostlyclean clean distclean extraclean realclean \
TAGS check::
for d in $(subdirs); do (cd $$d; $(MAKE) $(makeargs) $@); done
.PHONY: install mostlyclean clean distclean extraclean realclean TAGS check
# Prevent GNU make 3 from overflowing arg limit on system V.
.NOEXPORT:
distfiles = AUTHORS ChangeLog COPYING INSTALL NEWS README \
*.in configure regex.c regex.h
distdir = regex-$(version)
distargs = version=$(version) distdir=../$(distdir)/$$d
dist: TAGS configure
@echo "Version numbers in: Makefile.in, ChangeLog, NEWS,"
@echo " regex.c, regex.h,"
@echo " and doc/xregex.texi (if modified)."
rm -rf $(distdir)
mkdir $(distdir)
ln $(distfiles) $(distdir)
for d in $(subdirs); do (cd $$d; $(MAKE) $(distargs) dist); done
tar czhf $(distdir).tar.Z $(distdir)
rm -rf $(distdir)
.PHONY: dist
-60
View File
@@ -1,60 +0,0 @@
This directory contains the GNU regex library. It is compliant with
POSIX.2, except for internationalization features.
See the file NEWS for a list of major changes in the current release.
See the file INSTALL for compilation instructions. (The only thing
installed is the documentation; regex.c is compiled into regex.o, but
not installed anywhere.)
The subdirectory `doc' contains a (programmers') manual for the library.
It's probably out-of-date. Improvements are welcome.
The subdirectory `test' contains the various tests we've written.
We know this code is not as fast as it might be. If you have specific
suggestions, profiling results, or other such useful information to
report, please do.
Emacs 18 is not going use this revised regex (but Emacs 19 will). If
you want to try it with Emacs 18, apply the patch at the end of this
file first.
Mail bug reports to bug-gnu-utils@prep.ai.mit.edu.
Please include an actual regular expression that fails (and the syntax
used to compile it); without that, there's no way to reproduce the bug,
so there's no way we can fix it. Even if you include a patch, also
include the regular expression in error; otherwise, we can't know for
sure what you're trying to fix.
Here is the patch to make this version of regex work with Emacs 18.
*** ORIG/search.c Tue Jan 8 13:04:55 1991
--- search.c Sun Jan 5 10:57:00 1992
***************
*** 25,26 ****
--- 25,28 ----
#include "commands.h"
+
+ #include <sys/types.h>
#include "regex.h"
***************
*** 477,479 ****
/* really needed. */
! && *(searchbuf.buffer) == (char) exactn /* first item is "exact match" */
&& searchbuf.buffer[1] + 2 == searchbuf.used) /*first is ONLY item */
--- 479,482 ----
/* really needed. */
! /* first item is "exact match" */
! && *(searchbuf.buffer) == (char) RE_EXACTN_VALUE
&& searchbuf.buffer[1] + 2 == searchbuf.used) /*first is ONLY item */
***************
*** 1273,1275 ****
searchbuf.allocated = 100;
! searchbuf.buffer = (char *) malloc (searchbuf.allocated);
searchbuf.fastmap = search_fastmap;
--- 1276,1278 ----
searchbuf.allocated = 100;
! searchbuf.buffer = (unsigned char *) malloc (searchbuf.allocated);
searchbuf.fastmap = search_fastmap;
-462
View File
@@ -1,462 +0,0 @@
#!/bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated automatically using autoconf.
# Copyright (C) 1991, 1992, 1993 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
# Usage: configure [--srcdir=DIR] [--host=HOST] [--gas] [--nfp] [--no-create]
# [--prefix=PREFIX] [--exec-prefix=PREFIX] [--with-PACKAGE] [TARGET]
# Ignores all args except --srcdir, --prefix, --exec-prefix, --no-create, and
# --with-PACKAGE unless this script has special code to handle it.
for arg
do
# Handle --exec-prefix with a space before the argument.
if test x$next_exec_prefix = xyes; then exec_prefix=$arg; next_exec_prefix=
# Handle --host with a space before the argument.
elif test x$next_host = xyes; then next_host=
# Handle --prefix with a space before the argument.
elif test x$next_prefix = xyes; then prefix=$arg; next_prefix=
# Handle --srcdir with a space before the argument.
elif test x$next_srcdir = xyes; then srcdir=$arg; next_srcdir=
else
case $arg in
# For backward compatibility, also recognize exact --exec_prefix.
-exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* | --exec=* | --exe=* | --ex=* | --e=*)
exec_prefix=`echo $arg | sed 's/[-a-z_]*=//'` ;;
-exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- | --exec | --exe | --ex | --e)
next_exec_prefix=yes ;;
-gas | --gas | --ga | --g) ;;
-host=* | --host=* | --hos=* | --ho=* | --h=*) ;;
-host | --host | --hos | --ho | --h)
next_host=yes ;;
-nfp | --nfp | --nf) ;;
-no-create | --no-create | --no-creat | --no-crea | --no-cre | --no-cr | --no-c | --no- | --no)
no_create=1 ;;
-prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
prefix=`echo $arg | sed 's/[-a-z_]*=//'` ;;
-prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
next_prefix=yes ;;
-srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=* | --s=*)
srcdir=`echo $arg | sed 's/[-a-z_]*=//'` ;;
-srcdir | --srcdir | --srcdi | --srcd | --src | --sr | --s)
next_srcdir=yes ;;
-with-* | --with-*)
package=`echo $arg|sed 's/-*with-//'`
# Delete all the valid chars; see if any are left.
if test -n "`echo $package|sed 's/[-a-zA-Z0-9_]*//g'`"; then
echo "configure: $package: invalid package name" >&2; exit 1
fi
eval "with_`echo $package|sed s/-/_/g`=1" ;;
*) ;;
esac
fi
done
trap 'rm -f conftest* core; exit 1' 1 3 15
rm -f conftest*
compile='${CC-cc} $CFLAGS $DEFS conftest.c -o conftest $LIBS >/dev/null 2>&1'
# A filename unique to this package, relative to the directory that
# configure is in, which we can look for to find out if srcdir is correct.
unique_file=regex.c
# Find the source files, if location was not specified.
if test -z "$srcdir"; then
srcdirdefaulted=yes
# Try the directory containing this script, then `..'.
prog=$0
confdir=`echo $prog|sed 's%/[^/][^/]*$%%'`
test "X$confdir" = "X$prog" && confdir=.
srcdir=$confdir
if test ! -r $srcdir/$unique_file; then
srcdir=..
fi
fi
if test ! -r $srcdir/$unique_file; then
if test x$srcdirdefaulted = xyes; then
echo "configure: Can not find sources in \`${confdir}' or \`..'." 1>&2
else
echo "configure: Can not find sources in \`${srcdir}'." 1>&2
fi
exit 1
fi
# Preserve a srcdir of `.' to avoid automounter screwups with pwd.
# But we can't avoid them for `..', to make subdirectories work.
case $srcdir in
.|/*|~*) ;;
*) srcdir=`cd $srcdir; pwd` ;; # Make relative path absolute.
esac
if test -z "$CC"; then
echo checking for gcc
saveifs="$IFS"; IFS="${IFS}:"
for dir in $PATH; do
test -z "$dir" && dir=.
if test -f $dir/gcc; then
CC="gcc"
break
fi
done
IFS="$saveifs"
fi
test -z "$CC" && CC="cc"
# Find out if we are using GNU C, under whatever name.
cat > conftest.c <<EOF
#ifdef __GNUC__
yes
#endif
EOF
${CC-cc} -E conftest.c > conftest.out 2>&1
if egrep yes conftest.out >/dev/null 2>&1; then
GCC=1 # For later tests.
fi
rm -f conftest*
# Make sure to not get the incompatible SysV /etc/install and
# /usr/sbin/install, which might be in PATH before a BSD-like install,
# or the SunOS /usr/etc/install directory, or the AIX /bin/install,
# or the AFS install, which mishandles nonexistent args. (Sigh.)
if test -z "$INSTALL"; then
echo checking for install
saveifs="$IFS"; IFS="${IFS}:"
for dir in $PATH; do
test -z "$dir" && dir=.
case $dir in
/etc|/usr/sbin|/usr/etc|/usr/afsws/bin) ;;
*)
if test -f $dir/install; then
if grep dspmsg $dir/install >/dev/null 2>&1; then
: # AIX
else
INSTALL="$dir/install -c"
INSTALL_PROGRAM='$(INSTALL)'
INSTALL_DATA='$(INSTALL) -m 644'
break
fi
fi
;;
esac
done
IFS="$saveifs"
fi
INSTALL=${INSTALL-cp}
INSTALL_PROGRAM=${INSTALL_PROGRAM-'$(INSTALL)'}
INSTALL_DATA=${INSTALL_DATA-'$(INSTALL)'}
echo checking for AIX
echo checking how to run the C preprocessor
if test -z "$CPP"; then
CPP='${CC-cc} -E'
cat > conftest.c <<EOF
#include <stdio.h>
EOF
err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
if test -z "$err"; then
:
else
CPP=/lib/cpp
fi
rm -f conftest*
fi
cat > conftest.c <<EOF
#ifdef _AIX
yes
#endif
EOF
eval "$CPP $DEFS conftest.c > conftest.out 2>&1"
if egrep "yes" conftest.out >/dev/null 2>&1; then
DEFS="$DEFS -D_ALL_SOURCE=1"
fi
rm -f conftest*
echo checking for DYNIX/ptx libseq
cat > conftest.c <<EOF
#if defined(_SEQUENT_)
yes
#endif
EOF
eval "$CPP $DEFS conftest.c > conftest.out 2>&1"
if egrep "yes" conftest.out >/dev/null 2>&1; then
SEQUENT=1
fi
rm -f conftest*
test -n "$SEQUENT" && test -f /usr/lib/libseq.a &&
LIBS="$LIBS -lseq"
echo checking for POSIXized ISC
if test -d /etc/conf/kconfig.d &&
grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
then
ISC=1 # If later tests want to check for ISC.
DEFS="$DEFS -D_POSIX_SOURCE=1"
if test -n "$GCC"; then
CC="$CC -posix"
else
CC="$CC -Xp"
fi
fi
echo checking for minix/config.h
cat > conftest.c <<EOF
#include <minix/config.h>
EOF
err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
if test -z "$err"; then
MINIX=1
fi
rm -f conftest*
# The Minix shell can't assign to the same variable on the same line!
if test -n "$MINIX"; then
DEFS="$DEFS -D_POSIX_SOURCE=1"
DEFS="$DEFS -D_POSIX_1_SOURCE=2"
DEFS="$DEFS -D_MINIX=1"
fi
echo checking for ANSI C header files
cat > conftest.c <<EOF
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <float.h>
EOF
err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
if test -z "$err"; then
# SunOS string.h does not declare mem*, contrary to ANSI.
echo '#include <string.h>' > conftest.c
eval "$CPP $DEFS conftest.c > conftest.out 2>&1"
if egrep "memchr" conftest.out >/dev/null 2>&1; then
# SGI's /bin/cc from Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
cat > conftest.c <<EOF
#include <ctype.h>
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
#define XOR(e,f) (((e) && !(f)) || (!(e) && (f)))
int main () { int i; for (i = 0; i < 256; i++)
if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
exit (0); }
EOF
eval $compile
if test -s conftest && (./conftest; exit) 2>/dev/null; then
DEFS="$DEFS -DSTDC_HEADERS=1"
fi
rm -f conftest*
fi
rm -f conftest*
fi
rm -f conftest*
for hdr in string.h
do
trhdr=HAVE_`echo $hdr | tr '[a-z]./' '[A-Z]__'`
echo checking for ${hdr}
cat > conftest.c <<EOF
#include <${hdr}>
EOF
err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
if test -z "$err"; then
DEFS="$DEFS -D${trhdr}=1"
fi
rm -f conftest*
done
# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
# for constant arguments. Useless!
echo checking for working alloca.h
cat > conftest.c <<EOF
#include <alloca.h>
main() { exit(0); }
t() { char *p = alloca(2 * sizeof(int)); }
EOF
if eval $compile; then
DEFS="$DEFS -DHAVE_ALLOCA_H=1"
fi
rm -f conftest*
decl="#ifdef __GNUC__
#define alloca __builtin_alloca
#else
#if HAVE_ALLOCA_H
#include <alloca.h>
#else
#ifdef _AIX
#pragma alloca
#else
char *alloca ();
#endif
#endif
#endif
"
echo checking for alloca
cat > conftest.c <<EOF
$decl
main() { exit(0); }
t() { char *p = (char *) alloca(1); }
EOF
if eval $compile; then
:
else
alloca_missing=1
fi
rm -f conftest*
if test -n "$alloca_missing"; then
# The SVR3 libPW and SVR4 libucb both contain incompatible functions
# that cause trouble. Some versions do not even contain alloca or
# contain a buggy version. If you still want to use their alloca,
# use ar to extract alloca.o from them instead of compiling alloca.c.
ALLOCA=alloca.o
fi
prog='/* Ultrix mips cc rejects this. */
typedef int charset[2]; const charset x;
/* SunOS 4.1.1 cc rejects this. */
char const *const *p;
char **p2;
/* HPUX 7.0 cc rejects these. */
++p;
p2 = (char const* const*) p;'
echo checking for working const
cat > conftest.c <<EOF
main() { exit(0); }
t() { $prog }
EOF
if eval $compile; then
:
else
DEFS="$DEFS -Dconst="
fi
rm -f conftest*
if test -z "$prefix"
then
echo checking for gcc to derive installation directory prefix
saveifs="$IFS"; IFS="$IFS:"
for dir in $PATH; do
test -z "$dir" && dir=.
if test $dir != . && test -f $dir/gcc; then
# Not all systems have dirname.
prefix=`echo $dir|sed 's%/[^/][^/]*$%%'`
break
fi
done
IFS="$saveifs"
fi
if test -n "$prefix"; then
test -z "$exec_prefix" && exec_prefix='${prefix}'
prsub="s%^prefix\\([ ]*\\)=\\([ ]*\\).*$%prefix\\1=\\2$prefix%"
fi
if test -n "$exec_prefix"; then
prsub="$prsub
s%^exec_prefix\\([ ]*\\)=\\([ ]*\\).*$%\
exec_prefix\\1=\\2$exec_prefix%"
fi
trap 'rm -f config.status; exit 1' 1 3 15
echo creating config.status
rm -f config.status
cat > config.status <<EOF
#!/bin/sh
# Generated automatically by configure.
# Run this file to recreate the current configuration.
# This directory was configured as follows,
# on host `(hostname || uname -n) 2>/dev/null`:
#
# $0 $*
for arg
do
case "\$arg" in
-recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
exec /bin/sh $0 $* ;;
*) echo "Usage: config.status --recheck" 2>&1; exit 1 ;;
esac
done
trap 'rm -f Makefile; exit 1' 1 3 15
CC='$CC'
INSTALL='$INSTALL'
INSTALL_PROGRAM='$INSTALL_PROGRAM'
INSTALL_DATA='$INSTALL_DATA'
CPP='$CPP'
ALLOCA='$ALLOCA'
LIBS='$LIBS'
srcdir='$srcdir'
DEFS='$DEFS'
prefix='$prefix'
exec_prefix='$exec_prefix'
prsub='$prsub'
EOF
cat >> config.status <<\EOF
top_srcdir=$srcdir
for file in .. Makefile; do if [ "x$file" != "x.." ]; then
srcdir=$top_srcdir
# Remove last slash and all that follows it. Not all systems have dirname.
dir=`echo $file|sed 's%/[^/][^/]*$%%'`
if test "$dir" != "$file"; then
test "$top_srcdir" != . && srcdir=$top_srcdir/$dir
test ! -d $dir && mkdir $dir
fi
echo creating $file
rm -f $file
echo "# Generated automatically from `echo $file|sed 's|.*/||'`.in by configure." > $file
sed -e "
$prsub
s%@CC@%$CC%g
s%@INSTALL@%$INSTALL%g
s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
s%@INSTALL_DATA@%$INSTALL_DATA%g
s%@CPP@%$CPP%g
s%@ALLOCA@%$ALLOCA%g
s%@LIBS@%$LIBS%g
s%@srcdir@%$srcdir%g
s%@DEFS@%$DEFS%
" $top_srcdir/${file}.in >> $file
fi; done
exit 0
EOF
chmod +x config.status
test -n "$no_create" || ./config.status
-23
View File
@@ -1,23 +0,0 @@
dnl Process this file with autoconf to produce a configure script.
AC_INIT(regex.c)
AC_PROG_CC
AC_PROG_INSTALL
dnl I'm not sure if AC_AIX and AC_DYNIX_SEQ are really necessary. The
dnl Autoconf documentation isn't specific about which BSD functions they
dnl provide.
AC_AIX
AC_DYNIX_SEQ
AC_ISC_POSIX
AC_MINIX
AC_STDC_HEADERS
AC_HAVE_HEADERS(string.h)
AC_ALLOCA
AC_CONST
AC_PREFIX(gcc)
AC_OUTPUT(Makefile doc/Makefile test/Makefile)
-4
View File
@@ -1,4 +0,0 @@
clean:
default:
all:
echo "."
-4940
View File
File diff suppressed because it is too large Load Diff
-490
View File
@@ -1,490 +0,0 @@
/* Definitions for data structures and routines for the regular
expression library, version 0.12.
Copyright (C) 1985, 1989, 1990, 1991, 1992, 1993 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#ifndef __REGEXP_LIBRARY_H__
#define __REGEXP_LIBRARY_H__
/* POSIX says that <sys/types.h> must be included (by the caller) before
<regex.h>. */
#ifdef VMS
/* VMS doesn't have `size_t' in <sys/types.h>, even though POSIX says it
should be there. */
#include <stddef.h>
#endif
/* The following bits are used to determine the regexp syntax we
recognize. The set/not-set meanings are chosen so that Emacs syntax
remains the value 0. The bits are given in alphabetical order, and
the definitions shifted by one from the previous bit; thus, when we
add or remove a bit, only one other definition need change. */
typedef unsigned reg_syntax_t;
/* If this bit is not set, then \ inside a bracket expression is literal.
If set, then such a \ quotes the following character. */
#define RE_BACKSLASH_ESCAPE_IN_LISTS (1)
/* If this bit is not set, then + and ? are operators, and \+ and \? are
literals.
If set, then \+ and \? are operators and + and ? are literals. */
#define RE_BK_PLUS_QM (RE_BACKSLASH_ESCAPE_IN_LISTS << 1)
/* If this bit is set, then character classes are supported. They are:
[:alpha:], [:upper:], [:lower:], [:digit:], [:alnum:], [:xdigit:],
[:space:], [:print:], [:punct:], [:graph:], and [:cntrl:].
If not set, then character classes are not supported. */
#define RE_CHAR_CLASSES (RE_BK_PLUS_QM << 1)
/* If this bit is set, then ^ and $ are always anchors (outside bracket
expressions, of course).
If this bit is not set, then it depends:
^ is an anchor if it is at the beginning of a regular
expression or after an open-group or an alternation operator;
$ is an anchor if it is at the end of a regular expression, or
before a close-group or an alternation operator.
This bit could be (re)combined with RE_CONTEXT_INDEP_OPS, because
POSIX draft 11.2 says that * etc. in leading positions is undefined.
We already implemented a previous draft which made those constructs
invalid, though, so we haven't changed the code back. */
#define RE_CONTEXT_INDEP_ANCHORS (RE_CHAR_CLASSES << 1)
/* If this bit is set, then special characters are always special
regardless of where they are in the pattern.
If this bit is not set, then special characters are special only in
some contexts; otherwise they are ordinary. Specifically,
* + ? and intervals are only special when not after the beginning,
open-group, or alternation operator. */
#define RE_CONTEXT_INDEP_OPS (RE_CONTEXT_INDEP_ANCHORS << 1)
/* If this bit is set, then *, +, ?, and { cannot be first in an re or
immediately after an alternation or begin-group operator. */
#define RE_CONTEXT_INVALID_OPS (RE_CONTEXT_INDEP_OPS << 1)
/* If this bit is set, then . matches newline.
If not set, then it doesn't. */
#define RE_DOT_NEWLINE (RE_CONTEXT_INVALID_OPS << 1)
/* If this bit is set, then . doesn't match NUL.
If not set, then it does. */
#define RE_DOT_NOT_NULL (RE_DOT_NEWLINE << 1)
/* If this bit is set, nonmatching lists [^...] do not match newline.
If not set, they do. */
#define RE_HAT_LISTS_NOT_NEWLINE (RE_DOT_NOT_NULL << 1)
/* If this bit is set, either \{...\} or {...} defines an
interval, depending on RE_NO_BK_BRACES.
If not set, \{, \}, {, and } are literals. */
#define RE_INTERVALS (RE_HAT_LISTS_NOT_NEWLINE << 1)
/* If this bit is set, +, ? and | aren't recognized as operators.
If not set, they are. */
#define RE_LIMITED_OPS (RE_INTERVALS << 1)
/* If this bit is set, newline is an alternation operator.
If not set, newline is literal. */
#define RE_NEWLINE_ALT (RE_LIMITED_OPS << 1)
/* If this bit is set, then `{...}' defines an interval, and \{ and \}
are literals.
If not set, then `\{...\}' defines an interval. */
#define RE_NO_BK_BRACES (RE_NEWLINE_ALT << 1)
/* If this bit is set, (...) defines a group, and \( and \) are literals.
If not set, \(...\) defines a group, and ( and ) are literals. */
#define RE_NO_BK_PARENS (RE_NO_BK_BRACES << 1)
/* If this bit is set, then \<digit> matches <digit>.
If not set, then \<digit> is a back-reference. */
#define RE_NO_BK_REFS (RE_NO_BK_PARENS << 1)
/* If this bit is set, then | is an alternation operator, and \| is literal.
If not set, then \| is an alternation operator, and | is literal. */
#define RE_NO_BK_VBAR (RE_NO_BK_REFS << 1)
/* If this bit is set, then an ending range point collating higher
than the starting range point, as in [z-a], is invalid.
If not set, then when ending range point collates higher than the
starting range point, the range is ignored. */
#define RE_NO_EMPTY_RANGES (RE_NO_BK_VBAR << 1)
/* If this bit is set, then an unmatched ) is ordinary.
If not set, then an unmatched ) is invalid. */
#define RE_UNMATCHED_RIGHT_PAREN_ORD (RE_NO_EMPTY_RANGES << 1)
/* This global variable defines the particular regexp syntax to use (for
some interfaces). When a regexp is compiled, the syntax used is
stored in the pattern buffer, so changing this does not affect
already-compiled regexps. */
extern reg_syntax_t re_syntax_options;
/* Define combinations of the above bits for the standard possibilities.
(The [[[ comments delimit what gets put into the Texinfo file, so
don't delete them!) */
/* [[[begin syntaxes]]] */
#define RE_SYNTAX_EMACS 0
#define RE_SYNTAX_AWK \
(RE_BACKSLASH_ESCAPE_IN_LISTS | RE_DOT_NOT_NULL \
| RE_NO_BK_PARENS | RE_NO_BK_REFS \
| RE_NO_BK_VBAR | RE_NO_EMPTY_RANGES \
| RE_UNMATCHED_RIGHT_PAREN_ORD)
#define RE_SYNTAX_POSIX_AWK \
(RE_SYNTAX_POSIX_EXTENDED | RE_BACKSLASH_ESCAPE_IN_LISTS)
#define RE_SYNTAX_GREP \
(RE_BK_PLUS_QM | RE_CHAR_CLASSES \
| RE_HAT_LISTS_NOT_NEWLINE | RE_INTERVALS \
| RE_NEWLINE_ALT)
#define RE_SYNTAX_EGREP \
(RE_CHAR_CLASSES | RE_CONTEXT_INDEP_ANCHORS \
| RE_CONTEXT_INDEP_OPS | RE_HAT_LISTS_NOT_NEWLINE \
| RE_NEWLINE_ALT | RE_NO_BK_PARENS \
| RE_NO_BK_VBAR)
#define RE_SYNTAX_POSIX_EGREP \
(RE_SYNTAX_EGREP | RE_INTERVALS | RE_NO_BK_BRACES)
/* P1003.2/D11.2, section 4.20.7.1, lines 5078ff. */
#define RE_SYNTAX_ED RE_SYNTAX_POSIX_BASIC
#define RE_SYNTAX_SED RE_SYNTAX_POSIX_BASIC
/* Syntax bits common to both basic and extended POSIX regex syntax. */
#define _RE_SYNTAX_POSIX_COMMON \
(RE_CHAR_CLASSES | RE_DOT_NEWLINE | RE_DOT_NOT_NULL \
| RE_INTERVALS | RE_NO_EMPTY_RANGES)
#define RE_SYNTAX_POSIX_BASIC \
(_RE_SYNTAX_POSIX_COMMON | RE_BK_PLUS_QM)
/* Differs from ..._POSIX_BASIC only in that RE_BK_PLUS_QM becomes
RE_LIMITED_OPS, i.e., \? \+ \| are not recognized. Actually, this
isn't minimal, since other operators, such as \`, aren't disabled. */
#define RE_SYNTAX_POSIX_MINIMAL_BASIC \
(_RE_SYNTAX_POSIX_COMMON | RE_LIMITED_OPS)
#define RE_SYNTAX_POSIX_EXTENDED \
(_RE_SYNTAX_POSIX_COMMON | RE_CONTEXT_INDEP_ANCHORS \
| RE_CONTEXT_INDEP_OPS | RE_NO_BK_BRACES \
| RE_NO_BK_PARENS | RE_NO_BK_VBAR \
| RE_UNMATCHED_RIGHT_PAREN_ORD)
/* Differs from ..._POSIX_EXTENDED in that RE_CONTEXT_INVALID_OPS
replaces RE_CONTEXT_INDEP_OPS and RE_NO_BK_REFS is added. */
#define RE_SYNTAX_POSIX_MINIMAL_EXTENDED \
(_RE_SYNTAX_POSIX_COMMON | RE_CONTEXT_INDEP_ANCHORS \
| RE_CONTEXT_INVALID_OPS | RE_NO_BK_BRACES \
| RE_NO_BK_PARENS | RE_NO_BK_REFS \
| RE_NO_BK_VBAR | RE_UNMATCHED_RIGHT_PAREN_ORD)
/* [[[end syntaxes]]] */
/* Maximum number of duplicates an interval can allow. Some systems
(erroneously) define this in other header files, but we want our
value, so remove any previous define. */
#ifdef RE_DUP_MAX
#undef RE_DUP_MAX
#endif
#define RE_DUP_MAX ((1 << 15) - 1)
/* POSIX `cflags' bits (i.e., information for `regcomp'). */
/* If this bit is set, then use extended regular expression syntax.
If not set, then use basic regular expression syntax. */
#define REG_EXTENDED 1
/* If this bit is set, then ignore case when matching.
If not set, then case is significant. */
#define REG_ICASE (REG_EXTENDED << 1)
/* If this bit is set, then anchors do not match at newline
characters in the string.
If not set, then anchors do match at newlines. */
#define REG_NEWLINE (REG_ICASE << 1)
/* If this bit is set, then report only success or fail in regexec.
If not set, then returns differ between not matching and errors. */
#define REG_NOSUB (REG_NEWLINE << 1)
/* POSIX `eflags' bits (i.e., information for regexec). */
/* If this bit is set, then the beginning-of-line operator doesn't match
the beginning of the string (presumably because it's not the
beginning of a line).
If not set, then the beginning-of-line operator does match the
beginning of the string. */
#define REG_NOTBOL 1
/* Like REG_NOTBOL, except for the end-of-line. */
#define REG_NOTEOL (1 << 1)
/* If any error codes are removed, changed, or added, update the
`re_error_msg' table in regex.c. */
typedef enum
{
REG_NOERROR = 0, /* Success. */
REG_NOMATCH, /* Didn't find a match (for regexec). */
/* POSIX regcomp return error codes. (In the order listed in the
standard.) */
REG_BADPAT, /* Invalid pattern. */
REG_ECOLLATE, /* Not implemented. */
REG_ECTYPE, /* Invalid character class name. */
REG_EESCAPE, /* Trailing backslash. */
REG_ESUBREG, /* Invalid back reference. */
REG_EBRACK, /* Unmatched left bracket. */
REG_EPAREN, /* Parenthesis imbalance. */
REG_EBRACE, /* Unmatched \{. */
REG_BADBR, /* Invalid contents of \{\}. */
REG_ERANGE, /* Invalid range end. */
REG_ESPACE, /* Ran out of memory. */
REG_BADRPT, /* No preceding re for repetition op. */
/* Error codes we've added. */
REG_EEND, /* Premature end. */
REG_ESIZE, /* Compiled pattern bigger than 2^16 bytes. */
REG_ERPAREN /* Unmatched ) or \); not returned from regcomp. */
} reg_errcode_t;
/* This data structure represents a compiled pattern. Before calling
the pattern compiler, the fields `buffer', `allocated', `fastmap',
`translate', and `no_sub' can be set. After the pattern has been
compiled, the `re_nsub' field is available. All other fields are
private to the regex routines. */
struct re_pattern_buffer
{
/* [[[begin pattern_buffer]]] */
/* Space that holds the compiled pattern. It is declared as
`unsigned char *' because its elements are
sometimes used as array indexes. */
unsigned char *buffer;
/* Number of bytes to which `buffer' points. */
unsigned long allocated;
/* Number of bytes actually used in `buffer'. */
unsigned long used;
/* Syntax setting with which the pattern was compiled. */
reg_syntax_t syntax;
/* Pointer to a fastmap, if any, otherwise zero. re_search uses
the fastmap, if there is one, to skip over impossible
starting points for matches. */
char *fastmap;
/* Either a translate table to apply to all characters before
comparing them, or zero for no translation. The translation
is applied to a pattern when it is compiled and to a string
when it is matched. */
char *translate;
/* Number of subexpressions found by the compiler. */
size_t re_nsub;
/* Zero if this pattern cannot match the empty string, one else.
Well, in truth it's used only in `re_search_2', to see
whether or not we should use the fastmap, so we don't set
this absolutely perfectly; see `re_compile_fastmap' (the
`duplicate' case). */
unsigned can_be_null : 1;
/* If REGS_UNALLOCATED, allocate space in the `regs' structure
for `max (RE_NREGS, re_nsub + 1)' groups.
If REGS_REALLOCATE, reallocate space if necessary.
If REGS_FIXED, use what's there. */
#define REGS_UNALLOCATED 0
#define REGS_REALLOCATE 1
#define REGS_FIXED 2
unsigned regs_allocated : 2;
/* Set to zero when `regex_compile' compiles a pattern; set to one
by `re_compile_fastmap' if it updates the fastmap. */
unsigned fastmap_accurate : 1;
/* If set, `re_match_2' does not return information about
subexpressions. */
unsigned no_sub : 1;
/* If set, a beginning-of-line anchor doesn't match at the
beginning of the string. */
unsigned not_bol : 1;
/* Similarly for an end-of-line anchor. */
unsigned not_eol : 1;
/* If true, an anchor at a newline matches. */
unsigned newline_anchor : 1;
/* [[[end pattern_buffer]]] */
};
typedef struct re_pattern_buffer regex_t;
/* search.c (search_buffer) in Emacs needs this one opcode value. It is
defined both in `regex.c' and here. */
#define RE_EXACTN_VALUE 1
/* Type for byte offsets within the string. POSIX mandates this. */
typedef int regoff_t;
/* This is the structure we store register match data in. See
regex.texinfo for a full description of what registers match. */
struct re_registers
{
unsigned num_regs;
regoff_t *start;
regoff_t *end;
};
/* If `regs_allocated' is REGS_UNALLOCATED in the pattern buffer,
`re_match_2' returns information about at least this many registers
the first time a `regs' structure is passed. */
#ifndef RE_NREGS
#define RE_NREGS 30
#endif
/* POSIX specification for registers. Aside from the different names than
`re_registers', POSIX uses an array of structures, instead of a
structure of arrays. */
typedef struct
{
regoff_t rm_so; /* Byte offset from string's start to substring's start. */
regoff_t rm_eo; /* Byte offset from string's start to substring's end. */
} regmatch_t;
/* Declarations for routines. */
/* To avoid duplicating every routine declaration -- once with a
prototype (if we are ANSI), and once without (if we aren't) -- we
use the following macro to declare argument types. This
unfortunately clutters up the declarations a bit, but I think it's
worth it. */
#if __STDC__
#define _RE_ARGS(args) args
#else /* not __STDC__ */
#define _RE_ARGS(args) ()
#endif /* not __STDC__ */
/* Sets the current default syntax to SYNTAX, and return the old syntax.
You can also simply assign to the `re_syntax_options' variable. */
extern reg_syntax_t re_set_syntax _RE_ARGS ((reg_syntax_t syntax));
/* Compile the regular expression PATTERN, with length LENGTH
and syntax given by the global `re_syntax_options', into the buffer
BUFFER. Return NULL if successful, and an error string if not. */
extern const char *re_compile_pattern
_RE_ARGS ((const char *pattern, int length,
struct re_pattern_buffer *buffer));
/* Compile a fastmap for the compiled pattern in BUFFER; used to
accelerate searches. Return 0 if successful and -2 if was an
internal error. */
extern int re_compile_fastmap _RE_ARGS ((struct re_pattern_buffer *buffer));
/* Search in the string STRING (with length LENGTH) for the pattern
compiled into BUFFER. Start searching at position START, for RANGE
characters. Return the starting position of the match, -1 for no
match, or -2 for an internal error. Also return register
information in REGS (if REGS and BUFFER->no_sub are nonzero). */
extern int re_search
_RE_ARGS ((struct re_pattern_buffer *buffer, const char *string,
int length, int start, int range, struct re_registers *regs));
/* Like `re_search', but search in the concatenation of STRING1 and
STRING2. Also, stop searching at index START + STOP. */
extern int re_search_2
_RE_ARGS ((struct re_pattern_buffer *buffer, const char *string1,
int length1, const char *string2, int length2,
int start, int range, struct re_registers *regs, int stop));
/* Like `re_search', but return how many characters in STRING the regexp
in BUFFER matched, starting at position START. */
extern int re_match
_RE_ARGS ((struct re_pattern_buffer *buffer, const char *string,
int length, int start, struct re_registers *regs));
/* Relates to `re_match' as `re_search_2' relates to `re_search'. */
extern int re_match_2
_RE_ARGS ((struct re_pattern_buffer *buffer, const char *string1,
int length1, const char *string2, int length2,
int start, struct re_registers *regs, int stop));
/* Set REGS to hold NUM_REGS registers, storing them in STARTS and
ENDS. Subsequent matches using BUFFER and REGS will use this memory
for recording register information. STARTS and ENDS must be
allocated with malloc, and must each be at least `NUM_REGS * sizeof
(regoff_t)' bytes long.
If NUM_REGS == 0, then subsequent matches should allocate their own
register data.
Unless this function is called, the first search or match using
PATTERN_BUFFER will allocate its own register data, without
freeing the old data. */
extern void re_set_registers
_RE_ARGS ((struct re_pattern_buffer *buffer, struct re_registers *regs,
unsigned num_regs, regoff_t *starts, regoff_t *ends));
/* 4.2 bsd compatibility. */
extern char *re_comp _RE_ARGS ((const char *));
extern int re_exec _RE_ARGS ((const char *));
/* POSIX compatibility. */
extern int regcomp _RE_ARGS ((regex_t *preg, const char *pattern, int cflags));
extern int regexec
_RE_ARGS ((const regex_t *preg, const char *string, size_t nmatch,
regmatch_t pmatch[], int eflags));
extern size_t regerror
_RE_ARGS ((int errcode, const regex_t *preg, char *errbuf,
size_t errbuf_size));
extern void regfree _RE_ARGS ((regex_t *preg));
#endif /* not __REGEXP_LIBRARY_H__ */
/*
Local variables:
make-backup-files: t
version-control: t
trim-versions-without-asking: nil
End:
*/
+5 -6
View File
@@ -1,12 +1,12 @@
# AppArmor profile for UnrealIRCd 4.0.16+
# AppArmor profile for UnrealIRCd 6
#
# Note that you may still see some DENIED warnings in logs with
# operation="chmod". These are harmless and can be safely ignored.
#
# Tested on Ubuntu 16.x and 17.x
# Tested on Ubuntu 16.04 LTS, Ubuntu 18.04 LTS, Ubuntu 20.04 LTS
#
# NOTE: you will have to modify the path to executable below
# if it's not /home/ircd/unrealircd/bin/unrealircd.
# IMPORTANT: you will have to modify the path to executable below
# if it's not /home/ircd/unrealircd/bin/unrealircd !
#include <tunables/global>
@@ -17,8 +17,7 @@
@{HOME}/unrealircd/conf/ r,
@{HOME}/unrealircd/conf/** r,
@{HOME}/unrealircd/data/ircd.tune rw,
@{HOME}/unrealircd/data/unrealircd.pid rw,
@{HOME}/unrealircd/data/** rw,
@{HOME}/unrealircd/lib/*.so* mr,
@{HOME}/unrealircd/logs/* rw,
@{HOME}/unrealircd/modules/**.so r,
+41
View File
@@ -0,0 +1,41 @@
# Systemd service for UnrealIRCd
# To use this:
# 1) Adjust user/group/paths under [Service] if needed.
# 2) Then run the following commands as root:
# cp -av unrealircd.service /etc/systemd/system/
# systemctl daemon-reload
# systemctl enable unrealircd.service
# systemctl start unrealircd.service
[Unit]
Description=UnrealIRCd
Documentation=https://www.unrealircd.org/
Description=UnrealIRCd IRC Server
After=network-online.target
Wants=network-online.target
[Service]
# If needed, change 'ircd' to your unrealircd user and adjust paths:
User=ircd
Group=ircd
ExecStart=/home/ircd/unrealircd/bin/unrealircd -F
# These settings should be fine for everyone
Type=simple
Restart=on-failure
RestartSec=5s
LimitNOFILE=65536
ExecReload=/bin/kill -HUP $MAINPID
ExecStop=/bin/kill -TERM $MAINPID
NoNewPrivileges=true
PrivateTmp=true
ProtectKernelTunables=true
ProtectKernelModules=true
ProtectControlGroups=true
LockPersonality=true
MemoryDenyWriteExecute=true
RestrictRealtime=true
ProtectSystem=strict
[Install]
WantedBy=default.target
+37
View File
@@ -0,0 +1,37 @@
# Systemd service for UnrealIRCd (user service)
#
# This is the USER service. You can use this if you don't have root
# on the machine (otherwise, people usually use the other
# unrealircd.service system unit instead).
#
# To install:
# 1) Adjust the ExecStart= line below, if your unrealircd isn't
# installed in ~/unrealircd/
# 2) Then run the following commands (as a regular user):
# loginctl enable-linger
# mkdir -p ~/.config/systemd/user
# cp unrealircd_user.service ~/.config/systemd/user/unrealircd.service
# systemctl --user daemon-reload
# systemctl --user enable unrealircd.service
# systemctl --user start unrealircd.service
[Unit]
Description=UnrealIRCd
Documentation=https://www.unrealircd.org/
Description=UnrealIRCd IRC Server (user service)
After=network-online.target
Wants=network-online.target
[Service]
# Adjust this if unrealircd is installed somewhere else:
ExecStart=%h/unrealircd/bin/unrealircd -F
Type=simple
Restart=on-failure
RestartSec=5s
LimitNOFILE=65536
ExecReload=/bin/kill -HUP $MAINPID
ExecStop=/bin/kill -TERM $MAINPID
[Install]
WantedBy=default.target

Some files were not shown because too many files have changed in this diff Show More