##// END OF EJS Templates
convert: test for shell injection in git calls (SEC)...
convert: test for shell injection in git calls (SEC) CVE-2016-3069 (5/5) Before recent refactoring we were not escaping calls to git at all which made such injections possible. Let's have a test for that to avoid this problem in the future. Reported by Blake Burkhart.

File last commit:

r21812:73e4a02e default
r28663:ae279d4a 3.7.3 stable
Show More
hg
43 lines | 1.1 KiB | text/plain | TextLexer
mpm@selenic.com
Add back links from file revisions to changeset revisions...
r0 #!/usr/bin/env python
#
Matt Mackall
Update copyright notice
r1698 # mercurial - scalable distributed SCM
mpm@selenic.com
Add back links from file revisions to changeset revisions...
r0 #
Thomas Arendsen Hein
Updated copyright notices and add "and others" to "hg version"
r4635 # Copyright 2005-2007 Matt Mackall <mpm@selenic.com>
mpm@selenic.com
Add back links from file revisions to changeset revisions...
r0 #
Martin Geisler
updated license to be explicit about GPL version 2
r8225 # This software may be used and distributed according to the terms of the
Matt Mackall
Update license to GPLv2+
r10263 # GNU General Public License version 2 or any later version.
mpm@selenic.com
Add back links from file revisions to changeset revisions...
r0
Dan Villiom Podlaski Christiansen
setup/hg: always load Mercurial from where it was installed....
r12661 import os
import sys
Augie Fackler
hg: add support for HGUNICODEPEDANTRY environment variable...
r21812 if os.environ.get('HGUNICODEPEDANTRY', False):
reload(sys)
sys.setdefaultencoding("undefined")
Dan Villiom Podlaski Christiansen
setup/hg: always load Mercurial from where it was installed....
r12661 libdir = '@LIBDIR@'
if libdir != '@' 'LIBDIR' '@':
if not os.path.isabs(libdir):
L. David Baron
setup/hg: handle hg being a symlink when appending relative libdir to sys.path...
r12805 libdir = os.path.join(os.path.dirname(os.path.realpath(__file__)),
libdir)
Dan Villiom Podlaski Christiansen
setup/hg: always load Mercurial from where it was installed....
r12661 libdir = os.path.abspath(libdir)
sys.path.insert(0, libdir)
Thomas Arendsen Hein
Enable demandimport only in scripts, not in importable modules (issue605)...
r5197 # enable importing on demand to reduce startup time
Matt Mackall
Give a useful message about PYTHONPATH if startup fails
r7672 try:
from mercurial import demandimport; demandimport.enable()
except ImportError:
import sys
sys.stderr.write("abort: couldn't find mercurial libraries in [%s]\n" %
' '.join(sys.path))
sys.stderr.write("(check your install and PYTHONPATH)\n")
sys.exit(-1)
Thomas Arendsen Hein
Enable demandimport only in scripts, not in importable modules (issue605)...
r5197
Patrick Mezard
Change standard streams mode to binary at hg startup...
r5531 import mercurial.util
Matt Mackall
dispatch: move command dispatching into its own module...
r5178 import mercurial.dispatch
Patrick Mezard
Change standard streams mode to binary at hg startup...
r5531
for fp in (sys.stdin, sys.stdout, sys.stderr):
Adrian Buehlmann
rename util.set_binary to setbinary
r14233 mercurial.util.setbinary(fp)
Patrick Mezard
Change standard streams mode to binary at hg startup...
r5531
Matt Mackall
dispatch: move command dispatching into its own module...
r5178 mercurial.dispatch.run()