Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
5241e25ae8 | ||
![]() |
3f1d12ccd8 | ||
![]() |
2b8309eb04 | ||
![]() |
adb9f37cca |
9
CHANGES
9
CHANGES
@@ -7,6 +7,15 @@ contributors are listed. Note that Calamares does not have a historical
|
||||
changelog -- this log starts with version 3.2.0. The release notes on the
|
||||
website will have to do for older versions.
|
||||
|
||||
# 3.2.39.3 (2021-04-14) #
|
||||
|
||||
A minor bugfix tweak release. Since this contains yet **another**
|
||||
autologin-related fix, and there is nothing large enough to justify
|
||||
a 3.2.40 release yet, add it to the growing tail of 3.2.39. (Reported
|
||||
by Joe Kamprad, #1672). Also fixes a regression from 3.2.28 in
|
||||
localized packages (e.g. *package-LOCALE* did not work).
|
||||
|
||||
|
||||
# 3.2.39.2 (2021-04-02) #
|
||||
|
||||
This is **another** hotfix release for issues around autologin ..
|
||||
|
@@ -41,7 +41,7 @@
|
||||
# TODO:3.3: Require CMake 3.12
|
||||
cmake_minimum_required( VERSION 3.3 FATAL_ERROR )
|
||||
project( CALAMARES
|
||||
VERSION 3.2.39.2
|
||||
VERSION 3.2.39.3
|
||||
LANGUAGES C CXX
|
||||
)
|
||||
|
||||
|
@@ -259,8 +259,7 @@ Config::setCurrentLocation( const CalamaresUtils::Locale::TimeZoneData* location
|
||||
auto newLocale = automaticLocaleConfiguration();
|
||||
if ( !m_selectedLocaleConfiguration.explicit_lang )
|
||||
{
|
||||
m_selectedLocaleConfiguration.setLanguage( newLocale.language() );
|
||||
emit currentLanguageStatusChanged( currentLanguageStatus() );
|
||||
setLanguage( newLocale.language() );
|
||||
}
|
||||
if ( !m_selectedLocaleConfiguration.explicit_lc )
|
||||
{
|
||||
@@ -302,11 +301,20 @@ Config::localeConfiguration() const
|
||||
void
|
||||
Config::setLanguageExplicitly( const QString& language )
|
||||
{
|
||||
m_selectedLocaleConfiguration.setLanguage( language );
|
||||
m_selectedLocaleConfiguration.explicit_lang = true;
|
||||
setLanguage( language );
|
||||
}
|
||||
|
||||
emit currentLanguageStatusChanged( currentLanguageStatus() );
|
||||
emit currentLanguageCodeChanged( currentLanguageCode() );
|
||||
void
|
||||
Config::setLanguage( const QString& language )
|
||||
{
|
||||
if ( language != m_selectedLocaleConfiguration.language() )
|
||||
{
|
||||
m_selectedLocaleConfiguration.setLanguage( language );
|
||||
|
||||
emit currentLanguageStatusChanged( currentLanguageStatus() );
|
||||
emit currentLanguageCodeChanged( currentLanguageCode() );
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
@@ -95,6 +95,8 @@ private:
|
||||
}
|
||||
|
||||
public Q_SLOTS:
|
||||
/// Set the language, but do not mark it as user-choice
|
||||
void setLanguage( const QString& language );
|
||||
/// Set a language by user-choice, overriding future location changes
|
||||
void setLanguageExplicitly( const QString& language );
|
||||
/// Set LC (formats) by user-choice, overriding future location changes
|
||||
|
@@ -803,6 +803,29 @@ addPasswordCheck( const QString& key, const QVariant& value, PasswordCheckList&
|
||||
return true;
|
||||
}
|
||||
|
||||
/** @brief Returns a value of either key from the map
|
||||
*
|
||||
* Takes a function (e.g. getBool, or getString) and two keys,
|
||||
* returning the value in the map of the one that is there (or @p defaultArg)
|
||||
*/
|
||||
template < typename T, typename U >
|
||||
T
|
||||
either( T ( *f )( const QVariantMap&, const QString&, U ),
|
||||
const QVariantMap& configurationMap,
|
||||
const QString& oldKey,
|
||||
const QString& newKey,
|
||||
U defaultArg )
|
||||
{
|
||||
if ( configurationMap.contains( oldKey ) )
|
||||
{
|
||||
return f( configurationMap, oldKey, defaultArg );
|
||||
}
|
||||
else
|
||||
{
|
||||
return f( configurationMap, newKey, defaultArg );
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
Config::setConfigurationMap( const QVariantMap& configurationMap )
|
||||
{
|
||||
@@ -814,7 +837,8 @@ Config::setConfigurationMap( const QVariantMap& configurationMap )
|
||||
// Now it might be explicitly set to empty, which is ok
|
||||
setUserShell( shell );
|
||||
|
||||
setAutoLoginGroup( CalamaresUtils::getString( configurationMap, "autoLoginGroup" ) );
|
||||
setAutoLoginGroup( either< QString, const QString& >(
|
||||
CalamaresUtils::getString, configurationMap, "autologinGroup", "autoLoginGroup", QString() ) );
|
||||
setSudoersGroup( CalamaresUtils::getString( configurationMap, "sudoersGroup" ) );
|
||||
|
||||
m_hostNameActions = getHostNameActions( configurationMap );
|
||||
@@ -823,16 +847,11 @@ Config::setConfigurationMap( const QVariantMap& configurationMap )
|
||||
|
||||
// Renaming of Autologin -> AutoLogin in 4ffa79d4cf also affected
|
||||
// configuration keys, which was not intended. Accept both.
|
||||
const auto oldKey = QStringLiteral( "doAutologin" );
|
||||
const auto newKey = QStringLiteral( "doAutoLogin" );
|
||||
if ( configurationMap.contains( oldKey ) )
|
||||
{
|
||||
m_doAutoLogin = CalamaresUtils::getBool( configurationMap, oldKey, false );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_doAutoLogin = CalamaresUtils::getBool( configurationMap, newKey, false );
|
||||
}
|
||||
m_doAutoLogin = either( CalamaresUtils::getBool,
|
||||
configurationMap,
|
||||
QStringLiteral( "doAutologin" ),
|
||||
QStringLiteral( "doAutoLogin" ),
|
||||
false );
|
||||
|
||||
m_writeRootPassword = CalamaresUtils::getBool( configurationMap, "setRootPassword", true );
|
||||
Calamares::JobQueue::instance()->globalStorage()->insert( "setRootPassword", m_writeRootPassword );
|
||||
|
@@ -44,6 +44,9 @@ private Q_SLOTS:
|
||||
void testHostActions();
|
||||
void testPasswordChecks();
|
||||
void testUserPassword();
|
||||
|
||||
void testAutoLogin_data();
|
||||
void testAutoLogin();
|
||||
};
|
||||
|
||||
UserTests::UserTests() {}
|
||||
@@ -339,6 +342,43 @@ UserTests::testUserPassword()
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
UserTests::testAutoLogin_data()
|
||||
{
|
||||
QTest::addColumn< QString >( "filename" );
|
||||
QTest::addColumn< bool >( "autoLoginIsSet" );
|
||||
QTest::addColumn< QString >( "autoLoginGroupName" );
|
||||
|
||||
QTest::newRow( "old, old" ) << "tests/6a-issue-1672.conf" << true << "derp";
|
||||
QTest::newRow( "old, new" ) << "tests/6b-issue-1672.conf" << true << "derp";
|
||||
QTest::newRow( "new, old" ) << "tests/6c-issue-1672.conf" << true << "derp";
|
||||
QTest::newRow( "new, new" ) << "tests/6d-issue-1672.conf" << true << "derp";
|
||||
QTest::newRow( "default" ) << "tests/6e-issue-1672.conf" << false << QString();
|
||||
}
|
||||
|
||||
void
|
||||
UserTests::testAutoLogin()
|
||||
{
|
||||
QFETCH( QString, filename );
|
||||
QFETCH( bool, autoLoginIsSet );
|
||||
QFETCH( QString, autoLoginGroupName );
|
||||
|
||||
// BUILD_AS_TEST is the source-directory path
|
||||
QFile fi( QString( "%1/%2" ).arg( BUILD_AS_TEST, filename ) );
|
||||
QVERIFY( fi.exists() );
|
||||
|
||||
bool ok = false;
|
||||
const auto map = CalamaresUtils::loadYaml( fi, &ok );
|
||||
QVERIFY( ok );
|
||||
QVERIFY( map.count() > 0 );
|
||||
|
||||
Config c;
|
||||
c.setConfigurationMap( map );
|
||||
|
||||
QCOMPARE( c.doAutoLogin(), autoLoginIsSet );
|
||||
QCOMPARE( c.autoLoginGroup(), autoLoginGroupName );
|
||||
}
|
||||
|
||||
|
||||
QTEST_GUILESS_MAIN( UserTests )
|
||||
|
||||
|
7
src/modules/users/tests/6a-issue-1672.conf
Normal file
7
src/modules/users/tests/6a-issue-1672.conf
Normal file
@@ -0,0 +1,7 @@
|
||||
# SPDX-FileCopyrightText: no
|
||||
# SPDX-License-Identifier: CC0-1.0
|
||||
#
|
||||
---
|
||||
autologinGroup: derp
|
||||
doAutologin: true
|
||||
|
7
src/modules/users/tests/6b-issue-1672.conf
Normal file
7
src/modules/users/tests/6b-issue-1672.conf
Normal file
@@ -0,0 +1,7 @@
|
||||
# SPDX-FileCopyrightText: no
|
||||
# SPDX-License-Identifier: CC0-1.0
|
||||
#
|
||||
---
|
||||
autologinGroup: derp
|
||||
doAutoLogin: true
|
||||
|
7
src/modules/users/tests/6c-issue-1672.conf
Normal file
7
src/modules/users/tests/6c-issue-1672.conf
Normal file
@@ -0,0 +1,7 @@
|
||||
# SPDX-FileCopyrightText: no
|
||||
# SPDX-License-Identifier: CC0-1.0
|
||||
#
|
||||
---
|
||||
autoLoginGroup: derp
|
||||
doAutologin: true
|
||||
|
7
src/modules/users/tests/6d-issue-1672.conf
Normal file
7
src/modules/users/tests/6d-issue-1672.conf
Normal file
@@ -0,0 +1,7 @@
|
||||
# SPDX-FileCopyrightText: no
|
||||
# SPDX-License-Identifier: CC0-1.0
|
||||
#
|
||||
---
|
||||
autoLoginGroup: derp
|
||||
doAutoLogin: true
|
||||
|
7
src/modules/users/tests/6e-issue-1672.conf
Normal file
7
src/modules/users/tests/6e-issue-1672.conf
Normal file
@@ -0,0 +1,7 @@
|
||||
# SPDX-FileCopyrightText: no
|
||||
# SPDX-License-Identifier: CC0-1.0
|
||||
#
|
||||
---
|
||||
doautologin: true
|
||||
autologingroup: wheel
|
||||
|
Reference in New Issue
Block a user