From b3995f48ffe765eb64533901e0d09235f945c8a2 Mon Sep 17 00:00:00 2001 From: Bram Matthys Date: Sat, 15 Jul 2023 08:58:57 +0200 Subject: [PATCH] Mention password hashing in the example.conf itself. Suggested by rafaelgrether in https://bugs.unrealircd.org/view.php?id=6303 --- doc/conf/examples/example.conf | 13 ++++++++++++- doc/conf/examples/example.es.conf | 13 ++++++++++++- doc/conf/examples/example.fr.conf | 13 ++++++++++++- doc/conf/examples/example.tr.conf | 13 ++++++++++++- src/conf.c | 2 +- 5 files changed, 49 insertions(+), 5 deletions(-) diff --git a/doc/conf/examples/example.conf b/doc/conf/examples/example.conf index bf8048bce..28bbbff2b 100644 --- a/doc/conf/examples/example.conf +++ b/doc/conf/examples/example.conf @@ -156,7 +156,18 @@ allow { oper bobsmith { class opers; mask *@*; - password "test"; + + /* Technically you can put oper passwords in plaintext in the conf + * but this is HIGHLY DISCOURAGED. Instead, on *NIX in the shell run: + * ./unrealircd mkpasswd + * ...to generate a password hash and paste the result here: + */ + password "$argon2id..etc.."; + /* See https://www.unrealircd.org/docs/Authentication_types for + * more information, including even better authentication types + * such as 'certfp', and how to generate hashes on Windows. + */ + /* Oper permissions are defined in an 'operclass' block. * See https://www.unrealircd.org/docs/Operclass_block * UnrealIRCd ships with a number of default blocks, see diff --git a/doc/conf/examples/example.es.conf b/doc/conf/examples/example.es.conf index 99ac8ecb0..78696836f 100644 --- a/doc/conf/examples/example.es.conf +++ b/doc/conf/examples/example.es.conf @@ -145,7 +145,18 @@ allow { oper bobsmith { class opers; mask *@*; - password "test"; + + /* Technically you can put oper passwords in plaintext in the conf + * but this is HIGHLY DISCOURAGED. Instead, on *NIX in the shell run: + * ./unrealircd mkpasswd + * ...to generate a password hash and paste the result here: + */ + password "$argon2id..etc.."; + /* See https://www.unrealircd.org/docs/Authentication_types for + * more information, including even better authentication types + * such as 'certfp', and how to generate hashes on Windows. + */ + /* Los permisos de operación se definen en un bloque 'operclass'. * Ver https://www.unrealircd.org/docs/Operclass_block * UnrealIRCd se envía con una serie de bloques predeterminados, consulte diff --git a/doc/conf/examples/example.fr.conf b/doc/conf/examples/example.fr.conf index 1b7c001c0..b7d672bb4 100644 --- a/doc/conf/examples/example.fr.conf +++ b/doc/conf/examples/example.fr.conf @@ -158,7 +158,18 @@ allow { oper bobsmith { class opers; mask *@*; - password "test"; + + /* Technically you can put oper passwords in plaintext in the conf + * but this is HIGHLY DISCOURAGED. Instead, on *NIX in the shell run: + * ./unrealircd mkpasswd + * ...to generate a password hash and paste the result here: + */ + password "$argon2id..etc.."; + /* See https://www.unrealircd.org/docs/Authentication_types for + * more information, including even better authentication types + * such as 'certfp', and how to generate hashes on Windows. + */ + /* Les permissions Oper sont définies dans un bloc 'operclass'. * Voir https://www.unrealircd.org/docs/Operclass_block * UnrealIRCd est fourni avec des classes par défaut, voir la doc diff --git a/doc/conf/examples/example.tr.conf b/doc/conf/examples/example.tr.conf index f8a534b55..a915e29e3 100644 --- a/doc/conf/examples/example.tr.conf +++ b/doc/conf/examples/example.tr.conf @@ -157,7 +157,18 @@ allow { oper bobsmith { class opers; mask *@*; - password "test"; + + /* Technically you can put oper passwords in plaintext in the conf + * but this is HIGHLY DISCOURAGED. Instead, on *NIX in the shell run: + * ./unrealircd mkpasswd + * ...to generate a password hash and paste the result here: + */ + password "$argon2id..etc.."; + /* See https://www.unrealircd.org/docs/Authentication_types for + * more information, including even better authentication types + * such as 'certfp', and how to generate hashes on Windows. + */ + /* Oper izinleri bir "operclass 'bloğunda tanımlanır. * Görmeniz için: https://www.unrealircd.org/docs/Operclass_block * UnrealIRCd varsayılan bloklar makalesi için, diff --git a/src/conf.c b/src/conf.c index e0eba5a22..8124a98bb 100644 --- a/src/conf.c +++ b/src/conf.c @@ -4222,7 +4222,7 @@ int _test_oper(ConfigFile *conf, ConfigEntry *ce) if (ce->value && cep->value && !strcmp(ce->value, "bobsmith") && - !strcmp(cep->value, "test")) + (!strcmp(cep->value, "test") || !strcmp(cep->value, "$argon2id..etc.."))) { config_error("%s:%i: please change the the name and password of the " "default 'bobsmith' oper block",