Commit 0465aee2 authored by Kyle Fuller's avatar Kyle Fuller

Don't let the user run as root

Closes #1815
parent f054f3b7
......@@ -25,6 +25,10 @@ To install or update CocoaPods see this [guide](http://docs.cocoapods.org/guides
[Kyle Fuller](https://github.com/kylef)
[#2010](https://github.com/CocoaPods/CocoaPods/issues/2010)
* Prevent the user from using `pod` commands as root
[Kyle Fuller](https://github.com/kylef)
[#1815](https://github.com/CocoaPods/CocoaPods/issues/1815)
## 0.31.1
[CocoaPods](https://github.com/CocoaPods/CocoaPods/compare/0.31.1...0.31.0)
[CocoaPods-Core](https://github.com/CocoaPods/Core/compare/0.31.1...0.31.0)
......
......@@ -43,11 +43,14 @@ module Pod
end
def self.run(argv)
help! "You cannot run CocoaPods as root." if Process.uid == 0
argv = CLAide::ARGV.new(argv)
if argv.flag?('version')
UI.puts VERSION
exit 0
end
super(argv)
UI.print_warnings
end
......
......@@ -14,5 +14,9 @@ module Pod
UI.output.should.include 'spec/fixtures/spec-repos/master/AFNetworking'
end
it "doesn't let you run as root" do
Process.stubs(:uid).returns(0)
lambda { Pod::Command.run(['--version']) }.should.raise CLAide::Help
end
end
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment