Skip to content

Commit

Permalink
v0.14-3
Browse files Browse the repository at this point in the history
  • Loading branch information
jgibbon committed May 13, 2022
1 parent e74c6d7 commit c84026f
Show file tree
Hide file tree
Showing 9 changed files with 33 additions and 16 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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 }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 2 additions & 0 deletions main/harbour-slumber.desktop
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@ Name=slumber
# a different app name in German locale (de).
Name[de]=slumber

[X-Sailjail]
Sandboxing=Disabled
8 changes: 8 additions & 0 deletions main/qml/harbour-slumber.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
3 changes: 1 addition & 2 deletions main/qml/lib/actuators/PrivilegedLauncher.qml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,10 @@ ActuatorBase {
if(settings.timerRestartOfonoEnabled) {
commands.push('killall -9 ofonod');
}

var commandCount = commands.length;
for(var i=0; i<commandCount; i++) {
console.log('launching privileged', commands[i]);
console.log(launcher.launchPrivileged(commands[i]));
console.log('out:', launcher.launchPrivileged(commands[i]));
}
done();
}
Expand Down
6 changes: 3 additions & 3 deletions main/src/lib/launcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ bool Launcher::checkPrivilegedLauncher()
{
QFileInfo privileged(m_privilegedLauncherLocation);
qDebug().noquote() << "check stat: " << this->launch("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)
Expand All @@ -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();
Expand Down Expand Up @@ -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();
}
Expand Down
6 changes: 5 additions & 1 deletion privlaunch/privlaunch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -39,18 +40,21 @@ 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));
proc->waitForFinished();
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();
Expand Down
10 changes: 7 additions & 3 deletions rpm/harbour-slumber.changes
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,13 @@
# * date Author's Name <author's email> 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
Expand Down
2 changes: 1 addition & 1 deletion rpm/harbour-slumber.spec
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion rpm/harbour-slumber.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit c84026f

Please sign in to comment.