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
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
01753c67cd
Validate hostname and vhost in UID command. And some very minor cleanups.
2021-08-12 09:13:02 +02:00