Commit graph

357 commits

Author SHA1 Message Date
Ed Kellett 211c25b17d
extensions/filter: filter quit messages 2020-05-23 19:10:31 +01:00
Ed Kellett e9408bc4fc
filter: fix part handling
previously we would have formatted a null pointer into %s for the
command, which is theoretically bad but handled by glibc
2020-05-02 02:52:21 +01:00
Ed Kellett c500b0bdb5
Add priorities to some hooks 2020-05-01 17:47:14 +01:00
Ed Kellett 91ccda4f8c
Fix invite-notify and move it to an extension
The existing approach to invite-notify is deeply flawed--it currently
notifies only the target user's server, and that can't be fixed without
sending notifies for invites that end up not happening.

I'm resolving this by broadcasting a second message, INVITED, from the
target user's server. I'm also pulling it out into an extension while
I'm at it--invite notifies reveal new information, so I don't think
they should be mandatory.
2020-04-30 18:17:00 +01:00
Ed Kellett a7d4a0ab81
Centralise banmask matching logic 2020-04-12 12:35:18 +01:00
Aaron Jones 6cfb19943a
extensions/extb_ssl.c: make certfp parameter case-insensitive
I had the idea that maybe these should be case-sensitive because some
encodings (like Base-64) are. But it turns out it's better to
prioritise not breaking existing configurations / channel mode lists,
and just revisit this in future maybe.

[ci skip]
2020-01-28 20:48:23 +00:00
Aaron Jones e0a8d121fa
extensions/extb_ssl.c: port e0f1c3b5bc6c55b88938 & 5572f43834b93b898ea0
Reported-by: Opal Hart <opal@wowana.me>
2020-01-28 20:37:39 +00:00
Ed Kellett b44f6669d8
sasl_usercloak: fix typo in format string
thanks @ProgVal
2020-01-02 16:29:23 +00:00
Ed Kellett cdeca37ec3
sasl_usercloak: make the magic string more specific
Require '/account' at the end of the spoof, rather than
'account' anywhere.
2020-01-02 16:15:51 +00:00
Ed Kellett 5d5603b6ef
sasl_usercloak: modernize 2020-01-02 16:15:50 +00:00
Ed Kellett 11ae52095f
Remove duplicated notify_banned_client 2020-01-02 03:36:34 +00:00
Ed Kellett 5958d6b99b
sasl_usercloak: check K-lines after host change 2020-01-02 03:36:34 +00:00
Ed Kellett 40c4d9d85b
Revert "recheck users after applying SASL account cloaks"
This reverts commit 4d401d3c60019cf96b07a012106cab9678b7a79d.
2020-01-02 03:36:34 +00:00
Ed Kellett 5aeeea187e
recheck users after applying SASL account cloaks
(so K-lines on them will take effect properly)
2020-01-02 03:36:34 +00:00
Stephen Bennett dae6f5dbee
Make sasl_usercloak.so update the original host, as well as the visible host if it hasn't already changed. Allows for the sasl spoof to be used to override services ones in some circumstances. 2020-01-02 03:36:34 +00:00
Stephen Bennett 271ddd99d7
Be sure to zero out host buffer before using it 2020-01-02 03:36:34 +00:00
Stephen Bennett 721410d575
Add sasl_usercloak module, to allow injecting SASL account name into a user's host on connection 2020-01-02 03:36:24 +00:00
Aaron Jones 58a7048006
Merge pull request #287 from edk0/filter
Add extensions/filter (port from ircd-seven)
2019-10-22 18:33:51 +00:00
Ed Kellett 09784400f2
filter: avoid a memory leak per @amdj 2019-10-22 18:44:19 +01:00
Aaron Jones a52d84f723
Merge pull request #293 from edk0/webirc
m_webirc: improve TLS handling
2019-10-22 16:17:33 +00:00
Aaron Jones 9e6c36d571
Merge pull request #294 from edk0/deny-webirc-auth
m_webirc: deny using webirc. as a real auth block
2019-10-22 16:16:36 +00:00
Ed Kellett 8ffc517321
m_webirc: deny using webirc. as a real auth block 2019-10-20 18:41:39 +01:00
Ed Kellett cccda2ff2f
m_webirc: it's "TLS" to you 2019-10-20 18:18:32 +01:00
Ed Kellett 11ef0e2b98
m_webirc: don't bail out when denying 'secure' 2019-10-20 18:18:32 +01:00
Ed Kellett a6b97b7d88
m_webirc: const-correctness 2019-10-20 18:18:27 +01:00
Ed Kellett d6c813780f
m_webirc: respect ircv3's secure option 2019-10-20 18:17:34 +01:00
Ed Kellett ab4420cbbe
m_webirc: enforce need_ssl 2019-10-20 18:17:33 +01:00
Ed Kellett e5742a172b
override: don't spam about (un)setting the mode
We will spam about any uses of it, so this just seems like extra noise.
2019-10-06 22:28:19 +01:00
Ed Kellett 0cbb1ba9f0
filter: explicit type conversion 2019-10-06 19:41:06 +01:00
Ed Kellett eb06afc3fa
filter: correct type for modinit 2019-10-06 19:24:35 +01:00
Ed Kellett 9fe8bccba0
Fix build when hyperscan is missing 2019-10-06 19:24:34 +01:00
Ed Kellett a8f402e909
filter: use AV2 2019-10-06 19:24:34 +01:00
Ed Kellett 344af24c2f
filter: add DROP and ABORT 2019-10-06 19:24:34 +01:00
Ed Kellett dc141aad45
filter: require an extra "+" before data
This disambiguates it from control commands
2019-10-06 19:24:33 +01:00
Ed Kellett 8692240f51
filter: add modes to disable incoming filters 2019-10-06 19:24:33 +01:00
Ed Kellett 649bda6d5d
filter: make the kill reason more honest 2019-10-06 19:24:32 +01:00
Ed Kellett d928bc7af3
filter: send the failure response only on PRIVMSG 2019-10-06 19:24:32 +01:00
Ed Kellett 744ac30804
filter: match in two passes, before and after stripping 2019-10-06 19:24:32 +01:00
Ed Kellett fccc6d5669
filter: move to extensions 2019-10-06 19:24:31 +01:00
Simon Arlott e52893db93
Fix GCC 8 compiler warnings 2019-09-15 10:57:53 +01:00
Janik Kleinhoff a0d1df9f38
extensions/drain: remove superfluous includes 2019-09-14 21:13:11 +01:00
Ed Kellett b674a619eb
Add extensions/drain
This takes the simplest possible approach: load the module and you're in
drain mode.
2019-09-14 21:13:11 +01: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
Aaron Jones 95c84a44fd
Merge pull request #277 from edk0/helpops
Fix various bugs in extensions/helpops
2019-09-07 14:57:30 +00:00
Aaron Jones a9118e5b81
Merge pull request #278 from edk0/override
Fix various bugs in extensions/override
2019-09-07 14:26:01 +00:00
Ed Kellett dbeda234e6
override: always check oper:override
It's possible to have the oper:override privilege removed by /grant.
/grant triggers an empty umode change event to allow privileged umodes
to be set or removed, so checking for oper:override on all umode changes
(and not just ones where +o or +p is changed) allows us to remove +p
when necessary.
2019-09-07 15:06:39 +01:00
Ed Kellett 6637a54728
override: don't leak the old expiry timer list 2019-09-07 15:06:39 +01:00
Ed Kellett cc75db3f3f
override: start timers for +p clients on modinit
Reloading override previously would have the effect of cancelling +p
expiry. With this change, reloading the module just refreshes the
timers, so expiry is delayed a bit rather than forgotten entirely.
2019-09-07 15:06:39 +01:00
Ed Kellett 5339043003
helpops: remove +H if usermode:helpops is lost 2019-09-07 15:04:05 +01:00
Ed Kellett 0c5dd86cfc
helpops: handle the helper list properly on reload
Free the whole list on unload rather than leaking it, and initialise it
to the list of people with +H on load.
2019-09-07 15:04:05 +01:00
Ed Kellett 6c639159b0
helpops: fix umode handling
construct_umodebuf() can change the char->flag mapping (to restore an
orphaned mode). I don't love the use of a fake constant, so I think the
cleanest solution here is just to index user_modes with a macro for the
umode letter.
2019-09-07 15:04:05 +01:00
Ed Kellett ead77e93aa
override: move kick immunity to its own module 2019-09-07 14:53:21 +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 fe5fc851aa
gcc7 fixes: NICKLEN -> NAMELEN
Use NAMELEN instead of NICKLEN when accessing Client->name because it
could in theory be a HOSTLEN length string.
2018-01-19 23:26:20 +00:00
Simon Arlott de2934965c
remove RB_IPV6 2017-08-20 12:54:46 +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 2355be38a3
m_webirc: set sockhost before potentially using it to set host
Remove extra IP check, it's not necessary.
2017-08-01 22:42:56 +01:00
Simon Arlott fdfe62e7cc
m_webirc: use rb_inet_ntop_sock to populate sockhost 2017-06-27 21:13:25 +01:00
Keith Buck 1175ff837d extensions/extb_channel: Allow matching secret channels.
This change modifies extb_channel to allow matching users in secret
channels, which prevents trivial ban evasion by setting the target
channel +s. Information leak due to this change is unlikely since the
attacker would have to know that the target channel exists, the name of
the channel (or guess it), have a specific user they wanted to know
whether was in the channel (and not know already), and the target user
would need to have something like autojoin-on-invite enabled (or any of
the other various ways hostname cloaking is attacked).
2016-12-29 06:21:58 +00:00
Simon Arlott ab6a27d184
Fix cross compile for Windows 2016-12-04 20:21:07 +00:00
Simon Arlott d8f0b5d763
cppcheck: fix various warnings/errors
[ircd/match.c:316]: (error) Shifting a negative value is undefined behaviour
[librb/src/patricia.c:55]: (error) Shifting a negative value is undefined behaviour
[modules/m_alias.c:64]: (portability) '(void*)message' is of type 'void *'. When using void pointers in calculations, the behaviour is undefined.
[modules/m_time.c:111]: (warning) %u in format string (no. 9) requires 'unsigned int' but the argument type is 'signed int'.
[modules/m_time.c:111]: (warning) %u in format string (no. 10) requires 'unsigned int' but the argument type is 'signed int'.
[librb/src/dictionary.c:819]: (warning) %d in format string (no. 3) requires 'int' but the argument type is 'unsigned int'.
[librb/src/radixtree.c:1080]: (warning) %d in format string (no. 3) requires 'int' but the argument type is 'unsigned int'.
[ircd/s_user.c:351] -> [ircd/s_user.c:357]: (warning) Either the condition '0!=source_p' is redundant or there is possible null pointer dereference: source_p.
[extensions/ip_cloaking_3.0.c:109]: (warning, inconclusive) The buffer 'buf' may not be null-terminated after the call to strncpy().
[ircd/chmode.c:256]: (style) Clarify calculation precedence for '&' and '?'.
[modules/m_help.c:100]: (style) Clarify calculation precedence for '&' and '?'.
[modules/m_knock.c:169]: (style) Clarify calculation precedence for '&' and '?'.
[modules/m_stats.c:628]: (style) Clarify calculation precedence for '&' and '?'.
[modules/m_stats.c:727]: (style) Clarify calculation precedence for '&' and '?'.
[librb/src/radixtree.c:601]: (style) Clarify calculation precedence for '&' and '?'.
[librb/src/radixtree.c:704]: (style) Clarify calculation precedence for '&' and '?'.
[librb/src/radixtree.c:739]: (style) Clarify calculation precedence for '&' and '?'.
[librb/src/radixtree.c:763]: (style) Clarify calculation precedence for '&' and '?'.
[librb/src/radixtree.c:768]: (style) Clarify calculation precedence for '&' and '?'.
[librb/src/radixtree.c:774]: (style) Clarify calculation precedence for '&' and '?'.
[librb/src/radixtree.c:781]: (style) Clarify calculation precedence for '&' and '?'.
[librb/src/radixtree.c:786]: (style) Clarify calculation precedence for '&' and '?'.
[librb/src/radixtree.c:791]: (style) Clarify calculation precedence for '&' and '?'.
[librb/src/radixtree.c:804]: (style) Clarify calculation precedence for '&' and '?'.
[ircd/wsproc.c:372]: (style) Unused variable: len
[modules/core/m_modules.c:382]: (style) Unused variable: i
[modules/m_stats.c:741]: (style) Unused variable: amsg
[ircd/authproc.c:390]: (style) Unused variable: iter
[ircd/authproc.c:391]: (style) Unused variable: client_p
2016-10-28 20:13:36 +01:00
Xenthys bd2c29f738
Added kick immunity to umode +p (oper-override) 2016-09-29 00:34:53 +02:00
William Pitcock b1c32af98e helpops: add duplication guards on helper/dehelper state changes 2016-09-18 17:11:32 -05:00
William Pitcock 4d3f8ead19 helpops: fix up graph cleanup for helpers_list 2016-09-16 17:02:50 -05:00
William Pitcock 5a12d0b1e8 extensions/chantype_dummy: ^ is a valid nickchar, but > isn't 2016-09-16 14:12:29 -05:00
William Pitcock 1cfc0cd9f2 extensions/chantype_dummy: cleanups 2016-09-16 14:07:54 -05:00
William Pitcock 75980a5e2f extensions: add new module adding ^channels (which are just like #channels) 2016-09-16 13:55:44 -05:00
William Pitcock e47c4be18c helpops: MyClient() check is wrong, we only care if it is a Person or a Server 2016-09-16 12:57:34 -05:00
William Pitcock 8093dc5fb7 helpops: handle cleaning up remote opers from the helpops list 2016-09-16 12:56:18 -05:00
Aaron Jones ba1edd7277
mkpasswd: use urandom for salts, cleanup
Using /dev/random for salt generation is pointless -- it can block, and
any extra randomness it would provide (which is debatable) is not needed,
as salts only need to be unique, not unpredictable.
2016-08-15 09:50:53 +00:00
Elizabeth Myers 4eafa9e62f ipv4_from_ipv6: move to librb 2016-04-08 03:49:23 -05:00
Elizabeth Myers f956cb0f1f Use rb_* versions of nonportable string functions 2016-04-05 05:39:59 -05:00
Elizabeth Myers 0ed0a9fe0a Move m_locops module to extensions.
Many networks do not use local ops and therefore should not be required
to have this around all the time.
2016-04-02 05:20:30 -05:00
Aaron Jones fef6857e3f
extensions: Fix duplicate extban character usage
extb_usermode and extb_hostmask both use the same extban character
('m'), resulting in only one of the modules being usable (depending
on module load order) and neither one functioning if one of them
is unloaded.

This changes the character for extb_usermode from 'm' to 'u'.

[ci skip]
2016-03-28 03:26:10 +01:00
Matt Ullman afba2488ec extb_combi: More int to bool conversion
Cleanup whitespace in ircd_lexer.l
2016-03-25 19:47:58 -04:00
Elizabeth Myers fea4e2d2a8 modules: libircd depends on librb, so no need to include it.
This triggers multiple inclusion warnings on Solaris also.
2016-03-23 13:59:45 -05:00
Elizabeth Myers 79435744c7 common.h: raison d'être is gone, so out it goes.
Fold whatever was left into ircd_defs.h
2016-03-23 09:33:56 -05:00
Matt Ullman 66769bc1f8 More cleanup 2016-03-23 00:11:26 -04:00
Matt Ullman e23126c83b Cleanup warnings 2016-03-21 22:28:41 -04:00
William Pitcock 032ef5ef9e modules: more GET_SS_FAMILY() checking 2016-03-20 04:46:50 -05:00
William Pitcock c0949eb003 extensions/m_webirc: win32 fixes 2016-03-20 02:26:30 -05:00
Elizabeth Myers 503727d1ee More bool conversions 2016-03-09 02:19:31 -06:00
Elizabeth Myers 3c7d6fcce7 Message handlers should return void.
Also fix up some return values and stuff to use bool (or void if
nothing). I just did it whilst I was here.

According to jilles, the return value used to signify whether or not the
client had exited. This was error-prone and was fixed a long, long time
ago, but the return value was left int for historical reasons.

Since the return type is not used (and has no clear use case anyway),
it's safe to just get rid of it.
2016-03-09 01:37:03 -06:00
Elizabeth Myers eeabf33a7c Move module description headers to the top
This is cleaner.

Note this was broken out of a much larger piece of work I did, so if
there's any problems, I apologise!
2016-03-09 01:29:41 -06:00
Max Teufel 54d8925ed4 extensions: add umode_noctcp extension 2016-03-07 18:48:14 +01:00
Elizabeth Myers a278a4fc68 AV2 descriptions: forgot these 2016-03-07 04:11:58 -06:00
Elizabeth Myers 3bde01a819 Update extensions/spy_* with AV2 descriptions. 2016-03-07 04:09:14 -06:00
Elizabeth Myers 84b4c05888 Add AV2 descriptions for extensions/sno_* 2016-03-07 04:02:27 -06:00
Elizabeth Myers 3fd3d7e176 Port some more extensions to AV2 and add descriptions 2016-03-07 03:50:03 -06:00
Elizabeth Myers 8699801ca2 Compensate for my obviously diminished faculties. 2016-03-07 03:42:43 -06:00
Elizabeth Myers 02369fa767 Give all extensions/m_* modules AV2 descriptions 2016-03-07 03:40:51 -06:00
Elizabeth Myers dacd2aa8c2 Bump some extensions to AV2 and add descriptions 2016-03-07 03:08:40 -06:00
Elizabeth Myers de2b673f5a example_module: forgot a stupid semicolon. 2016-03-07 01:35:35 -06:00
Elizabeth Myers 4d552723ee example_module: update for AV2. 2016-03-07 01:27:57 -06:00
William Pitcock c81afd1580 extensions: add AV2 description strings to a few modules 2016-03-07 00:32:01 -06:00
Elizabeth Myers 1bb809cb30 Remove m_42 from README. 2016-03-06 23:58:32 -06:00
Elizabeth Myers d40217b4f6 Bye m_42.
Mostly a useless hybrid relic that nobody had used for years.
2016-03-06 23:57:50 -06:00
Elizabeth Myers 04f832b778 Bump all extensions to AV2
Most do not yet have descriptions, but that's trivial.
2016-03-06 23:57:10 -06:00
Elizabeth Myers 581dad19a4 Update chm_* modules to AV2 2016-03-06 23:48:27 -06:00
Elizabeth Myers 216d70e91d modules: tag origin at load time. 2016-03-06 18:57:05 -06:00