From ac28764f2b227d25a2b9d2415199ff19af8e201a Mon Sep 17 00:00:00 2001 From: elijah Date: Fri, 26 Jun 2015 16:11:01 -0700 Subject: ensure that `leap` is not run as root. --- lib/leap_cli/commands/pre.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib') 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) -- cgit v1.2.3