Skip to content

Commit

Permalink
Disallow running with sudo
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeremy Wootten committed Mar 7, 2017
1 parent 7423b1d commit f0e4a44
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Application.vala
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,12 @@ public class Marlin.Application : Granite.Application {

message ("Report any issues/bugs you might find to http://bugs.launchpad.net/pantheon-files");

/* Only allow running with root privileges using pkexec, not using sudo */
if (Posix.getuid () == 0 && GLib.Environ.get_variable (GLib.Environ.get (), "PKEXEC_UID") == null) {
warning ("Running Files as root using sudo is not possible. Please use the command: pantheon-files-pkexec [folder]");
quit ();
};

init_schemas ();

Gtk.IconTheme.get_default ().changed.connect (() => {
Expand Down

0 comments on commit f0e4a44

Please sign in to comment.