D6197: Add basic KAuth support to file ioslave
Chinmoy Ranjan Pradhan
noreply at phabricator.kde.org
Sat Jul 15 13:07:31 UTC 2017
chinmoyr updated this revision to Diff 16738.
chinmoyr marked 4 inline comments as done.
chinmoyr edited the test plan for this revision.
chinmoyr added a comment.
In my previous revision the logic for showing warning from ioslave was flawed. In case of deleteRecursive everything would have worked out fine but in case of copy the logic for warning would have failed. Since CopyJob creates number of sub jobs, there are as many number of slaves. If there happen to be more than one file with read access restricted then ioslave's warning would have been shown multiple times.
In this revision, I added a variable `m_enablePrivilegeExecution`, a public method `isPrivilegeExecutionEnabled` and an additional job flag `PrivilegeExecution` to the KIO Job class.
Now if an application want's to execute a privilege file operation, it will
1. create a job with `PrivilegeExecution` flag.
2. the flag will cause the job to set `m_enablePrivilegeExecution` to true.
3. when `execWithElevatedPrivilege()` is called it will first emit `dataReq()` signal.
4. the job will respond with a message "ElevatePrivilege" if it supports it and the slave will continue.
The step 2 is very important. Even if the flag is set its upto us to decide which job should support it. And the jobs which support it will also show warnings prior to notifying the slave. This prevents misuse of the job during the brief period of elevated privilege.
@dfaure what do you say about the feasibility of this approach?
REPOSITORY
R241 KIO
CHANGES SINCE LAST UPDATE
https://phabricator.kde.org/D6197?vs=15729&id=16738
REVISION DETAIL
https://phabricator.kde.org/D6197
AFFECTED FILES
src/core/job.cpp
src/core/job_base.h
src/core/job_p.h
src/core/simplejob.cpp
src/core/simplejob.h
src/ioslaves/file/CMakeLists.txt
src/ioslaves/file/file.h
src/ioslaves/file/file_unix.cpp
src/ioslaves/file/file_win.cpp
src/ioslaves/file/kauth/CMakeLists.txt
src/ioslaves/file/kauth/file.actions
src/ioslaves/file/kauth/filehelper.cpp
src/ioslaves/file/kauth/filehelper.h
To: chinmoyr, elvisangelaccio, #frameworks, dfaure
Cc: dfaure, eliasp, aacid
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20170715/4bcaa878/attachment.html>
More information about the Kde-frameworks-devel
mailing list