Run as administrator and sudo are different

Bug #1469122 reported by pafosdfkapos
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Files
Fix Committed
Low
Jeremy Wootten

Bug Description

If i right click on the Files and run it as an administrator from the Plank and when I use sudo pantheon-files, the results are not the same. Is it supposed to be like this?

Related branches

Revision history for this message
Jeremy Wootten (jeremywootten) wrote :

When run from terminal the sidebar shows the current user's bookmarks but when run from Plank the sidebar shows only Home and Rubbish bookmarks. Not sure whether this is a problem with Files or Plank but I do not think it should be like this.

Changed in pantheon-files:
status: New → Confirmed
Revision history for this message
Jeremy Wootten (jeremywootten) wrote :

On investigation, the cause of this is that Files is launched from Plank using "pkexec" which resets the environment, not sudo. Unfortunately FIles crashes after the authentication dialog if this is simply changed to gksudo --preserve-env

Revision history for this message
Jeremy Wootten (jeremywootten) wrote :

The simplest fix to this would be to show the root bookmarks in both cases.

Revision history for this message
pafosdfkapos (pafosdfkapos) wrote :

The simplest method is always not the best one, I think that the users' bookmarks should be displayed in both cases, IF there is only one user.
If there are multiple accounts, maybe then only show the bookmarks of the root.

Revision history for this message
Danielle Foré (danrabbit) wrote :

Launching apps with gksudo is deprecated. Running the app complete as root (sudo) is not recommended as it is not as safe as pkexec.

Policykit (pkexec) is the recommended method for escalating privileges. From the pkexec docs "The environment that PROGRAM will run it, will be set to a minimal known and safe environment in order to avoid injecting code through LD_LIBRARY_PATH or similar mechanisms. In addition the PKEXEC_UID environment variable is set to the user id of the process invoking pkexec"

Changed in pantheon-files:
status: Confirmed → In Progress
assignee: nobody → Jeremy Wootten (jeremywootten)
importance: Undecided → Low
Changed in pantheon-files:
milestone: none → loki-beta1
Changed in pantheon-files:
status: In Progress → Confirmed
assignee: Jeremy Wootten (jeremywootten) → nobody
Cody Garver (codygarver)
Changed in pantheon-files:
milestone: loki-beta1 → loki+1-beta1
Changed in pantheon-files:
status: Confirmed → In Progress
assignee: nobody → Jeremy Wootten (jeremywootten)
Changed in pantheon-files:
status: In Progress → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.