Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(143)

Unified Diff: gclient.py

Issue 1406053003: Error out in `gclient config` if --name is relative (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Comments Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gclient.py
diff --git a/gclient.py b/gclient.py
index 8de7e52df8f4702a37d9bfd5e6632a29ec209c1b..fab867b7439b4dfa957c1bbdb17d923049484b7b 100755
--- a/gclient.py
+++ b/gclient.py
@@ -1886,6 +1886,12 @@ def CMDconfig(parser, args):
else:
# specify an alternate relpath for the given URL.
name = options.name
+ if not os.path.abspath(os.path.join(os.getcwd(), name)).startswith(
+ os.getcwd()):
+ parser.error('Do not pass a relative path for --name.')
+ if any(x in ('..', '.', '/', '\\') for x in name.split(os.sep)):
+ parser.error('Do not include relative path components in --name.')
+
deps_file = options.deps_file
safesync_url = ''
if len(args) > 1:
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698