From 3bd49f8e4907f44a1f92c034371254cacb8990ec Mon Sep 17 00:00:00 2001 From: Sebastian Stenzel Date: Sat, 4 Jan 2020 21:55:10 +0100 Subject: [PATCH 1/3] bumped cryptofs version --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index e506cdc..06ae5a0 100644 --- a/pom.xml +++ b/pom.xml @@ -113,7 +113,7 @@ org.cryptomator cryptofs - 1.8.0 + 1.9.0 test From cf7e0ca7361b09e4ee0c7e661c866261ad4e467f Mon Sep 17 00:00:00 2001 From: Sebastian Stenzel Date: Sat, 4 Jan 2020 22:00:02 +0100 Subject: [PATCH 2/3] fixes #40 --- .../frontend/fuse/mount/MacMounter.java | 16 +++++++++++++++- src/main/resources/PropertyList-1.0.dtd | 19 +++++++++++++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 src/main/resources/PropertyList-1.0.dtd diff --git a/src/main/java/org/cryptomator/frontend/fuse/mount/MacMounter.java b/src/main/java/org/cryptomator/frontend/fuse/mount/MacMounter.java index afb5271..7a33e4d 100644 --- a/src/main/java/org/cryptomator/frontend/fuse/mount/MacMounter.java +++ b/src/main/java/org/cryptomator/frontend/fuse/mount/MacMounter.java @@ -7,8 +7,10 @@ import org.w3c.dom.Document; import org.w3c.dom.Node; import org.w3c.dom.NodeList; +import org.xml.sax.InputSource; import org.xml.sax.SAXException; +import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; import javax.xml.xpath.XPath; @@ -32,6 +34,7 @@ class MacMounter implements Mounter { private static final int[] OSXFUSE_MINIMUM_SUPPORTED_VERSION = new int[]{3, 8, 2}; private static final String OSXFUSE_VERSIONFILE_LOCATION = "/Library/Filesystems/osxfuse.fs/Contents/version.plist"; private static final String OSXFUSE_VERSIONFILE_XPATH = "/plist/dict/key[.='CFBundleShortVersionString']/following-sibling::string[1]"; + private static final String PLIST_DTD_URL = "http://www.apple.com/DTDs/PropertyList-1.0.dtd"; @Override public synchronized Mount mount(Path directory, EnvironmentVariables envVars) throws CommandFailedException { @@ -103,7 +106,9 @@ private String getVersionString() { DocumentBuilderFactory domFactory = DocumentBuilderFactory.newInstance(); XPath xPath = XPathFactory.newInstance().newXPath(); try (InputStream in = Files.newInputStream(plistFile, StandardOpenOption.READ)) { - Document doc = domFactory.newDocumentBuilder().parse(in); + DocumentBuilder docBuilder = domFactory.newDocumentBuilder(); + docBuilder.setEntityResolver(this::resolveEntity); + Document doc = docBuilder.parse(in); NodeList nodeList = (NodeList) xPath.compile(OSXFUSE_VERSIONFILE_XPATH).evaluate(doc, XPathConstants.NODESET); Node node = nodeList.item(0); if (node == null) { @@ -120,6 +125,15 @@ private String getVersionString() { } } + private InputSource resolveEntity(String publicId, String systemId) { + if (PLIST_DTD_URL.equals(systemId)) { + // load DTD from local resource. fixes https://github.com/cryptomator/fuse-nio-adapter/issues/40 + return new InputSource(getClass().getResourceAsStream("/PropertyList-1.0.dtd")); + } else { + return null; + } + } + private static class MacMount extends AbstractMount { private final ProcessBuilder revealCommand; diff --git a/src/main/resources/PropertyList-1.0.dtd b/src/main/resources/PropertyList-1.0.dtd new file mode 100644 index 0000000..d6feecd --- /dev/null +++ b/src/main/resources/PropertyList-1.0.dtd @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file From 2270e8ce9192faaabd2e3b7572effbf76e386a00 Mon Sep 17 00:00:00 2001 From: Sebastian Stenzel Date: Thu, 9 Jan 2020 15:36:46 +0100 Subject: [PATCH 3/3] Preparing 1.2.2 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 06ae5a0..f499e28 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 org.cryptomator fuse-nio-adapter - 1.3.0-SNAPSHOT + 1.2.2 FUSE-NIO-Adapter Access resources at a given NIO path via FUSE. https://github.com/cryptomator/fuse-nio-adapter