Commit graph

63 commits

Author SHA1 Message Date
Ariadne Conill a389de2a25 authd: rename blacklist_provider to dnsbl_provider, change auth notices accordingly 2020-07-05 21:20:34 -06:00
Simon Arlott 17809d2db7
librb: Fix type of dst for rb_inet_pton_sock() 2019-08-31 16:10:50 +01:00
Simon Arlott c6ad9b0c5f
Add basic SCTP listener support that binds to multiple addresses
This only supports two addresses as the intended use is 1 IPv4 and 1 IPv6
address on a single-homed host, and the only supported configuration of
outgoing connections to other servers is to bind a single IPv4 or IPv6
address.
2017-08-24 20:08:20 +01:00
Simon Arlott f21ef0cebc
authd: assume all providers are running
Otherwise ident returns without setting itself running causing problems.

Move opm/blacklist before ident/rdns so that they can receive completion
notifications.
2017-08-20 12:54:45 +01:00
Aaron Jones 656c85d090
authd/provider: remove shadowed double variable decl 2016-06-01 20:29:35 +00:00
Simon Arlott 84d0b55e76
authd: fix reference far off the end of the array on shutdown
When authd has no more input it tries to reject all current clients with
an id of UINT32_MAX.
2016-05-01 11:51:07 +01:00
Simon Arlott 2f598dacdd
authd: remove unused variable id from accept_client 2016-05-01 11:51:06 +01:00
Simon Arlott 075d4d569e
authd: allocate the correct size of auth_client_data
If there are holes in the auth_providers ID numbers, the array allocated
based on list length won't be large enough to handle all the IDs.

(auth->data could be converted to a dlink_list)
2016-05-01 11:51:05 +01:00
Simon Arlott a5f52774bb
authd: Only use refcount for reference counting
Use providers_active for provider activity tracking.
2016-05-01 11:31:05 +01:00
Simon Arlott 2392770f4d
authd: fix auth->cid type sizes
* long is too small on 32-bit systems, use unsigned long long if we want
  to check for out of range values
* UINT32_MAX is a valid cid, and 0 isn't
* make auth->cid a uint32_t not uint16_t
2016-05-01 11:12:34 +01:00
Simon Arlott a4da4fe574
authd: fix memory leak in start_auth 2016-05-01 10:59:22 +01:00
Simon Arlott 9f928dc532
authd: don't call cancel_providers recursively
Also check that they haven't been cancelled while starting up.
2016-05-01 10:53:34 +01:00
Simon Arlott d955cd9f97
authd: use a list for auth_providers
We only need to iterate over this small fixed size list, so
dictionary iteration will be less efficient.
2016-05-01 10:49:12 +01:00
William Pitcock b585278b32 authd: provider: make refcounting system less fragile 2016-04-30 19:26:02 -05:00
William Pitcock a71b65b15c Revert "authd: change to lists instead of dictionaries for various things"
This reverts commit 49fd293f20.
2016-04-30 19:20:12 -05:00
Simon Arlott 3b0b4037d0
authd: don't decrement refcount twice when accepting the client 2016-04-30 17:06:21 +01:00
Elizabeth Myers 49fd293f20
authd: change to lists instead of dictionaries for various things
Iteration is the primary thing done on these, so using a dictionary
doesn't help a lot. Furthermore (and most importantly), they are not
safe to delete from.
2016-04-30 01:59:05 -05:00
staticfox 1729f46eab
authd: Avoid negative array indices 2016-04-22 23:06:42 -04:00
Elizabeth Myers 4434f37513 authd: clean up refcounting stuff 2016-04-06 11:43:05 -05:00
Elizabeth Myers 45e6c74631 authd: refcounting fixes 2016-04-06 09:52:25 -05:00
Elizabeth Myers 731d128990 authd: rework module ID system
Provider ID's are now assigned dynamically at load-time. To accomodate
this, there is now a lookup system for finding providers by name (all
providers have names as well).
2016-04-05 04:31:22 -05:00
Elizabeth Myers 376ae2e2a7 Clean up the provider status logic.
Provider status (done, running, not run) is now attached to the
provider-specific data of the client. A reference count of auth
instances is kept in the auth_client struct to determine if a client is
done or not.

This also moves a lot of the logic for manipulating provider data into
into the provider.h header for inlining (no point in a function call for
these simple accessors).
2016-04-05 03:30:02 -05:00
Elizabeth Myers a68d9a2b61 authd: dynamically allocate data and timeout elements 2016-04-05 03:08:52 -05:00
Elizabeth Myers 2e1e0b9981 authd: add provider timeout setting API 2016-04-04 04:24:49 -05:00
Elizabeth Myers 74909c9ada authd: add provider data getter/setter functions 2016-04-04 03:33:25 -05:00
Elizabeth Myers 53c0462146 provider: use rb_dlinkAddTail instead of rb_dlinkAdd.
Providers we add last should come last, not first.
2016-04-03 00:06:58 -05:00
Elizabeth Myers 5cbfed5407 authd: fix up comment [ci skip] 2016-04-02 03:49:31 -05:00
Elizabeth Myers a3b112f426 authd: fix race with aborting clients. 2016-04-02 03:48:37 -05:00
Elizabeth Myers fbe8d087e7 Add exempt logic for open proxies 2016-04-02 02:42:11 -05:00
Elizabeth Myers d86692fa44 Add new sockaddr_storage port retrieval/setting macros
These macros are safe for use on IPv6 and clean up a lot of code.
2016-03-31 03:00:29 -05:00
Elizabeth Myers 4e85459a7c authd: add (not really working) OPM provider.
It doesn't do anything yet as no configuration is plugged in, as well.
2016-03-31 00:28:05 -05:00
Elizabeth Myers c23f97550f authd/provider: exit on critical errors 2016-03-31 00:26:48 -05:00
Elizabeth Myers 9f9ab5c2d6 authd/provider: don't crash if there's no init or destroy function 2016-03-30 23:17:21 -05:00
Elizabeth Myers 15c49abbb3 authd/providers: add timeout callback system.
This means that each provider no longer has to keep its own event; it
can set a timeout and have a callbackinstead.
2016-03-30 17:21:49 -05:00
Elizabeth Myers a5ab106298 authd/provider: fix misordering in macro 2016-03-30 03:38:30 -05:00
Elizabeth Myers 045d9d31c2 Merge branch 'master' of github.com:charybdis-ircd/charybdis 2016-03-30 02:33:19 -05:00
Elizabeth Myers b3912eae9b authd/provider: it's va_start. 2016-03-30 02:32:34 -05:00
Elizabeth Myers 52d49164a8 authd/provider: include stdinc.h for stdarg.h 2016-03-30 02:22:43 -05:00
Elizabeth Myers 64afc35817 authd/provider: make reject_client take a format string and varargs 2016-03-30 01:29:21 -05:00
Matt Ullman d8f8474dfd authd: Cleanup 2016-03-28 20:14:31 -04:00
Elizabeth Myers 1345a41dda authd: misc fixes 2016-03-28 16:46:52 -05:00
Elizabeth Myers ee7f92714a authd/provider: add stats handling hooking 2016-03-27 17:15:08 -05:00
Elizabeth Myers 6535177fef authd/provider: add data to rejection tag.
This is used for information such as what blacklist rejected the client.
2016-03-27 13:52:52 -05:00
Elizabeth Myers 60374ac975 authd: add abiltiy to cancel connection 2016-03-26 23:54:21 -05:00
Elizabeth Myers 420cfb677c authd/provider: add notices in comments to certain functions not to use auth after calling 2016-03-26 23:16:53 -05:00
Elizabeth Myers 05fdc0301d authd/provider: do not accept clients until all providers have had a chance to run 2016-03-26 20:32:35 -05:00
Elizabeth Myers f5586c3abb authd: misc provider fixes 2016-03-26 19:50:09 -05:00
Elizabeth Myers 0cff7adb13 authd/provider: some fixes 2016-03-26 18:01:58 -05:00
Elizabeth Myers a51487e0e7 authd/provider: add options handlers for providers
This allows providers to create handlers for changing their
configuration.
2016-03-25 23:04:00 -05:00
Elizabeth Myers db821ee9ba authd: split out notices stuff for backporting to master. 2016-03-25 21:29:44 -05:00