D6831: Make use of kauth helper in methods of file ioslave

2018-01-12 Thread Chinmoy Ranjan Pradhan
This revision was automatically updated to reflect the committed changes. Closed by commit R241:13ab6a85bbb8: Use kauth helper in member functions of FileProtocol (authored by chinmoyr). REPOSITORY R241 KIO CHANGES SINCE LAST UPDATE https://phabricator.kde.org/D6831?vs=25219&id=25220 REVISI

D6831: Make use of kauth helper in methods of file ioslave

2018-01-12 Thread Chinmoy Ranjan Pradhan
chinmoyr updated this revision to Diff 25219. chinmoyr edited the summary of this revision. chinmoyr added a comment. 1.Merge code from https://phabricator.kde.org/D6830 2.Fix FreeBSD (CI) build REPOSITORY R241 KIO CHANGES SINCE LAST UPDATE https://phabricator.kde.org/D6831?vs=24585&id=

D6831: Make use of kauth helper in methods of file ioslave

2018-01-04 Thread David Faure
dfaure accepted this revision. dfaure added inline comments. INLINE COMMENTS > file.cpp:304 > +bool dirCreated; > +if (!(dirCreated = QDir().mkdir(path))) { > +if (auto err = execWithElevatedPrivilege(MKDIR, path)) { moving this to the line above would be simpler / mo

D6831: Make use of kauth helper in methods of file ioslave

2018-01-03 Thread Dominik Haumann
dhaumann added a comment. Ok, good :) REPOSITORY R241 KIO BRANCH master REVISION DETAIL https://phabricator.kde.org/D6831 To: chinmoyr, dfaure, #frameworks Cc: dhaumann, #frameworks

D6831: Make use of kauth helper in methods of file ioslave

2018-01-02 Thread Chinmoy Ranjan Pradhan
chinmoyr added a comment. @dhaumann The helper is called only when the error is EACCES or EPERM. So, if you are already root then this won't be the case and file ioslave will work as usual. REPOSITORY R241 KIO BRANCH master REVISION DETAIL https://phabricator.kde.org/D6831 To: chinm

D6831: Make use of kauth helper in methods of file ioslave

2018-01-02 Thread Dominik Haumann
dhaumann added a comment. Without looking too much into details of the patch: what happens, if you are already root? Does that work as expected? I am asking, since we introduced regressions into Kate since using kauth to save data with elevated privileges: Kate disallows running as root.

D6831: Make use of kauth helper in methods of file ioslave

2018-01-02 Thread Chinmoy Ranjan Pradhan
chinmoyr updated this revision to Diff 24585. chinmoyr added a comment. 1.Added check for unit test mode at beginning of put. 2.put was setting the wrong permissions because I initialized 'filemode' to 0 and did't update it. Now it is fixed. 3.Replaced file.setPermissions with Qfile::setPe

D6831: Make use of kauth helper in methods of file ioslave

2017-10-07 Thread David Faure
dfaure accepted this revision. BRANCH master REVISION DETAIL https://phabricator.kde.org/D6831 To: chinmoyr, dfaure, #frameworks Cc: #frameworks

D6831: Make use of kauth helper in methods of file ioslave

2017-10-05 Thread Chinmoy Ranjan Pradhan
chinmoyr updated this revision to Diff 20367. chinmoyr added a comment. Added correct header Removed the `openMode` variable. `FileProtocol::tryOpen` takes care of file mode. Newline changes CHANGES SINCE LAST UPDATE https://phabricator.kde.org/D6831?vs=19170&id=20367 BRANCH master

D6831: Make use of kauth helper in methods of file ioslave

2017-09-09 Thread David Faure
dfaure added a comment. separate commits are easier to review, so that's fine INLINE COMMENTS > file.cpp:651 > +oflags = O_RDWR | O_APPEND; > +openMode = QIODevice::ReadWrite | QIODevice::Append; > } else { why not share th

D6831: Make use of kauth helper in methods of file ioslave

2017-09-04 Thread Chinmoy Ranjan Pradhan
chinmoyr updated this revision to Diff 19170. chinmoyr added a comment. - ret -> err - used tryOpen @dfaure shall i merge https://phabricator.kde.org/D6830 & https://phabricator.kde.org/D6831 into a single commit? CHANGES SINCE LAST UPDATE https://phabricator.kde.org/D6831?vs=18697&i

D6831: Make use of kauth helper in methods of file ioslave

2017-08-28 Thread David Faure
dfaure accepted this revision. dfaure added a comment. This revision is now accepted and ready to land. Ah! I know how to improve the readability of (auto ret = execWithElevatedPrivilege)... please rename all "ret" variables to "err" (short for error, which is already taken), or if you prefer

D6831: Make use of kauth helper in methods of file ioslave

2017-08-24 Thread Chinmoy Ranjan Pradhan
chinmoyr updated this revision to Diff 18697. chinmoyr added a comment. - use the new execWithElevatedPrivilege method CHANGES SINCE LAST UPDATE https://phabricator.kde.org/D6831?vs=18016&id=18697 BRANCH master REVISION DETAIL https://phabricator.kde.org/D6831 AFFECTED FILES src/ios

D6831: Make use of kauth helper in methods of file ioslave

2017-08-11 Thread David Faure
dfaure added a comment. If you agree that showing an error message after hitting Cancel on the kauth prompt is suboptimal (I didn't actually test it), then it seems to me that a simple solution to turn `bool isPrivilegeOperationAllowed()` into a method that returns an enum? (same for `execWi

D6831: Make use of kauth helper in methods of file ioslave

2017-08-11 Thread Chinmoy Ranjan Pradhan
chinmoyr added a comment. > what happens if the user cancels the root-password prompt? He will then get another msg box with "cannot create directory?" even though he/she purposefully canceled the operation? When that happens the slave should use error(KIO::ERR_USER_CANCELED) instead (which

D6831: Make use of kauth helper in methods of file ioslave

2017-08-11 Thread Chinmoy Ranjan Pradhan
chinmoyr updated this revision to Diff 18016. chinmoyr added a comment. - Fixed error handling logic in FileProtocol::chmod. CHANGES SINCE LAST UPDATE https://phabricator.kde.org/D6831?vs=17019&id=18016 BRANCH master REVISION DETAIL https://phabricator.kde.org/D6831 AFFECTED FILES s

D6831: Make use of kauth helper in methods of file ioslave

2017-08-04 Thread David Faure
dfaure requested changes to this revision. dfaure added a comment. This revision now requires changes to proceed. Please resubmit with context. Also, did you check that unittests still pass? No kauth prompt should occur :-) INLINE COMMENTS > file.cpp:242 > #if defined(ENOTSUP) > -

D6831: Make use of kauth helper in methods of file ioslave

2017-07-22 Thread Chinmoy Ranjan Pradhan
chinmoyr edited the summary of this revision. chinmoyr added reviewers: dfaure, Frameworks. REPOSITORY R241 KIO REVISION DETAIL https://phabricator.kde.org/D6831 To: chinmoyr, dfaure, #frameworks Cc: #frameworks

D6831: Make use of kauth helper in methods of file ioslave

2017-07-22 Thread Chinmoy Ranjan Pradhan
chinmoyr added a task: T6561: Polkit support in KIO. REPOSITORY R241 KIO REVISION DETAIL https://phabricator.kde.org/D6831 To: chinmoyr Cc: #frameworks

D6831: Make use of kauth helper in methods of file ioslave

2017-07-22 Thread Chinmoy Ranjan Pradhan
chinmoyr removed a task: T6561: Polkit support in KIO. REPOSITORY R241 KIO REVISION DETAIL https://phabricator.kde.org/D6831 To: chinmoyr Cc: #frameworks

D6831: Make use of kauth helper in methods of file ioslave

2017-07-22 Thread Chinmoy Ranjan Pradhan
chinmoyr added a task: T6561: Polkit support in KIO. REPOSITORY R241 KIO REVISION DETAIL https://phabricator.kde.org/D6831 To: chinmoyr Cc: #frameworks

D6831: Make use of kauth helper in methods of file ioslave

2017-07-22 Thread Chinmoy Ranjan Pradhan
chinmoyr created this revision. Restricted Application added a project: Frameworks. Restricted Application added a subscriber: Frameworks. REVISION SUMMARY Adds calls to `execWithRootPrivileges()` to following methods chmod(), get(), mkdir(), put(), setModificationTime(), deleteRecursive(),