Commit Graph

50 Commits

Author SHA1 Message Date
Andrius Štikonas ec3479f302 Add overrides to destructors. 2020-10-24 01:33:52 +01:00
Andrius Štikonas e085ba9ed9 Do not link to KAuth. But there is still a build time dependency on kauth-policy-gen. 2020-10-12 20:23:37 +01:00
Andrius Štikonas 6cff70567b Fix signals between helper and client. 2020-10-12 20:23:37 +01:00
Andrius Štikonas a2ee82e021 Simplify createFile function, it was checking for authorization twice. 2020-10-12 20:23:37 +01:00
Andrius Štikonas 296f281ffb WIP: cleanup polkit port: licenses, dead code and kauth removal, add TODO about signals. 2020-10-12 20:18:55 +01:00
David Edmundson edfabb90dc WIP: port to polkit 2020-10-12 20:18:55 +01:00
Andrius Štikonas d68ffeadef REUSE: SPDX style license headers for src/util. 2020-10-01 00:33:19 +01:00
Andrius Štikonas c5c21849b9 Compile kpmcore with QT_NO_KEYWORDS. 2020-09-15 02:36:46 +01:00
Andrius Štikonas 2ed9953694 Simplify some External Command functions. 2020-09-11 20:27:24 +01:00
Andrius Štikonas 5b80c6045c Fix fstab editing functionality.
In the old code QByteArray fstabContents was actually empty.
Also, writeData function was opening file in append mode,
thus nothing was actually written.

Split writeData function into two:
  * one for block devices
  * another for writing fstab file

BUG: 417205
2020-09-10 23:54:23 +01:00
Andrius Štikonas 76ca72eccd Revert "Create a timer to wait for system to free resources"
This reverts commit 2627d476f4.
2019-09-26 23:47:34 +01:00
Shubham Jangra d1a82f65d4 Revert "Remove redundant includes and refactor"
This reverts commit 4229b02fd2.
2019-06-12 22:11:11 +05:30
Shubham Jangra 4229b02fd2 Remove redundant includes and refactor 2019-06-10 23:07:06 +05:30
Shubham Jangra 2627d476f4 Create a timer to wait for system to free resources
Reviewers: stikonas

Reviewed By: stikonas

Differential Revision: https://phabricator.kde.org/D21696
2019-06-09 22:41:13 +05:30
Shubham Jangra 3184cbcee3 Remove extra semicolon 2019-05-30 22:47:17 +05:30
Shubham Jangra a7532d4041 Scrap Public Key Cryptography code based on QCA as QDbus is secure enough
Summary: QDbus already provides enough security to the calls made by the application to the helper. Hence no need to encrypt, sign the requests of the application and verify their integrity at the helper side.

Reviewers: stikonas, cjlcarvalho

Reviewed By: stikonas

Subscribers: #kde_partition_manager

Tags: #kde_partition_manager

Differential Revision: https://phabricator.kde.org/D21275
2019-05-19 22:53:13 +05:30
Shubham Jangra 5e4efa89ec Fix typo and constantify arguments
Reviewers: stikonas, cjlcarvalho, #kde_partition_manager

Reviewed By: cjlcarvalho

Subscribers: #kde_partition_manager

Tags: #kde_partition_manager

Differential Revision: https://phabricator.kde.org/D20269
2019-04-05 11:45:08 -06:00
Andrius Štikonas 09e4d47e07 Do not use external process dd.
BUG: 398154
2018-11-25 20:50:22 +00:00
Harald Sitter 87dc44dab8 use QDBusServiceWatcher instead of pinging the client
Summary:
the motivation here is to terminate the "server" helper when the client
disappears. dbus supports this use case natively via service registration
events which we can easily handle via QDBusServiceWatcher.
instead of repeatedly poking the client we'll simply monitor its dbus
service now. this is cheaper, less code and doesn't risk timing out
randomly.

Test Plan:
- on neon ISO build kpmcore & calamares & pm
- calamares manages to actually partition stuff
- partitionmanager also starts properly

- also the same again on the installed system.

Reviewers: stikonas, bshah

Reviewed By: bshah

Subscribers: bshah

Differential Revision: https://phabricator.kde.org/D14646
2018-08-06 15:46:11 +02:00
Andrius Štikonas 872715f4e0 Switch DBus calls to classes generated from XML. 2018-08-05 21:15:33 +01:00
Andrius Štikonas 3d6aa8c333 Remove ExternalCommand::onFinished. 2018-07-21 21:29:36 +01:00
Andrius Štikonas 2579d04229 Remove ExternalCommand::waitFor.
This is no longer used with KAuth.
ExternalCommand::start now waits until command finishes.
2018-07-21 21:19:34 +01:00
Andrius Štikonas 938ec7fa8b Make ExternalCommandHelper::getNonce() reentrant.
Store previously generated values of nonce, and remove them from
the container when they are used.

BUG: 396312
2018-07-21 11:03:25 +01:00
Andrius Štikonas c50e04c9d1 Use cryptographic nonce instead of counters. 2018-07-20 21:12:13 +01:00
Andrius Štikonas e5b63b0d6f Fix support for QProcess::ProcessChannelMode. 2018-07-15 17:37:29 +01:00
Andrius Štikonas 51780a6297 Stop KAuth helper if application crashes.
This is implemented by pinging application from KAuth helper via DBus.
If it is busy  then KAuth helper also waits for the current job to finish.
2018-07-15 00:09:39 +01:00
Andrius Štikonas 5814c6c02a Allow setting KAuth parent widget. 2018-04-15 01:35:29 +03:00
Andrius Štikonas 145f54f18c Move KAuth helper setup code to ExternalCommand class.
Delay helper startup until it is actually required.
2018-04-14 23:55:05 +03:00
Andrius Štikonas 221d7aded6 d-pointerize ExternalCommand class. 2018-04-12 00:47:40 +03:00
Andrius Štikonas 738842799a Make kpmcore link libraries private. 2018-03-31 16:30:53 +01:00
Andrius Štikonas 2cef3f6ec6 Cleanup ExternalCommand interface:
* Remove a separate constructor for copyblocks.
 * Remove kauthThread and finished() signal.
2018-03-22 17:29:40 +00:00
Andrius Štikonas 39d3592c23 Actually check if the caller is authorized. 2018-03-22 17:41:49 +01:00
Andrius Štikonas 06139c85ac Remove unused function argument in startCopyBlocks. 2018-02-06 16:24:32 +00:00
Huzaifa Faruqui b143c139e5 Fix Report in copyBlocks 2018-01-29 16:45:21 +05:30
Huzaifa Faruqui e42a5c9289 Implement copyblocks function in KAuth helper.
Switch BackupFileSystemJob to thenew copyblocks function.

Reviewed and cleaned up by: Andrius Štikonas
2018-01-24 15:22:42 +00:00
Andrius Štikonas 47429dd1bf Proof of concept attempt to implement KAuth. 2017-12-10 17:36:39 +00:00
Andrius Štikonas 80c5cb5a1f Remove no longer used include. 2017-10-03 02:32:36 +01:00
Andrius Štikonas 40e22c94f2 Store ExternalCommand output in QByteArray.
This makes it possible to run dd with ExternalCommand.
2017-10-03 02:27:47 +01:00
Andrius Štikonas f7e5f7c7bf Rename KPMcore include guards.
clang in -Weverything mode does not like double underscore.
2017-09-10 20:12:52 +01:00
Andrius Štikonas 2a118753ae Allow selecting different channels in ExternalCommand output. 2017-08-31 10:13:24 +01:00
Andrius Štikonas 349b59574f Q_OBJECT macro is not necessary for ExternalCommand. 2016-05-18 22:32:33 +01:00
Andrius Štikonas 45654e5e83 Convert to new syntax and slots syntax. 2016-05-18 19:54:36 +01:00
Andrius Štikonas 785aa7edf4 Avoid piping LUKS passphrase.
Also remove piping support from ExternalCommand.
It's unlikely that it will be useful enough. There were no more users of this
after luks open was migrated to QProcess::write.
2016-05-09 00:42:01 +01:00
Andrius Štikonas 440aa74dcf List .cpp files for cmake instead of globbing them. 2016-05-04 22:14:38 +01:00
Andrius Štikonas 58e9876307
Rename qglobal.h to QtGlobal 2016-04-18 17:14:31 +01:00
Teo Mrnjavac de27f840bf Always use nullptr instead of NULL because it is type-safe. 2015-07-22 15:48:03 +02:00
Andrius Štikonas 626f560e52 Format kpmcore code using KDE style. 2015-07-13 17:16:36 +03:00
Teo Mrnjavac 3bbce2865f Revert "Format kpmcore code using KDE style."
This reverts commit 21b569e499.
2015-07-13 16:03:36 +02:00
Andrius Štikonas 21b569e499 Format kpmcore code using KDE style. 2015-07-13 17:02:13 +03:00
Andrius Štikonas 1ef6fa8131 Move kpmcore library into its own repository. 2015-06-04 01:29:22 +01:00