Review Request 123857: Fix crash after a user has launched kbuildsycoca as root.

David Edmundson david at davidedmundson.co.uk
Wed May 20 18:32:22 UTC 2015



> On May 20, 2015, 10:37 a.m., Luigi Toscano wrote:
> > One thing is discouraging running applications as root, another thing is blocking them completely: what will it happen with this patch when the application is run as root, simply no cache and slower application?
> > 
> > Isn't it possible to discover that the current HOME is not the real home of the (root) user and avoid writing the cache only in that case?
> 
> David Edmundson wrote:
>     I think you're right that I shouldn't merge that part like it is now.
>     
>     It would be possible to compare against what getpwuid says the home dir should be. It would be unix only, but this problem is unix only.

New plan, I keep the permissions the same when running as root if $HOME/.cache/ksycoca5 exists


- David


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/123857/#review80654
-----------------------------------------------------------


On May 19, 2015, 10:11 p.m., David Edmundson wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/123857/
> -----------------------------------------------------------
> 
> (Updated May 19, 2015, 10:11 p.m.)
> 
> 
> Review request for KDE Frameworks.
> 
> 
> Repository: kservice
> 
> 
> Description
> -------
> 
> 3 commits fixing; a crash, what caused the crash, and why we weren't auto recovering from it.
> 
> QFile::open() will return a Read/Write error on failed access,
> PermissionsError is only in the result of a setPermissions call.
> 
> CCBUG: 342438
> 
> Don't write kbuildsycoca cache files as root
> 
> $HOME is often preserved as root, making us write cache files in the
> user's home directory. People shouldn't be running apps as root anyway.
> 
> CCBUG: 342438
> 
> Guard against being unable to open stream
> 
> This can happen if we are unable to open the database when a
> notifyDatabaseChanged signal is emitted.
> Other places guard also against this eventuality.
> 
> BUG: 342438
> 
> 
> Diffs
> -----
> 
>   src/kbuildsycoca/kbuildsycoca.cpp d14f1f950cdb0d8c9fefbce2a4740f211d3d97a1 
>   src/services/kservicegroupfactory.cpp 8cfc6c6670d3b87e8ed6bdfe4aeac947846afc18 
> 
> Diff: https://git.reviewboard.kde.org/r/123857/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> David Edmundson
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20150520/0ef9b39d/attachment-0001.html>


More information about the Kde-frameworks-devel mailing list