Chromium Code Reviews| Index: gclient.py |
| diff --git a/gclient.py b/gclient.py |
| index 8de7e52df8f4702a37d9bfd5e6632a29ec209c1b..c4b023ffab1e777d9e77bcec06a708a7524a91eb 100755 |
| --- a/gclient.py |
| +++ b/gclient.py |
| @@ -1886,6 +1886,13 @@ 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.') |
| + pieces = name.split(os.sep) |
|
Lei Zhang
2015/10/20 00:55:21
just roll |pieces| into any() ?
agable
2015/10/20 01:05:27
Done.
|
| + if any(x in ('..', '.', '/', '\\') for x in pieces): |
| + parser.error('Do not include relative path components in --name.') |
| + |
| deps_file = options.deps_file |
| safesync_url = '' |
| if len(args) > 1: |