[users] sample config and stub function for libpwquality
This commit is contained in:
parent
27e1de6548
commit
354cb79cb1
@ -89,6 +89,18 @@ DEFINE_CHECK_FUNC(maxLength)
|
||||
#ifdef HAVE_LIBPWQUALITY
|
||||
DEFINE_CHECK_FUNC(libpwquality)
|
||||
{
|
||||
if ( !value.canConvert( QVariant::List ) )
|
||||
{
|
||||
cDebug() << "WARNING: libpwquality settings is not a list";
|
||||
return;
|
||||
}
|
||||
|
||||
QVariantList l = value.toList();
|
||||
unsigned int requirement_count = 0;
|
||||
for ( const auto& v : l )
|
||||
{
|
||||
cDebug() << " .. " << v.type() << v;
|
||||
// TODO: pass strings on to libpwquality
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
@ -473,5 +473,5 @@ UsersPage::addPasswordCheck( const QString& key, const QVariant& value )
|
||||
}
|
||||
#endif
|
||||
else
|
||||
cDebug() << "WARNING: Unknown password-check key" << '"' << key << '"';
|
||||
cDebug() << "WARNING: Unknown password-check key" << key;
|
||||
}
|
||||
|
@ -58,7 +58,19 @@ doReusePassword: true
|
||||
# (e.g. specifying a maximum length less than the minimum length
|
||||
# will annoy users).
|
||||
#
|
||||
# (additional checks may be implemented in UsersPage.cpp)
|
||||
# The libpwquality check relies on the (optional) libpwquality library.
|
||||
# Its value is a list of configuration statements that could also
|
||||
# be found in pwquality.conf, and these are handed off to the
|
||||
# libpwquality parser for evaluation. The check is ignored if
|
||||
# libpwquality is not available at build time (generates a warning in
|
||||
# the log). The Calamares password check rejects passwords with a
|
||||
# score of < 40 with the given libpwquality settings.
|
||||
#
|
||||
# (additional checks may be implemented in CheckPWQuality.cpp and
|
||||
# wired into UsersPage.cpp)
|
||||
passwordRequirements:
|
||||
minLength: -1 # Password at least this many characters
|
||||
maxLength: -1 # Password at most this many characters
|
||||
libpwquality:
|
||||
- minlen=8
|
||||
- minclass=2
|
||||
|
Loading…
Reference in New Issue
Block a user