InspIRCd v2 is coming to the end of its lifetime!

Fixes for security vulnerabilities will be provided until 2020-06-01 but after this date v2 will no longer be maintained.

InspIRCd v3 contains many new features including full support for all currently ratified IRCv3 extensions and WebSocket connections.

InspIRCd v3 installation instructions are available here and a list of breaking changes is available here.

The "sqlauth" Module

Description

This module allows connecting users to be authenticated against an arbitrary SQL table.

Configuration

To load this module use the following <module> tag:

<module name="m_sqlauth.so">

<sqlauth>

The <sqlauth> tag defines settings about how the sqlauth module should behave. This tag can only be defined once.

Name Type Default Value Description
allowpattern Text None If defined then a glob pattern for nicknames that are exempted from the authentication requirement.
dbid Text None Required! The name of the database connection to execute the query against.
killreason Text None Required! The message to kill users that fail to authenticate with.
query Text None Required! The SQL query to authenticate users with. If this query returns one or more rows it is considered a success otherwise it is considered a failure.
verbose Boolean No Whether to log failed authentications to snomask a (local) and snomask A (remote).

The query field can contain any of the following template variables:

Variable Description
$gecos The real name (gecos) of the connecting user.
$host The real hostname of the connecting user.
$ident The username (ident) of the connecting user.
$ip The IP address of the connecting user.
$md5pass An MD5 hash of the password sent with /PASS by the connecting user (requires the md5 module).
$nick The nickname of the connecting user.
$pass The password sent with /PASS by the connecting user.
$server The name of the server the connecting user connected to.
$sha256pass A SHA-256 hash of the password sent with /PASS by the connecting user (requires the sha256 module).
$uuid The UUID of the connecting user.
Example Usage
<sqlauth allowpattern="Guest*"
         dbid="sqlauth"
         killreason="Access denied"
         query="SELECT * FROM users WHERE name='$nick' AND password='$sha256pass' LIMIT 1"
         verbose="no">

Special Notes

The following SQL modules are included with InspIRCd:

Engine Module Description
mysql mysql Queries a MySQL database.
pgsql pgsql Queries a PostgreSQL database.
sqlite3 sqlite3 Queries an SQLite database.