Commit graph

61 commits

Author SHA1 Message Date
Ed Kellett
06c5309534 m_sasl: Remove implicit abort on registration
This doesn't make sense in a world where post-registration SASL is
allowed, and should fix one case of an annoying login desync that's seen
in the real world.

Specifically, when a client sends its final AUTHENTICATE and Atheme
receives it, it sends an SVSLOGIN for that client. If the client sends
us its CAP END *before* we see the SVSLOGIN, the implicit abort will try
to abort the SASL session that's already succeeded.

Atheme interprets this as an instruction to forget about the successful
SASL session; you'll connect unidentified. But it's already sent
SVSLOGIN, which will log the client in ircd-side, causing ircd and
services views to differ until the user authenticates again manually.

I think allowing a SASL session to be aborted when it has already
succeeded is an Atheme bug, and it can still be triggered without this
change. But our behaviour here seems silly anyway.
2022-10-06 17:06:28 -04:00
Doug Freed
fae8f2517c valid_temp_time: more simplification and test fixes 2022-06-20 16:35:03 +01:00
Ed Kellett
4f46809305 valid_temp_time: simplify/correct overflow check
the logic for trying to detect the maximum value of time_t was broken;
since we target a lower maximum time anyway, just use that for the
overflow check
2022-06-20 16:35:03 +01:00
Ed Kellett
1fcdacb424 Test some edge cases of valid_temp_time 2022-04-13 01:09:27 +01:00
Ed Kellett
2644dcd166 Add tests for valid_temp_time 2022-03-06 22:51:19 +00:00
Ariadne Conill
40ae4dee6c tests: chase listener refactor changes 2021-07-31 00:05:59 -04:00
jailbird777
8f0c3422e7 Remove Windows support 2021-07-30 14:17:47 -04:00
Ed Kellett
df4fead0f2 privilegeset_add_privs: append rather than replace 2021-03-01 15:45:03 +00:00
Ed Kellett
9962f62577 privilegeset_diff: return things in a struct 2021-03-01 15:45:03 +00:00
Ed Kellett
ae54b3a735 Add tests for privsets 2021-03-01 15:45:03 +00:00
Ed Kellett
2e79cebb9e
chmode: centralise + test mode limits (#94) 2021-01-26 11:22:39 +00:00
Ed Kellett
6f88bf5c30 Add some tests for multiline 2020-11-12 19:18:01 -05:00
Ed Kellett
0e50ab822d tests: clean *.db, *.log
Co-authored-by: Unit 193 <unit193@unit193.net>
2020-11-10 09:37:55 +00:00
Ed Kellett
828f8ffada Autogenerate tests/runtime/modules 2020-11-09 09:18:36 +00:00
Ed Kellett
4eeaf9473e tests: autogenerate TESTS 2020-11-09 09:18:36 +00:00
Ed Kellett
c4f463c9ad tests: cleanup .gitignore 2020-11-09 09:18:36 +00:00
Ed Kellett
875051669a tests: implicitly link *_util.c into every test 2020-11-09 09:18:36 +00:00
Ed Kellett
7393690255 Test chmode parsing 2020-11-08 00:26:27 +00:00
Ed Kellett
5409fbc0f7 Mark fake test clients, don't assert they're real 2020-11-01 04:33:30 +00:00
Ed Kellett
57fbf05388 Fix a corner case of superset matching
The algorithm we're using gets stuck if it has a ? and can only see a *
to feed to it, even if it could skip over that * and consume a character
following it. Remedy this by rearranging the input so * always precedes
? in runs of wildcards, so when we're matching ? we know we can skip
things.
2020-10-31 17:00:25 +00:00
Ed Kellett
83e9a49847 Add (some failing) tests for mask matching 2020-10-31 17:00:25 +00:00
Ed Kellett
94613c78b6 Implement the solanum.chat/identify-msg vendor cap 2020-10-16 21:47:38 +01:00
Ed Kellett
a6f63a829e
Innovation by sed 2020-10-15 15:52:41 +01:00
Aaron Jones
59cfd72e68
Merge pull request #355 from edk0/kline-cidr
Improve [kd]line handling of invalid IP-like masks
2020-08-06 09:17:00 +00:00
Ed Kellett
4af85fed0a
Test sendto_channel_local_priv not ONLY_OPERS 2020-08-04 22:58:31 +01:00
Ed Kellett
9ea60637cd
Add tests for parse_netmask 2020-07-26 22:03:20 +01:00
Aaron Jones
860d2381cf
Merge pull request #345 from edk0/alias
m_alias: Preserve protocol framing characters
2020-07-07 09:16:38 +00:00
Ed Kellett
f42959a205
Add tests for opmod_send_statusmsg 2020-07-06 10:36:35 +01:00
Ed Kellett
4e14f9a413
m_alias: Preserve protocol framing characters 2020-07-05 01:15:03 +01:00
Aaron Jones
c7561f03ef
Merge pull request #319 from edk0/invite-notify
Fix invite-notify and move it to an extension
2020-05-01 16:22:44 +00:00
Ed Kellett
0934799fb9
Use a different cap for send tests 2020-04-30 18:17:00 +01:00
Ed Kellett
30725c434b
Run tests with ASan leak detection off
The test environment is sufficiently weird that I don't think fixing
these would be a good use of anyone's time
2020-04-26 16:05:05 +01:00
Simon Arlott
155ecb7a7a
tests: Check sendto_wallops_flags works with format strings 2020-01-11 16:26:10 +00:00
Aaron Jones
ac0ae805d7
tests/Makefile.am: check-local: don't depend on extensions/*
This breaks if a file in extensions/ doesn't get built due to
conditional compilation, and the tests don't need anything
under extensions/ anyway.
2019-10-07 03:49:00 +00:00
Ed Kellett
ed3ca2ff16
Propagate OPER
Move opername and privset storage to struct User, so it can exist for
remote opers.

On /oper and when bursting opers, send:

    :foo OPER opername privset

which sets foo's opername and privset. The contents of the privset on
remote servers come from the remote server's config, so the potential
for confusion exists if these do not match.

If an oper's privset does not exist on a server that sees it, it will
complain, but create a placeholder privset. If the privset is created by
a rehash, this will be reflected properly.

/privs is udpated to take an optional argument, the server to query, and
is now local by default:

    /privs [[nick_or_server] nick]
2019-09-13 10:08:27 +01:00
Simon Arlott
493f729efc
tests: Fix use-after-free bug 2019-08-31 16:32:55 +01:00
Simon Arlott
17809d2db7
librb: Fix type of dst for rb_inet_pton_sock() 2019-08-31 16:10:50 +01:00
Simon Arlott
8b96670079
tests: Remove modules that don't exist 2019-08-31 15:38:48 +01:00
Simon Arlott
958c354cca
tests: Verify behaviour if services authenticates a user after SASL is aborted 2019-02-23 13:02:15 +00:00
Simon Arlott
e701026837
tests: add serv_connect1 (exit_unknown_client)
Test serv_connect followed by exit_unknown_client.

An outgoing connection should not delete an incoming connection that
occurs during the connection attempt.
2017-08-24 20:08:17 +01:00
Simon Arlott
959dffde9b
tests: add rb_dictionary1
This doesn't do much because replacing existing elements isn't allowed.
2017-08-06 18:38:43 +01:00
Simon Arlott
cb53fd6a83
tests: send1: add tag tests to all functions 2017-08-06 16:21:30 +01:00
Simon Arlott
4b1cce65ed
ircd: send tags on every message
Simplify linebuf by introducing fsnprint to manage a list of printfs.
Add a msgbuf unparse cache for send functions that loop.
2017-08-06 16:21:29 +01:00
Simon Arlott
8f43ad3f72
tests: send1: fix sendto_channel_opmod (remote) to cover all scenarios 2017-08-06 13:30:47 +01:00
Simon Arlott
a53032dd70
tests: send1: fix sendto_channel_opmod (remote) to call the right function 2017-08-06 13:14:12 +01:00
Simon Arlott
dd3a17a0c2
tests: send1: add missing CAP_SERVER_TIME test to sendto_channel_flags from remote users 2017-08-06 13:00:49 +01:00
Simon Arlott
762adec9f6
tests: send1: test MODE_MODERATED with sendto_channel_opmod 2017-08-06 12:53:39 +01:00
Simon Arlott
692fbac66d
tests: send1: load modules in a predictable order
So that tags are added in the same order every time.

# wanted: @time=2017-07-14T02:40:00.000Z;account=test :LChanPeon!username@example.test TEST #placeholder :Hello World!
#   seen: @account=test;time=2017-07-14T02:40:00.000Z :LChanPeon!username@example.test TEST #placeholder :Hello World!
2017-08-06 11:05:03 +01:00
Simon Arlott
4e9035f2f1
tests: add missing modules symlinks 2017-08-06 01:42:51 +01:00
Simon Arlott
54f75d36e3
tests: add remaining sendto_* tests 2017-08-06 01:12:59 +01:00