From d2214b8d2e45bc11c726030af4766ebd457cc13d Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Fri, 1 Dec 2023 18:15:00 +0100 Subject: [PATCH] [users] Document retirement of 'nonempty' --- CHANGES-3.3 | 5 +++++ src/modules/users/Config.cpp | 14 ++------------ src/modules/users/users.schema.yaml | 1 - src/modules/usersq/usersq.conf | 5 ++--- 4 files changed, 9 insertions(+), 16 deletions(-) diff --git a/CHANGES-3.3 b/CHANGES-3.3 index 5d5886db3..fd986d920 100644 --- a/CHANGES-3.3 +++ b/CHANGES-3.3 @@ -12,12 +12,17 @@ the history of the 3.2 series (2018-05 - 2022-08). This release contains contributions from (alphabetically by first name): - Adriaan de Groot + - Alberto Salvia Novella - Christophe Marin - Frede Hundewadt ## Core ## ## Modules ## + - *users* and *usersq* no longer support the password requirement 'nonempty'. + Use 'minLength: 1' instead. The example configuration allows the user to + choose any password at all, but also contains suggestions for other + password-requirements schemes. (thanks Alberto) # 3.3.0-alpha6 (2023-11-16) diff --git a/src/modules/users/Config.cpp b/src/modules/users/Config.cpp index 8927fb4ed..1e6db0f33 100644 --- a/src/modules/users/Config.cpp +++ b/src/modules/users/Config.cpp @@ -834,18 +834,8 @@ addPasswordCheck( const QString& key, const QVariant& value, PasswordCheckList& } else if ( key == "nonempty" ) { - if ( value.toBool() ) - { - passwordChecks.push_back( - PasswordCheck( []() { return QCoreApplication::translate( "PWQ", "Password is empty" ); }, - []( const QString& s ) { return !s.isEmpty(); }, - PasswordCheck::Weight( 1 ) ) ); - } - else - { - cDebug() << "nonempty check is mentioned but set to false"; - return false; - } + cWarning() << "nonempty check is ignored; use minLength: 1"; + return false; } #ifdef CHECK_PWQUALITY else if ( key == "libpwquality" ) diff --git a/src/modules/users/users.schema.yaml b/src/modules/users/users.schema.yaml index 972306b80..a67504321 100644 --- a/src/modules/users/users.schema.yaml +++ b/src/modules/users/users.schema.yaml @@ -41,7 +41,6 @@ properties: additionalProperties: false type: object properties: - nonempty: { type: boolean, default: true } minLength: { type: number } maxLength: { type: number } libpwquality: { type: array, items: { type: string } } # Don't know what libpwquality supports diff --git a/src/modules/usersq/usersq.conf b/src/modules/usersq/usersq.conf index 19a30bd02..ea171bd91 100644 --- a/src/modules/usersq/usersq.conf +++ b/src/modules/usersq/usersq.conf @@ -27,9 +27,8 @@ setRootPassword: true doReusePassword: true passwordRequirements: - nonempty: true - minLength: -1 # Password at least this many characters - maxLength: -1 # Password at most this many characters + minLength: -1 + maxLength: -1 libpwquality: - minlen=0 - minclass=0