Mercurial > public > mercurial-scm > hg-stable
diff mercurial/windows.py @ 33641:00a75672a9cb stable
ssh: quote parameters using shellquote (SEC)
This patch uses shellquote to quote ssh parameters more strictly to avoid
shell injection.
author | Jun Wu <quark@fb.com> |
---|---|
date | Fri, 04 Aug 2017 23:54:12 -0700 |
parents | e10745311406 |
children |
line wrap: on
line diff
--- a/mercurial/windows.py Mon Jul 31 14:55:11 2017 -0700 +++ b/mercurial/windows.py Fri Aug 04 23:54:12 2017 -0700 @@ -204,7 +204,10 @@ raise error.Abort( _('illegal ssh hostname or username starting with - or /: %s') % args) - return port and ("%s %s %s" % (args, pflag, port)) or args + args = shellquote(args) + if port: + args = '%s %s %s' % (pflag, shellquote(port), args) + return args def setflags(f, l, x): pass