summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorelijah <elijah@riseup.net>2015-06-26 16:11:01 -0700
committerelijah <elijah@riseup.net>2015-06-26 16:11:01 -0700
commitac28764f2b227d25a2b9d2415199ff19af8e201a (patch)
tree7ff2c8bfd8f7fe21cf5de5295eb0fc2f69b403c7 /lib
parenta48a10fa048c534ba82536126a2a951090675d98 (diff)
ensure that `leap` is not run as root.
Diffstat (limited to 'lib')
-rw-r--r--lib/leap_cli/commands/pre.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/leap_cli/commands/pre.rb b/lib/leap_cli/commands/pre.rb
index 3b316a4..c531065 100644
--- a/lib/leap_cli/commands/pre.rb
+++ b/lib/leap_cli/commands/pre.rb
@@ -47,6 +47,10 @@ module LeapCli; module Commands
# :color -- true or false, to log in color or not.
#
def initialize_leap_cli(require_provider, options={})
+ if Process::Sys.getuid == 0
+ bail! "`leap` should not be run as root."
+ end
+
# set verbosity
options[:verbose] ||= 1
LeapCli.set_log_level(options[:verbose].to_i)