D12795: Re-allow running Dolphin as the root user (but still not using sudo)

Mark Gaiser noreply at phabricator.kde.org
Thu May 10 19:41:53 BST 2018


markg added a comment.


  In D12795#260449 <https://phabricator.kde.org/D12795#260449>, @ngraham wrote:
  
  > Right: if our uid is zero, but `$SUDO_USER` is set to something, then we're actually a non-root user using sudo, not the root user itself. We have to check `$SUDO_USER` and not `$USER` because `$USER` is set to "root" for the sudo use case.
  >
  > Does it not work for you? It works for me. Though if there's a better way, I'm all ears. As I'm sure you've noticed by know, I'm a //terrible// programmer, though I'm trying to improve all the time!
  
  
  I can't test it as dolphin doesn't compile anymore here.
  That is due to some change in Baloo DateFormats that is not in the latest released version. Which is all fine, but i don't really feel like setting up the whole KDE environment again (kinda takes a while).
  
  I understand what you say and try to do, but i don't get the usecase (i think you're doing fine as a developer btw).
  Why: login as root, followed by **sudo** dolphin?
  If it works in the exact way as mentioned in the line above (or the 2nd testcase line) then i don't understand why that works.
  
    if (getuid() == 0 && getenv("SUDO_USER")) {
    ==
    if ROOT && SUDO_USER IS NON NULL
    aka
    if both root and sudo are set.
    
    Then..
    Error.
  
  I think you intent:
  
  > Log in as the root user and run ~~`sudo~~ dolphin; you can do it.
  
  Sorry if this comes across as nitpicking but i just find it " slightly" confusing and am trying to get it clear for myself :)

REPOSITORY
  R318 Dolphin

REVISION DETAIL
  https://phabricator.kde.org/D12795

To: ngraham
Cc: elvisangelaccio, mmustac, Fuchs, markg, graesslin, nicolasfella, zzag, kfm-devel, emmanuelp, spoorun, navarromorales, isidorov, firef, andrebarros
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20180510/36a07744/attachment.htm>


More information about the kfm-devel mailing list