##// END OF EJS Templates
tests-subrepo-git: emit a different "pwned" message based on the test...
Danek Duvall -
r29257:a9764ab8 3.8.3 stable
parent child Browse files
Show More
@@ -1135,7 +1135,7 make sure we show changed files, rather
1135 1135 test for Git CVE-2016-3068
1136 1136 $ hg init malicious-subrepository
1137 1137 $ cd malicious-subrepository
1138 $ echo "s = [git]ext::sh -c echo% pwned% >pwned.txt" > .hgsub
1138 $ echo "s = [git]ext::sh -c echo% \$PWNED_MSG% >pwned.txt" > .hgsub
1139 1139 $ git init s
1140 1140 Initialized empty Git repository in $TESTTMP/tc/malicious-subrepository/s/.git/
1141 1141 $ cd s
@@ -1146,26 +1146,29 test for Git CVE-2016-3068
1146 1146 $ hg commit -m "add subrepo"
1147 1147 $ cd ..
1148 1148 $ rm -f pwned.txt
1149 $ env -u GIT_ALLOW_PROTOCOL hg clone malicious-subrepository malicious-subrepository-protected
1149 $ env -u GIT_ALLOW_PROTOCOL \
1150 > PWNED_MSG="your git is too old or mercurial has regressed" hg clone \
1151 > malicious-subrepository malicious-subrepository-protected
1150 1152 Cloning into '$TESTTMP/tc/malicious-subrepository-protected/s'... (glob)
1151 1153 fatal: transport 'ext' not allowed
1152 1154 updating to branch default
1153 cloning subrepo s from ext::sh -c echo% pwned% >pwned.txt
1155 cloning subrepo s from ext::sh -c echo% $PWNED_MSG% >pwned.txt
1154 1156 abort: git clone error 128 in s (in subrepo s)
1155 1157 [255]
1156 1158 $ test -f pwned.txt && cat pwned.txt || true
1157 1159
1158 1160 whitelisting of ext should be respected (that's the git submodule behaviour)
1159 1161 $ rm -f pwned.txt
1160 $ env GIT_ALLOW_PROTOCOL=ext hg clone malicious-subrepository malicious-subrepository-clone-allowed
1162 $ env GIT_ALLOW_PROTOCOL=ext PWNED_MSG="you asked for it" hg clone \
1163 > malicious-subrepository malicious-subrepository-clone-allowed
1161 1164 Cloning into '$TESTTMP/tc/malicious-subrepository-clone-allowed/s'... (glob)
1162 1165 fatal: Could not read from remote repository.
1163 1166
1164 1167 Please make sure you have the correct access rights
1165 1168 and the repository exists.
1166 1169 updating to branch default
1167 cloning subrepo s from ext::sh -c echo% pwned% >pwned.txt
1170 cloning subrepo s from ext::sh -c echo% $PWNED_MSG% >pwned.txt
1168 1171 abort: git clone error 128 in s (in subrepo s)
1169 1172 [255]
1170 1173 $ cat pwned.txt
1171 pwned
1174 you asked for it
General Comments 0
You need to be logged in to leave comments. Login now