]> jfr.im git - irc/atheme/atheme.git/log
irc/atheme/atheme.git
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

3 years agoVersion: Indicate if --enable-fhs-paths was given
Aaron Jones [Wed, 3 Mar 2021 07:30:59 +0000 (07:30 +0000)] 
Version: Indicate if --enable-fhs-paths was given

3 years agoinclude/atheme/mkserno.sh: exit early in presence of an environment variable
Aaron Jones [Tue, 2 Mar 2021 05:46:12 +0000 (05:46 +0000)] 
include/atheme/mkserno.sh: exit early in presence of an environment variable

This makes life easier for people who want to package snapshots
of a git branch. They must provide their own serno.h in this
case, containing also, perhaps, the date the snapshot was
downloaded or such.

3 years agoBuild System: Compiler Sanitizers: Some small improvements
Aaron Jones [Tue, 2 Mar 2021 00:48:18 +0000 (00:48 +0000)] 
Build System: Compiler Sanitizers: Some small improvements

- Remove a few levels of indentation by swapping the following approach:

  < Try to enable LTO >
  if (that succeeded) {
    < Try to enable some sanitizers >
    if (one of those succeeded) {
      AC_DEFINE(...)
    } else {
      AC_MSG_FAILURE(...)
    }
  } else {
    AC_MSG_FAILURE(...)
  }

  ... for this equivalent approach instead:

  < Try to enable LTO >
  if (that failed) {
    AC_MSG_FAILURE(...)
  }
  < Try to enable some sanitizers >
  If (none of those succeeded) {
    AC_MSG_FAILURE(...)
  }
  AC_DEFINE(...)

  This is equivalent because AC_MSG_FAILURE terminates the script

- Add support for -fsanitize=bounds

  This enables some checks not enabled by -fsanitize=undefined on Clang

- Add support for falling back to individual undefined behaviour
  sanitizers if the compiler does not support -fsanitize=undefined

  This may seem pointless, but it may benefit older compilers, and
  compilers that are not GCC or Clang.

- Adjust the compiler sanitizers driver to take the name of a sanitizer
  rather than its whole -fsanitize= option. Use this to collect a list
  of enabled sanitizers and report it in the output of ./configure

3 years agoGitHub Actions: CI: Tidy up a bit
Aaron Jones [Mon, 1 Mar 2021 20:21:38 +0000 (20:21 +0000)] 
GitHub Actions: CI: Tidy up a bit

- Clone the repository first

  This is likely to be much faster than downloading the dependencies,
  which will result in the job aborting much earlier and wasting less
  data if for some reason the clone cannot succeed

- Remove a pointless single-valued option from the build matrix

This more closely aligns it with the Coverity Scan action.

3 years agoGitHub Actions: Coverity Scan: Pleeeeeeease work damn you!
Aaron Jones [Mon, 1 Mar 2021 19:37:34 +0000 (19:37 +0000)] 
GitHub Actions: Coverity Scan: Pleeeeeeease work damn you!

GitHub is throwing an incredibly vague and non-specific "No such file or
directory" error when trying to start this job.

I have no idea why.

Remove all the fancy bells and whistles.

Allow it to be scheduled manually.

3 years agoGitHub Actions: Coverity Scan: Check out source repo first
Aaron Jones [Mon, 1 Mar 2021 18:19:36 +0000 (18:19 +0000)] 
GitHub Actions: Coverity Scan: Check out source repo first

3 years agoMerge branch 'list-mlock' (PR #762)
Nicole Kleinhoff [Mon, 1 Mar 2021 11:51:35 +0000 (11:51 +0000)] 
Merge branch 'list-mlock' (PR #762)

3 years agomodules/operserv/readonly: error out on no write backend
Aaron Jones [Sun, 28 Feb 2021 15:33:12 +0000 (15:33 +0000)] 
modules/operserv/readonly: error out on no write backend

3 years agoBuild System: Detect user error w/ downloading sourcecode
Aaron Jones [Sun, 28 Feb 2021 02:15:43 +0000 (02:15 +0000)] 
Build System: Detect user error w/ downloading sourcecode

A frequent complaint we receive is that serno.h is missing. This turns
out to be users downloading release tarballs from GitHub, which does
not include the .git directory, thus making the target for serno.h
fail.

Detect whether .git/ exists; reference GIT-Access.txt then. Otherwise,
this must be a release tarball, so see if it has a pre-supplied serno.h
and error if not (this could only be caused by downloading a GitHub
source code link instead of an asset/release tarball).

Also tidy up mkserno.sh a bit. It still can't use git-describe(1) on
this branch (lack of recent tags), but will be made to do so on release
branches.

Thanks to ilbelkyr for the idea (pointing out that the sourcecode links
on GitHub don't include the .git/ directory, making it possible to
distinguish between that and git-clone(1)).

3 years agoSupport rehashing of general::commit_interval
Aaron Jones [Fri, 26 Feb 2021 16:10:43 +0000 (16:10 +0000)] 
Support rehashing of general::commit_interval

3 years agomodules/nickserv/listlogins: correct module name & help path
Aaron Jones [Sun, 28 Feb 2021 00:26:08 +0000 (00:26 +0000)] 
modules/nickserv/listlogins: correct module name & help path

This was overlooked when backporting this module from contrib/.

3 years agoBuild System: Several small improvements
Aaron Jones [Sat, 27 Feb 2021 21:14:22 +0000 (21:14 +0000)] 
Build System: Several small improvements

- Don't let autoconf add "-O2 -g" to the CFLAGS variable. Detect
  optimisations automatically (if sanitizers are not enabled) or
  explicitly disable them (if they are). Detect debugging flags
  automatically, preferring DWARF, then GDB, then regular -g as
  autoconf does. This allows more accurate debugging when supported
  by the toolchain. Allow debugging symbols to be disabled; enable
  them by default.

- When requested to enable compiler sanitizers, bail out with an
  error when they cannot be enabled. Update the comment on
  ATHEME_ENABLE_COMPILER_SANITIZERS to reflect that sanitizers are
  enabled; rather than just the configure argument given.

- Move the logic for testing CFLAGS / CPPFLAGS / LDFLAGS / some
  combination of them to a dedicated separate file. Tidy up those
  functions to use the same M4sh coding style as the other files.
  Explicitly provide a program with both a header and main body when
  doing compiler and linker tests. Use a unified function and variable
  name scheme.

- Rewrite the compiler sanitizers driver function to use the new
  combined compiler and linker test logic.

- Update the comment in the compiler sanitizers feature file to explain
  why we are trying to enable LTO (Clang sanitizers require it).

- Clean up temporary _SAVED variables at the end of function execution
  in various feature and library tests.

- Remove 2 unsubstituted and unused variables from extra.mk.in.

- Support the -Wa,--noexecstack flag to the compiler and linker; enable
  it by default.

3 years agoGitHub Actions: Coverity Scan: Truncate version hash
Aaron Jones [Sat, 27 Feb 2021 16:31:23 +0000 (16:31 +0000)] 
GitHub Actions: Coverity Scan: Truncate version hash

The web UI truncates excessively long version fields; 20 characters
is more than long enough, and is already what we use in e.g. serno.h.

3 years agoGitHub Actions: Coverity Scan: Ensure version string is valid
Aaron Jones [Sat, 27 Feb 2021 16:05:00 +0000 (16:05 +0000)] 
GitHub Actions: Coverity Scan: Ensure version string is valid

curl(1) reads this file for the value of the 'version' form field.
We should not be submitting a field with a newline character in it.

3 years agomodules/contrib/: bump to latest HEAD
Aaron Jones [Sat, 27 Feb 2021 15:50:22 +0000 (15:50 +0000)] 
modules/contrib/: bump to latest HEAD

3 years agolibathemecore/logger.c: logfile_new(): fix up close-on-exec logic
Aaron Jones [Sat, 27 Feb 2021 15:14:33 +0000 (15:14 +0000)] 
libathemecore/logger.c: logfile_new(): fix up close-on-exec logic

We were calling fcntl(2) F_SETFD without first obtaining the current
file descriptor flags with F_GETFD. Furthermore, we were not checking
the return value of the F_SETFD operation. Now we obtain the current
flags to bitwise-OR FD_CLOEXEC them with, and we warn if the operation
fails.

However, it would be better if we didn't have to try to call it in the
first place, so try opening the file descriptor with the O_CLOEXEC flag
first, which is safer too.

While we're at it, make sure that the log file doesn't end up being
world-readable if services' umask is not sufficient to prevent this.

Identified by Coverity Scan.

3 years agolibathemecore/commandhelp.c: help_not_available(): move buffer
Aaron Jones [Sat, 27 Feb 2021 14:48:25 +0000 (14:48 +0000)] 
libathemecore/commandhelp.c: help_not_available(): move buffer

We cannot (safely) assign the address of this block-scope buffer to a
function-scope variable and then use it after the block ends.

Identified by Coverity Scan.

3 years agolibathemecore/version.c: infotext[]: add missing comma delimiter
Aaron Jones [Sat, 27 Feb 2021 14:46:57 +0000 (14:46 +0000)] 
libathemecore/version.c: infotext[]: add missing comma delimiter

Identified by Coverity Scan.

3 years agolibathemecore/connection.c: connection_add(): library calling fixes
Aaron Jones [Sat, 27 Feb 2021 14:46:24 +0000 (14:46 +0000)] 
libathemecore/connection.c: connection_add(): library calling fixes

We should check if getpeername(2) fails, and we must use inet_ntop(3)
properly.

Previously the code assumed that "(struct sockaddr_in *)->sin_addr" and
"(struct sockaddr_in6 *)->sin6_addr" both started at the same offset.

While we're at it, use the proper "struct sockaddr_storage" type for
passing to inet_pton(3), capable of holding any kind of sockaddr
structure, and remove it from `struct connection', as it was not
referenced anywhere. Also remove some unused macros and the now-unused
sockaddr_any union.

Finally, remove the non-blocking invocation from connection_open_tcp();
this prevents getpeername(2) from functioning alltogether (the socket
is not yet connected). connection_add() itself sets the socket non-
blocking.

Identified by Coverity Scan.

3 years agolibathemecore/connection.c: connection_open_tcp(): correct argument
Aaron Jones [Sat, 27 Feb 2021 14:08:15 +0000 (14:08 +0000)] 
libathemecore/connection.c: connection_open_tcp(): correct argument

From setsockopt(2):

    Most socket-level options utilize an int argument for optval. For
    setsockopt(2), the argument should be non-zero to enable a boolean
    option, or zero if the option is to be disabled. For a description
    of the available socket options see socket(7) and the appropriate
    protocol man pages.

From socket(7):

    The socket options listed below can be set by using setsockopt(2)
    and read with getsockopt(2) with the socket level set to SOL_SOCKET
    for all sockets. Unless otherwise noted, optval is a pointer to an
    int.

    SO_REUSEADDR
        Indicates that the rules used in validating addresses supplied
        in a bind(2) call should allow reuse of local addresses. For
        AF_INET sockets this means that a socket may bind, except when
        there is an active listening socket bound to the address. When
        the listening socket is bound to INADDR_ANY with a specific port
        then it is not possible to bind to this port for any local
        address. Argument is an integer boolean flag.

Therefore, the argument must be a pointer to int. Further, check the
return value of setsockopt(2) to ensure that it succeeds.

Identified by Coverity Scan.

3 years agolibathemecore/connection.c: connection_open_listener_tcp(): correct argument
Aaron Jones [Sat, 27 Feb 2021 14:05:43 +0000 (14:05 +0000)] 
libathemecore/connection.c: connection_open_listener_tcp(): correct argument

From setsockopt(2):

    Most socket-level options utilize an int argument for optval. For
    setsockopt(2), the argument should be non-zero to enable a boolean
    option, or zero if the option is to be disabled. For a description
    of the available socket options see socket(7) and the appropriate
    protocol man pages.

From socket(7):

    The socket options listed below can be set by using setsockopt(2)
    and read with getsockopt(2) with the socket level set to SOL_SOCKET
    for all sockets. Unless otherwise noted, optval is a pointer to an
    int.

    SO_REUSEADDR
        Indicates that the rules used in validating addresses supplied
        in a bind(2) call should allow reuse of local addresses. For
        AF_INET sockets this means that a socket may bind, except when
        there is an active listening socket bound to the address. When
        the listening socket is bound to INADDR_ANY with a specific port
        then it is not possible to bind to this port for any local
        address. Argument is an integer boolean flag.

Therefore, the argument must be a pointer to int. Further, check the
return value of setsockopt(2) to ensure that it succeeds.

Identified by Coverity Scan.

3 years agolibathemecore/services.c: get_storage_oper_name(): complete NULL checks
Aaron Jones [Sat, 27 Feb 2021 13:51:29 +0000 (13:51 +0000)] 
libathemecore/services.c: get_storage_oper_name(): complete NULL checks

Code above this already tests if si->v is NULL; indicating that it can
be NULL (and it can be). Therefore, check if it's NULL again before
attempting to dereference it again.

At present this cannot be the case, but guard against it anyway, making
sure to fill the result buffer with something in any case.

Identified by Coverity Scan.

3 years agolibathemecore/services.c: get_oper_name(): complete NULL checks
Aaron Jones [Sat, 27 Feb 2021 13:51:17 +0000 (13:51 +0000)] 
libathemecore/services.c: get_oper_name(): complete NULL checks

Code above this already tests if si->v is NULL; indicating that it can
be NULL (and it can be). Therefore, check if it's NULL again before
attempting to dereference it again.

At present this cannot be the case, but guard against it anyway, making
sure to fill the result buffer with something in any case.

Identified by Coverity Scan.

3 years agolibathemecore/services.c: get_source_mask(): complete NULL checks
Aaron Jones [Sat, 27 Feb 2021 13:51:05 +0000 (13:51 +0000)] 
libathemecore/services.c: get_source_mask(): complete NULL checks

Code above this already tests if si->v is NULL; indicating that it can
be NULL (and it can be). Therefore, check if it's NULL again before
attempting to dereference it again.

At present this cannot be the case, but guard against it anyway, making
sure to fill the result buffer with something in any case.

Identified by Coverity Scan.

3 years agolibathemecore/services.c: get_source_name(): complete NULL checks
Aaron Jones [Sat, 27 Feb 2021 13:49:48 +0000 (13:49 +0000)] 
libathemecore/services.c: get_source_name(): complete NULL checks

Code above this already tests if si->v is NULL; indicating that it can
be NULL (and it can be). Therefore, check if it's NULL again before
attempting to dereference it again.

At present this cannot be the case, but guard against it anyway, making
sure to fill the result buffer with something in any case.

Identified by Coverity Scan.

3 years agochanserv/{voice,op,halfop,owner,protect,kick}: check channel exists
Nicole Kleinhoff [Fri, 26 Feb 2021 20:07:02 +0000 (20:07 +0000)] 
chanserv/{voice,op,halfop,owner,protect,kick}: check channel exists

These modules would not check whether the target channel existed
ircd-side, instead failing on their chanuser_find call and causing an
assertion failure. Add a proper check instead.

3 years agoGitHub Actions: Add periodic Coverity Scan runner
Aaron Jones [Fri, 26 Feb 2021 16:31:00 +0000 (16:31 +0000)] 
GitHub Actions: Add periodic Coverity Scan runner

3 years agoGitHub Actions: CI: Increase dependencies wrapping character column
Aaron Jones [Fri, 26 Feb 2021 19:19:06 +0000 (19:19 +0000)] 
GitHub Actions: CI: Increase dependencies wrapping character column

3 years agoGitHub Actions: CI: Use version 2 of actions/checkout & name it
Aaron Jones [Fri, 26 Feb 2021 18:59:35 +0000 (18:59 +0000)] 
GitHub Actions: CI: Use version 2 of actions/checkout & name it

3 years agoGitHub Actions: CI: Use /tmp for dependency install step
Aaron Jones [Fri, 26 Feb 2021 19:01:26 +0000 (19:01 +0000)] 
GitHub Actions: CI: Use /tmp for dependency install step

3 years agoGitHub Actions: CI: Ignore modifications to periodic actions
Aaron Jones [Fri, 26 Feb 2021 18:59:01 +0000 (18:59 +0000)] 
GitHub Actions: CI: Ignore modifications to periodic actions

3 years agoGitHub Actions: CI: Ensure the build-essential package is installed
Aaron Jones [Fri, 26 Feb 2021 16:11:56 +0000 (16:11 +0000)] 
GitHub Actions: CI: Ensure the build-essential package is installed

3 years agoatheme.conf.example: listownmail_canon: apply style updates
Nicole Kleinhoff [Wed, 24 Feb 2021 02:56:22 +0000 (02:56 +0000)] 
atheme.conf.example: listownmail_canon: apply style updates

This is a follow-up to PR #745 to make the added bit in the example
configuration follow the style as since adjusted on the master branch.

3 years agoMerge PR #745 (make LISTOWNMAIL canonicalization optional)
Nicole Kleinhoff [Wed, 24 Feb 2021 02:51:26 +0000 (02:51 +0000)] 
Merge PR #745 (make LISTOWNMAIL canonicalization optional)

3 years agoMerge branch 'infoserv-improvements'
Nicole Kleinhoff [Tue, 23 Feb 2021 01:15:53 +0000 (01:15 +0000)] 
Merge branch 'infoserv-improvements'

3 years agolibmowgli-2/: bump to latest HEAD
Nicole Kleinhoff [Tue, 23 Feb 2021 00:05:06 +0000 (00:05 +0000)] 
libmowgli-2/: bump to latest HEAD

3 years agomodules/scripting/perl: make non-unloadable
Aaron Jones [Mon, 22 Feb 2021 19:43:35 +0000 (19:43 +0000)] 
modules/scripting/perl: make non-unloadable

Reloading this module causes services to segfault because the
PERL_SYS_INIT3() macro should only be called once during the entire
lifetime of the process [1]. Allowing it to be unloaded thus carries the
risk that it will be reloaded (or, at a later date, loaded again).

I tried to (ab)use Mowgli's global storage API to only call it once
(regardless of how many times it's loaded), and to not call the
PERL_SYS_TERM() macro at all, but this only lead to a different crash on
reload: trying to allocate a little less than 100 TiB of memory (!).

If a Perl expert comes along and weighs in, this commit can be reverted
and the underlying problem fixed. Nonetheless, libperl did exhibit *dozens*
of uses of unintialized data on reload (confirmed by valgrind), followed by
a segmentation fault even if we skip calling PERL_SYS_INIT3() again
(because, naturally, such a large allocation will usually return NULL, and
it apparently doesn't deal with that).

[1] https://perldoc.perl.org/perlembed

3 years agomodules/proxyscan/dnsbl: make reload-only to prevent data loss
Aaron Jones [Mon, 22 Feb 2021 16:59:08 +0000 (16:59 +0000)] 
modules/proxyscan/dnsbl: make reload-only to prevent data loss

3 years agomodules/chanserv/moderate: make reload-only to prevent data loss
Aaron Jones [Mon, 22 Feb 2021 16:11:46 +0000 (16:11 +0000)] 
modules/chanserv/moderate: make reload-only to prevent data loss

3 years agoinfoserv/main: fix signedness on format parameter
Nicole Kleinhoff [Mon, 22 Feb 2021 15:51:15 +0000 (15:51 +0000)] 
infoserv/main: fix signedness on format parameter

(spotted by @aaronmdjones)

3 years agoinfoserv/main: store list node in struct logoninfo
Nicole Kleinhoff [Mon, 22 Feb 2021 15:13:25 +0000 (15:13 +0000)] 
infoserv/main: store list node in struct logoninfo

This avoids having to dynamically allocate the node (as suggested during
review of PR #765).

3 years agoinfoserv/main: address issues found in review
Nicole Kleinhoff [Mon, 22 Feb 2021 14:49:20 +0000 (14:49 +0000)] 
infoserv/main: address issues found in review

See discussion on PR #765 for details.

3 years agoREADME.md, GIT-Access.txt: Some small improvements
Aaron Jones [Sun, 21 Feb 2021 23:08:41 +0000 (23:08 +0000)] 
README.md, GIT-Access.txt: Some small improvements

- Recommend an explicit directory name for the clone, to avoid cloning
  into ~/atheme/ if the user runs the `git clone` operation in their
  home directory. Atheme defaults to installing to ~/atheme/, and you
  cannot install Atheme to its source directory. [1]

- Recommend the use of the `--recursive` option to `git clone` in
  `README.md`, as it was already recommended in `GIT-Access.txt`. [1]

- Provide alternative command sequences for people who have very old
  versions of git, which may not even support the `--init` option of
  `git submodule update`, let alone the `--recursive` option of
  `git clone`.

- Quote a filesystem path.

- Tidy up the more information section in the bottom of `README.md`.

[1] Suggested by GitHub user @PeGaSuS-Coder in PR #764

Closes #764