diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 35d4518..d92c5ca 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -26,13 +26,13 @@ jobs: id: build_armv7hl uses: coderus/github-sfos-build@master with: - release: 3.4.0.24 + release: 4.2.0.21 - name: Build i486 id: build_i486 uses: coderus/github-sfos-build@master with: - release: 3.4.0.24 + release: 4.2.0.21 arch: i486 # aarch64 complains about ssl/crypto @@ -42,7 +42,7 @@ jobs: id: build_aarch64 uses: coderus/github-sfos-build@master with: - release: 4.0.1.45 + release: 4.2.0.21 arch: aarch64 - name: Upload build result @@ -73,6 +73,6 @@ jobs: assets+=("-a" "$asset") done tag_name="${GITHUB_REF##*/}" - hub release create -p "${assets[@]}" -m "$tag_name" -m "This is a pre-release for testing purposes only. It may or may not be unstable." -m "Join the Telegram group to help out: https://github.com/Wunderfitz/harbour-fernschreiber/issues/162" "$tag_name" + hub release create -p "${assets[@]}" -m "$tag_name" -m "This is a pre-release for testing purposes only. It may or may not be unstable." "$tag_name" env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/main/harbour-slumber.desktop b/main/harbour-slumber.desktop index ca5c61e..5b218d0 100644 --- a/main/harbour-slumber.desktop +++ b/main/harbour-slumber.desktop @@ -11,3 +11,5 @@ Name=slumber # a different app name in German locale (de). Name[de]=slumber +[X-Sailjail] +Sandboxing=Disabled diff --git a/main/qml/harbour-slumber.qml b/main/qml/harbour-slumber.qml index 3023ad8..8bd968e 100644 --- a/main/qml/harbour-slumber.qml +++ b/main/qml/harbour-slumber.qml @@ -85,6 +85,14 @@ ApplicationWindow } } } + Launcher { + id: launcher + } + Component.onCompleted: { + console.log('well you.'); + var res = launcher.launchPrivileged("whoami"); + console.log(res); + } // import old sqlite settings once Loader { diff --git a/main/qml/lib/actuators/PrivilegedLauncher.qml b/main/qml/lib/actuators/PrivilegedLauncher.qml index ab46579..bbd50df 100644 --- a/main/qml/lib/actuators/PrivilegedLauncher.qml +++ b/main/qml/lib/actuators/PrivilegedLauncher.qml @@ -22,11 +22,10 @@ ActuatorBase { if(settings.timerRestartOfonoEnabled) { commands.push('killall -9 ofonod'); } - var commandCount = commands.length; for(var i=0; ilaunch("stat -c %a \""+m_privilegedLauncherLocation+"\""); - return privileged.exists() && privileged.owner() == "root" && this->launch("stat -c %a \""+m_privilegedLauncherLocation+"\"") == "6770\n"; + return privileged.exists() && privileged.owner() == "root" && this->launch("stat -c %a \""+m_privilegedLauncherLocation+"\"") == "6771\n"; } QString Launcher::runDevelSu(const QString &password, const QStringList &command) @@ -48,7 +48,7 @@ QString Launcher::runDevelSu(const QString &password, const QStringList &command develSuProcess.write((password + "\n").toLatin1()); develSuProcess.waitForFinished(); - if( !develSuProcess.exitCode() == 0 ) + if( !(develSuProcess.exitCode() == 0) ) { qDebug() << "Command failed:" << develSuProcess.readAllStandardError(); @@ -88,7 +88,7 @@ bool Launcher::preparePrivilegedLauncher(const QString &rootpw) } QFile::copy(":/launch" , m_privilegedLauncherLocation); QStringList launcherPermissionCommand; - launcherPermissionCommand << "bash" << "-c" << "chown root " + m_privilegedLauncherLocation + "; chmod 6770 " + m_privilegedLauncherLocation + ""; + launcherPermissionCommand << "bash" << "-c" << "chown root " + m_privilegedLauncherLocation + "; chmod 6771 " + m_privilegedLauncherLocation + ""; this->runDevelSu(rootpw, launcherPermissionCommand); return checkPrivilegedLauncher(); } diff --git a/privlaunch/privlaunch.cpp b/privlaunch/privlaunch.cpp index f8ee1ec..0b77c89 100644 --- a/privlaunch/privlaunch.cpp +++ b/privlaunch/privlaunch.cpp @@ -18,6 +18,7 @@ int main(int argc, char *argv[]) QCoreApplication::setApplicationVersion("1.0"); QCommandLineParser parser; QTextStream out(stdout); + setuid(geteuid()); parser.setApplicationDescription("slumber helper"); parser.addHelpOption(); @@ -39,6 +40,7 @@ int main(int argc, char *argv[]) proc->waitForFinished(); QString parentName = QString::fromLocal8Bit(proc->readAll()); bool parentIsValid = parentName == "/usr/bin/harbour-slumber\n"; + out << "Authentication \n" << parentName << "\n"; if(!parentIsValid) { proc->start(QString("pstree -pA %1").arg(parentId)); @@ -46,11 +48,13 @@ int main(int argc, char *argv[]) parentName = QString::fromLocal8Bit(proc->readAll()); QRegExp rx("harbour-slumber\\((\\d+)\\)"); parentIsValid = rx.indexIn(parentName) != -1; - } + out << "Authentication2 \n" << parentName << "\n"; + } if(parentIsValid) { if(args.length() > 0) { QString program = parser.positionalArguments().at(0); +// out << program << "\n" << geteuid() << "\n"; proc->start(program); proc->waitForFinished(-1); QByteArray bytes = proc->readAllStandardOutput(); diff --git a/rpm/harbour-slumber.changes b/rpm/harbour-slumber.changes index b7628c0..23acb39 100644 --- a/rpm/harbour-slumber.changes +++ b/rpm/harbour-slumber.changes @@ -8,9 +8,13 @@ # * date Author's Name version-release # - Summary of changes -* Fri Jun 04 2021 velox 0.14-2 - - bugfix: change ofono privileged action to work with busybox environment - - maintenance: change github CI build +* Sat Jun 05 2021 velox 0.14-3 + - bugfix: more privileged launcher changes + - bugfix: opt out of sailjail + + * Fri Jun 04 2021 velox 0.14-2 + - bugfix: change ofono privileged action to work with busybox environment + - maintenance: change github CI build * Sun May 09 2021 velox 0.14-1 - feature: D-Bus call for manually triggering/stopping the running timer diff --git a/rpm/harbour-slumber.spec b/rpm/harbour-slumber.spec index 4c48854..e337f38 100644 --- a/rpm/harbour-slumber.spec +++ b/rpm/harbour-slumber.spec @@ -14,7 +14,7 @@ Name: harbour-slumber %{?qtc_builddir:%define _builddir %qtc_builddir} Summary: Slumber Sleeptimer Version: 0.14 -Release: 2 +Release: 3 Group: Qt/Qt License: GPL2 URL: https://github.com/jgibbon/slumber diff --git a/rpm/harbour-slumber.yaml b/rpm/harbour-slumber.yaml index b154fec..fe46aac 100644 --- a/rpm/harbour-slumber.yaml +++ b/rpm/harbour-slumber.yaml @@ -1,7 +1,7 @@ Name: harbour-slumber Summary: Slumber Sleeptimer Version: 0.14 -Release: 2 +Release: 3 # The contents of the Group field should be one of the groups listed here: # http://gitorious.org/meego-developer-tools/spectacle/blobs/master/data/GROUPS Group: Qt/Qt