512 Commits

Author SHA1 Message Date
Sadie Powell
05cea6f835 Fix formatting strings on C++20 compilers. 2024-08-22 09:41:36 +01:00
Sadie Powell
d95be0a516 Add a formatting overload to {Membership,User}::Write(Remote)Notice. 2024-08-18 16:19:12 +01:00
Sadie Powell
ca78bc4a0e Document Write* members in the User type correctly. 2024-08-18 15:53:01 +01:00
InspIRCd Robot
fd4c5e3840 Update copyright headers. 2024-06-21 10:36:09 +01:00
InspIRCd Robot
ae3e2db109 Update copyright headers. 2024-06-07 10:37:56 +01:00
Sadie Powell
c3cff63dca Make passwords for oper accounts optional.
This allows restricting an oper account based on other data such
as TLS fingerprint or services account but without logging them in
automatically like autologin.
2024-05-16 12:29:32 +01:00
Sadie Powell
57368bd981 If a user has an oper connect class then reset it when de-opering. 2024-02-19 12:27:28 +00:00
Sadie Powell
635feb1a9a Rework how away state is stored internally.
This will be necessary for implementing pre-away as well as some
changes for WATCH compatibility with Unreal.
2023-08-04 13:14:49 +01:00
Sadie Powell
a0e424fc3a Refactor Change{Displayed,Real}Host to match other Change* methods. 2023-06-30 08:28:40 +01:00
Sadie Powell
1d96baaf77 Remove OnPreChange{Host,RealName} events and deboolify methods.
These have not ever been used as far as I can see.
2023-06-29 22:52:07 +01:00
Sadie Powell
29705306f2 Retain the "real" username properly like we do for hostnames.
This introduces the concept of a real username. This value comes
from either the initial USER message or from an ident lookup. Doing
this allows us to use it for bans through vidents and cloaking web
client users using their remote username.

While changing this I also changed all of the uses of "ident" other
than RFC 1413 lookups and some compatibility cases to refer to
usernames as user(name) instead of ident. Our use of ident in these
places was incorrect as that only refers to the RFC 1413 response
and is not commonly used in the way we used it by any other IRC
server implementations.
2023-06-29 17:01:25 +01:00
Sadie Powell
1f5551c1e8 Inline various User methods. 2023-06-25 17:18:08 +01:00
Sadie Powell
57cc457ec6 Rename some headers to match the common naming system. 2023-01-26 06:16:57 +00:00
Sadie Powell
f310e1c98d Refactor the caching methods in User and rename to make more sense. 2023-01-24 02:58:46 +00:00
Sadie Powell
cadf228c3e Convert various enums to strongly typed scoped enums. 2023-01-22 22:36:31 +00:00
Sadie Powell
1b2916c845 Avoid copying shared_ptr<ConfigTag> when not necessary. 2023-01-10 21:27:18 +00:00
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
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
4a468f26cc Allow synching oper privileges between servers. 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
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
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
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
7a623b0663 Use T&& instead of T or const T&. 2022-11-29 06:09:01 +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
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
a46b8b8ede Allow UserManager::Find{Nick,UUID,} to ignore unregistered users. 2022-10-29 13:01:42 +01:00
Sadie Powell
859088dac5 More const correctness. 2022-10-23 14:51:33 +01:00
Sadie Powell
3928f478f1 Assign more class members inline instead of in the constructor. 2022-10-21 17:15:10 +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
28a7f1f0c8 Merge branch 'insp3' into master. 2022-08-27 14:48:19 +01:00
InspIRCd Robot
96f355c2fa Update copyright headers. 2022-08-25 20:46:11 +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
bbdbbc64d5 Deprecate the string variant of SetClientIP.
Nothing uses this anymore.
2022-08-10 19:37:07 +01:00