##// END OF EJS Templates
dispatch: protect against malicious 'hg serve --stdio' invocations (sec)...
dispatch: protect against malicious 'hg serve --stdio' invocations (sec) Some shared-ssh installations assume that 'hg serve --stdio' is a safe command to run for minimally trusted users. Unfortunately, the messy implementation of argument parsing here meant that trying to access a repo named '--debugger' would give the user a pdb prompt, thereby sidestepping any hoped-for sandboxing. Serving repositories over HTTP(S) is unaffected. We're not currently hardening any subcommands other than 'serve'. If your service exposes other commands to users with arbitrary repository names, it is imperative that you defend against repository names of '--debugger' and anything starting with '--config'. The read-only mode of hg-ssh stopped working because it provided its hook configuration to "hg serve --stdio" via --config parameter. This is banned for security reasons now. This patch switches it to directly call ui.setconfig(). If your custom hosting infrastructure relies on passing --config to "hg serve --stdio", you'll need to find a different way to get that configuration into Mercurial, either by using ui.setconfig() as hg-ssh does in this patch, or by placing an hgrc file someplace where Mercurial will read it. mitrandir@fb.com provided some extra fixes for the dispatch code and for hg-ssh in places that I overlooked.

File last commit:

r30894:5b60464e default
r32050:77eaf953 4.1.3 stable
Show More
test-check-pyflakes.t
15 lines | 583 B | text/troff | Tads3Lexer
/ tests / test-check-pyflakes.t
timeless
tests: mark test-check-pyflakes.t as requiring hg1.0+...
r29138 #require test-repo pyflakes hg10
Matt Mackall
tests: add repository check for pyflakes test...
r21208
timeless
tests: silence test-repo obsolete warning...
r29219 $ . "$TESTDIR/helpers-testrepo.sh"
Thomas Arendsen Hein
tests: make tests work if directory contains special characters...
r16350 $ cd "`dirname "$TESTDIR"`"
Simon Heimberg
tests: run pyflakes on files from manifest which could be python files...
r19377
run pyflakes on all tracked files ending in .py or without a file ending
(skipping binary file random-seed)
Matt Mackall
tests: add repository check for pyflakes test...
r21208
Zack Hricz
tests: exclude bundled pywatchman from test-check-pyflakes...
r30655 $ hg locate 'set:**.py or grep("^#!.*python")' -X hgext/fsmonitor/pywatchman \
Pulkit Goyal
pycompat: make pycompat demandimport friendly...
r29584 > -X mercurial/pycompat.py \
> 2>/dev/null \
Simon Heimberg
tests: run pyflakes on files from manifest which could be python files...
r19377 > | xargs pyflakes 2>/dev/null | "$TESTDIR/filterpyflakes.py"
Gregory Szorc
zstd: vendor python-zstandard 0.5.0...
r30435 contrib/python-zstandard/tests/test_data_structures.py:107: local variable 'size' is assigned to but never used
Augie Fackler
filterpyflakes: dramatically simplify the entire thing by blacklisting...
r30421 tests/filterpyflakes.py:39: undefined name 'undefinedname'
Matt Mackall
tests: fix pyflakes test whitespace breakage
r22053