]> jfr.im git - irc/atheme/atheme.git/log
irc/atheme/atheme.git
2 years agolibathemecore/function.c: sendemail_urlencode: cast argument to isalnum(3)
Aaron Jones [Sat, 10 Jul 2021 21:05:44 +0000 (21:05 +0000)] 
libathemecore/function.c: sendemail_urlencode: cast argument to isalnum(3)

This may avoid diagnostics on systems with signed chars. Not actually a
problem in practice because we do not consider such characters to be
valid in a nickname, which is required for them to be valid account
names.

cf. https://github.com/atheme/atheme/commit/fcc4e19a573001263245#r53314237

2 years agolibathemecore/function.c: sendemail(): allow for urlencoding account
Aaron Jones [Sat, 10 Jul 2021 18:07:47 +0000 (18:07 +0000)] 
libathemecore/function.c: sendemail(): allow for urlencoding account

If one wishes to replace their register email template to prefix the account
name and registration verification token with a URL (to implement a webserver
to verify registrations, so people don't have to copy and paste commands to
execute on IRC), we should allow for the possibility that people will have
non-alphanumeric characters in their account name, and provide a URL-encoded
version of it.

This will ensure that such links are always clickable in various MUAs.

2 years agoMerge pull request #793 from ProgVal/patch-1
alyx [Mon, 5 Jul 2021 20:58:14 +0000 (15:58 -0500)] 
Merge pull request #793 from ProgVal/patch-1

INSTALL: Remove unnessarily agressive remark

2 years agoMerge pull request #794 from ProgVal/patch-2
alyx [Mon, 5 Jul 2021 20:57:07 +0000 (15:57 -0500)] 
Merge pull request #794 from ProgVal/patch-2

Explain configuration outside the "Compiling" section

2 years agoMerge pull request #803 from ValwareIRC/master
Aaron Jones [Sun, 4 Jul 2021 19:36:08 +0000 (19:36 +0000)] 
Merge pull request #803 from ValwareIRC/master

gib de topic reject reason more verbose explanation

2 years agoMerge pull request #807 from spb/hs-take-single
Aaron Jones [Sun, 4 Jul 2021 19:04:30 +0000 (19:04 +0000)] 
Merge pull request #807 from spb/hs-take-single

Allow HS TAKE without params if there's only one HS OFFER (#2)

2 years agoMerge pull request #790 from edk0/confirm-by-emailchg
Aaron Jones [Sat, 3 Jul 2021 16:22:32 +0000 (16:22 +0000)] 
Merge pull request #790 from edk0/confirm-by-emailchg

Make VERIFY EMAILCHG confirm the account if necessary

2 years agostrncpy->mowgli_strlcpy, fix buffer size
Stephen Bennett [Sat, 3 Jul 2021 15:34:52 +0000 (16:34 +0100)] 
strncpy->mowgli_strlcpy, fix buffer size

2 years agoAllow services-generated passwords length to be dynamically configured
Aaron Jones [Sat, 3 Jul 2021 14:15:25 +0000 (14:15 +0000)] 
Allow services-generated passwords length to be dynamically configured

Closes #800

2 years agoMake a local copy before modifying the host string, as we might be using the copy...
Stephen Bennett [Fri, 2 Jul 2021 19:57:56 +0000 (20:57 +0100)] 
Make a local copy before modifying the host string, as we might be using the copy from the offer db instead of a command parameter

2 years agoAllow HS TAKE without params if there's only one HS OFFER
Stephen Bennett [Fri, 2 Jul 2021 19:34:14 +0000 (20:34 +0100)] 
Allow HS TAKE without params if there's only one HS OFFER

2 years agoUpdate modules/chanserv/topic.c
Valerie Pond [Mon, 28 Jun 2021 09:00:29 +0000 (10:00 +0100)] 
Update modules/chanserv/topic.c

Please change color to colour to match the rest of the language as it uses British English.

Co-authored-by: Data <redacted>
2 years agoupdate a bit more ♥♥
ValwareIRC [Mon, 28 Jun 2021 08:45:05 +0000 (09:45 +0100)] 
update a bit more ♥♥

2 years agoUpdate function.c
ValwareIRC [Mon, 28 Jun 2021 08:14:21 +0000 (09:14 +0100)] 
Update function.c

2 years agoGive correct information when declining a topic because of control chars.
ValwareIRC [Mon, 28 Jun 2021 07:37:41 +0000 (08:37 +0100)] 
Give correct information when declining a topic because of control chars.

2 years agoExplain configuration outside the "Compiling" section
Val Lorentz [Sat, 26 Jun 2021 17:51:59 +0000 (19:51 +0200)] 
Explain configuration outside the "Compiling" section

It didn't really make sense as configuration isn't part of the compilation.

Additionally, not everyone installs Atheme by compiling it themselves,
or they may not have the file at hand while reading this document
(eg. reading the documentation before actually doing it)

2 years agoINSTALL: Remove unnessarily agressive remark
Val Lorentz [Sat, 26 Jun 2021 17:07:45 +0000 (19:07 +0200)] 
INSTALL: Remove unnessarily agressive remark

People who set up their first IRC network will read this documentation,
it seems unnecessary to shame them for... not knowing how to setup
and IRC network.

2 years agoMerge pull request #792 from mquin/patch-1
Aaron Jones [Thu, 24 Jun 2021 13:02:18 +0000 (13:02 +0000)] 
Merge pull request #792 from mquin/patch-1

Remove reference to SET FOUNDER in help for DROP

2 years agoRemove reference to SET FOUNDER in help for DROP
Mike Quin [Thu, 24 Jun 2021 10:35:15 +0000 (11:35 +0100)] 
Remove reference to SET FOUNDER in help for DROP

2 years ago.gitattributes: remove files that no longer exist
Aaron Jones [Thu, 24 Jun 2021 09:46:09 +0000 (09:46 +0000)] 
.gitattributes: remove files that no longer exist

2 years agoemail/default/setpass: don't encourage contact for unsolicited receipt
Aaron Jones [Thu, 24 Jun 2021 09:39:27 +0000 (09:39 +0000)] 
email/default/setpass: don't encourage contact for unsolicited receipt

Nothing can be done to the account without the token in this e-mail,
and any competent malicious actor who does have unauthorised access to
a user's e-mail inbox is also just going to delete the e-mail after
compromising the user's account anyway.

Therefore, it doesn't make sense to encourage the user to reach out to
the network administration.

Also clarify that password reset tokens are now automatically
invalidated by a successful login.

2 years agolibathemecore/services.c: myuser_login(): invalidate password change tokens
Aaron Jones [Thu, 24 Jun 2021 09:38:14 +0000 (09:38 +0000)] 
libathemecore/services.c: myuser_login(): invalidate password change tokens

2 years agolibathemecore/ptasks.c: handle_kill(): don't use slog() if we got killed
Aaron Jones [Sun, 20 Jun 2021 02:32:27 +0000 (02:32 +0000)] 
libathemecore/ptasks.c: handle_kill(): don't use slog() if we got killed

If a client on our server is killed, we cannot reliably use slog(),
because the client may be OperServ, and slog() mesages are sent from
OperServ.

It turns out that some IRCds care about receiving messages from UIDs
it doesn't know about (because it just killed them), and will send
KILLs for them over and over again.

Reported-By: @A-UNDERSCORE-D
2 years agomodules/protocol/unreal4: correct module name
Aaron Jones [Sat, 19 Jun 2021 22:46:22 +0000 (22:46 +0000)] 
modules/protocol/unreal4: correct module name

2 years agoLog correct target name for verifies
Ed Kellett [Sat, 19 Jun 2021 14:39:04 +0000 (15:39 +0100)] 
Log correct target name for verifies

2 years agoVERIFY EMAILCHG confirms account too
Ed Kellett [Sat, 19 Jun 2021 14:38:57 +0000 (15:38 +0100)] 
VERIFY EMAILCHG confirms account too

2 years agom4/atheme-libtest-*.m4: correct copy/paste mistake on temporary variable name
Aaron Jones [Fri, 18 Jun 2021 17:27:32 +0000 (17:27 +0000)] 
m4/atheme-libtest-*.m4: correct copy/paste mistake on temporary variable name

3 years agoMerge pull request #786 from atheme/fix/module_unload
Aaron Jones [Sun, 13 Jun 2021 08:18:22 +0000 (08:18 +0000)] 
Merge pull request #786 from atheme/fix/module_unload

Module unloading use-after-free fixes

3 years agomodules/operserv/modmanager: account for an entire list of non-reloadables
Aaron Jones [Sun, 13 Jun 2021 07:59:31 +0000 (07:59 +0000)] 
modules/operserv/modmanager: account for an entire list of non-reloadables

When recursing a given module's reverse dependencies, it is
possible that we run into a permanent module that is depended
upon by a semi-permanent (reload-only) module. This will result
in the reload of that module being skipped (as there is a
permanent module in its reverse dependency chain), but the
mod_recurse_revdeps() function will still set the r_dep pointer
to the semi-permanent one.

We then test if r_dep is set to perform a database save (in case
reloading of the reload-only module fails). However, if our
entire list of modules to reload has recursive non-reloadability
status, we will be saving the database for nothing, as we then
go on to ignore every module in the list.

Exit early if this is the case, avoiding a pointless wallops and
database save.

3 years agooperserv/modmanager: MODRELOAD: avoid potential use-after-free
Nicole Kleinhoff [Thu, 3 Jun 2021 06:46:56 +0000 (06:46 +0000)] 
operserv/modmanager: MODRELOAD: avoid potential use-after-free

Listing the same module twice in the list of MODRELOAD parameters, or
listing a module that would already be unloaded for depending on a
module given earlier in the list, would attempt to unload a module that
had already been unloaded.

Instead of storing the module pointer when initially processing the
list, we now call module_find_published() again just before unloading
the module. (We do remember the unload capability value computed during
the initial processing to avoid having to recurse again.)

3 years agomodule_unload: avoid potential use-after-free
Nicole Kleinhoff [Thu, 3 Jun 2021 05:58:04 +0000 (05:58 +0000)] 
module_unload: avoid potential use-after-free

Given three modules (A, B, C), where:

B depends on A
C depends on B
C depends on A

Module A can end up with this reverse dependency graph (as represented
in the modules' required_by lists):

A -> B -> C
A -> C

Given B is listed first in required_by, it will be unloaded;
recursively, C will be unloaded. However, unloading a module also
removes it from its dependencies' required_by lists, thus removing C
from A's required_by list. While the _SAFE variant of the list iteration
macro is designed to handle the current element being removed, it is not
able to handle an arbitrary number of following elements being removed
as well.

As unloading a module will always remove it from the required_by list,
we can instead keep unloading the first element of the list until the
list is empty.

3 years agoUpdate loginnolimit.c
alyx [Fri, 11 Jun 2021 18:38:21 +0000 (13:38 -0500)] 
Update loginnolimit.c

Fixes #789

3 years agoUpdate my e-mail address
Aaron Jones [Tue, 8 Jun 2021 04:41:25 +0000 (04:41 +0000)] 
Update my e-mail address

3 years agomodules/saslserv/main.c: rename flag for secure client connection
Aaron Jones [Fri, 4 Jun 2021 22:57:45 +0000 (23:57 +0100)] 
modules/saslserv/main.c: rename flag for secure client connection

Hooks should be able to judge whether to allow an SASL negotiation
based on whether the client is connected to the network securely or
not; not just whether it is using TLS. Some IRCds have the concept
of "secure origins", and can treat e.g. connections from localhost
as secure against eavesdropping. Rename the flag appropriately.

3 years agoMerge pull request #782 from atheme/amdj/stats-t-unpriv
Aaron Jones [Wed, 2 Jun 2021 21:47:16 +0000 (21:47 +0000)] 
Merge pull request #782 from atheme/amdj/stats-t-unpriv

libathemecore/ptasks.c: STATS:T: make nonsensitive data available

3 years agolibathemecore/ptasks.c: STATS:T: make nonsensitive data available
Aaron Jones [Sat, 29 May 2021 21:12:23 +0000 (21:12 +0000)] 
libathemecore/ptasks.c: STATS:T: make nonsensitive data available

The statistics for server, user, and chan can already be obtained via
the LUSERS command on IRC, so it does not make sense for services to
prevent accessing these by requiring services privileges.

Furthermore, the number of registered accounts, nicknames, and channels
should also not be considered sensitive data. The Atheme project does
not condone hiding such basic and non-sensitive data from network users.

Finally, put missing mynicks count in default MOTD file.

3 years agomodules/chanserv/access: re-arrange empty check order
Aaron Jones [Sun, 30 May 2021 15:34:57 +0000 (15:34 +0000)] 
modules/chanserv/access: re-arrange empty check order

Discovered while I was about to merge #784. Didn't want to trip CI again
twice with the fix and merge, so I'll merge and fix it in one shot. The
rest of the pull request establishes the check order as permissions,
closure, and then emptiness.

3 years agoMerge pull request #784 from phy1729/chanserv-ensure-not-closed
Aaron Jones [Sun, 30 May 2021 15:38:09 +0000 (15:38 +0000)] 
Merge pull request #784 from phy1729/chanserv-ensure-not-closed

3 years agochanserv/{clear,clone}: Use STR_CHANNEL_IS_EMPTY
Matthew Martin [Sun, 30 May 2021 15:11:48 +0000 (10:11 -0500)] 
chanserv/{clear,clone}: Use STR_CHANNEL_IS_EMPTY

3 years agochanserv/{akick,clear,clone,getkey,info,invite,recover,sync,topic,unban,xop}: Sort...
Matthew Martin [Sun, 30 May 2021 14:46:31 +0000 (09:46 -0500)] 
chanserv/{akick,clear,clone,getkey,info,invite,recover,sync,topic,unban,xop}: Sort checks

Checks go in the order access, closure, empty (if needed).

3 years agochanserv/{ban,kick,quiet,set,sync,taxonomy,unban}: Ensure channel is not closed
Matthew Martin [Sun, 30 May 2021 03:19:14 +0000 (22:19 -0500)] 
chanserv/{ban,kick,quiet,set,sync,taxonomy,unban}: Ensure channel is not closed

3 years agoMerge pull request #780 from mquin/mquin-ns-help-examples
Aaron Jones [Sat, 29 May 2021 18:53:01 +0000 (18:53 +0000)] 
Merge pull request #780 from mquin/mquin-ns-help-examples

Add examples to NickServ help entries.

3 years agomodules/nickserv/set_accountname: log when hook denies account name change
Aaron Jones [Sat, 29 May 2021 18:50:56 +0000 (18:50 +0000)] 
modules/nickserv/set_accountname: log when hook denies account name change

3 years agomodules/saslserv/main: downgrade severity of no mechanism log message
Aaron Jones [Sat, 29 May 2021 13:56:09 +0000 (13:56 +0000)] 
modules/saslserv/main: downgrade severity of no mechanism log message

It was discovered while testing some improvements to contrib/sasl_blacklist
that clients can trigger this message remotely and at will, just by not
adhering to the SASL specification.

3 years agoAdd examples to NickServ help entries.
Mike Quin [Sun, 23 May 2021 10:57:13 +0000 (11:57 +0100)] 
Add examples to NickServ help entries.
For consistenty with other entries.
Adds examples to set_accountname, set_enforce, set_pubkey, and setpass.

3 years agochanserv/flags help: only mention groups if groupserv exists
Nicole Kleinhoff [Fri, 21 May 2021 05:34:32 +0000 (05:34 +0000)] 
chanserv/flags help: only mention groups if groupserv exists

3 years agoThe Great Migration
Aaron Jones [Fri, 21 May 2021 00:12:02 +0000 (00:12 +0000)] 
The Great Migration

3 years agohelp/default/nickserv/drop: fix command help
Aaron Jones [Wed, 19 May 2021 20:50:23 +0000 (20:50 +0000)] 
help/default/nickserv/drop: fix command help

3 years agoAdd match_masks_through_vhost option for Solanum
Nicole Kleinhoff [Sat, 24 Apr 2021 21:31:06 +0000 (21:31 +0000)] 
Add match_masks_through_vhost option for Solanum

This reflects a similar Solanum PR: solanum-ircd/solanum#150

It might be slightly more proper to have this option apply specifically
to the solanum protocol module once we have one, but we don't, plus
there isn't currently any precedent for config options added from
protocol modules.

The option is deliberately rehashable as the Solanum option is as well,
allowing a synchronized change in configuration across a network without
requiring restarts.

3 years agoUpdate version in SECURITY.md
Aaron Jones [Sun, 4 Apr 2021 21:25:39 +0000 (21:25 +0000)] 
Update version in SECURITY.md

3 years agolibathemecore/object.c: add method for deleting object privatedata
Aaron Jones [Sun, 28 Mar 2021 23:25:56 +0000 (23:25 +0000)] 
libathemecore/object.c: add method for deleting object privatedata

3 years agoinclude/atheme/hooktypes.in: add a hook for password (hash) change
Aaron Jones [Sun, 28 Mar 2021 21:06:53 +0000 (21:06 +0000)] 
include/atheme/hooktypes.in: add a hook for password (hash) change

This will allow modules to detect when a user's account password
(or its hash) has been changed (after the fact; use the hook added
in the previous commit if you need to access the plaintext password
for some reason).

3 years agonickserv/set_password: allow a hook to deny a password change
Aaron Jones [Sun, 28 Mar 2021 20:30:21 +0000 (20:30 +0000)] 
nickserv/set_password: allow a hook to deny a password change

This prevents bypassing nickserv/pwquality, by initially registering
with a password that it does not object to, and then changing it to
a more insecure one.

3 years agolibathemecore/connection.c: free vhost_addr after using it.
Aaron Jones [Fri, 26 Mar 2021 12:03:09 +0000 (12:03 +0000)] 
libathemecore/connection.c: free vhost_addr after using it.

Caught by Clang's AddressSanitizer, eventually, after a few inexplicable
corrupt addresses were output. I'm not sure why it didn't catch this
immediately.

Fixes: 642759fc2907efe5e0ba ("libathemecore/connection.c: use
                              connection->name to store addrs & ports")

3 years agolibathemecore/connection.c: fix cut/paste mistake
Aaron Jones [Thu, 25 Mar 2021 23:06:13 +0000 (23:06 +0000)] 
libathemecore/connection.c: fix cut/paste mistake

Fixes: 642759fc2907efe5e0ba ("libathemecore/connection.c: use
                              connection->name to store addrs & ports")

3 years agoinclude/atheme/global.h: remove obsolete/unused global maxfd vars
Aaron Jones [Thu, 25 Mar 2021 20:40:26 +0000 (20:40 +0000)] 
include/atheme/global.h: remove obsolete/unused global maxfd vars

3 years agomodules/protocol/charybdis: check_forward(): add +oO flags to check
Aaron Jones [Wed, 24 Mar 2021 08:54:54 +0000 (08:54 +0000)] 
modules/protocol/charybdis: check_forward(): add +oO flags to check

If the user has the *ability* to obtain channel operator status (via
services), consider that as good as the user *having* channel operator
status.

Also document why the existing code is the way it is, and allow checks
against myuser to succeed even if user is present.

Reported-by: grumble <redacted>
3 years agolibathemecore/connection.c: connection_stats(): don't justify fds
Aaron Jones [Thu, 25 Mar 2021 20:33:06 +0000 (20:33 +0000)] 
libathemecore/connection.c: connection_stats(): don't justify fds

This only ends up making the output look weird.

3 years agolibathemecore/connection.c: connection_stats(): indicate if listening
Aaron Jones [Thu, 25 Mar 2021 20:29:38 +0000 (20:29 +0000)] 
libathemecore/connection.c: connection_stats(): indicate if listening

3 years agolibathemecore/connection.c: connection_stats(): indicate the uplink
Aaron Jones [Thu, 25 Mar 2021 20:28:56 +0000 (20:28 +0000)] 
libathemecore/connection.c: connection_stats(): indicate the uplink

3 years agolibathemecore/connection.c: use connection->name to store addrs & ports
Aaron Jones [Thu, 25 Mar 2021 17:19:24 +0000 (17:19 +0000)] 
libathemecore/connection.c: use connection->name to store addrs & ports

Also obtain IP addresses where the sockets are created, instead of in
connection_add(). This is a better approach than that taken by commit
1bb7e1e587306239ca87, and restores the ability to perform non-blocking
connections.

Finally, since connection_add() creates the mowgli.pollable object for
the fd, don't bother testing if the fd is valid. Add an assertion for a
valid fd being passed, because an invalid fd will only result in
nothing working anyway. Likewise assert that the connection name is
valid, and that at least one I/O handler was supplied.

3 years agoinclude/atheme/connection.h: add an intrusive connection list node
Aaron Jones [Thu, 25 Mar 2021 13:09:52 +0000 (13:09 +0000)] 
include/atheme/connection.h: add an intrusive connection list node

3 years agoinclude/atheme/connection.h: rearrange struct in member size order
Aaron Jones [Thu, 25 Mar 2021 13:07:25 +0000 (13:07 +0000)] 
include/atheme/connection.h: rearrange struct in member size order

3 years agoinclude/atheme/connection.h: remove obsolete/unused struct member
Aaron Jones [Thu, 25 Mar 2021 13:03:12 +0000 (13:03 +0000)] 
include/atheme/connection.h: remove obsolete/unused struct member

3 years agolibathemecore/connection.c: tidy up all functions
Aaron Jones [Thu, 25 Mar 2021 17:22:35 +0000 (17:22 +0000)] 
libathemecore/connection.c: tidy up all functions

Apply const-correctness, move variables to where they are needed, etc.

3 years agoinclude/atheme/connection.h: add a typedef to reduce boilerplate
Aaron Jones [Wed, 24 Mar 2021 08:04:24 +0000 (08:04 +0000)] 
include/atheme/connection.h: add a typedef to reduce boilerplate

3 years agolibathemecore/connection.c: ask getaddrinfo(3) to fill in the port instead
Aaron Jones [Thu, 25 Mar 2021 17:15:04 +0000 (17:15 +0000)] 
libathemecore/connection.c: ask getaddrinfo(3) to fill in the port instead

3 years agolibathemecore/connection.c: refactor how to ignore errno on connect(2)
Aaron Jones [Tue, 23 Mar 2021 10:35:56 +0000 (10:35 +0000)] 
libathemecore/connection.c: refactor how to ignore errno on connect(2)

3 years agolibathemecore/connection.c: tidy up macro definitions
Aaron Jones [Tue, 23 Mar 2021 10:33:40 +0000 (10:33 +0000)] 
libathemecore/connection.c: tidy up macro definitions

3 years agolibathemecore/connection.c: move empty_handler() up and rename it
Aaron Jones [Tue, 23 Mar 2021 10:32:46 +0000 (10:32 +0000)] 
libathemecore/connection.c: move empty_handler() up and rename it

3 years agoinclude/atheme/connection.h: reindent and tidy up CF_ macros
Aaron Jones [Tue, 23 Mar 2021 10:21:19 +0000 (10:21 +0000)] 
include/atheme/connection.h: reindent and tidy up CF_ macros

Also add missing CF_IS_*() macros, and use them directly.

3 years agocontrib/: add script for converting pbkdf2 hashes to pbkdf2v2 hashes
Aaron Jones [Mon, 22 Mar 2021 05:01:53 +0000 (05:01 +0000)] 
contrib/: add script for converting pbkdf2 hashes to pbkdf2v2 hashes

3 years agomodules/contrib/: transition to independent build system
Aaron Jones [Thu, 18 Mar 2021 21:11:08 +0000 (21:11 +0000)] 
modules/contrib/: transition to independent build system

Having to duplicate configure tests in all supported Atheme release and
development branches, to enable contrib modules to be built reliably on
all of our supported platforms, was quickly becoming untenable.

3 years agodist/atheme.conf.example: expand on how to use pseudoservice::access{}
Aaron Jones [Mon, 15 Mar 2021 04:10:26 +0000 (04:10 +0000)] 
dist/atheme.conf.example: expand on how to use pseudoservice::access{}

3 years agodist/atheme.conf.example: upgrade URI scheme for commented helpurl
Aaron Jones [Sun, 14 Mar 2021 15:22:08 +0000 (15:22 +0000)] 
dist/atheme.conf.example: upgrade URI scheme for commented helpurl

3 years agomodules/operserv/{readonly,set_commitinterval}: change fault code
Aaron Jones [Sat, 13 Mar 2021 21:43:07 +0000 (21:43 +0000)] 
modules/operserv/{readonly,set_commitinterval}: change fault code

cf. https://github.com/atheme/atheme/pull/767#pullrequestreview-600277627

3 years ago.gitattributes: update for commit 8c3926d73eb23f567a25
Aaron Jones [Sat, 13 Mar 2021 21:39:00 +0000 (21:39 +0000)] 
.gitattributes: update for commit 8c3926d73eb23f567a25

3 years agom4/atheme-libtest-mowgli.m4: add a usability test if using external lib
Aaron Jones [Sat, 13 Mar 2021 21:21:27 +0000 (21:21 +0000)] 
m4/atheme-libtest-mowgli.m4: add a usability test if using external lib

When we are not using the internal libmowgli submodule, do a link test
to see if the library is usable, just like we do with the other library
tests.

This one is fairly extensive, as this codebase makes heavy use of this
library.

3 years agoBuild System: Improve handling of enabling and configuring submodules
Aaron Jones [Sat, 13 Mar 2021 21:20:55 +0000 (21:20 +0000)] 
Build System: Improve handling of enabling and configuring submodules

- When performing the libmowgli test, don't pollute CFLAGS / CPPFLAGS /
  LDFLAGS / LIBS variables. Set library-specific variables, just like
  the other library tests do

  This allows us to configure submodules later without having to save
  the environment variables first

- When --with-libmowgli=yes is given, require that pkg-config is
  available and that it can detect the library, erroring out otherwise

- Put the logic for handling enabling and configuring submodules into
  its own M4 file

3 years agomodules/Makefile: build module subdirectories alphabetically
Aaron Jones [Sat, 13 Mar 2021 19:21:38 +0000 (19:21 +0000)] 
modules/Makefile: build module subdirectories alphabetically

3 years agoextra.mk.in: Tidy up and document some groups of variables
Aaron Jones [Sat, 13 Mar 2021 19:21:07 +0000 (19:21 +0000)] 
extra.mk.in: Tidy up and document some groups of variables

3 years agom4/atheme-libtest-ldap.m4: prefix library variables with LIB
Aaron Jones [Sat, 13 Mar 2021 18:39:57 +0000 (18:39 +0000)] 
m4/atheme-libtest-ldap.m4: prefix library variables with LIB

This more closely aligns it with the other library tests.

3 years agoconfigure.ac: move digest/RNG API tests to immediately after libraries
Aaron Jones [Sat, 13 Mar 2021 18:36:28 +0000 (18:36 +0000)] 
configure.ac: move digest/RNG API tests to immediately after libraries

The library tests set the variables that these use, so it makes sense
that they appear immediately after.

3 years agoconfigure.ac: move warning about pkg-config being absent
Aaron Jones [Sat, 13 Mar 2021 18:35:24 +0000 (18:35 +0000)] 
configure.ac: move warning about pkg-config being absent

This belongs with where it is tested for. Also break it up a
bit to make it easier to read.

3 years agoconfigure.ac: rename AC_CONFIG_HEADER to AC_CONFIG_HEADERS
Aaron Jones [Sat, 13 Mar 2021 18:34:00 +0000 (18:34 +0000)] 
configure.ac: rename AC_CONFIG_HEADER to AC_CONFIG_HEADERS

The former was never documented anywhere and is now obsolete.

3 years agoconfigure.ac: move AC_CONFIG_FILES to the top
Aaron Jones [Sat, 13 Mar 2021 18:33:06 +0000 (18:33 +0000)] 
configure.ac: move AC_CONFIG_FILES to the top

This is an autoconf configuration instantiation, just like all of the
other macros around it.

3 years agoconfigure.ac: rename autoconf/ to build-aux/
Aaron Jones [Sat, 13 Mar 2021 18:31:30 +0000 (18:31 +0000)] 
configure.ac: rename autoconf/ to build-aux/

This is the name that a lot of other projects use, the name that is
recommended by the GNU autoconf documentation, and the name that is
used by the upstream buildsys project [1] (though we have diverged
from that significantly).

[1] https://fossil.nil.im/buildsys/timeline

3 years agoconfigure: put directory macros in a header file, not in CPPFLAGS
Aaron Jones [Thu, 11 Mar 2021 20:04:39 +0000 (20:04 +0000)] 
configure: put directory macros in a header file, not in CPPFLAGS

This will be necessary for my near-future intention to change the contrib
modules repository to be self-building; i.e. to have its own configure
script and build system.

Also don't try to expand directories like MODDIR for pretty printing,
because it sometimes doesn't work depending on the directory arguments
given to ./configure. Yeah, the config output looks worse, but oh well.

3 years agom4/atheme-api-random-frontend.m4: detect more secure arc4random(3)s
Aaron Jones [Thu, 11 Mar 2021 15:14:42 +0000 (15:14 +0000)] 
m4/atheme-api-random-frontend.m4: detect more secure arc4random(3)s

It turns out that a lot more than recent OpenBSD systems have a
secure algorithm backing their arc4random(3) implementation.

Remove the check for just OpenBSD, and add checks for:

- Mac OS 10.12+
- FreeBSD 12.0+
- NetBSD 7.0+
- OpenBSD 5.4+

Created with input from rqsd from IRC, in response to commit
8ff53e4d2a843c5fdd7a.

Note that this is not a statement that Atheme will successfully
compile & run on the above platforms.

3 years agom4/atheme-libtest-mowgli.m4: warn when pkg-config is unavailable
Aaron Jones [Thu, 11 Mar 2021 14:21:55 +0000 (14:21 +0000)] 
m4/atheme-libtest-mowgli.m4: warn when pkg-config is unavailable

3 years agom4/atheme-*.m4: use autoconf flow control macros exclusively
Aaron Jones [Thu, 11 Mar 2021 14:18:23 +0000 (14:18 +0000)] 
m4/atheme-*.m4: use autoconf flow control macros exclusively

The AS_IF and AS_CASE macros enable one to write "if" and "case"
shell statements in a portable way. They still generate more or
less the same output, but code which works better on various
obscure platforms.

They also allow autoconf to examine the conditional block bodies
for macro calls, to ensure those macros are available. This will
become more necessary in future versions of autoconf.

Also use these to replace an unguarded grep(1) invocation in the
Perl library testing macro.

3 years agolibathemecore/: rename openbsd random backend to arc4random
Aaron Jones [Thu, 11 Mar 2021 14:02:42 +0000 (14:02 +0000)] 
libathemecore/: rename openbsd random backend to arc4random

There may well be platforms in the future that have a secure algorithm
backing their arc4random(3) implementation. For the moment we continue
to support only OpenBSD, but make it easier to adjust in the future.

3 years agoconfigure.ac: remove checks for programs that aren't used
Aaron Jones [Tue, 9 Mar 2021 20:10:14 +0000 (20:10 +0000)] 
configure.ac: remove checks for programs that aren't used

3 years agomodules/**/Makefile: remove PLUGIN_CFLAGS & PLUGIN_LDFLAGS
Aaron Jones [Tue, 9 Mar 2021 19:15:43 +0000 (19:15 +0000)] 
modules/**/Makefile: remove PLUGIN_CFLAGS & PLUGIN_LDFLAGS

The buildsys.mk.in and buildsys.module.mk files already add these
variables to CFLAGS and LDFLAGS during execution of CompileModule,
CompilePlugin, and Link steps.

3 years agolibathemecore/Makefile: remove LIB_CFLAGS from CFLAGS
Aaron Jones [Tue, 9 Mar 2021 19:14:20 +0000 (19:14 +0000)] 
libathemecore/Makefile: remove LIB_CFLAGS from CFLAGS

The buildsys.mk.in file already adds this variable to CFLAGS during
execution of CompileLib steps.

3 years agoconfigure.ac: approach noexecstack differently
Aaron Jones [Tue, 9 Mar 2021 17:49:41 +0000 (17:49 +0000)] 
configure.ac: approach noexecstack differently

This can also be passed as -Wl,-z,noexecstack which saves Clang warning
about it being unused during compilation. Since -Wl arguments are only
used by the linker, take it out of CFLAGS. This continues to work on
GCC.

3 years agoconfigure.ac: prepend LIBPCRE_CFLAGS and LIBPCRE_LIBS
Aaron Jones [Tue, 9 Mar 2021 17:38:14 +0000 (17:38 +0000)] 
configure.ac: prepend LIBPCRE_CFLAGS and LIBPCRE_LIBS

The entire codebase depends on libpcre if it is detected successfully,
so we need to build all of the .c files with the appropriate CFLAGS &
LIBS.

This was taken care of in libathemecore/Makefile, but nowhere else.
It's better to just have configure.ac take care of adding it if they
are non-empty.

3 years agomodules/saslserv/ecdh-x25519-challenge: fix ifdef soup
Aaron Jones [Tue, 9 Mar 2021 17:31:06 +0000 (17:31 +0000)] 
modules/saslserv/ecdh-x25519-challenge: fix ifdef soup

3 years agom4/atheme-featuretest-contrib.m4: fix test for res_query(3)
Aaron Jones [Tue, 9 Mar 2021 08:37:42 +0000 (08:37 +0000)] 
m4/atheme-featuretest-contrib.m4: fix test for res_query(3)

Most platforms have these as enums, which are converted to int (for use
as arguments) by the compiler automatically. However, some platforms do
not have these as enums, and use macros to define their values instead.

The former platforms also have those macros to define them in terms of
the corresponding enum, so use the macros instead of the enums for
broader compatibility, defining them in terms of their enums when they
don't exist.

glibc2 and musl have enums and compatibility macros, uclibc and
uclibc-ng have enums only, and OpenBSD libc has macros only.

3 years agodoc/VERSION_LETTERS: sync with reality
Aaron Jones [Wed, 3 Mar 2021 07:33:45 +0000 (07:33 +0000)] 
doc/VERSION_LETTERS: sync with reality