diff --git a/CHANGES-3.3 b/CHANGES-3.3 index bf02374d0..d2be18a3e 100644 --- a/CHANGES-3.3 +++ b/CHANGES-3.3 @@ -7,6 +7,19 @@ contributors are listed. Note that Calamares does not have a historical changelog -- this log starts with version 3.3.0. See CHANGES-3.2 for the history of the 3.2 series (2018-05 - 2022-08). +# 3.3.12 (2024-11-21) + +This release contains contributions from (alphabetically by given name): + - Adriaan de Groot + +## Core ## + - This release repairs the Calamares configuration file which is + used by external Calamares modules -- calamares-extensions in particular. + +## Modules ## + - *users* module always uses a 3-digit UMASK if one is specified. + + # 3.3.11 (2024-11-05) This release contains contributions from (alphabetically by given name): diff --git a/CMakeLists.txt b/CMakeLists.txt index ad1148676..91521ca0a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -48,7 +48,7 @@ cmake_minimum_required(VERSION 3.16 FATAL_ERROR) -set(CALAMARES_VERSION 3.3.11) +set(CALAMARES_VERSION 3.3.12) set(CALAMARES_RELEASE_MODE ON) # Set to ON during a release if(CMAKE_SCRIPT_MODE_FILE) diff --git a/CMakeModules/KPMcoreHelper.cmake b/CMakeModules/KPMcoreHelper.cmake index 888b4aea4..cdbd2336f 100644 --- a/CMakeModules/KPMcoreHelper.cmake +++ b/CMakeModules/KPMcoreHelper.cmake @@ -36,7 +36,8 @@ if(NOT TARGET calapmcore) if(KPMcore_FOUND) find_package(${qtname} REQUIRED DBus) # Needed for KPMCore - find_package(${kfname} REQUIRED I18n WidgetsAddons) # Needed for KPMCore + find_package(${kfname}I18n REQUIRED) # Needed for KPMCore + find_package(${kfname}WidgetsAddons REQUIRED) # Needed for KPMCore target_link_libraries(calapmcore INTERFACE kpmcore ${qtname}::DBus ${kfname}::I18n ${kfname}::WidgetsAddons) target_include_directories(calapmcore INTERFACE ${KPMCORE_INCLUDE_DIR}) diff --git a/CalamaresConfig.cmake.in b/CalamaresConfig.cmake.in index 67350352b..5145666b8 100644 --- a/CalamaresConfig.cmake.in +++ b/CalamaresConfig.cmake.in @@ -49,8 +49,12 @@ endmacro() set(Calamares_WITH_QT6 @WITH_QT6@) if(Calamares_WITH_QT6) set(qtname "Qt6") + set(kfname "kf6") + message(STATUS "Calamares was built with Qt6 and KDE Frameworks 6") else() set(qtname "Qt5") + set(kfname "kf5") + message(STATUS "Calamares was built with Qt5 and KDE Frameworks 5 (legacy)") endif() # Qt infrastructure for translations is required @@ -59,14 +63,14 @@ accumulate_deps(qt_required Calamares::calamares ${qtname}::) accumulate_deps(qt_required Calamares::calamaresui ${qtname}::) find_package(${qtname} CONFIG REQUIRED ${qt_required}) -set(kf5_required "") -accumulate_deps(kf5_required Calamares::calamares ${kfname}::) -accumulate_deps(kf5_required Calamares::calamaresui ${kfname}::) -if(kf5_required) +set(kf_required "") +accumulate_deps(kf_required Calamares::calamares ${kfname}::) +accumulate_deps(kf_required Calamares::calamaresui ${kfname}::) +if(kf_required) find_package(ECM ${ECM_VERSION} NO_MODULE) if( ECM_FOUND ) list(INSERT CMAKE_MODULE_PATH 0 ${ECM_MODULE_PATH}) - find_package(${kfname} REQUIRED COMPONENTS ${kf5_required}) + find_package(${kfname} REQUIRED COMPONENTS ${kf_required}) endif() endif() diff --git a/src/modules/users/CreateUserJob.cpp b/src/modules/users/CreateUserJob.cpp index 422b77c05..c55ee1858 100644 --- a/src/modules/users/CreateUserJob.cpp +++ b/src/modules/users/CreateUserJob.cpp @@ -70,7 +70,8 @@ createUser( const QString& loginName, const QString& fullName, const QString& sh useraddCommand << "-c" << fullName; if ( umask >= 0 ) { - useraddCommand << "-K" << ( QStringLiteral( "UMASK=" ) + QString::number( umask, 8 ) ); + // The QChar() is needed to disambiguate from the overload that takes a double + useraddCommand << "-K" << ( QStringLiteral( "UMASK=%1" ).arg( umask, 3, 8, QChar( '0' ) ) ); } useraddCommand << loginName; #endif diff --git a/src/modules/users/Tests.cpp b/src/modules/users/Tests.cpp index f44e73f6a..76446064c 100644 --- a/src/modules/users/Tests.cpp +++ b/src/modules/users/Tests.cpp @@ -519,14 +519,17 @@ UserTests::testUserUmask_data() QTest::addColumn< QString >( "filename" ); QTest::addColumn< int >( "permission" ); QTest::addColumn< int >( "umask" ); + QTest::addColumn< QString >( "umask_string" ); - QTest::newRow( "good " ) << "tests/8a-issue-2362.conf" << 0700 << 0077; - QTest::newRow( "open " ) << "tests/8b-issue-2362.conf" << 0755 << 0022; - QTest::newRow( "weird" ) << "tests/8c-issue-2362.conf" << 0126 << 0651; - QTest::newRow( "rwxx " ) << "tests/8d-issue-2362.conf" << 0710 << 0067; - QTest::newRow( "-wrd " ) << "tests/8e-issue-2362.conf" << 0214 << 0563; - QTest::newRow( "bogus" ) << "tests/8f-issue-2362.conf" << -1 << -1; - QTest::newRow( "good2" ) << "tests/8g-issue-2362.conf" << 0750 << 0027; + QTest::newRow( "good " ) << "tests/8a-issue-2362.conf" << 0700 << 0077 << QStringLiteral( "077" ); + QTest::newRow( "open " ) << "tests/8b-issue-2362.conf" << 0755 << 0022 << QStringLiteral( "022" ); + QTest::newRow( "weird" ) << "tests/8c-issue-2362.conf" << 0126 << 0651 << QStringLiteral( "651" ); + QTest::newRow( "rwxx " ) << "tests/8d-issue-2362.conf" << 0710 << 0067 << QStringLiteral( "067" ); + QTest::newRow( "-wrd " ) << "tests/8e-issue-2362.conf" << 0214 << 0563 << QStringLiteral( "563" ); + QTest::newRow( "bogus" ) << "tests/8f-issue-2362.conf" << -1 << -1 + << QStringLiteral( "-01" ); // Bogus 3-character representation + QTest::newRow( "good2" ) << "tests/8g-issue-2362.conf" << 0750 << 0027 << QStringLiteral( "027" ); + QTest::newRow( "numrc" ) << "tests/8h-issue-2362.conf" << 0751 << 0026 << QStringLiteral( "026" ); } void @@ -549,6 +552,7 @@ UserTests::testUserUmask() QFETCH( QString, filename ); QFETCH( int, permission ); QFETCH( int, umask ); + QFETCH( QString, umask_string ); // Checks that the test-data is valid if ( permission != -1 ) @@ -571,6 +575,8 @@ UserTests::testUserUmask() QCOMPARE( c.homePermissions(), permission ); QCOMPARE( c.homeUMask(), umask ); + // The QChar() is needed to disambiguate from the overload that takes a double + QCOMPARE( QStringLiteral( "%1" ).arg( umask, 3, 8, QChar( '0' ) ), umask_string ); QCOMPARE( c.forbiddenLoginNames(), forbidden ); } diff --git a/src/modules/users/tests/8h-issue-2362.conf b/src/modules/users/tests/8h-issue-2362.conf new file mode 100644 index 000000000..a4e7ba548 --- /dev/null +++ b/src/modules/users/tests/8h-issue-2362.conf @@ -0,0 +1,12 @@ +# SPDX-FileCopyrightText: no +# SPDX-License-Identifier: CC0-1.0 +# +--- +user: + shell: /usr/bin/new + forbidden_names: + - me + - myself + - moi + # This is a number, which is interpreted by YAML as decimal even with a leading 0 + home_permissions: 0751