[RFC] PoC patch for polkit support in kio.

Review Request #129983 - Created March 3, 2017 and updated

Chinmoy Ranjan Pradhan
dfaure, elvisangelaccio

This is regarding the GSOC idea https://community.kde.org/GSoC/2017/Ideas#Project:_Polkit_support_in_KIO.

This patch intends to demonstrate one possible approach to provide polkit support in kio. Here its only for the delete operation. This is based on the patch in task https://phabricator.kde.org/T5070.

The approach is as follows;
1. Whenever file ioslave gets access denied error it calls the method execWithRoot with the action that requires priviledge, the path of items
upon which action needs to be performed and a warning ID as arguments.
2. execWithRoot then executes the KAuth::Action org.kde.kio.file.execute.
3. This Kauth::Action has its Persistence set too 'session'. This means that after authentication the restrictions are dropped for a while, for
about 5 minutes. This is similar to the behaviour of sudo command.
4. During this time we can perform any action as a privileged user without any authentication. So to prevent any mishap i added a warning box which
would popup before performing any action(only during this period).
5. After the said time interval the root privileges are droped and calling execWithRoot should show the usual authentication dialog.




  • 2
  • 23
  • 1
  • 26
Description From Last Updated
I don't see the advantage of using a single kauth action. This way you are generating only one "generic" polkit ... Elvis Angelaccio Elvis Angelaccio
I tried to delete a folder (kioclient5 remove /opt/test/) but I didn't get this warning. Elvis Angelaccio Elvis Angelaccio
Chinmoy Ranjan Pradhan
Aleix Pol Gonzalez
Chinmoy Ranjan Pradhan
Chinmoy Ranjan Pradhan
David Faure
Elvis Angelaccio
David Faure
Elvis Angelaccio
Elvis Angelaccio