From 42d7565ba9b97effdee3f737e32541b26b7341ab Mon Sep 17 00:00:00 2001 From: Robin Rosenberg Date: Mon, 23 Apr 2012 22:37:50 +0200 Subject: Validate paths during DirCheckout DirCacheCheckout and CanonicalTreeParser cooperate. CanonicalTreeParser can detect malformed, potentially malicious tree entries and sets a flag, while DirCacheCheckout refuses to work with such paths. Malicious tree entries are ".", "..", ".git" (case insensitive), any name containing '/' and (on Windows '\') and also (on Windows) any paths ending in a combination of '.' or space or containing a ':'. We also forbid all special names like "con" etc on Windows. Some of the test can execute on any platform by enabling partial platform emulation. A new runtime exception, InvalidPathException, is introduced. For backwards compatibility it extends InvalidArgumentException. Change-Id: I86199105814b63d4340e5de0e471d0da6b579ead Signed-off-by: Matthias Sohn --- org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/MockSystemReader.java | 1 + 1 file changed, 1 insertion(+) (limited to 'org.eclipse.jgit.junit') diff --git a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/MockSystemReader.java b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/MockSystemReader.java index 23bf5632cc..deca341067 100644 --- a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/MockSystemReader.java +++ b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/MockSystemReader.java @@ -92,6 +92,7 @@ public class MockSystemReader extends SystemReader { init(Constants.GIT_COMMITTER_EMAIL_KEY); userGitConfig = new MockConfig(null, null); systemGitConfig = new MockConfig(null, null); + setCurrentPlatform(); } private void init(final String n) { -- cgit v1.2.3 spamd-3.10'>rspamd-3.10 Rapid spam filtering system: https://github.com/rspamd/rspamdwww-data
aboutsummaryrefslogtreecommitdiffstats