1073 Commits

Author SHA1 Message Date
Sadie Powell
8831595e1a Rework how users are assigned to connect classes.
- Move core connect class checks and <performance:clonesonconnect>
  to the core_user module.
- Add pre-change and post-change events for when a connect class
  changes.
- Split explicit class changing out into its own method.
- Remove the need to almost always call CheckClass after SetClass.
- Add use counting to the connect class instead of relying on the
  shared_ptr use count.
2023-01-08 16:28:40 +00:00
Sadie Powell
ef292c8d80 Fix CanUseSnomask checking the wrong snomask index.
We reuse the mode index packing here to avoid duplication.
2023-01-02 22:49:07 +00:00
Sadie Powell
b1e6084b2d Fix getting the full snomask and mode lists. 2023-01-02 22:49:07 +00:00
Sadie Powell
45ef938965 Get rid of the virtual Has*Permission methods.
These are no longer needed now we store privs for the remote oper.
2023-01-02 21:49:20 +00:00
Sadie Powell
137dbe2fdc Allow getting all of the oper command/mode/snomask privs. 2023-01-02 21:05:19 +00:00
Sadie Powell
37ce48e61a Add some useful aliases to OperType. 2023-01-02 19:48:14 +00:00
Sadie Powell
d048778f78 Merge branch 'insp3' into master. 2023-01-01 13:19:45 +00:00
InspIRCd Robot
2b810b412a Update copyright headers. 2022-12-30 11:31:28 +00:00
Sadie Powell
b1eb362d83 Refactor SocketEngine slightly.
- Remove pointless shutdown() wrapper.
- Remove pointless bounds checking function.
- Make Bind and Listen take an EventHandler instead of a fd.
- Add nullability attributes to every method.
2022-12-25 22:41:28 +00:00
Sadie Powell
7673db8d1b Pass the client/server sockaddr around as a ref instead of a ptr. 2022-12-25 13:06:50 +00:00
Sadie Powell
2ddb623198 Use in_port_t instead of int/unsigned int/long. 2022-12-18 18:47:28 +00:00
Sadie Powell
d8b4414ee1 Rework the levels things are logged at to make more sense. 2022-12-18 13:43:33 +00:00
Sadie Powell
bfee808f26 Fix conflicting with a predefined value on Windows.
STRICT is already defined on Windows so we'll need to do something
else here. Thanks Microsoft.
2022-12-11 10:31:00 +00:00
Sadie Powell
3c6e24665f Move <oper:autologin> from m_sslinfo to core_oper and rework.
- Promote autologin to a core concept with visibility in events.

- Replace the binary yes/no value with strict/relaxed/never. This
  intentionally breaks v3 oper block autologin as admins will need
  to review them for the security implications of the new behaviour.
2022-12-11 10:14:33 +00:00
Sadie Powell
9d35da3e84 Move password checking from core_oper into OperAccount. 2022-12-10 15:30:51 +00:00
Sadie Powell
86b4a0853e Remove the unused Extensible* parameter to PassCompare/OnPassCompare. 2022-12-10 15:22:15 +00:00
Sadie Powell
52e048b214 Allow modules to ignore any checks from OnPreOperLogin. 2022-12-10 14:58:48 +00:00
Sadie Powell
5e44188857 More const correctness work. 2022-12-08 10:19:47 +00:00
Sadie Powell
d130106374 Avoid copying a shared_ptr where not actually necessary. 2022-12-01 05:39:24 +00:00
Sadie Powell
45e56e5ee1 Yet more stylistic fixes. 2022-12-01 05:25:01 +00:00
Sadie Powell
4df802c56f Fix GetSnomasks returning unregistered snomasks. 2022-11-30 10:51:21 +00:00
Sadie Powell
f9ef385b89 Move the oper statistics to core_oper and rewrite.
The numerics we used previously were not being used according to
the RFC and every implementation has their own behaviour here which
makes it hard for clients to do anything reasonable. Instead of this
using the generic stats numeric makes a lot more sense.
2022-11-29 04:52:42 +00:00
Sadie Powell
ee41348dbd Avoid sending an +o mode change when the mode isn't available.
This is generally fine but may cause problems if an oper unloads
the core_oper module.
2022-11-28 03:22:08 +00:00
Sadie Powell
ee44af8d04 Refactor the internals of the oper system.
- Allow overriding privileges from the <class> blocks in the <type>
  and <oper> blocks.
- Separate oper types from oper accounts in the code. This enables
  moving some core stuff out of the config tag later.
- Merge the config tags together to make a synthetic tag that can
  have getXXX called on it instead of using getConfig and then
  converting it.
- Move the details of Have*Permission into the oper type class.
- Improve oper events to allow modules to easily hook into the oper
  system.
2022-11-28 02:57:50 +00:00
Sadie Powell
561fe0fe64 Clean up the typedefs for OnBuildNeighborList. 2022-10-29 17:38:58 +01:00
Sadie Powell
6fc111ccb6 Rename session registration to connection to avoid a semantic conflict.
We previously referred to both session registration and user registration
as "registration" which is confusing for users who aren't familiar with
how IRC works.
2022-10-29 15:54:59 +01:00
Sadie Powell
5a508c19ff Use User::IsFullyConnected instead of checking for REG_ALL. 2022-10-29 13:43:11 +01:00
Sadie Powell
41d1312853 Rename User::age to User::nickchanged and fix the docs. 2022-10-11 11:12:04 +01:00
Sadie Powell
552b2db321 Mark User::Has{Command,Priv}Permission as const. 2022-10-07 21:34:37 +01:00
Sadie Powell
89537ed2ab Fix various cases of the &* being next to the name instead of type. 2022-09-29 12:36:01 +01:00
Sadie Powell
9203f40f41 Fix some warnings noticed by the readability-* clang-tidy checkers. 2022-09-03 23:17:05 +01:00
Sadie Powell
2cfc79bfcb Rip out the extensible/user serialisation system.
This was part of a failed attempt to implement zero downtime
restarts in v3. This can be implemented in a better way but for
now its just slowing down build times so lets kill it.
2022-09-01 11:53:47 +01:00
Sadie Powell
6c34d4e8ea Update some code that uses "endpoint" to use "socket address" instead. 2022-09-01 11:53:47 +01:00
Sadie Powell
f88fbaa2fe Move aptosa/untosa into the sockaddrs union and add from/from_ip.
The struct will also now always be zero-initialized by default which
removes the footgun which has happened previously where the union has
been accessed before being initialized leading to it containing weird
values.
2022-08-11 15:40:57 +01:00
Sadie Powell
5c751696d6 Rename OnSetUserIP to OnChangeRemoteAddress. 2022-08-10 22:18:06 +01:00
Sadie Powell
d4125ff12d Rename SetClientIP to ChangeRemoteAddress. 2022-08-10 22:16:06 +01:00
Sadie Powell
2dc07dbc06 Merge branch 'insp3' into master. 2022-08-10 22:04:19 +01:00
Sadie Powell
ff28fd38e5 Fix some harmless debug messages when initializing remote users. 2022-08-10 14:46:05 +01:00
Sadie Powell
3c455a8511 Modernize various minor legacy C++isms. 2022-07-30 19:15:41 +01:00
Sadie Powell
ad2aecf191 Remove some unnecessary getters in ConnectClass.
All of these members are public anyway.
2022-07-22 20:44:47 +01:00
Sadie Powell
648f813f8c Switch from NULL to nullptr. 2022-07-22 18:53:21 +01:00
Sadie Powell
68fd81b319 Make clientprotocol{msg,event} and numericbuilder non-default headers. 2022-06-26 16:34:21 +01:00
Sadie Powell
89712e2e84 Move numerics to the source files where they are actually used. 2022-06-26 15:29:29 +01:00
Sadie Powell
ed95dcf44a Remove unnecessary arguments to On(Post)Oper.
These are already accessible from the user object.
2022-05-07 18:01:43 +01:00
Sadie Powell
e23ee3fde1 Rewrite logging calls to use the new APIs. 2022-05-01 22:07:14 +01:00
Sadie Powell
d7912e6a3e Merge branch 'insp3' into master. 2022-04-29 11:24:05 +01:00
InspIRCd Robot
346ec99c43 Update copyright headers. 2022-04-28 18:49:16 +01:00
Sadie Powell
056d0b4383 Pack the mode set more efficiently and add support for numeric modes. 2022-03-27 16:09:19 +01:00
Sadie Powell
414105e409 Add a typedef for the mode status bitset. 2022-03-27 16:09:19 +01:00
Sadie Powell
f06ea52d0a Merge branch 'insp3' into master. 2022-03-27 15:30:41 +01:00