Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
cocoapods
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gengmeiios
cocoapods
Commits
0465aee2
Commit
0465aee2
authored
Apr 09, 2014
by
Kyle Fuller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't let the user run as root
Closes #1815
parent
f054f3b7
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
0 deletions
+11
-0
CHANGELOG.md
CHANGELOG.md
+4
-0
command.rb
lib/cocoapods/command.rb
+3
-0
command_spec.rb
spec/functional/command_spec.rb
+4
-0
No files found.
CHANGELOG.md
View file @
0465aee2
...
...
@@ -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
)
...
...
lib/cocoapods/command.rb
View file @
0465aee2
...
...
@@ -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
...
...
spec/functional/command_spec.rb
View file @
0465aee2
...
...
@@ -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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment