1
0
mirror of https://github.com/unrealircd/unrealircd.git synced 2026-06-25 22:26:38 +02:00
Commit Graph

600 Commits

Author SHA1 Message Date
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 da5aefaad7 Get rid of class.h 2019-10-26 10:02:00 +02:00
Bram Matthys 24c60fd85e Fix some doxygen tags (eg @notes to @note) 2019-10-26 09:33:09 +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 49c2f7c2c3 Get rid of this whole kill path nonsense. 2019-10-16 11:11:46 +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 44f9423e13 Remove ID() macro as client->id always contains a proper UID now. 2019-10-13 20:11:58 +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 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 394168c288 Style fixes: "char* " -> "char *" etc. 2019-10-11 12:23:45 +02:00
Bram Matthys 798b223ee3 Convert some more stuff to enums (config preprocessor mostly). 2019-10-06 07:54:46 +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 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 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 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 9e4dbf8c89 dead_link() -> dead_socket() since that is more descriptive 2019-10-04 11:36:34 +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 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 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 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 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 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 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 baf02e8980 Rename all m_* functions to cmd_* functions. 2019-09-13 15:45:19 +02:00
GottemHams 358a31eaee First draft of require-modules module (require modules globally or deny them) 2019-09-11 22:18: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