Andrius Štikonas
83a865411d
ExternalCommandHelper::ReadData should not follow symlinks.
...
Resolve all symlinks in the userspace application and make sure
that helper only deals with root owned path in /dev but not in
/dev/shm.
2022-06-20 00:03:18 +01:00
Andrius Štikonas
5afe143a19
Add a maximum file size limit when writing to /etc/fstab file.
2022-03-27 14:19:56 +01:00
Andrius Štikonas
6b260fa84e
Only run partitioning commands from trusted prefixes.
2022-03-20 21:07:17 +00:00
Andrius Štikonas
858f8d9bae
Add a comment about WriteOnly.
2022-02-20 20:49:57 +00:00
Andrius Štikonas
d92ebc0b76
Rename variables into more appropriate fstabPath and fstabFile.
2022-02-20 20:47:43 +00:00
Andrius Štikonas
e483bab0d5
Restrict CreateFile method to WriteFstab method in polkit helper.
2022-02-20 19:42:25 +00:00
Andrius Štikonas
27b85117c4
Rename blockSize to chunkSize to avoid confusion with physical blocks.
2022-02-20 14:41:31 +00:00
Andrius Štikonas
d9ceb50238
Add a few more comments explaining copy direction.
2022-02-20 14:41:31 +00:00
Andrius Štikonas
c05bb54bc5
Set "false" as the default return value and change it to "true" on success.
...
Please enter the commit message for your changes. Lines starting
2022-02-15 19:56:46 +00:00
Andrius Štikonas
1c87b494ef
Add a node for Qt6.
2022-02-06 21:18:29 +00:00
Andrius Štikonas
fd7f9b87a9
Do not repeatedly open and close file when reading from it.
2022-02-06 21:18:29 +00:00
Andrius Štikonas
eddbd7a301
Do not repeatedly open and close file when writing to it.
2022-02-06 21:06:39 +00:00
Andrius Štikonas
fb11a02d24
It is no longer necessary to namespace exit function.
2022-02-06 01:27:09 +00:00
Andrius Štikonas
4ef17463ff
Make sure that path passed to WriteData is block device.
2022-02-05 14:42:17 +00:00
Andrius Štikonas
81a5eae665
Restrict CopyFileData to writing to already existing files.
2022-02-05 14:12:38 +00:00
Andrius Štikonas
3903ae1b83
Rename CopyBlocks to CopyFileData.
2022-02-05 14:05:50 +00:00
Andrius Štikonas
949ce01ae4
Check for relative paths in ExternalCommandHelper::CopyBlocks.
2022-02-05 13:48:37 +00:00
Andrius Štikonas
5d1c03b9d8
Restrict QProcess::ProcessChannelMode to two used values.
...
Casting and passing the processChannel argument unfiltered to QProcess
could pose a security issue if future additions are made to
QProcess that introduce new behaviour.
2022-02-05 13:24:38 +00:00
Andrius Štikonas
1502494eda
Be a bit more strict in root helper when checking path to /etc/fstab.
2022-02-05 13:13:12 +00:00
Andrius Štikonas
73de1709e2
Port to Qt6.
2022-01-16 00:17:46 +00:00
Andrius Štikonas
e9fc875c5e
Fix seek error when filling device with random data or zeroes.
2021-11-12 01:02:34 +00:00
Andrius Štikonas
73da1bc514
Only allow using ReadData on block devices.
2020-11-29 23:24:49 +00:00
Andrius Štikonas
b0e5fa66c4
Add an explicit ReadData method to polkit helper instead of relying on copyblocks with empty target device.
2020-11-29 23:14:08 +00:00
Andrius Štikonas
04a095a542
Simplify find syntax.
2020-11-29 13:49:50 +00:00
Andrius Štikonas
551654de0d
Also rename source/targetFirstByte ot offsets in function declarations.
2020-11-29 13:08:53 +00:00
Andrius Štikonas
d34b617272
Rename source/targetFirstByte to source/targetOffset.
...
Add some diagrams explaining difference between
source/targetOffsets and read/writeOffset.
2020-11-29 01:54:48 +00:00
Andrius Štikonas
ee0a1e1b41
Add a limit on the amount of data that can be passed back via DBus.
2020-11-29 01:08:43 +00:00
Andrius Štikonas
c556f39064
Add a limit on blocksize to prevent out-of-memory situation.
2020-11-29 00:58:55 +00:00
Andrius Štikonas
9dd38744c5
Add a comment about auth_admin_keep.
2020-11-29 00:50:57 +00:00
Andrius Štikonas
4fa91d75f3
externalcommandhelper: Do not commit suicide when attempting to run non whitelisted command.
...
Simply returning failure should be sufficient.
2020-11-26 23:35:52 +00:00
Andrius Štikonas
32d146eed3
externalcommandhelper: Make copy direction an enum.
2020-11-26 23:26:31 +00:00
Andrius Štikonas
d16d9e8019
Do not reuse QProcess object in externalcommandhelper for different invocations.
2020-11-26 22:05:25 +00:00
Andrius Štikonas
fae9f83451
Fix division by zero.
2020-11-26 21:58:24 +00:00
Andrius Štikonas
6cff70567b
Fix signals between helper and client.
2020-10-12 20:23:37 +01:00
Andrius Štikonas
cd4d9b1985
Rename helper interfaces.
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
2dff59260c
Remove exit call from the helper. It is no longer used.
...
BUG: 412887
2020-10-12 20:23:04 +01:00
Andrius Štikonas
89bd4eb6c7
Store successful polkit authentication requests.
...
We need this to avoid multiple authentication requests when applying
long operations.
Otherwise, the user will have to authenticate after each job,
which can mean up to 4 password dialogs for some longer operations.
2020-10-12 20:22:48 +01:00
Andrius Štikonas
424c8f0bf0
Update comment describing kpmcore_externalcommandhelper.
2020-10-12 20:18:55 +01:00
David Edmundson
f646b507ae
Fix a crash.
2020-10-12 20:18:55 +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
fbe54e21f3
Merge branch 'fstab'
2020-09-15 01:09:38 +01:00
Andrius Štikonas
1782a9d4bb
Port away from deprecated QTime::elapsed.
2020-09-13 17:25:51 +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
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
6f7cea6b27
Quit application if bus is not connected, interface not registered
...
Reviewers: stikonas, cjlcarvalho
Reviewed By: stikonas
Subscribers: #kde_partition_manager
Tags: #kde_partition_manager
Differential Revision: https://phabricator.kde.org/D21616
2019-06-08 15:43:24 +05:30
Andrius Štikonas
ba48851d34
Merge branch '4.0'
2019-06-07 19:12:07 +01:00