summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJannik Schönartz2021-11-29 00:53:42 +0100
committerJannik Schönartz2021-11-29 00:53:42 +0100
commit09df714c0935cfad1ad586e1b6443097d53c59d0 (patch)
tree4f379e9f94091e89d1c4e7c69985153e4cd83f83
parentRPC-login: Add lectureid and editsession id as param and create files needed ... (diff)
downloadslxgreeter-remote-edit-vm.tar.gz
slxgreeter-remote-edit-vm.tar.xz
slxgreeter-remote-edit-vm.zip
Cleanup, add permissions to created fileremote-edit-vm
-rw-r--r--src/loginrpc.cpp27
1 files changed, 16 insertions, 11 deletions
diff --git a/src/loginrpc.cpp b/src/loginrpc.cpp
index 09f6454..c13483f 100644
--- a/src/loginrpc.cpp
+++ b/src/loginrpc.cpp
@@ -119,7 +119,6 @@ void LoginRpc::handleCommandV1(const QString &command)
allOutputs << virtOut;
}
}
- /* Commented, to have a view on the client while debugging TODO REMOVE XXX
// Either -1 if we didn't have a virtual one, or != 0 if xrandr setting failed
if (ret != 0) {
// Play it safe and disable all the outputs
@@ -133,7 +132,6 @@ void LoginRpc::handleCommandV1(const QString &command)
p.waitForFinished(2000);
p.kill();
}
- */
}
}
@@ -147,10 +145,11 @@ void LoginRpc::handleCommandV1(const QString &command)
// Create edit.config
if (file.open(QIODevice::ReadWrite)) {
file.setPermissions(QFileDevice::ReadOwner | QFileDevice::WriteOwner |
- QFileDevice::ExeOwner | QFileDevice::ReadUser |
- QFileDevice::WriteUser | QFileDevice::ExeUser |
- QFileDevice::ReadGroup | QFileDevice::ExeGroup |
- QFileDevice::ReadOther | QFileDevice::ExeOther);
+ QFileDevice::ExeOwner | QFileDevice::ReadUser |
+ QFileDevice::WriteUser | QFileDevice::ExeUser |
+ QFileDevice::ReadGroup | QFileDevice::WriteGroup |
+ QFileDevice::ExeGroup | QFileDevice::ReadOther |
+ QFileDevice::WriteOther | QFileDevice::ExeOther);
qDebug() << "edit.config created!";
QTextStream stream(&file);
stream << "[Desktop Entry]" << endl;
@@ -173,12 +172,18 @@ void LoginRpc::handleCommandV1(const QString &command)
qDebug() << "Edit session ID was provided: " << lines[4];
QFile file("editsession.id");
- if (file.open(QIODevice::ReadWrite)) {
+ if (file.open(QIODevice::ReadWrite)) {
+ file.setPermissions(QFileDevice::ReadOwner | QFileDevice::WriteOwner |
+ QFileDevice::ExeOwner | QFileDevice::ReadUser |
+ QFileDevice::WriteUser | QFileDevice::ExeUser |
+ QFileDevice::ReadGroup | QFileDevice::WriteGroup |
+ QFileDevice::ExeGroup | QFileDevice::ReadOther |
+ QFileDevice::WriteOther | QFileDevice::ExeOther);
qDebug() << "editsession.id file created!";
- QTextStream stream(&file);
- stream << lines[4];
- file.close();
- }
+ QTextStream stream(&file);
+ stream << lines[4];
+ file.close();
+ }
}
emit loginRequest(lines[0], lines[1], lines[2]);